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

This commit is contained in:
dhanabalan
2026-11-06 19:54:05 +05:30
parent b4a1dbe29c
commit 33d5d33405
2 changed files with 20 additions and 7 deletions

View File

@@ -698,12 +698,18 @@ class ProductionTargetPlan extends Component
foreach ($plans as $plan) {
$row = $plan->toArray();
//$row = $plan->toArray();
$row['plan_quantity'] = (int) round($row['plan_quantity']);
$workingDays = (int) ($row['working_days'] ?? 0);
// $normalDailyTarget = $workingDays > 0
// ? round((float) $row['plan_quantity'] / $workingDays, 2)
// : 0;
$normalDailyTarget = $workingDays > 0
? round((float) $row['plan_quantity'] / $workingDays, 2)
? (int) round((float) $row['plan_quantity'] / $workingDays)
: 0;
$pendingQty = 0;
@@ -728,10 +734,12 @@ class ProductionTargetPlan extends Component
continue;
}
$todayTarget = round(
$normalDailyTarget + $pendingQty,
2
);
// $todayTarget = round(
// $normalDailyTarget + $pendingQty,
// 2
// );
$todayTarget = (int) round($normalDailyTarget + $pendingQty);
$producedQty = $producedData[$key][$date]->total_qty ?? 0;