From 9dd06fae3498305464e4bc506518ea24c68c04ad Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 12 Sep 2022 13:03:39 +1000 Subject: [PATCH] minor fixes + additional logging --- app/Services/Invoice/MarkPaid.php | 2 +- app/Utils/Traits/GeneratesCounter.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/Invoice/MarkPaid.php b/app/Services/Invoice/MarkPaid.php index 9c60591515f6..60182238642c 100644 --- a/app/Services/Invoice/MarkPaid.php +++ b/app/Services/Invoice/MarkPaid.php @@ -55,7 +55,7 @@ class MarkPaid extends AbstractService \DB::connection(config('database.default'))->transaction(function () { - $this->invoice = Invoice::where('id', $this->invoice->id)->lockForUpdate()->first(); + $this->invoice = Invoice::withTrashed()->where('id', $this->invoice->id)->lockForUpdate()->first(); $this->payable_balance = $this->invoice->balance; diff --git a/app/Utils/Traits/GeneratesCounter.php b/app/Utils/Traits/GeneratesCounter.php index 0f311c4fc013..9dea5d139e02 100644 --- a/app/Utils/Traits/GeneratesCounter.php +++ b/app/Utils/Traits/GeneratesCounter.php @@ -435,6 +435,7 @@ trait GeneratesCounter if ($check_counter > 100) { nlog("counter error"); + nlog("check counter = {$check_counter}"); nlog("original_counter = {$original_counter}"); nlog("entity company = {$entity->company_id}"); nlog("counter = {$counter}");