From 19f4db21437de0fcad58998f4322ef059621e355 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 1 Feb 2024 15:45:21 +1100 Subject: [PATCH] Fixes for data sanity --- app/Console/Commands/CheckData.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 709ccecc0d59..79c98f656c7f 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -934,6 +934,21 @@ class CheckData extends Command }); + Invoice::withTrashed() + ->where("partial", 0) + ->whereNotNull("partial_due_date") + ->cursor() + ->each(function ($i) { + $i->partial_due_date = null; + $i->saveQuietly(); + + + $this->logMessage("Fixing partial due date for # {$i->id}"); + + }); + + + } }