From 6167f865bf860e064eb0a33c72ce523ace4eaa10 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Mon, 12 Oct 2026 16:56:22 +0530 Subject: [PATCH] Revoked logic of production mail report --- app/Console/Commands/SendProductionReport.php | 12 ++++++------ app/Mail/ProductionMail.php | 6 ++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/Console/Commands/SendProductionReport.php b/app/Console/Commands/SendProductionReport.php index 78da8476..78860d40 100644 --- a/app/Console/Commands/SendProductionReport.php +++ b/app/Console/Commands/SendProductionReport.php @@ -57,14 +57,14 @@ class SendProductionReport extends Command // $startDate = now()->setTime(8, 0, 0); // $endDate = now()->copy()->addDay()->setTime(8, 0, 0); - // if (strtolower($scheduleType) == 'daily') { - // $startDate = now()->subDay()->setTime(8, 0, 0); - // $endDate = now()->setTime(8, 0, 0); - // } if (strtolower($scheduleType) == 'daily') { - $startDate = now()->subDays(2)->setTime(8, 0, 0); - $endDate = now()->subDay()->setTime(8, 0, 0); + $startDate = now()->subDay()->setTime(8, 0, 0); + $endDate = now()->setTime(8, 0, 0); } + // if (strtolower($scheduleType) == 'daily') { + // $startDate = now()->subDays(2)->setTime(8, 0, 0); + // $endDate = now()->subDay()->setTime(8, 0, 0); + // } else { $startDate = now()->setTime(8, 0, 0); $endDate = now()->copy()->addDay()->setTime(8, 0, 0); diff --git a/app/Mail/ProductionMail.php b/app/Mail/ProductionMail.php index 10bd5f42..63fd6947 100644 --- a/app/Mail/ProductionMail.php +++ b/app/Mail/ProductionMail.php @@ -72,10 +72,8 @@ class ProductionMail extends Mailable $greeting = "Dear Sir/Madam,

Kindly find the attached production report status details for the 'Target Quantity' and 'Production Quantity' count,"; if ($this->scheduleType == 'Daily') { - // $fromDate = (new DateTime('yesterday 08:00'))->format('d/m/Y H:i').':000'; - // $toDate = (new DateTime('today 07:59'))->format('d/m/Y H:i').':999'; - $fromDate = (new DateTime('2 days ago 08:00'))->format('d/m/Y H:i') . ':000'; - $toDate = (new DateTime('yesterday 07:59'))->format('d/m/Y H:i') . ':999'; + $fromDate = (new DateTime('yesterday 08:00'))->format('d/m/Y H:i').':000'; + $toDate = (new DateTime('today 07:59'))->format('d/m/Y H:i').':999'; $reportPeriod = "The following report presents results from: $fromDate to $toDate."; $greeting .= $reportPeriod; } -- 2.49.1