1
0
forked from poc/pds

Added logic for invoice report for daily report

This commit is contained in:
dhanabalan
2025-07-31 15:00:03 +05:30
parent 162eaa0c9c
commit 3b18411141

View File

@@ -280,8 +280,8 @@ class SendInvoiceReport extends Command
$mailRules = \App\Models\AlertMailRule::where('module', 'InvoiceValidation')->get()->groupBy('rule_name'); $mailRules = \App\Models\AlertMailRule::where('module', 'InvoiceValidation')->get()->groupBy('rule_name');
$startDate = now()->setTime(8, 0, 0); // $startDate = now()->setTime(8, 0, 0);
$endDate = now()->copy()->addDay()->setTime(8, 0, 0); // $endDate = now()->copy()->addDay()->setTime(8, 0, 0);
$serialTableData = []; $serialTableData = [];
$materialTableData = []; $materialTableData = [];
@@ -293,6 +293,16 @@ class SendInvoiceReport extends Command
: [$plantIdArg]; : [$plantIdArg];
$no = 1; $no = 1;
if (strtolower($schedule) == 'daily')
{
$startDate = now()->subDay()->setTime(8, 0, 0);
$endDate = now()->setTime(8, 0, 0);
}
else
{
$startDate = now()->setTime(8, 0, 0);
$endDate = now()->copy()->addDay()->setTime(8, 0, 0);
}
foreach ($plantIds as $plantId) { foreach ($plantIds as $plantId) {
$plant = Plant::find($plantId); $plant = Plant::find($plantId);
$plantName = $plant ? $plant->name : $plantId; $plantName = $plant ? $plant->name : $plantId;