pembiayaan semasa
This commit is contained in:
@@ -1140,16 +1140,19 @@ class GadaiController extends Controller
|
||||
return response()->json(number_format($upahTerkumpul,2));
|
||||
}
|
||||
|
||||
public function outstandingSemasaCustomer($ic){
|
||||
$cawangan_all = Cawangan::on('mysql7')->get();
|
||||
public function outstandingSemasaCustomer($ic,$kodcaw){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$total_pembiayaan = 0;
|
||||
foreach($cawangan_all as $index=>$cawangan){
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where([['nokp','=',$ic],['sttebus','=','']])->get();
|
||||
if(sizeof($gadai) != 0){
|
||||
foreach($gadai as $index=>$gadai_detail){
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where([['nokp','=',$ic],['sttebus','=','']])->get();
|
||||
if(is_array($gadai) || is_object($gadai)){
|
||||
foreach($gadai as $index=>$gadai_detail){
|
||||
if($gadai_detail['pinjaman'] != 0 || $gadai_detail['pinjaman'] != null){
|
||||
$total_pembiayaan += $gadai_detail['bakipjm'];
|
||||
}else{
|
||||
$total_pembiayaan += $gadai_detail['pinjaman'];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ $router->group(['prefix'=>'api'], function () use ($router){
|
||||
$router->get('gadaiansemasa/belum_serah/{kodcaw}',['uses'=>'GadaiController@getGadaianBelumSerah']);
|
||||
$router->get('gadai/laporan/{kodcaw}/{tarikh}',['uses'=>'GadaiController@getLaporanGadai']);
|
||||
|
||||
$router->get('gadai/customers/{ic}/outstandingsemasa',['uses'=>'GadaiController@outstandingSemasaCustomer']);
|
||||
$router->get('gadai/customers/{ic}/outstandingsemasa/{kodcaw}',['uses'=>'GadaiController@outstandingSemasaCustomer']);
|
||||
$router->put('gadai/updatehistory/{kodcaw}/{norujukan}',['uses'=>'GadaiController@updateHistoryGadai']);
|
||||
|
||||
$router->get('senarai/lelong/{kodcaw}',['uses'=>'GadaiController@senaraiLelong']);
|
||||
|
||||
Reference in New Issue
Block a user