fix penebusan upah
This commit is contained in:
@@ -2817,38 +2817,17 @@ class KhazanahController extends Controller
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
// dd($request->all());
|
||||
|
||||
if($request->datemula == null){
|
||||
$split_date = explode('-', $request->datehingga);
|
||||
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
|
||||
if($request->datetarikh == null){
|
||||
$gadai_date = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-', $request->datemula);
|
||||
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
$split_date = explode('-',$request->datetarikh);
|
||||
$gadai_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
}
|
||||
|
||||
if($request->datehingga == null){
|
||||
$hingga_date = $request->datemula;
|
||||
}else{
|
||||
$split_date = explode('-', $request->datehingga);
|
||||
$hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
}
|
||||
|
||||
if($request->datemula == null && $request->datehingga == null)
|
||||
{
|
||||
$mula_date = $current->toDateString();
|
||||
$hingga_date = $current->toDateString();
|
||||
}
|
||||
|
||||
// $gadai = Http::get(config('api.url'). '/api/gadai/laporan/'. $auth_user['cawangan'] .'/'. $gadai_date)->json();
|
||||
$gadai = Http::get(config('api.url'). '/api/gadailaporanRange/'. $auth_user['cawangan'],['mula' => $mula_date, 'akhir' => $hingga_date])->json();
|
||||
|
||||
$gadai = Http::get(config('api.url'). '/api/gadai/laporan/'. $auth_user['cawangan'] .'/'. $gadai_date)->json();
|
||||
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
// dd($gadai);
|
||||
return view('print.laporan_gadaian', compact('gadai','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'));
|
||||
|
||||
return view('print.laporan_gadaian', compact('gadai','cawangan_detail','tarikh_cetak','gadai_date','api_url'));
|
||||
}
|
||||
|
||||
public function laporanPenebusan(){
|
||||
@@ -2859,43 +2838,27 @@ class KhazanahController extends Controller
|
||||
}
|
||||
|
||||
public function cetakLaporanPenebusan(Request $request){
|
||||
// dd($request);
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
if($request->datemula == null){
|
||||
$split_date = explode('-', $request->datehingga);
|
||||
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
|
||||
}else{
|
||||
$split_date = explode('-', $request->datemula);
|
||||
$mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
}
|
||||
|
||||
if($request->datehingga == null){
|
||||
$hingga_date = $request->datemula;
|
||||
}else{
|
||||
$split_date = explode('-', $request->datehingga);
|
||||
$hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
}
|
||||
|
||||
if($request->datemula == null && $request->datehingga == null)
|
||||
{
|
||||
$mula_date = $current->toDateString();
|
||||
$hingga_date = $current->toDateString();
|
||||
}
|
||||
|
||||
$tebus = Http::get(config('api.url'). '/api/tebuslaporanRange/'. $auth_user['cawangan'],['mula' => $mula_date,'akhir' => $hingga_date])->json();
|
||||
$tebuspengasingan = Http::get(config('api.url'). '/api/tebuslaporanjenistawarruqrange/'. $auth_user['cawangan'],['mula' => $mula_date,'akhir' => $hingga_date])->json();
|
||||
$upahlama = Http::get(config('api.url'). '/api/advansurdetailsrange/'. $auth_user['cawangan'],['mula' => $mula_date,'akhir' => $hingga_date])->json();
|
||||
|
||||
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
// dd($gadai);
|
||||
return view('print.laporan_penebusan', compact('tebus','cawangan_detail','tarikh_cetak','mula_date','hingga_date','tebuspengasingan','api_url','upahlama'));
|
||||
// dd($request);
|
||||
$api_url = config('api.url');
|
||||
$auth_user = Auth::user();
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
if($request->datetarikh == null){
|
||||
$tebus_date = $current->toDateString();
|
||||
}else{
|
||||
$split_date = explode('-',$request->datetarikh);
|
||||
$tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
|
||||
}
|
||||
$tebus = Http::get(config('api.url'). '/api/tebus/laporan/'. $auth_user['cawangan'] .'/'. $tebus_date)->json();
|
||||
$tebuspengasingan = Http::get(config('api.url'). '/api/tebus/laporanjenistawarruq/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
|
||||
$upahlama = Http::get(config('api.url'). '/api/advansurdetails/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
|
||||
|
||||
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
$cawangan_detail=$cawangan[0];
|
||||
// dd($gadai);
|
||||
return view('print.laporan_penebusan', compact('tebus','cawangan_detail','tarikh_cetak','tebus_date','tebuspengasingan','api_url','upahlama'));
|
||||
|
||||
}
|
||||
|
||||
public function laporanLelongan(){
|
||||
@@ -4321,134 +4284,7 @@ class KhazanahController extends Controller
|
||||
|
||||
//KIRAAN UNTUK LEJER_AM BAYARAN ONLINE & TRANSAKSI BAYARAN UPAH
|
||||
|
||||
$getProduct=Http::get(config('api.url').'/api/getProduct/'.$auth_user['cawangan'])->json();
|
||||
$glcode=$getProduct[0]['glcode'];
|
||||
$kodGL=$getProduct[0]['kodgl'];
|
||||
$glcode_UP=$getProduct[0]['glcode_up'];
|
||||
|
||||
$get_GLCode=Http::get(config('api.url').'/api/getGlCode/'.$auth_user['cawangan'],['glcode'=>$kodGL])->json();
|
||||
|
||||
$keterangan=$get_GLCode[0]['descpt'];
|
||||
$acctype=$get_GLCode[0]['acttype'];
|
||||
|
||||
$total_bayaranOnline=0.0;
|
||||
|
||||
|
||||
// $getTotalBayaranOnline=Http::get(config('api.url').'/api/ansuranByrOnline/'.$auth_user['cawangan'])->json();
|
||||
// if(sizeof($getTotalBayaranOnline)!=0)
|
||||
// {
|
||||
|
||||
// $total_bayaranOnline=$getTotalBayaranOnline[0]['cash_in'];
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
//START UNTUK GLEJER
|
||||
|
||||
//carian_GLejer untuk Bayaran Online (Update Bayaran)
|
||||
$getBayarOnline_GL=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$GL_Code_BayaranOnline])->json();
|
||||
$keteranganBayaranOnlie=$getBayarOnline_GL[0]['descpt']; //keterangan glcode
|
||||
$actypeBayaranOnline=$getBayarOnline_GL[0]['acttype']; //keterangan acctype
|
||||
|
||||
$get_current_GLejer_Details_BayaranOnline=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$GL_Code_BayaranOnline])->json();
|
||||
if(sizeof($get_current_GLejer_Details_BayaranOnline)==0)
|
||||
{ //start kalau xdak data
|
||||
$jumlah=0.0;
|
||||
|
||||
$getGLedjer=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$GL_Code_BayaranOnline])->json();
|
||||
|
||||
if(sizeof($getGLedjer)==0)
|
||||
{
|
||||
$jumlah=0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//$glejer=$getGLedjer[0];
|
||||
$jumlahSemalam=$getGLedjer[0]['jumlah'];
|
||||
|
||||
$hariIniSemalam=$getGLedjer[0]['hariini'];
|
||||
$jumlah=$jumlahSemalam+$hariIniSemalam;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
$jumlahBulan_ini=0.0;
|
||||
$get_GlejerBulan_Tahun=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$GL_Code_BayaranOnline])->json();
|
||||
|
||||
if( sizeof($get_GlejerBulan_Tahun)==0)
|
||||
{
|
||||
$jumlahBulan_ini=0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$jumlahBulan_ini=$get_GlejerBulan_Tahun[0]['jumlah'];
|
||||
$jumlahBulan_ini=$jumlah-$jumlahBulan_ini;
|
||||
}//end bulan tahun
|
||||
$Jumlah_TahunIni=0.0;
|
||||
$get_Glejer_Tahun=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$GL_Code_BayaranOnline])->json();
|
||||
if(sizeof($get_Glejer_Tahun)==0)
|
||||
{
|
||||
$Jumlah_TahunIni=0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
$JumTahunIni=$get_Glejer_Tahun[0]['jumlah'];
|
||||
$Jumlah_TahunIni=$jumlah-$JumTahunIni;
|
||||
|
||||
}
|
||||
|
||||
$HariIni=0.0;
|
||||
$kelmarin=$jumlah-$HariIni;
|
||||
//insert glejer untuk current date /hari ini
|
||||
$daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[
|
||||
|
||||
'kodcaw' =>$auth_user['cawangan'],
|
||||
'glcode' =>$GL_Code_BayaranOnline,
|
||||
'descpt' =>$keteranganBayaranOnlie,
|
||||
'debit'=>0.0,
|
||||
'kredit'=>0.0,
|
||||
'hariini'=>$HariIni,
|
||||
'kelmarin'=>$kelmarin,
|
||||
'jumlah'=>$jumlah,
|
||||
'bulanini'=>$jumlahBulan_ini,
|
||||
'tahunini'=>$Jumlah_TahunIni,
|
||||
'acttype'=> $actypeBayaranOnline
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$get_lejer=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$glcode])->json();
|
||||
|
||||
if(sizeof($get_lejer)>0)
|
||||
{
|
||||
$hariIni=$get_lejer[0]['hariini'];
|
||||
$jumlah=$get_lejer[0]['kelmarin'];
|
||||
$kredit=$get_lejer[0]['kredit'];
|
||||
$debit=$get_lejer[0]['debit'];
|
||||
$recno=$get_lejer[0]['recno'];
|
||||
$kredit=$kredit+ $total_bayaranOnline;
|
||||
$Hari_Ini=$debit-$kredit;
|
||||
$Kelmarin=$jumlah-$Hari_Ini;
|
||||
$updateGlejer=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[
|
||||
'recno'=>$recno,
|
||||
'debit'=>$debit,
|
||||
'kredit'=>$kredit,
|
||||
'hariini'=>$Hari_Ini,
|
||||
'kelmarin'=>$Kelmarin,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
|
||||
@@ -4456,7 +4292,7 @@ class KhazanahController extends Controller
|
||||
$debit=Http::get(config('api.url').'/api/glejer/sumDebit/'.$tarikh_mula.'/'.$tarikh_akhir.'/'.$auth_user['cawangan'])->json();
|
||||
$kredit=Http::get(config('api.url').'/api/glejer/sumKredit/'.$tarikh_mula.'/'.$tarikh_akhir.'/'.$auth_user['cawangan'])->json();
|
||||
$data=Http::get(config('api.url').'/api/glejer/getdata/'.$tarikh_mula.'/'.$tarikh_akhir.'/'.$auth_user['cawangan'])->json();
|
||||
}
|
||||
|
||||
|
||||
//return view('print.laporan_imbanduga',compact('tarikh_imbangan','tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail'));
|
||||
return view( 'print.laporan_lejer_am',compact('cawangan','cawangan_info', 'api_url','cawangan_detail','tarikh_akhir','tarikh_mula','data','debit','kredit'));
|
||||
|
||||
Reference in New Issue
Block a user