Minor fixes for ledgers with pre payments

This commit is contained in:
David Bomba 2024-10-03 17:33:24 +10:00
parent 8aed90a060
commit 67ef16e4d3
1 changed files with 3 additions and 0 deletions

View File

@ -95,6 +95,9 @@ class UpdateInvoicePayment
if (property_exists($this->payment_hash->data, 'pre_payment') && $this->payment_hash->data->pre_payment == "1") { if (property_exists($this->payment_hash->data, 'pre_payment') && $this->payment_hash->data->pre_payment == "1") {
$invoice->payments()->each(function ($p) { $invoice->payments()->each(function ($p) {
$p->pivot->forceDelete(); $p->pivot->forceDelete();
$p->invoices()->each(function ($i){
$i->pivot->forceDelete();
});
}); });