Fixes for check data script

This commit is contained in:
David Bomba 2021-06-22 19:02:26 +10:00
parent 30a98dc011
commit a76678e7b4

View File

@ -67,7 +67,7 @@ class CheckData extends Command
/** /**
* @var string * @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 * @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->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; $this->isValid = false;
if($this->option('paid_to_date')){
$client->paid_to_date = $total_invoice_payments;
$client->save();
}
} }
}); });