Merge pull request #6104 from turbo124/v5-develop

Fixes for check data script
This commit is contained in:
David Bomba 2021-06-22 19:02:43 +10:00 committed by GitHub
commit f245457a6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}
}
});