fix rounded dekat hargatebus sekali

This commit is contained in:
Hafifie PKB
2023-12-13 23:49:59 +08:00
parent 850be004bf
commit ab4be6cf11
+19 -10
View File
@@ -35,6 +35,8 @@ class Penebusan
}
public function tebusTawarruq($kodcaw,$norujukan){
$onepercentservices = new Calculation();
$cawangan = Cawangan::on('mysql7')
->where('kodcaw','=',$kodcaw)
->first();
@@ -49,15 +51,20 @@ class Penebusan
$harga_tebus = $gadai_data['bakihargajualan'] - $rebet;
// $hargatebus = round($harga_tebus,PHP_ROUND_HALF_UP);
$hargatebus = bcdiv(round($harga_tebus,2),1,1);
$hargatebus = number_format($hargatebus,2);
if(strpos($hargatebus,',')){
$hargatebus = str_replace(',','',$hargatebus);
}
// $hargatebus = bcdiv(round($harga_tebus,2),1,1);
// $hargatebus = number_format($hargatebus,2);
// if(strpos($hargatebus,',')){
// $hargatebus = str_replace(',','',$hargatebus);
// }
$hargatebus = $onepercentservices->getRoundedMethod($harga_tebus);
return response()->json($hargatebus);
}
public function hargaTebusTawarruq($kodcaw,$norujukan){
$onepercentservices = new Calculation();
$cawangan = Cawangan::on('mysql7')
->where('kodcaw','=',$kodcaw)
->first();
@@ -71,11 +78,13 @@ class Penebusan
$harga_tebus = $gadai_data['bakihargajualan'] - $rebet;
// $hargatebus = round($harga_tebus,PHP_ROUND_HALF_UP);
$hargatebus = bcdiv(round($harga_tebus,2),1,1);
$hargatebus = number_format($hargatebus,2);
if(strpos($hargatebus,',')){
$hargatebus = str_replace(',','',$hargatebus);
}
// $hargatebus = bcdiv(round($harga_tebus,2),1,1);
// $hargatebus = number_format($hargatebus,2);
// if(strpos($hargatebus,',')){
// $hargatebus = str_replace(',','',$hargatebus);
// }
$hargatebus = $onepercentservices->getRoundedMethod($harga_tebus);
$arrayharga = ['harga' => $hargatebus];