Merge branch 'master' of https://gitlab.com/online-sistem1/api_arrahn into adminapi

This commit is contained in:
hafifierahman
2022-04-14 11:29:23 +08:00
5 changed files with 73 additions and 32 deletions
@@ -1670,6 +1670,18 @@ class AdminPageController extends Controller
return response()->json($detailslelong, 200); return response()->json($detailslelong, 200);
} }
public function UpdateNotisLelong2($kodcaw,Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$detailslelong = Pelelong::on($cawangan['mysql'])->
update(array(
'para3'=>$request->content
));
return response()->json($detailslelong, 200);
}
public function paginate($items, $perPage = 5, $page = null, $options = []) public function paginate($items, $perPage = 5, $page = null, $options = [])
{ {
$page = $page ?: (Paginator::resolveCurrentPage() ?: 1); $page = $page ?: (Paginator::resolveCurrentPage() ?: 1);
+37 -28
View File
@@ -321,7 +321,12 @@ class GadaiController extends Controller
->where('norujukan','=',$norujukan) ->where('norujukan','=',$norujukan)
->first(); ->first();
$bilang_bln = $gadai_data['tempoh'] - $gadai_data['tempohbayar']; if($gadai_data['tempoh'] >= 12.0){
$tempoh = 12;
}else{
$tempoh = $gadai_data['tempoh'];
}
$bilang_bln = $tempoh - $gadai_data['tempohbayar'];
$upahsemasa_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['pinjaman']); $upahsemasa_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['pinjaman']);
@@ -343,7 +348,12 @@ class GadaiController extends Controller
->where('norujukan','=',$norujukan) ->where('norujukan','=',$norujukan)
->first(); ->first();
$bilang_bln = $gadai_data['tempoh'] - $gadai_data['tempohbayar']; if($gadai_data['tempoh'] >= 12.0){
$tempoh = 12;
}else{
$tempoh = $gadai_data['tempoh'];
}
$bilang_bln = $tempoh - $gadai_data['tempohbayar'];
$upahrebet_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']); $upahrebet_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
@@ -3252,7 +3262,6 @@ class GadaiController extends Controller
}else{ }else{
$cawangan = Cawangan::on('mysql7')->where('zone',$request->zone)->get(); $cawangan = Cawangan::on('mysql7')->where('zone',$request->zone)->get();
} }
$current = Carbon::now();
foreach($cawangan as $cawangan_mysql){ foreach($cawangan as $cawangan_mysql){
$all_gadai = Gadai::on($cawangan_mysql['mysql'])->whereNotIn('sttebus',['L','T'])->get(); $all_gadai = Gadai::on($cawangan_mysql['mysql'])->whereNotIn('sttebus',['L','T'])->get();
@@ -3263,39 +3272,39 @@ class GadaiController extends Controller
$tarikh_update = Carbon::parse($gadai['t_update'].' 00:00:00' ); $tarikh_update = Carbon::parse($gadai['t_update'].' 00:00:00' );
} }
$tarikh_gadai = Carbon::parse($gadai['t_gadai']. ' 00:00:00'); $tarikh_gadai = Carbon::parse($gadai['t_gadai']. ' 00:00:00');
$current = Carbon::now();
$diff_carbon = $tarikh_gadai->diffInDays($current); $tahun_gadai = $tarikh_gadai->year;
$bulan_gadai = $tarikh_gadai->month;
$hari_gadai = $tarikh_gadai->day;
$year = floor($diff_carbon/356); $tahun_semasa = $current->year;
$day_year_minus = $year * 356; $bulan_semasa = $current->month;
$diff_carbon = $diff_carbon - $day_year_minus; $hari_semasa = $current->day;
$month = floor($diff_carbon/30); if($hari_semasa >= $hari_gadai){
$day_month_minus = $month * 30; $beza_hari = $hari_semasa - $hari_gadai + 1;
$diff_carbon = $diff_carbon - $day_month_minus; }else if($hari_semasa < $hari_gadai){
$bulan_semasa = $bulan_semasa - 1;
$beza_hari = ($hari_semasa + 30) - $hari_gadai + 1;
}
$extensivemonth_gadai = 0; $extensivemonth_gadai = 0;
if($diff_carbon >= 1 && $diff_carbon <= 15){
$extensivemonth_gadai = 0.5;
}
else if($diff_carbon >= 16){
$extensivemonth_gadai = 1;
}
$tempoh_gadai = ($year*12) + $month + $extensivemonth_gadai;
if($gadai['t_gadai'] == $current->toDateString()){ if($beza_hari >= 1 && $beza_hari <= 15){
$tempoh_gadai = 0.5; $extensivemonth_gadai = 0.5;
} }else if($beza_hari >= 16){
if($tempoh_gadai >= 6.0){ $extensivemonth_gadai = 1;
if($gadai['t_matang'] >= $current->toDateString()){ }else{
$tempoh_gadai = 6.0; $extensivemonth_gadai = 0;
}
}else if($tempoh_gadai >= 12){
if($gadai['t_matang1'] >= $current->toDateString()){
$tempoh_gadai = 12.0;
}
} }
$beza_tahun = $tahun_semasa - $tahun_gadai;
$beza_bulan = ($bulan_semasa + ($beza_tahun * 12)) - $bulan_gadai;
$tempoh_gadai = $beza_bulan + $extensivemonth_gadai;
$upah_semasa = $this->kiraupahTawarruqStokAudit($tempoh_gadai,$gadai['tempohbayar'],$gadai['kadarupah'],$gadai['bakipjm']); $upah_semasa = $this->kiraupahTawarruqStokAudit($tempoh_gadai,$gadai['tempohbayar'],$gadai['kadarupah'],$gadai['bakipjm']);
Gadai::on($cawangan_mysql['mysql'])->where('norujukan','=',$gadai['norujukan'])->update(array( Gadai::on($cawangan_mysql['mysql'])->where('norujukan','=',$gadai['norujukan'])->update(array(
+3 -1
View File
@@ -663,7 +663,7 @@ class LelongController extends Controller
$lelong = Lelong::on($cawangan['mysql']) $lelong = Lelong::on($cawangan['mysql'])
->selectRaw('count(*) as total, batchno,t_lelong') ->selectRaw('count(*) as total, batchno,t_lelong')
->where('t_lelong','>=',$current->toDateString()) ->where('t_lelong','>=',$current->toDateString())
->where('fasa', 1) ->where('fasa', 2)
->whereNull('t_jual') ->whereNull('t_jual')
->orderBy('t_lelong','desc') ->orderBy('t_lelong','desc')
->groupBy('batchno') ->groupBy('batchno')
@@ -691,6 +691,7 @@ class LelongController extends Controller
->where('batchno','=',$request->batchno) ->where('batchno','=',$request->batchno)
->where('fasa',0) ->where('fasa',0)
->orderBy('gadai.t_gadai','asc') ->orderBy('gadai.t_gadai','asc')
->orderBy('gadai.sirig','asc')
->where('gadai.taglel','=', 1); ->where('gadai.taglel','=', 1);
}else{ }else{
$lelong = Lelong::on($cawangan['mysql']) $lelong = Lelong::on($cawangan['mysql'])
@@ -700,6 +701,7 @@ class LelongController extends Controller
->where('batchno','=',$request->batchno) ->where('batchno','=',$request->batchno)
->where('fasa',1) ->where('fasa',1)
->orderBy('gadai.t_gadai','asc') ->orderBy('gadai.t_gadai','asc')
->orderBy('gadai.sirig','asc')
->where('gadai.taglel','=', 1); ->where('gadai.taglel','=', 1);
} }
+20 -3
View File
@@ -81,7 +81,12 @@ class TebusController extends Controller
->where('norujukan','=',$norujukan) ->where('norujukan','=',$norujukan)
->first(); ->first();
$bilang_bln = $gadai_data['tempoh'] - $gadai_data['tempohbayar']; if($gadai_data['tempoh'] >= 12.0){
$tempoh = 12;
}else{
$tempoh = $gadai_data['tempoh'];
}
$bilang_bln = $tempoh - $gadai_data['tempohbayar'];
$upahsemasa_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['pinjaman']); $upahsemasa_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['pinjaman']);
@@ -106,7 +111,13 @@ class TebusController extends Controller
->where('norujukan','=',$norujukan) ->where('norujukan','=',$norujukan)
->first(); ->first();
$bilang_bln = $gadai_data['tempoh'] - $gadai_data['tempohbayar']; if($gadai_data['tempoh'] >= 12.0){
$tempoh = 12;
}else{
$tempoh = $gadai_data['tempoh'];
}
$bilang_bln = $tempoh - $gadai_data['tempohbayar'];
$upahrebet_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']); $upahrebet_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
@@ -131,6 +142,12 @@ class TebusController extends Controller
->where('norujukan','=',$norujukan) ->where('norujukan','=',$norujukan)
->first(); ->first();
if($gadai_data['tempoh'] >= 12.0){
$tempoh = 12;
}else{
$tempoh = $gadai_data['tempoh'];
}
$bilang_bln = $gadai_data['tempoh'] - $gadai_data['tempohbayar']; $bilang_bln = $gadai_data['tempoh'] - $gadai_data['tempohbayar'];
$upahrebet_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']); $upahrebet_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
@@ -658,7 +675,7 @@ class TebusController extends Controller
->orderBy('tebus.sirit') ->orderBy('tebus.sirit')
->get(); ->get();
$tebus = []; $tebus = [];
if($tebus_data){ if($tebus_data){
foreach($tebus_data as $index=>$tebusData){ foreach($tebus_data as $index=>$tebusData){
$customer_info = Customer::on('mysql7')->where('kplama','=',$tebusData['nokp'])->orWhere('kpbaru','=',$tebusData['nokp'])->first(); $customer_info = Customer::on('mysql7')->where('kplama','=',$tebusData['nokp'])->orWhere('kpbaru','=',$tebusData['nokp'])->first();
+1
View File
@@ -677,6 +677,7 @@ $router->group(['prefix'=>'admin'], function () use ($router){
$router->post('DeleteBlacklist',['uses'=>'AdminPageController@DeleteBlackList']); $router->post('DeleteBlacklist',['uses'=>'AdminPageController@DeleteBlackList']);
$router->post('AddSenaraiHitam',['uses'=>'AdminPageController@AddSenaraiHitam']); $router->post('AddSenaraiHitam',['uses'=>'AdminPageController@AddSenaraiHitam']);
$router->put('notislelong/update/{kodcaw}',['uses'=>'AdminPageController@UpdateNotisLelong']); $router->put('notislelong/update/{kodcaw}',['uses'=>'AdminPageController@UpdateNotisLelong']);
$router->put('notislelong/update2/{kodcaw}',['uses'=>'AdminPageController@UpdateNotisLelong2']);
$router->get('ListOperasi/Paginate',['uses'=>'AdminPageController@listoperasi']); $router->get('ListOperasi/Paginate',['uses'=>'AdminPageController@listoperasi']);
$router->get('ListOperasiKelulusan/Paginate',['uses'=>'AdminPageController@listoperasikelulusan']); $router->get('ListOperasiKelulusan/Paginate',['uses'=>'AdminPageController@listoperasikelulusan']);