From a76678e7b44f3ea71edbbddbed2622b62c784e99 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 22 Jun 2021 19:02:26 +1000 Subject: [PATCH] Fixes for check data script --- app/Console/Commands/CheckData.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 8b0505e9e346..14785b462ac2 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -67,7 +67,7 @@ class CheckData extends Command /** * @var string */ - protected $signature = 'ninja:check-data {--database=} {--fix=} {--client_id=}'; + protected $signature = 'ninja:check-data {--database=} {--fix=} {--client_id=} {--paid_to_date=}'; /** * @var string @@ -339,6 +339,11 @@ class CheckData extends Command $this->logMessage($client->present()->name.' id = # '.$client->id." - Paid to date does not match Client Paid To Date = {$client->paid_to_date} - Invoice Payments = {$total_invoice_payments}"); $this->isValid = false; + + if($this->option('paid_to_date')){ + $client->paid_to_date = $total_invoice_payments; + $client->save(); + } } });