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:
parent
eb0bdd12ba
commit
4d1555b46e
@ -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
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user