mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 13:14:30 -04:00
Support refunding payment from 'More actions'
This commit is contained in:
parent
0d71d54b07
commit
176f8374af
@ -136,7 +136,7 @@ class PaymentController extends BaseController
|
|||||||
$actions[] = ['url' => url("/invoices/{$payment->invoice->public_id}/edit"), 'label' => trans('texts.edit_invoice')];
|
$actions[] = ['url' => url("/invoices/{$payment->invoice->public_id}/edit"), 'label' => trans('texts.edit_invoice')];
|
||||||
|
|
||||||
if ($payment->canBeRefunded()) {
|
if ($payment->canBeRefunded()) {
|
||||||
$actions[] = ['url' => "javascript:showRefundModal({$payment->public_id}, \"{$payment->getCompletedAmount()}\", \"{$payment->present()->amount}\", \"{$payment->present()->currencySymbol}\")", 'label' => trans('texts.refund_payment')];
|
$actions[] = ['url' => "javascript:showRefundModal({$payment->public_id}, \"{$payment->getCompletedAmount()}\", \"{$payment->present()->completedAmount}\", \"{$payment->present()->currencySymbol}\")", 'label' => trans('texts.refund_payment')];
|
||||||
}
|
}
|
||||||
|
|
||||||
$actions[] = DropdownButton::DIVIDER;
|
$actions[] = DropdownButton::DIVIDER;
|
||||||
|
@ -12,6 +12,11 @@ class PaymentPresenter extends EntityPresenter
|
|||||||
return Utils::formatMoney($this->entity->amount, $this->entity->client->currency_id);
|
return Utils::formatMoney($this->entity->amount, $this->entity->client->currency_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function completedAmount()
|
||||||
|
{
|
||||||
|
return Utils::formatMoney($this->entity->getCompletedAmount(), $this->entity->client->currency_id);
|
||||||
|
}
|
||||||
|
|
||||||
public function currencySymbol()
|
public function currencySymbol()
|
||||||
{
|
{
|
||||||
return Utils::getFromCache($this->entity->currency_id ? $this->entity->currency_id : DEFAULT_CURRENCY, 'currencies')->symbol;
|
return Utils::getFromCache($this->entity->currency_id ? $this->entity->currency_id : DEFAULT_CURRENCY, 'currencies')->symbol;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user