diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 6421595..105678b 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -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')); diff --git a/app/Http/Controllers/LelongController.php b/app/Http/Controllers/LelongController.php index bcf260a..47f0aa5 100644 --- a/app/Http/Controllers/LelongController.php +++ b/app/Http/Controllers/LelongController.php @@ -60,6 +60,61 @@ class LelongController extends Controller } + // public function transaksituntutbaki(Request $request){ + + // $auth_user = Auth::user(); + + // $tuntutbaki = Http::post(config('api.url') . '/api/Tuntutbakisimpan/' . $auth_user['cawangan'], [ + // 'batchno' => $request->batchno, + // 'jenis' => $request->jenis, + // 'norujukan' => $request->norujukan, + // 'teller' => $request->teller, + // 'bakipjm' => $request->bakipjm, + // 'bakiupah' => $request->bakiupah, + // 'cajlain' => $request->cajlain, + // 'cajlelong' => $request->cajlelong, + // 'jumlah' => $request->jumlah, + // 'nowakil' => $request->nowakil, + // 'hargajual' => $request->hargajual + // ])->json(); + + // $updatetuntutbaki = Http::put( config('api.url').'/api/tuntutbakiupdate/' . $auth_user['cawangan'] . '/' . $request->norujukan); + + // $getTunai2=Http::get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $request->teller])->json(); + + // $keluar = $getTunai2['keluar']; + // $baki = $getTunai2['baki']; + // $masuk = $getTunai2['masuk']; + // $bakiawal = $getTunai2['bakiawal']; + // $pendahuluan = $getTunai2['tambah']; + // $serahan = $getTunai2['kurang']; + + // $bakiakhir = $baki; + + // if($request->jenis == 'T'){ + // $bakiakhir -= $request->jumlah; + // } + // else + // { + // $bakiakhir += -($request->jumlah); + // } + + // //masuk dalam tunai aliran + // $updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [ + // 'kodlaluan' => $request->teller, + // 'keluar' => $keluar, + // 'masuk' => $masuk, + // 'bakiakhir' => $bakiakhir + // ]); + + // if($updatetuntutbaki) + // { + // return response('Berjaya'); + // }else{ + // return response('Gagal'); + // } + // } + public function transaksituntutbaki(Request $request){ $auth_user = Auth::user(); @@ -90,15 +145,280 @@ class LelongController extends Controller $serahan = $getTunai2['kurang']; $bakiakhir = $baki; + $jumlah_byr=$request->jumlah; - if($request->jenis == 'T'){ + if($request->jenis == 'T') + { $bakiakhir -= $request->jumlah; + + + + $KOD_TUNAI='1000/010'; + $BAKI_LELONG='7000/090'; + + $get_lejerTunai=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$KOD_TUNAI])->json(); + $hariIni_Tunai=$get_lejerTunai[0]['hariini']; + $kelmarin_Tunai=$get_lejerTunai[0]['kelmarin']; + $jumlah_Tunai=$get_lejerTunai[0]['jumlah']; + $kredit_Tunai=$get_lejerTunai[0]['kredit']; + $debit_Tunai=$get_lejerTunai[0]['debit']; + $recno_Tunai=$get_lejerTunai[0]['recno']; + + + $kredit_Tunai=$kredit_Tunai+$jumlah_byr; + $hariIni_Tunai=$debit_Tunai-$kredit_Tunai; + $kelmarin_Tunai=$jumlah_Tunai-$hariIni_Tunai; + $updateGlejer_Tunai=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ + 'recno'=>$recno_Tunai, + 'debit'=>$debit_Tunai, + 'kredit'=>$kredit_Tunai, + 'hariini'=>$hariIni_Tunai, + 'kelmarin' =>$kelmarin_Tunai, + + ]); + + + $get_KOD_BL=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$BAKI_LELONG])->json(); + + $gl_cdetails_bl= $get_KOD_BL[0]; + $keterangan_bl= $get_KOD_BL[0]['descpt']; //keterangan glcode + $actype_bl= $get_KOD_BL[0]['acttype']; + + + $get_current_GLejer_Baki_Lelong=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$BAKI_LELONG])->json(); + + if(sizeof($get_current_GLejer_Baki_Lelong)==0) + { + $jumlah_bl=0.0; + + $getGLedjer_bl_Semalam=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$BAKI_LELONG])->json(); + if(sizeof($getGLedjer_bl_Semalam)==0) + { + $jumlah_bl=0.0; + } + else + { + + $jumlahSemalam_bl=$getGLedjer_bl_Semalam[0]['jumlah']; + + $hariIniSemalam_bl=$getGLedjer_bl_Semalam[0]['hariini']; + $jumlah_bl=$jumlahSemalam_bl+$hariIniSemalam_bl; + + } + $jumlahBulan_ini_bl=0.0; + $get_GlejerBulan_Tahun_bl=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$BAKI_LELONG])->json(); + if( sizeof($get_GlejerBulan_Tahun_bl)==0) + { + $jumlahBulan_ini_bl=0.0; + } + else + { + + $jumlahBulan_ini_bl=$get_GlejerBulan_Tahun_bl[0]['jumlah']; + $jumlahBulan_ini_bl=$jumlah_bl-$jumlahBulan_ini_bl; + + } + + + $Jumlah_TahunIni_bl=0.0; + $get_Glejer_Tahun_bl=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$BAKI_LELONG])->json(); + + if(sizeof($get_Glejer_Tahun_bl)==0) + { + $Jumlah_TahunIni_bl=0.0; + } + else + { + $JumTahunIni_bl=$get_Glejer_Tahun_bl[0]['jumlah']; + $Jumlah_TahunIni_bl=$jumlah_bl-$JumTahunIni_bl; + + } + + + $HariIni_bl=0.0; + $kelmarin_bl=$jumlah_bl-$HariIni_bl; + $daftarGlejer_bl=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ + + 'kodcaw'=>$auth_user['cawangan'], + 'glcode'=>$BAKI_LELONG, + 'descpt'=>$keterangan_bl, + 'debit'=>$jumlah_byr, + 'kredit'=>0.0, + 'hariini'=>$HariIni_bl, + 'kelmarin'=>$kelmarin_bl, + 'jumlah'=>$jumlah_bl, + 'bulanini'=>$jumlahBulan_ini_bl, + 'tahunini'=>$Jumlah_TahunIni_bl, + 'acttype'=> $actype_bl + + ]); + + + } + else + { + + $hariIni_BL=$get_current_GLejer_Baki_Lelong[0]['hariini']; + $kelmarin_BL=$get_current_GLejer_Baki_Lelong[0]['kelmarin']; + $jumlah_BL= $get_current_GLejer_Baki_Lelong[0]['jumlah']; + $kredit_BL=$get_current_GLejer_Baki_Lelong[0]['kredit']; + $debit_BL= $get_current_GLejer_Baki_Lelong[0]['debit']; + $recno_BL=$get_current_GLejer_Baki_Lelong[0]['recno']; + + $debit_BL=$debit_BL+$jumlah_byr; + $hariIni_Tunai=$debit_BL-$kredit_BL; + $kelmarin_BL=$jumlah_BL-$hariIni_BL; + + $updateGlejer_BL=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ + 'recno'=>$recno_BL, + 'debit'=>$debit_BL, + 'kredit'=>$kredit_BL, + 'hariini'=>$hariIni_BL, + 'kelmarin' =>$kelmarin_BL, + + ]); + + } + + + } else { $bakiakhir += -($request->jumlah); - } + + $KOD_TUNAI='1000/010'; + $get_lejerTunai=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$KOD_TUNAI])->json(); + $hariIni_Tunai=$get_lejerTunai[0]['hariini']; + $kelmarin_Tunai=$get_lejerTunai[0]['kelmarin']; + $jumlah_Tunai=$get_lejerTunai[0]['jumlah']; + $kredit_Tunai=$get_lejerTunai[0]['kredit']; + $debit_Tunai=$get_lejerTunai[0]['debit']; + $recno_Tunai=$get_lejerTunai[0]['recno']; + + + $debit_Tunai=$debit_Tunai+$jumlah_byr; + $hariIni_Tunai=$debit_Tunai-$kredit_Tunai; + $kelmarin_Tunai=$jumlah_Tunai-$hariIni_Tunai; + $updateGlejer_Tunai=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ + 'recno'=>$recno_Tunai, + 'debit'=>$debit_Tunai, + 'kredit'=>$kredit_Tunai, + 'hariini'=>$hariIni_Tunai, + 'kelmarin' =>$kelmarin_Tunai, + + ]); + + + + $RUGI_LELONG='3000/020'; + + $get_KOD_RL=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$RUGI_LELONG])->json(); + + $gl_cdetails_rl= $get_KOD_RL[0]; + $keterangan_rl= $get_KOD_RL[0]['descpt']; //keterangan glcode + $actype_rl= $get_KOD_RL[0]['acttype']; + + + $get_current_GLejer_Rugi_Lelong=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$RUGI_LELONG])->json(); + + if(sizeof($get_current_GLejer_Rugi_Lelong)==0) + { + $jumlah_rl=0.0; + + $getGLedjer_rl_Semalam=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$RUGI_LELONG])->json(); + if(sizeof($getGLedjer_rl_Semalam)==0) + { + $jumlah_rl=0.0; + } + else + { + + $jumlahSemalam_rl=$getGLedjer_rl_Semalam[0]['jumlah']; + + $hariIniSemalam_rl=$getGLedjer_rl_Semalam[0]['hariini']; + $jumlah_rl=$jumlahSemalam_rl+$hariIniSemalam_rl; + + } + $jumlahBulan_ini_rl=0.0; + $get_GlejerBulan_Tahun_rl=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$RUGI_LELONG])->json(); + if( sizeof($get_GlejerBulan_Tahun_rl)==0) + { + $jumlahBulan_ini_rl=0.0; + } + else + { + + $jumlahBulan_ini_rl=$get_GlejerBulan_Tahun_rl[0]['jumlah']; + $jumlahBulan_ini_rl=$jumlah_rl-$jumlahBulan_ini_rl; + + } + + + $Jumlah_TahunIni_rl=0.0; + $get_Glejer_Tahun_rl=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$RUGI_LELONG])->json(); + + if(sizeof($get_Glejer_Tahun_rl)==0) + { + $Jumlah_TahunIni_rl=0.0; + } + else + { + $JumTahunIni_rl=$get_Glejer_Tahun_rl[0]['jumlah']; + $Jumlah_TahunIni_rl=$jumlah_rl-$JumTahunIni_rl; + + } + + + $HariIni_rl=0.0; + $kelmarin_rl=$jumlah_rl-$HariIni_rl; + $daftarGlejer_bl=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ + + 'kodcaw'=>$auth_user['cawangan'], + 'glcode'=>$RUGI_LELONG, + 'descpt'=>$keterangan_rl, + 'debit'=>0.0, + 'kredit'=>$jumlah_byr, + 'hariini'=>$HariIni_rl, + 'kelmarin'=>$kelmarin_rl, + 'jumlah'=>$jumlah_rl, + 'bulanini'=>$jumlahBulan_ini_rl, + 'tahunini'=>$Jumlah_TahunIni_rl, + 'acttype'=> $actype_rl + + ]); + + + } + else + { + + $hariIni_RL=$get_current_GLejer_Rugi_Lelong[0]['hariini']; + $kelmarin_RL=$get_current_GLejer_Rugi_Lelong[0]['kelmarin']; + $jumlah_RL= $get_current_GLejer_Rugi_Lelong[0]['jumlah']; + $kredit_RL=$get_current_GLejer_Rugi_Lelong[0]['kredit']; + $debit_RL= $get_current_GLejer_Rugi_Lelong[0]['debit']; + $recno_RL=$get_current_GLejer_Rugi_Lelong[0]['recno']; + + $kredit_RL=$kredit_RL+$jumlah_byr; + $hariIni_Tunai=$debit_RL-$kredit_RL; + $kelmarin_BL=$jumlah_RL-$hariIni_RL; + + $updateGlejer_RL=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ + 'recno'=>$recno_RL, + 'debit'=>$debit_RL, + 'kredit'=>$kredit_RL, + 'hariini'=>$hariIni_RL, + 'kelmarin' =>$kelmarin_RL, + + ]); + + } + + + + } //masuk dalam tunai aliran $updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [ 'kodlaluan' => $request->teller, diff --git a/resources/views/aliran_tunai/index.blade.php b/resources/views/aliran_tunai/index.blade.php index acddf57..021c54b 100644 --- a/resources/views/aliran_tunai/index.blade.php +++ b/resources/views/aliran_tunai/index.blade.php @@ -116,7 +116,7 @@