1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Fixes for applying payment from a transaction, and then unwinding the transaction

This commit is contained in:
David Bomba 2022-11-30 13:10:24 +11:00
parent eb0bdd12ba
commit 4d1555b46e
2 changed files with 1 additions and 11 deletions

View File

@ -315,7 +315,7 @@ class MatchBankTransactions implements ShouldQueue
$this->invoice $this->invoice
->client ->client
->service() ->service()
->updateBalanceAndPaidToDate($amount*-1, $amount) ->updateBalanceAndPaidToDate($this->applied_amount*-1, $amount)
->save(); ->save();
$this->invoice = $this->invoice $this->invoice = $this->invoice

View File

@ -53,16 +53,6 @@ class MarkInvoiceDeleted extends AbstractService
->adjustPaidToDateAndBalance() ->adjustPaidToDateAndBalance()
->adjustLedger(); ->adjustLedger();
$transaction = [
'invoice' => $this->invoice->transaction_event(),
'payment' => $this->invoice->payments()->exists() ? $this->invoice->payments()->first()->transaction_event() : [],
'client' => $this->invoice->client->transaction_event(),
'credit' => [],
'metadata' => ['total_payments' => $this->total_payments, 'balance_adjustment' => $this->balance_adjustment, 'adjustment_amount' => $this->adjustment_amount],
];
// TransactionLog::dispatch(TransactionEvent::INVOICE_DELETED, $transaction, $this->invoice->company->db);
return $this->invoice; return $this->invoice;
} }