diff --git a/app/Jobs/Bank/MatchBankTransactions.php b/app/Jobs/Bank/MatchBankTransactions.php index 9f5260e204..286e3f6ef7 100644 --- a/app/Jobs/Bank/MatchBankTransactions.php +++ b/app/Jobs/Bank/MatchBankTransactions.php @@ -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 diff --git a/app/Services/Invoice/MarkInvoiceDeleted.php b/app/Services/Invoice/MarkInvoiceDeleted.php index b16c468c7c..2d123c8c91 100644 --- a/app/Services/Invoice/MarkInvoiceDeleted.php +++ b/app/Services/Invoice/MarkInvoiceDeleted.php @@ -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; }