diff --git a/app/Support/v2/Penebusan.php b/app/Support/v2/Penebusan.php index abac9c7..481fa39 100644 --- a/app/Support/v2/Penebusan.php +++ b/app/Support/v2/Penebusan.php @@ -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];