1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 16:31:33 +02: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
->client
->service()
->updateBalanceAndPaidToDate($amount*-1, $amount)
->updateBalanceAndPaidToDate($this->applied_amount*-1, $amount)
->save();
$this->invoice = $this->invoice

View File

@ -53,16 +53,6 @@ class MarkInvoiceDeleted extends AbstractService
->adjustPaidToDateAndBalance()
->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;
}