Rounded the value in produciton target livewire page
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 16s
Laravel Pint / pint (pull_request) Successful in 3m51s
Laravel Larastan / larastan (pull_request) Failing after 5m21s
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 16s
Laravel Pint / pint (pull_request) Successful in 3m51s
Laravel Larastan / larastan (pull_request) Failing after 5m21s
This commit is contained in:
@@ -698,12 +698,18 @@ class ProductionTargetPlan extends Component
|
|||||||
|
|
||||||
foreach ($plans as $plan) {
|
foreach ($plans as $plan) {
|
||||||
|
|
||||||
$row = $plan->toArray();
|
//$row = $plan->toArray();
|
||||||
|
|
||||||
|
$row['plan_quantity'] = (int) round($row['plan_quantity']);
|
||||||
|
|
||||||
$workingDays = (int) ($row['working_days'] ?? 0);
|
$workingDays = (int) ($row['working_days'] ?? 0);
|
||||||
|
|
||||||
|
// $normalDailyTarget = $workingDays > 0
|
||||||
|
// ? round((float) $row['plan_quantity'] / $workingDays, 2)
|
||||||
|
// : 0;
|
||||||
|
|
||||||
$normalDailyTarget = $workingDays > 0
|
$normalDailyTarget = $workingDays > 0
|
||||||
? round((float) $row['plan_quantity'] / $workingDays, 2)
|
? (int) round((float) $row['plan_quantity'] / $workingDays)
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
$pendingQty = 0;
|
$pendingQty = 0;
|
||||||
@@ -728,10 +734,12 @@ class ProductionTargetPlan extends Component
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$todayTarget = round(
|
// $todayTarget = round(
|
||||||
$normalDailyTarget + $pendingQty,
|
// $normalDailyTarget + $pendingQty,
|
||||||
2
|
// 2
|
||||||
);
|
// );
|
||||||
|
|
||||||
|
$todayTarget = (int) round($normalDailyTarget + $pendingQty);
|
||||||
|
|
||||||
$producedQty = $producedData[$key][$date]->total_qty ?? 0;
|
$producedQty = $producedData[$key][$date]->total_qty ?? 0;
|
||||||
|
|
||||||
|
|||||||
@@ -138,8 +138,13 @@
|
|||||||
{{-- <td class="border px-4 py-2 whitespace-nowrap">
|
{{-- <td class="border px-4 py-2 whitespace-nowrap">
|
||||||
{{ $record['daily_hourly_quantity'][$date] ?? '-' }}
|
{{ $record['daily_hourly_quantity'][$date] ?? '-' }}
|
||||||
</td> --}}
|
</td> --}}
|
||||||
<td class="border px-4 py-2 whitespace-nowrap">
|
{{-- <td class="border px-4 py-2 whitespace-nowrap">
|
||||||
{{ $record['daily_target_dynamic'][$date] ?? '-' }}
|
{{ $record['daily_target_dynamic'][$date] ?? '-' }}
|
||||||
|
</td> --}}
|
||||||
|
<td class="border px-4 py-2 whitespace-nowrap">
|
||||||
|
{{ is_numeric($record['daily_target_dynamic'][$date] ?? null)
|
||||||
|
? number_format($record['daily_target_dynamic'][$date], 0)
|
||||||
|
: ($record['daily_target_dynamic'][$date] ?? '-') }}
|
||||||
</td>
|
</td>
|
||||||
<td class="border px-4 py-2 whitespace-nowrap">
|
<td class="border px-4 py-2 whitespace-nowrap">
|
||||||
{{ $record['produced_quantity'][$date] ?? '-' }}
|
{{ $record['produced_quantity'][$date] ?? '-' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user