Merge pull request 'Added hourly quantity logic in production target plan livewire table' (#413) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s
Reviewed-on: #413
This commit was merged in pull request #413.
This commit is contained in:
@@ -209,8 +209,9 @@ class ProductionTargetPlan extends Component
|
||||
'items.code as item_code',
|
||||
'items.category as category',
|
||||
'items.description as item_description',
|
||||
'items.hourly_quantity as hourly_quantity',
|
||||
'lines.name as line_name',
|
||||
'lines.line_capacity as line_capacity',
|
||||
// 'lines.line_capacity as line_capacity',
|
||||
'plants.name as plant_name'
|
||||
)
|
||||
->get();
|
||||
@@ -257,10 +258,10 @@ class ProductionTargetPlan extends Component
|
||||
$remainingDays = (int) ($row['working_days'] ?? 0);
|
||||
|
||||
$lineCapacity = (float) ($row['line_capacity'] ?? 0);
|
||||
$dailyLineCapacity = (float) ($row['line_capacity'] ?? 0);
|
||||
$dailyHourlyQuantity = (float) ($row['hourly_quantity'] ?? 0);
|
||||
|
||||
$row['category'] = $row['category'] ?? '-';
|
||||
$row['daily_line_capacity'] = [];
|
||||
$row['daily_hourly_quantity'] = [];
|
||||
$row['daily_target_dynamic'] = [];
|
||||
$row['produced_quantity'] = [];
|
||||
|
||||
@@ -270,7 +271,7 @@ class ProductionTargetPlan extends Component
|
||||
|
||||
// Skip leave dates fast
|
||||
if (isset($leaveDates) && in_array($date, $leaveDates)) {
|
||||
$row['daily_line_capacity'][$date] = '-';
|
||||
$row['daily_hourly_quantity'][$date] = '-';
|
||||
$row['daily_target_dynamic'][$date] = '-';
|
||||
$row['produced_quantity'][$date] = '-';
|
||||
continue;
|
||||
@@ -284,7 +285,7 @@ class ProductionTargetPlan extends Component
|
||||
|
||||
$row['daily_target_dynamic'][$date] = $todayTarget;
|
||||
$row['produced_quantity'][$date] = $producedQty;
|
||||
$row['daily_line_capacity'][$date] = $dailyLineCapacity;
|
||||
$row['daily_hourly_quantity'][$date] = $dailyHourlyQuantity * 22.5;
|
||||
|
||||
// Carry forward remaining qty
|
||||
$remainingQty = max(0, $remainingQty - $producedQty);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
@foreach($dates as $date)
|
||||
<th class="border px-4 py-2 whitespace-nowrap">Line Capacity</th>
|
||||
<th class="border px-4 py-2 whitespace-nowrap">Item Quantity</th>
|
||||
<th class="border px-4 py-2 whitespace-nowrap">Target Plan</th>
|
||||
<th class="border px-4 py-2 whitespace-nowrap border-r-4 border-gray-400">
|
||||
Produced Quantity
|
||||
@@ -61,7 +61,7 @@
|
||||
@else
|
||||
{{-- <td class="border px-4 py-2 whitespace-nowrap">{{ $record['daily_target'] ?? '-' }}</td> --}}
|
||||
<td class="border px-4 py-2 whitespace-nowrap">
|
||||
{{ $record['daily_line_capacity'][$date] ?? '-' }}
|
||||
{{ $record['daily_hourly_quantity'][$date] ?? '-' }}
|
||||
</td>
|
||||
<td class="border px-4 py-2 whitespace-nowrap">
|
||||
{{ $record['daily_target_dynamic'][$date] ?? '-' }}
|
||||
|
||||
Reference in New Issue
Block a user