Added logic for particualr plan for line in production report
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Failing after 38s
Laravel Larastan / larastan (pull_request) Failing after 4m29s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 17s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Laravel Pint / pint (pull_request) Failing after 38s
Laravel Larastan / larastan (pull_request) Failing after 4m29s
This commit is contained in:
@@ -174,6 +174,7 @@ class SendProductionReport extends Command
|
||||
|
||||
foreach ($lines as $line) {
|
||||
|
||||
$hasProduction = false;
|
||||
$dayproductionQuantity = 0;
|
||||
$nightproductionQuantity = 0;
|
||||
$productionQuantity = 0;
|
||||
@@ -265,16 +266,16 @@ class SendProductionReport extends Command
|
||||
|
||||
// $capacityQuan = $totalHourlyQuantity * 22.5;
|
||||
|
||||
$leaveDates = ProductionCalendar::where('plant_id', $plant->id)
|
||||
->whereMonth('created_at', $month)
|
||||
->whereYear('created_at', $year)
|
||||
->value('leave_dates');
|
||||
// $leaveDates = ProductionCalendar::where('plant_id', $plant->id)
|
||||
// ->whereMonth('created_at', $month)
|
||||
// ->whereYear('created_at', $year)
|
||||
// ->value('leave_dates');
|
||||
|
||||
$leaveDates = $leaveDates ? array_map('trim', explode(',', $leaveDates)) : [];
|
||||
// $leaveDates = $leaveDates ? array_map('trim', explode(',', $leaveDates)) : [];
|
||||
|
||||
if (in_array($startDate->format('Y-m-d'), $leaveDates)) {
|
||||
$totalTargetQuantity = 0;
|
||||
}
|
||||
// if (in_array($startDate->format('Y-m-d'), $leaveDates)) {
|
||||
// $totalTargetQuantity = 0;
|
||||
// }
|
||||
|
||||
if (strtolower($line->type) == 'fg line') {
|
||||
|
||||
@@ -333,6 +334,26 @@ class SendProductionReport extends Command
|
||||
->count();
|
||||
}
|
||||
|
||||
if ($productionQuantity > 0) {
|
||||
$hasProduction = true;
|
||||
}
|
||||
|
||||
$leaveDates = ProductionCalendar::where('plant_id', $plant->id)
|
||||
->whereMonth('created_at', $month)
|
||||
->whereYear('created_at', $year)
|
||||
->value('leave_dates');
|
||||
|
||||
$leaveDates = $leaveDates
|
||||
? array_map('trim', explode(',', $leaveDates))
|
||||
: [];
|
||||
|
||||
if (
|
||||
in_array($startDate->format('Y-m-d'), $leaveDates)
|
||||
&& !$hasProduction
|
||||
) {
|
||||
$totalTargetQuantity = 0;
|
||||
}
|
||||
|
||||
if ($totalTargetQuantity > 0) {
|
||||
$efficiency = ($productionQuantity / $totalTargetQuantity) * 100;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user