update lelong kiraupahUjrahOnePercentRebate
This commit is contained in:
@@ -30,6 +30,8 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use App\Services\RingkasanHarianServices;
|
||||
use App\Services\OnePercentServices;
|
||||
use App\Services\MasterServices;
|
||||
use App\Support\v2\Calculation;
|
||||
|
||||
use Log;
|
||||
use DB;
|
||||
@@ -1115,6 +1117,9 @@ class LelongController extends Controller
|
||||
$lelong_to_be_inserted->berat = $index['berat'];
|
||||
$lelong_to_be_inserted->marhun = $index['marhun'];
|
||||
$lelong_to_be_inserted->fasa = $index['fasa'];
|
||||
$lelong_to_be_inserted->tagujarah = $index['tagujarah'];
|
||||
$lelong_to_be_inserted->ujrah = $index['ujrah'];
|
||||
$lelong_to_be_inserted->onepercent = $index['onepercent'];
|
||||
|
||||
$lelong_arr[] = $lelong_to_be_inserted->attributesToArray();
|
||||
}
|
||||
@@ -1634,39 +1639,40 @@ class LelongController extends Controller
|
||||
return ['ujrah' => $ujrah_semasa, 'onepercent' => $onepercent_semasa];
|
||||
}
|
||||
|
||||
public function kiraupahUjrahOnePercentRebate($kodcaw,$norujukan){
|
||||
$onepercentservices = new OnePercentServices();
|
||||
// public function kiraupahUjrahOnePercentRebate($kodcaw,$norujukan){
|
||||
// // $onepercentservices = new OnePercentServices();
|
||||
// $onepercentservices = new Calculation();
|
||||
|
||||
$cawangan = Cawangan::on('mysql7')
|
||||
->where('kodcaw','=',$kodcaw)
|
||||
->first();
|
||||
// $cawangan = Cawangan::on('mysql7')
|
||||
// ->where('kodcaw','=',$kodcaw)
|
||||
// ->first();
|
||||
|
||||
$gadai_data = Gadai::on($cawangan['mysql'])
|
||||
->where('norujukan','=',$norujukan)
|
||||
->first();
|
||||
// $gadai_data = Gadai::on($cawangan['mysql'])
|
||||
// ->where('norujukan','=',$norujukan)
|
||||
// ->first();
|
||||
|
||||
if($gadai_data['tempoh'] >= 12.0){
|
||||
$tempoh = 12;
|
||||
}else{
|
||||
$tempoh = $gadai_data['tempoh'];
|
||||
}
|
||||
// if($gadai_data['tempoh'] >= 12.0){
|
||||
// $tempoh = 12;
|
||||
// }else{
|
||||
// $tempoh = $gadai_data['tempoh'];
|
||||
// }
|
||||
|
||||
$bilang_bln = $tempoh - $gadai_data['tempohbayar'];
|
||||
$array_upah = $onepercentservices->kiraanKeuntunganRebet($gadai_data['bakipjm'],$gadai_data['nilaimarhun'],$gadai_data['kadarupah'],$gadai_data['margin_semasa']);
|
||||
$ujrah = $bilang_bln * $array_upah['ujrah'];
|
||||
$onepercent = $bilang_bln * $array_upah['onepercent'];
|
||||
// $bilang_bln = $tempoh - $gadai_data['tempohbayar'];
|
||||
// $array_upah = $onepercentservices->kiraanKeuntunganRebet($gadai_data['bakipjm'],$gadai_data['nilaimarhun'],$gadai_data['kadarupah'],$gadai_data['margin_semasa']);
|
||||
// $ujrah_semasa = $onepercentservices->getRoundedMethod($bilang_bln * $array_upah['ujrah']);
|
||||
// $onepercent_semasa = $onepercentservices->getRoundedMethod($bilang_bln * $array_upah['onepercent']);
|
||||
|
||||
// $rounded_ujrah = round(($ujrah*100)/5,0)*5/100;
|
||||
$ujrah_semasa = $ujrah;
|
||||
// return ['ujrah' => $ujrah_semasa, 'onepercent' => $onepercent_semasa];
|
||||
// }
|
||||
|
||||
// $rounded_onepercent = round(($onepercent*100)/5,0)*5/100;
|
||||
$onepercent_semasa = $onepercent;
|
||||
public function kiraupahUjrahOnePercentRebate($kodcaw,$norujukan){
|
||||
$master = new MasterServices($kodcaw);
|
||||
$response = $master->kiraupahUjrahOnePercentRebate($kodcaw,$norujukan);
|
||||
|
||||
return ['ujrah' => $ujrah_semasa, 'onepercent' => $onepercent_semasa];
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user