From 2786aae8712cc585d05c7341aeb65ab281e7a153 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 3 Jul 2017 15:09:55 +0300 Subject: [PATCH] Add check for invoice JS amounts --- app/Console/Commands/CheckData.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 3e9d4b980c..43e5e16478 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -76,7 +76,7 @@ class CheckData extends Command $this->checkDraftSentInvoices(); } - $this->checkInvoices(); + //$this->checkInvoices(); $this->checkBalances(); $this->checkContacts(); $this->checkUserAccounts(); @@ -142,8 +142,7 @@ class CheckData extends Command $date = new Carbon(); $date = $date->subDays(1)->format('Y-m-d'); - $invoices = Invoice::withTrashed() - ->with('invitations') + $invoices = Invoice::with('invitations') ->where('created_at', '>', $date) ->orderBy('id') ->get(['id', 'balance']); @@ -155,7 +154,7 @@ class CheckData extends Command $result = floatval(strip_tags($result)); $this->logMessage('Result: ' . $result); - if ($result != $invoice->balance) { + if ($result && $result != $invoice->balance) { $this->logMessage("Amounts do not match - PHP: {$invoice->balance}, JS: {$result}"); $this->isValid = false; }