Merge pull request 'Added logic for particualr plan for line in production report' (#1430) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Reviewed-on: #1430
This commit was merged in pull request #1430.
This commit is contained in:
@@ -174,6 +174,7 @@ class SendProductionReport extends Command
|
|||||||
|
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
|
|
||||||
|
$hasProduction = false;
|
||||||
$dayproductionQuantity = 0;
|
$dayproductionQuantity = 0;
|
||||||
$nightproductionQuantity = 0;
|
$nightproductionQuantity = 0;
|
||||||
$productionQuantity = 0;
|
$productionQuantity = 0;
|
||||||
@@ -265,16 +266,16 @@ class SendProductionReport extends Command
|
|||||||
|
|
||||||
// $capacityQuan = $totalHourlyQuantity * 22.5;
|
// $capacityQuan = $totalHourlyQuantity * 22.5;
|
||||||
|
|
||||||
$leaveDates = ProductionCalendar::where('plant_id', $plant->id)
|
// $leaveDates = ProductionCalendar::where('plant_id', $plant->id)
|
||||||
->whereMonth('created_at', $month)
|
// ->whereMonth('created_at', $month)
|
||||||
->whereYear('created_at', $year)
|
// ->whereYear('created_at', $year)
|
||||||
->value('leave_dates');
|
// ->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)) {
|
// if (in_array($startDate->format('Y-m-d'), $leaveDates)) {
|
||||||
$totalTargetQuantity = 0;
|
// $totalTargetQuantity = 0;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (strtolower($line->type) == 'fg line') {
|
if (strtolower($line->type) == 'fg line') {
|
||||||
|
|
||||||
@@ -333,6 +334,26 @@ class SendProductionReport extends Command
|
|||||||
->count();
|
->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) {
|
if ($totalTargetQuantity > 0) {
|
||||||
$efficiency = ($productionQuantity / $totalTargetQuantity) * 100;
|
$efficiency = ($productionQuantity / $totalTargetQuantity) * 100;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user