From 642d9f01bb1d1ccf75fb4e4892aa840744db3de8 Mon Sep 17 00:00:00 2001 From: hafifierahman Date: Wed, 1 Oct 2025 21:35:44 +0800 Subject: [PATCH] fix backdate stock audit that exceed 12 months --- app/Http/Controllers/BackupStokAuditController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/BackupStokAuditController.php b/app/Http/Controllers/BackupStokAuditController.php index 191806e..fb56b2a 100644 --- a/app/Http/Controllers/BackupStokAuditController.php +++ b/app/Http/Controllers/BackupStokAuditController.php @@ -331,7 +331,7 @@ class BackupStokAuditController extends Controller } public function kiraupahTawarruqStokAudit($tempoh,$tempohbayar,$kadarupah,$bakipinjaman){ - + $tempoh = ($tempoh > 12) ? 12 : $tempoh; $bilang_bln = $tempoh - $tempohbayar; if($bilang_bln > 12){ @@ -458,6 +458,7 @@ class BackupStokAuditController extends Controller public function kiraupahTawarruqStokAuditUjrahOnePercent($tempoh,$tempohbayar,$kadarupah,$bakipinjaman,$nilaimarhun,$margin_semasa){ $onepercentservices = new V2Calculation(); $upah = $onepercentservices->kiraanKeuntunganRebet($bakipinjaman,$nilaimarhun,$kadarupah,$margin_semasa); + $tempoh = ($tempoh > 12) ? 12 : $tempoh; $bilang_bln = $tempoh - $tempohbayar; $keuntungan_semasa = $bilang_bln * $upah['onepercent']; $ujrah_semasa = $bilang_bln * $upah['ujrah'];