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