From ac2c7b2bbe68bcd016d2c5998ff4a3f9de5daf2d Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 12 Feb 2021 09:01:39 +1100 Subject: [PATCH] Fixes for deleting a payment --- app/Services/Payment/DeletePayment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Payment/DeletePayment.php b/app/Services/Payment/DeletePayment.php index 4c58a11b8c19..b0fd8aeab657 100644 --- a/app/Services/Payment/DeletePayment.php +++ b/app/Services/Payment/DeletePayment.php @@ -69,7 +69,7 @@ class DeletePayment private function updateClient() { - $this->payment->client->service()->updatePaidToDate(-1 * $this->payment->amount)->save(); + //$this->payment->client->service()->updatePaidToDate(-1 * $this->payment->amount)->save(); return $this; } @@ -92,6 +92,7 @@ class DeletePayment $paymentable_invoice->client ->service() ->updateBalance($paymentable_invoice->pivot->amount) + ->updatePaidToDate($paymentable_invoice->pivot->amount * -1) ->save(); if ($paymentable_invoice->balance == $paymentable_invoice->amount) {