fix ujrah

This commit is contained in:
Afiq Zakwan
2023-12-17 11:11:46 +08:00
parent 6ab25db913
commit 32b91e9e61
3 changed files with 16 additions and 5 deletions
@@ -360,7 +360,12 @@ class TransactionOnlineController extends Controller
if(sizeof($gadai) != 0){ if(sizeof($gadai) != 0){
foreach($gadai as $gad) foreach($gadai as $gad)
{ {
$result = (new TebusController)->kiraupahTawarruq($gad['kodcaw'],$gad['norujukan']); if($gad['tagbaru'] == 1){
$jenis = 'onepercent';
}else{
$jenis = 'asal';
}
$result = (new TebusController)->kiraupahTawarruq($gad['kodcaw'],$gad['norujukan'],$jenis);
$gad['keuntungan'] = $result; $gad['keuntungan'] = $result;
array_push($gadai_all,$gad); array_push($gadai_all,$gad);
+1 -1
View File
@@ -37,7 +37,7 @@ class OnePercent extends MasterServices
public function getUpahSebenar($norujukan){ public function getUpahSebenar($norujukan){
$gadai = new Version2Gadai($this->kodcaw,$this->cawangan_info); $gadai = new Version2Gadai($this->kodcaw,$this->cawangan_info);
$response = $gadai->kiraupahOnePercent($this->kodcaw,$norujukan); $response = $gadai->kiraupahOnePercent($norujukan);
return $response; return $response;
} }
+9 -3
View File
@@ -149,10 +149,16 @@ class Penebusan
$keuntungan_semasa = $onepercentservices->getRoundedMethod($bilang_bln * $upah['onepercent']); $keuntungan_semasa = $onepercentservices->getRoundedMethod($bilang_bln * $upah['onepercent']);
$ujrah_semasa = $onepercentservices->getRoundedMethod($bilang_bln * $upah['ujrah']); $ujrah_semasa = $onepercentservices->getRoundedMethod($bilang_bln * $upah['ujrah']);
$upahsemasa_raw = $onepercentservices->getRoundedMethod($upahsemasa_raw); $upahsemasa_raw = $onepercentservices->getRoundedMethod($upahsemasa_raw);
$keuntungan_1bln = $onepercentservices->getRoundedMethod((1 * $upah['keuntungan'])+(1 * $upah['ujrah']));
$array_upah = ['pendapatan' => $upahsemasa_raw,
'keuntungan' => $keuntungan_semasa, $array_upah =
'ujrah' => $ujrah_semasa]; [
'keuntungan_1bln' => $keuntungan_1bln,
'pendapatan' => $upahsemasa_raw,
'keuntungan' => $keuntungan_semasa,
'ujrah' => $ujrah_semasa
];
return $array_upah; return $array_upah;
} }