From 7e1f01373d7c0cf7319783bca8ed205a6d06dfc5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 6 Aug 2017 16:28:00 +0300 Subject: [PATCH] Fix isValid in checkInvoices --- app/Console/Commands/CheckData.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index f8a75a14fc..ee5dfed094 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -147,6 +147,7 @@ class CheckData extends Command return; } + $isValid = true; $date = new Carbon(); $date = $date->subDays(1)->format('Y-m-d'); @@ -163,12 +164,12 @@ class CheckData extends Command //$this->logMessage('Result: ' . $result); if ($result && $result != $invoice->balance) { - $this->logMessage("Amounts do not match {$link} - PHP: {$invoice->balance}, JS: {$result}"); - $this->isValid = false; + $this->logMessage("PHP/JS amounts do not match {$link} - PHP: {$invoice->balance}, JS: {$result}"); + $this->isValid = $isValid = false; } } - if ($this->isValid) { + if ($isValid) { $this->logMessage('0 invoices with mismatched PHP/JS balances'); } }