From 02c810633abc7cf0953738ec5d570a532c2e8863 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 3 Dec 2020 21:46:49 +1100 Subject: [PATCH] Working on invoice delete restore refactor --- app/Services/Invoice/MarkInvoiceDeleted.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Services/Invoice/MarkInvoiceDeleted.php b/app/Services/Invoice/MarkInvoiceDeleted.php index 7fdf0ee3f8c2..137bce5bb924 100644 --- a/app/Services/Invoice/MarkInvoiceDeleted.php +++ b/app/Services/Invoice/MarkInvoiceDeleted.php @@ -76,9 +76,9 @@ class MarkInvoiceDeleted extends AbstractService //if total payments = adjustment amount - that means we need to delete the payments as well. if($this->adjustment_amount == $this->total_payments) { - + $this->invoice->payments()->update(['payments.deleted_at' => now(), 'payments.is_deleted' => true]); - + } else { //adjust payments down by the amount applied to the invoice payment.