fix backdate stock audit that exceed 12 months

This commit is contained in:
hafifierahman
2025-10-01 21:35:44 +08:00
parent 2f188d9d90
commit 177b253817
@@ -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'];