1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00

Set Exchange Rates on invoice when marked as paid

This commit is contained in:
David Bomba 2021-06-22 08:41:15 +10:00
parent 823d23df24
commit a3a406b122

View File

@ -66,7 +66,7 @@ class MarkPaid extends AbstractService
$payment->save(); $payment->save();
$this->setExchangeRate($payment); $this->setExchangeRate($payment);
$payment->invoices()->attach($this->invoice->id, [ $payment->invoices()->attach($this->invoice->id, [
'amount' => $payment->amount, 'amount' => $payment->amount,
]); ]);
@ -74,6 +74,7 @@ class MarkPaid extends AbstractService
$this->invoice->next_send_date = null; $this->invoice->next_send_date = null;
$this->invoice->service() $this->invoice->service()
->setExchangeRate()
->updateBalance($payment->amount * -1) ->updateBalance($payment->amount * -1)
->updatePaidToDate($payment->amount) ->updatePaidToDate($payment->amount)
->setStatus(Invoice::STATUS_PAID) ->setStatus(Invoice::STATUS_PAID)