tarikh upah dan imbang duga refined dan calculation ujrah

This commit is contained in:
Hafifie PKB
2024-02-01 09:33:51 +08:00
parent 4726ea7c5c
commit 363402dcf0
11 changed files with 273 additions and 23 deletions
+10 -8
View File
@@ -24,7 +24,7 @@ class Calculation
$formula_margin = ($this->maks_margin - $margin) / $this->maks_margin;
$ujrah_margin = $formula_margin * $kadarujrah;
$rebate_ujrah = $nilaimarhun*($ujrah_margin/100);
$ujrah_sebenar = $ujrah;
$ujrah_sebenar = $ujrah - $rebate_ujrah;
return $ujrah_sebenar;
}
@@ -62,8 +62,8 @@ class Calculation
$onepercent = $this->kiraanOnePercent($pembiayaan);
$ujrah_sebenar = $this->kiraanUjrahSebenar($nilaimarhun,$kadarujrah,$margin);
$onepercent = $this->getRoundedMethod($onepercent);
$ujrah_sebenar = $this->getRoundedMethod($ujrah_sebenar);
// $onepercent = $this->getRoundedMethod($onepercent);
// $ujrah_sebenar = $this->getRoundedMethod($ujrah_sebenar);
$keuntungan = $onepercent + $ujrah_sebenar;
@@ -73,12 +73,10 @@ class Calculation
public function kiraanKeuntunganSebenar(float $pembiayaan = 0.0,float $nilaimarhun = 0.0,float $kadarujrah = 0.0,float $margin = 0.0){
$this->one_percent = $this->getKadarUpah($nilaimarhun);
$onepercent = $this->kiraanOnePercent($pembiayaan);
$ujrah_sebenar = $this->kiraanUjrah($nilaimarhun,$kadarujrah,$margin);
$onepercent = $this->getRoundedMethod($onepercent);
$ujrah_sebenar = $this->getRoundedMethod($ujrah_sebenar);
// $onepercent = $this->getRoundedMethod($onepercent);
// $ujrah_sebenar = $this->getRoundedMethod($ujrah_sebenar);
$keuntungan = $onepercent + $ujrah_sebenar;
@@ -99,7 +97,11 @@ class Calculation
}
public function getRoundedMethod(float $number = 0.0) : Float{
$number_string = number_format(floor(($number*100))/100,2);
// $multiplied = number_format($number * 100,2);
// $floorResult = floor($multiplied);
// $number_string = number_format($floorResult/100,2);
$number_string = number_format(floor($number * 100)/100,2);
$rounded = substr($number_string, 0, -1);
$lastDigit = substr($number_string, -1);