1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-12 22:22:32 +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();
$this->setExchangeRate($payment);
$payment->invoices()->attach($this->invoice->id, [
'amount' => $payment->amount,
]);
@ -74,6 +74,7 @@ class MarkPaid extends AbstractService
$this->invoice->next_send_date = null;
$this->invoice->service()
->setExchangeRate()
->updateBalance($payment->amount * -1)
->updatePaidToDate($payment->amount)
->setStatus(Invoice::STATUS_PAID)