diff --git a/app/Http/Controllers/AliranTunaiController.php b/app/Http/Controllers/AliranTunaiController.php index ce238f7..441e690 100644 --- a/app/Http/Controllers/AliranTunaiController.php +++ b/app/Http/Controllers/AliranTunaiController.php @@ -110,1069 +110,6 @@ class AliranTunaiController extends Controller $requestkodlaluan = Http::get(config('api.url').'/api/get/pengguna/'.$auth_user['cawangan'],["namateller" => Auth::user()->name ])->json(); $advansur = Http::get(config('api.url').'/api/AnsuranByTarikh/'.$auth_user['cawangan'],['kodlaluan' => Auth::user()->name])->json(); - // dd($advansur); - //******************* INITIALIZE LEJER AM START HERE****************************// - - - $get_glcode=Http::get(config('api.url').'/api/getProduct/'. $auth_user['cawangan'])->json(); - $gl=$get_glcode[0]; - $prCode=$gl['prkod']; - $Gl_Code=$gl['glcode']; - - //new glcode 2021-02-22 - $GL_Code_BayaranOnline="1000/210"; - $GL_CodeUntungSebenar="1000/213"; - $GL_CodeHutangArrahn="1000/211"; - $GL_CodeHutangAkru="2000/007"; - $GL_Code_Tawarruq="1000/017";// new glcode 20210405 - $GL_Code_Untung="5000/017";//new glcode 20210405 - $KOD_Upah='5000/013'; - $KOD_Rebate_L='5000/021'; - $KOD_Rebate_A='1000/021'; - $KOD_ANS='5000/511'; - - $Bayaran_Pendahuluan='1000/019'; - //dapat keterangan glcode - // $gadai_transaction = Http::get(config('api.url') . '/api/gadai/'. $auth_user['cawangan'] . '/' . $current->toDateString())- - $get_glCode_Details=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$Gl_Code])->json(); - - $gl_cdetails=$get_glCode_Details[0]; - $keterangan=$get_glCode_Details[0]['descpt']; //keterangan glcode - $actype=$get_glCode_Details[0]['acttype']; //keterangan acctype - - - // carian perincian glejer untk glcode=1000/010 - $get_current_GLejer_Details=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$Gl_Code])->json(); - - if(sizeof($get_current_GLejer_Details)==0) - { //start kalau xdak data - $jumlah=0.0; - - $getGLedjer=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$Gl_Code])->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])->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])->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, - 'descpt'=>$keterangan, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni, - 'kelmarin'=>$kelmarin, - 'jumlah'=>$jumlah, - 'bulanini'=>$jumlahBulan_ini, - 'tahunini'=>$Jumlah_TahunIni, - 'acttype'=> $actype - - ]); - - } - else - { - - } - - $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 - { - - - - } - - //GL Penghutang Ar-Rahn - $GL_penghutang_Arrahn=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$GL_CodeHutangArrahn])->json(); - $keterangan_PenghutangArrahn=$GL_penghutang_Arrahn[0]['descpt']; //keterangan glcode - $actype_PenghutangArrahn=$GL_penghutang_Arrahn[0]['acttype']; //details_code - - $jumlah_PenghutangArrahn=0.0; - $get_current_GLejer_Details_PA=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$GL_CodeHutangArrahn])->json(); - if( sizeof($get_current_GLejer_Details_PA)==0) - { - - $getGLedjer_Semalam=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangArrahn])->json(); - - $jumlah_hutangArrahn=0.0; - if(sizeof($getGLedjer_Semalam)==0) - { - - $jumlah_hutangArrahn =0.0; - - } - else - { - - $jumlahSemalam=$getGLedjer_Semalam[0]['jumlah']; - $hariIniSemalam=$getGLedjer_Semalam[0]['hariini']; - $jumlah_hutangArrahn=$jumlahSemalam+$hariIniSemalam; - } - - $jumlahBulan_iniArrahn=0.0; - $get_GlejerBulan_Tahun=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangArrahn])->json(); - if(sizeof($get_GlejerBulan_Tahun)==0) - { - - $jumlahBulan_iniArrahn=0.0; - } - else - { - - $jumlahBulan_iniArrahn=$get_GlejerBulan_Tahun[0]['jumlah']; - $jumlahBulan_iniArrahn=$jumlah_hutangArrahn-$jumlahBulan_iniArrahn; - - } - - $Jumlah_TahunIni=0.0; - $get_Glejer_Tahun=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangArrahn])->json(); - $jumlah=0.0; - if(sizeof($get_Glejer_Tahun)==0) - { - $Jumlah_TahunIniArrahn=0.0; - - } - else - { - - $Jumlah_TahunIniArrahn=$get_Glejer_Tahun[0]['jumlah']; - $Jumlah_TahunIniArrahn=$jumlah_hutangArrahn-$Jumlah_TahunIniArrahn; - - } - - $HariIniHutangArrahn=0.0; - $kelmarinHutangArrahn=$jumlah_hutangArrahn-$HariIniHutangArrahn; - - - $daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - 'kodcaw' =>$auth_user['cawangan'], - 'glcode' =>$GL_CodeHutangArrahn, - 'descpt' =>$keterangan_PenghutangArrahn, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIniHutangArrahn, - 'kelmarin'=>$kelmarinHutangArrahn, - 'jumlah'=>$jumlah_hutangArrahn, - 'bulanini'=>$jumlahBulan_iniArrahn, - 'tahunini'=>$Jumlah_TahunIniArrahn, - 'acttype'=> $actype_PenghutangArrahn - - ]); - - }//END OF CARIAN GET GLEJER PENGHUTANG AR-RAHN - else - { - - } - //GL Penghutang Ar-Rahn - $GL_penghutang_Akru=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$GL_CodeHutangAkru])->json(); - $keterangan_PenghutangAkru=$GL_penghutang_Akru[0]['descpt']; //keterangan glcode - $actype_PenghutangAkru=$GL_penghutang_Akru[0]['acttype']; //details_code - - $get_current_GLejer_Details_HA=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$GL_CodeHutangAkru])->json(); - - if(sizeof($get_current_GLejer_Details_HA)==0) - { - $jumlahAkru=0.0; - $getGLedjer_Semalam_HA=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangAkru])->json(); - if(sizeof($getGLedjer_Semalam_HA)==0) - { - $jumlahAkru=0.0; - - } - else - { - $jumlahSemalam=$getGLedjer_Semalam_HA[0]['jumlah']; - $hariIniSemalam=$getGLedjer_Semalam_HA[0]['hariini']; - $jumlahAkru=$jumlahSemalam+$hariIniSemalam; - - } - - $jumlahBulan_ini_HA=0.0; - $get_GlejerBulan_Tahun_HA=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangAkru])->json(); - if(sizeof($get_GlejerBulan_Tahun_HA)==0) - { - - $jumlahBulan_iniAkru=0.0; - } - else - { - - $jumlahBulan_ini_HA=$get_GlejerBulan_Tahun_HA[0]['jumlah']; - $jumlahBulan_ini_HA=$jumlahAkru-$jumlahBulan_ini_HA; - - } - - $Jumlah_TahunIni_HA=0.0; - $get_Glejer_Tahun_HA=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangAkru])->json(); - if(sizeof($get_GlejerBulan_Tahun_HA)==0) - { - $Jumlah_TahunIni_HA=0.0; - - } - else - { - - $Jumlah_TahunIni_HA=$get_GlejerBulan_Tahun_HA[0]['jumlah']; - $Jumlah_TahunIni_HA=$jumlahAkru-$Jumlah_TahunIni_HA; - - - } - $hariIni_akru=0.0; - $kelmarin_akru= $jumlahAkru-$hariIni_akru; - - $daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - 'kodcaw' =>$auth_user['cawangan'], - 'glcode' =>$GL_CodeHutangAkru, - 'descpt' =>$keterangan_PenghutangAkru, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$hariIni_akru, - 'kelmarin'=>$kelmarin_akru, - 'jumlah'=>$jumlahAkru, - 'bulanini'=>$jumlahBulan_ini_HA, - 'tahunini'=>$Jumlah_TahunIni_HA, - 'acttype'=> $actype_PenghutangAkru - - ]); - - } - else{ - - - } - - $get_KOD_UPAH=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$KOD_Upah])->json(); - - $gl_cdetails_upah= $get_KOD_UPAH[0]; - $keterangan_upah= $get_KOD_UPAH[0]['descpt']; //keterangan glcode - $actype_upah= $get_KOD_UPAH[0]['acttype']; //keterangan acctype - - // carian perincian glejer untk glcode=1000/010 - $get_current_GLejer_Details_Upah=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$KOD_Upah])->json(); - - if(sizeof($get_current_GLejer_Details_Upah)==0) - { //start kalau xdak data - $jumlah_Upah=0.0; - - $getGLedjer_Upah=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$KOD_Upah])->json(); - - if(sizeof($getGLedjer_Upah)==0) - { - $jumlah_upah=0.0; - } - else - { - - //$glejer=$getGLedjer[0]; - $jumlahSemalam_Upah=$getGLedjer_Upah[0]['jumlah']; - $hariIniSemalam_Upah=$getGLedjer_Upah[0]['hariini']; - $jumlah_Upah=$jumlahSemalam_Upah+$hariIniSemalam_Upah; - - - } - - $jumlahBulan_ini_Upah=0.0; - $get_GlejerBulan_Tahun_Upah=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Upah])->json(); - - if( sizeof($get_GlejerBulan_Tahun_Upah)==0) - { - $jumlahBulan_ini_Upah=0.0; - } - else - { - $jumlahBulan_ini_Upah=$get_GlejerBulan_Tahun_Upah[0]['jumlah']; //try mcm tadi - $jumlahBulan_ini_Upah=$jumlah_Upah-$jumlahBulan_ini_Upah; - - - }//end bulan tahun - $Jumlah_TahunIni_Upah=0.0; - $get_Glejer_Tahun_Upah=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Upah])->json(); - if(sizeof($get_Glejer_Tahun_Upah)==0) - { - $Jumlah_TahunIni_Upah=0.0; - } - else - { - - $JumTahunIni_Upah=$get_Glejer_Tahun_Upah[0]['jumlah']; - $Jumlah_TahunIni_Upah=$jumlah_Upah-$JumTahunIni_Upah; - - } - - $HariIni_Upah=0.0; - $kelmarin_Upah=$jumlah_Upah-$HariIni_Upah; - //insert glejer untuk current date /hari ini - $daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - - 'kodcaw'=>$auth_user['cawangan'], - 'glcode'=>$KOD_Upah, - 'descpt'=>$keterangan_upah, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Upah, - 'kelmarin'=>$kelmarin_Upah, - 'jumlah'=>$jumlah_Upah, - 'bulanini'=>$jumlahBulan_ini_Upah, - 'tahunini'=>$Jumlah_TahunIni_Upah, - 'acttype'=> $actype_upah - - ]); - - } - else - { - - - } - //initial Pinjaman DiBeri untuk hari ini... - $KOD_Pinjam='1000/013'; - - $get_KOD_Pinjam=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$KOD_Pinjam])->json(); - - $gl_cdetails_pinjam= $get_KOD_Pinjam[0]; - $keterangan_pinjam= $get_KOD_Pinjam[0]['descpt']; //keterangan glcode - $actype_pinjam= $get_KOD_Pinjam[0]['acttype']; //keterangan acctype - - $get_current_GLejer_Details_Pinjam=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$KOD_Pinjam])->json(); - - - if(sizeof($get_current_GLejer_Details_Pinjam)==0) - { - - - $jumlah_Pinjam=0.0; - - $getGLedjer_Pinjam_Semalam=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$KOD_Pinjam])->json(); - if(sizeof($getGLedjer_Pinjam_Semalam)==0) - { - $jumlah_pinjam=0.0; - } - else - { - - $jumlahSemalam_Pinjam=$getGLedjer_Pinjam_Semalam[0]['jumlah']; - - $hariIniSemalam_Pinjam=$getGLedjer_Pinjam_Semalam[0]['hariini']; - $jumlah_Pinjam=$jumlahSemalam_Pinjam+$hariIniSemalam_Pinjam; - - - } - - - - $jumlahBulan_ini_Pinjam=0.0; - $get_GlejerBulan_Tahun_Pinjam=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Pinjam])->json(); - if( sizeof($get_GlejerBulan_Tahun_Pinjam)==0) - { - $jumlahBulan_ini_Pinjam=0.0; - } - else - { - - $jumlahBulan_ini_Pinjam=$get_GlejerBulan_Tahun_Pinjam[0]['jumlah']; - $jumlahBulan_ini_Pinjam=$jumlah_Pinjam-$jumlahBulan_ini_Pinjam; - - } - - $Jumlah_TahunIni_Pinjam=0.0; - $get_Glejer_Tahun_Pinjam=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Pinjam])->json(); - - if(sizeof($get_Glejer_Tahun_Pinjam)==0) - { - $Jumlah_TahunIni_Pinjam=0.0; - } - else - { - $JumTahunIni_Pinjam=$get_Glejer_Tahun_Pinjam[0]['jumlah']; - $Jumlah_TahunIni_Pinjam=$jumlah_Pinjam-$JumTahunIni_Pinjam; - - } - - $HariIni_Pinjam=0.0; - $kelmarin_Pinjam=$jumlah_Pinjam-$HariIni_Pinjam; - - $daftarGlejer_pinjam=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - - 'kodcaw'=>$auth_user['cawangan'], - 'glcode'=>$KOD_Pinjam, - 'descpt'=>$keterangan_pinjam, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Pinjam, - 'kelmarin'=>$kelmarin_Pinjam, - 'jumlah'=>$jumlah_Pinjam, - 'bulanini'=>$jumlahBulan_ini_Pinjam, - 'tahunini'=>$Jumlah_TahunIni_Pinjam, - 'acttype'=> $actype_pinjam - - ]); - - } - else{ - - } - - - $get_KOD_PinjamTawaruqq=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$GL_Code_Tawarruq])->json(); - - $gl_cdetails_pinjam= $get_KOD_PinjamTawaruqq [0]; - $keterangan_pinjam=$get_KOD_PinjamTawaruqq [0]['descpt']; //keterangan glcode - $actype_pinjam= $get_KOD_PinjamTawaruqq[0]['acttype']; //keterangan acctype - - $get_current_GLejer_Details_Pinjam_Tawaruqq=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$GL_Code_Tawarruq])->json(); - - - if(sizeof($get_current_GLejer_Details_Pinjam_Tawaruqq)==0) - { - - - $jumlah_Pinjam=0.0; - - $getGLedjer_Pinjam_Semalam=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$GL_Code_Tawarruq])->json(); - if(sizeof($getGLedjer_Pinjam_Semalam)==0) - { - $jumlah_pinjam=0.0; - } - else - { - - $jumlahSemalam_Pinjam=$getGLedjer_Pinjam_Semalam[0]['jumlah']; - - $hariIniSemalam_Pinjam=$getGLedjer_Pinjam_Semalam[0]['hariini']; - $jumlah_Pinjam=$jumlahSemalam_Pinjam+$hariIniSemalam_Pinjam; - - - } - $jumlahBulan_ini_Pinjam=0.0; - $get_GlejerBulan_Tahun_Pinjam=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$GL_Code_Tawarruq])->json(); - if( sizeof($get_GlejerBulan_Tahun_Pinjam)==0) - { - $jumlahBulan_ini_Pinjam=0.0; - } - else - { - - $jumlahBulan_ini_Pinjam=$get_GlejerBulan_Tahun_Pinjam[0]['jumlah']; - $jumlahBulan_ini_Pinjam=$jumlah_Pinjam-$jumlahBulan_ini_Pinjam; - - } - - $Jumlah_TahunIni_Pinjam=0.0; - $get_Glejer_Tahun_Pinjam=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$GL_Code_Tawarruq])->json(); - - if(sizeof($get_Glejer_Tahun_Pinjam)==0) - { - $Jumlah_TahunIni_Pinjam=0.0; - } - else - { - $JumTahunIni_Pinjam=$get_Glejer_Tahun_Pinjam[0]['jumlah']; - $Jumlah_TahunIni_Pinjam=$jumlah_Pinjam-$JumTahunIni_Pinjam; - - } - - $HariIni_Pinjam=0.0; - $kelmarin_Pinjam=$jumlah_Pinjam-$HariIni_Pinjam; - - $daftarGlejer_pinjam=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - - 'kodcaw'=>$auth_user['cawangan'], - 'glcode'=>$GL_Code_Tawarruq, - 'descpt'=>$keterangan_pinjam, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Pinjam, - 'kelmarin'=>$kelmarin_Pinjam, - 'jumlah'=>$jumlah_Pinjam, - 'bulanini'=>$jumlahBulan_ini_Pinjam, - 'tahunini'=>$Jumlah_TahunIni_Pinjam, - 'acttype'=> $actype_pinjam - - ]); - - } - else{ - - } - - $get_KOD_UPAH=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$GL_Code_Untung])->json(); - - $gl_cdetails_upah= $get_KOD_UPAH[0]; - $keterangan_upah= $get_KOD_UPAH[0]['descpt']; //keterangan glcode - $actype_upah= $get_KOD_UPAH[0]['acttype']; //keterangan acctype - - // carian perincian glejer untk glcode=1000/010 - $get_current_GLejer_Details_Upah=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$GL_Code_Untung])->json(); - - if(sizeof($get_current_GLejer_Details_Upah)==0) - { //start kalau xdak data - $jumlah_Upah=0.0; - - $getGLedjer_Upah=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$GL_Code_Untung])->json(); - - if(sizeof($getGLedjer_Upah)==0) - { - $jumlah_upah=0.0; - } - else - { - - $jumlahSemalam_Upah=$getGLedjer_Upah[0]['jumlah']; - $hariIniSemalam_Upah=$getGLedjer_Upah[0]['hariini']; - $jumlah_Upah=$jumlahSemalam_Upah+$hariIniSemalam_Upah; - - } - - $jumlahBulan_ini_Upah=0.0; - $get_GlejerBulan_Tahun_Upah=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$GL_Code_Untung])->json(); - - if( sizeof($get_GlejerBulan_Tahun_Upah)==0) - { - $jumlahBulan_ini_Upah=0.0; - } - else - { - $jumlahBulan_ini_Upah=$get_GlejerBulan_Tahun[0]['jumlah']; - $jumlahBulan_ini_Upah=$jumlah_Upah-$jumlahBulan_ini_Upah; - }//end bulan tahun - $Jumlah_TahunIni_Upah=0.0; - $get_Glejer_Tahun_Upah=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$GL_Code_Untung])->json(); - if(sizeof($get_Glejer_Tahun_Upah)==0) - { - $Jumlah_TahunIni_Upah=0.0; - } - else - { - - $JumTahunIni_Upah=$get_Glejer_Tahun_Upah[0]['jumlah']; - $Jumlah_TahunIni_Upah=$jumlah_Upah-$JumTahunIni_Upah; - - - } - - $HariIni_Upah=0.0; - $kelmarin_Upah=$jumlah_Upah-$HariIni_Upah; - //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_Untung, - 'descpt'=>$keterangan_upah, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Upah, - 'kelmarin'=>$kelmarin_Upah, - 'jumlah'=>$jumlah_Upah, - 'bulanini'=>$jumlahBulan_ini_Upah, - 'tahunini'=>$Jumlah_TahunIni_Upah, - 'acttype'=> $actype_upah - - ]); - - } - else - { - - - } - - $get_KOD_UPAH=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$KOD_Rebate_L])->json(); - - $gl_cdetails_upah= $get_KOD_UPAH[0]; - $keterangan_upah= $get_KOD_UPAH[0]['descpt']; //keterangan glcode - $actype_upah= $get_KOD_UPAH[0]['acttype']; //keterangan acctype - - // carian perincian glejer untk glcode=1000/010 - $get_current_GLejer_Details_Upah=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$KOD_Rebate_L])->json(); - - if(sizeof($get_current_GLejer_Details_Upah)==0) - { //start kalau xdak data - $jumlah_Upah=0.0; - - $getGLedjer_Upah=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$KOD_Rebate_L])->json(); - - if(sizeof($getGLedjer_Upah)==0) - { - $jumlah_upah=0.0; - } - else - { - - //$glejer=$getGLedjer[0]; - $jumlahSemalam_Upah=$getGLedjer_Upah[0]['jumlah']; - $hariIniSemalam_Upah=$getGLedjer_Upah[0]['hariini']; - $jumlah_Upah=$jumlahSemalam_Upah+$hariIniSemalam_Upah; - - - } - - $jumlahBulan_ini_Upah=0.0; - $get_GlejerBulan_Tahun_Upah=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Rebate_L])->json(); - - if( sizeof($get_GlejerBulan_Tahun_Upah)==0) - { - $jumlahBulan_ini_Upah=0.0; - } - else - { - $jumlahBulan_ini_Upah=$get_GlejerBulan_Tahun[0]['jumlah']; - $jumlahBulan_ini_Upah=$jumlah_Upah-$jumlahBulan_ini_Upah; - }//end bulan tahun - $Jumlah_TahunIni_Upah=0.0; - $get_Glejer_Tahun_Upah=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Rebate_L])->json(); - if(sizeof($get_Glejer_Tahun_Upah)==0) - { - $Jumlah_TahunIni_Upah=0.0; - } - else - { - - $JumTahunIni_Upah=$get_Glejer_Tahun_Upah[0]['jumlah']; - $Jumlah_TahunIni_Upah=$jumlah_Upah-$JumTahunIni_Upah; - - } - - $HariIni_Upah=0.0; - $kelmarin_Upah=$jumlah_Upah-$HariIni_Upah; - //insert glejer untuk current date /hari ini - $daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - - 'kodcaw'=>$auth_user['cawangan'], - 'glcode'=>$KOD_Rebate_L, - 'descpt'=>$keterangan_upah, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Upah, - 'kelmarin'=>$kelmarin_Upah, - 'jumlah'=>$jumlah_Upah, - 'bulanini'=>$jumlahBulan_ini_Upah, - 'tahunini'=>$Jumlah_TahunIni_Upah, - 'acttype'=> $actype_upah - - ]); - - } - else - { - - - - } - - $get_KOD_UPAH=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$KOD_Rebate_A])->json(); - - $gl_cdetails_upah= $get_KOD_UPAH[0]; - $keterangan_upah= $get_KOD_UPAH[0]['descpt']; //keterangan glcode - $actype_upah= $get_KOD_UPAH[0]['acttype']; //keterangan acctype - - // carian perincian glejer untk glcode=1000/010 - $get_current_GLejer_Details_Upah=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$KOD_Rebate_A])->json(); - - if(sizeof($get_current_GLejer_Details_Upah)==0) - { //start kalau xdak data - $jumlah_Upah=0.0; - - $getGLedjer_Upah=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$KOD_Rebate_A])->json(); - - if(sizeof($getGLedjer_Upah)==0) - { - $jumlah_upah=0.0; - } - else - { - - //$glejer=$getGLedjer[0]; - $jumlahSemalam_Upah=$getGLedjer_Upah[0]['jumlah']; - $hariIniSemalam_Upah=$getGLedjer_Upah[0]['hariini']; - $jumlah_Upah=$jumlahSemalam_Upah+$hariIniSemalam_Upah; - - - } - - $jumlahBulan_ini_Upah=0.0; - $get_GlejerBulan_Tahun_Upah=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Rebate_A])->json(); - - if( sizeof($get_GlejerBulan_Tahun_Upah)==0) - { - $jumlahBulan_ini_Upah=0.0; - } - else - { - $jumlahBulan_ini_Upah=$get_GlejerBulan_Tahun[0]['jumlah']; - $jumlahBulan_ini_Upah=$jumlah_Upah-$jumlahBulan_ini_Upah; - }//end bulan tahun - $Jumlah_TahunIni_Upah=0.0; - $get_Glejer_Tahun_Upah=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$KOD_Rebate_A])->json(); - if(sizeof($get_Glejer_Tahun_Upah)==0) - { - $Jumlah_TahunIni_Upah=0.0; - } - else - { - - - $JumTahunIni_Upah=$get_Glejer_Tahun_Upah[0]['jumlah']; - - $Jumlah_TahunIni_Upah=$jumlah_Upah-$JumTahunIni_Upah; - - - } - $HariIni_Upah=0.0; - $kelmarin_Upah=$jumlah_Upah-$HariIni_Upah; - //insert glejer untuk current date /hari ini - $daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - - 'kodcaw'=>$auth_user['cawangan'], - 'glcode'=>$KOD_Rebate_A, - 'descpt'=>$keterangan_upah, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Upah, - 'kelmarin'=>$kelmarin_Upah, - 'jumlah'=>$jumlah_Upah, - 'bulanini'=>$jumlahBulan_ini_Upah, - 'tahunini'=>$Jumlah_TahunIni_Upah, - 'acttype'=> $actype_upah - - ]); - - } - else - { - - - - } - - $get_KOD_UPAH=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$Bayaran_Pendahuluan])->json(); - - $gl_cdetails_upah= $get_KOD_UPAH[0]; - $keterangan_upah= $get_KOD_UPAH[0]['descpt']; //keterangan glcode - $actype_upah= $get_KOD_UPAH[0]['acttype']; //keterangan acctype - - // carian perincian glejer untk glcode=1000/010 - $get_current_GLejer_Details_Upah=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$Bayaran_Pendahuluan])->json(); - - if(sizeof($get_current_GLejer_Details_Upah)==0) - { //start kalau xdak data - $jumlah_Upah=0.0; - - $getGLedjer_Upah=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$Bayaran_Pendahuluan])->json(); - - if(sizeof($getGLedjer_Upah)==0) - { - $jumlah_upah=0.0; - } - else - { - - //$glejer=$getGLedjer[0]; - $jumlahSemalam_Upah=$getGLedjer_Upah[0]['jumlah']; - $hariIniSemalam_Upah=$getGLedjer_Upah[0]['hariini']; - $jumlah_Upah=$jumlahSemalam_Upah+$hariIniSemalam_Upah; - - - } - - $jumlahBulan_ini_Upah=0.0; - $get_GlejerBulan_Tahun_Upah=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$Bayaran_Pendahuluan])->json(); - - if( sizeof($get_GlejerBulan_Tahun_Upah)==0) - { - $jumlahBulan_ini_Upah=0.0; - } - else - { - $jumlahBulan_ini_Upah=$get_GlejerBulan_Tahun[0]['jumlah']; - $jumlahBulan_ini_Upah=$jumlah_Upah-$jumlahBulan_ini_Upah; - }//end bulan tahun - $Jumlah_TahunIni_Upah=0.0; - $get_Glejer_Tahun_Upah=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$Bayaran_Pendahuluan])->json(); - if(sizeof($get_Glejer_Tahun_Upah)==0) - { - $Jumlah_TahunIni_Upah=0.0; - } - else - { - - - $JumTahunIni_Upah=$get_Glejer_Tahun_Upah[0]['jumlah']; - - $Jumlah_TahunIni_Upah=$jumlah_Upah-$JumTahunIni_Upah; - - - } - - $HariIni_Upah=0.0; - $kelmarin_Upah=$jumlah_Upah-$HariIni_Upah; - //insert glejer untuk current date /hari ini - $daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - - 'kodcaw'=>$auth_user['cawangan'], - 'glcode'=>$Bayaran_Pendahuluan, - 'descpt'=>$keterangan_upah, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Upah, - 'kelmarin'=>$kelmarin_Upah, - 'jumlah'=>$jumlah_Upah, - 'bulanini'=>$jumlahBulan_ini_Upah, - 'tahunini'=>$Jumlah_TahunIni_Upah, - 'acttype'=> $actype_upah - - ]); - - } - else - { - - - - } - - - - - //UPAH U - - $get_KOD_UPAH=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$KOD_ANS])->json(); - - $gl_cdetails_upah= $get_KOD_UPAH[0]; - $keterangan_upah= $get_KOD_UPAH[0]['descpt']; //keterangan glcode - $actype_upah= $get_KOD_UPAH[0]['acttype']; //keterangan acctype - - // carian perincian glejer untk glcode=1000/010 - $get_current_GLejer_Details_Upah=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$KOD_ANS])->json(); - - if(sizeof($get_current_GLejer_Details_Upah)==0) - { //start kalau xdak data - $jumlah_Upah=0.0; - - $getGLedjer_Upah=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$KOD_ANS])->json(); - - if(sizeof($getGLedjer_Upah)==0) - { - $jumlah_upah=0.0; - } - else - { - - //$glejer=$getGLedjer[0]; - $jumlahSemalam_Upah=$getGLedjer_Upah[0]['jumlah']; - $hariIniSemalam_Upah=$getGLedjer_Upah[0]['hariini']; - $jumlah_Upah=$jumlahSemalam_Upah+$hariIniSemalam_Upah; - - - } - - $jumlahBulan_ini_Upah=0.0; - $get_GlejerBulan_Tahun_Upah=Http::get(config('api.url').'/api/getLejerMonthYear/'.$auth_user['cawangan'],['glcode'=>$KOD_ANS])->json(); - - if( sizeof($get_GlejerBulan_Tahun_Upah)==0) - { - $jumlahBulan_ini_Upah=0.0; - } - else - { - $jumlahBulan_ini_Upah=$get_GlejerBulan_Tahun_Upah[0]['jumlah']; - $jumlahBulan_ini_Upah=$jumlah_Upah-$jumlahBulan_ini_Upah; - }//end bulan tahun - $Jumlah_TahunIni_Upah=0.0; - $get_Glejer_Tahun_Upah=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$KOD_ANS])->json(); - if(sizeof($get_Glejer_Tahun_Upah)==0) - { - $Jumlah_TahunIni_Upah=0.0; - } - else - { - - - $JumTahunIni_Upah=$get_Glejer_Tahun_Upah[0]['jumlah']; - - $Jumlah_TahunIni_Upah=$jumlah_Upah-$JumTahunIni_Upah; - - - } - - $HariIni_Upah=0.0; - $kelmarin_Upah=$jumlah_Upah-$HariIni_Upah; - //insert glejer untuk current date /hari ini - $daftarGlejer=Http::post(config('api.url').'/api/daftarGlejer/'.$auth_user['cawangan'],[ - - 'kodcaw'=>$auth_user['cawangan'], - 'glcode'=>$KOD_ANS, - 'descpt'=>$keterangan_upah, - 'debit'=>0.0, - 'kredit'=>0.0, - 'hariini'=>$HariIni_Upah, - 'kelmarin'=>$kelmarin_Upah, - 'jumlah'=>$jumlah_Upah, - 'bulanini'=>$jumlahBulan_ini_Upah, - 'tahunini'=>$Jumlah_TahunIni_Upah, - 'acttype'=> $actype_upah - - ]); - - } - else - { - - - - } - - - - - - - - - - - - - - - - - - - - - - - - - - - //************************ END LEJER AM********************************** - - return view('aliran_tunai.index',compact('cawangan_info','alirantunai','api_url','GT','denominasi','gadai_tebus','tuntutbaki','advansur','addtunai')); } @@ -1339,60 +276,6 @@ class AliranTunaiController extends Controller 'bakiakhir'=>$bakiakhir ]); - //Lejer AM untuk Transaksi U..; - $KOD_ANS='5000/511'; - $KOD_TUNAI='1000/010'; - - $upahdibayar=$advansur['upahDibayar']; - $get_tunai=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$KOD_TUNAI])->json(); - - $hariini_tunai=$get_tunai[0]['hariini']; - $kelmarin_tunai=$get_tunai[0]['kelmarin']; - $jumlah_tunai=$get_tunai[0]['jumlah']; - $debit_tunai=$get_tunai[0]['debit']; - $recno_tunai=$get_tunai[0]['recno']; - $kredit_tunai=$get_tunai[0]['kredit']; - - $debit_tunai=$debit_tunai+$upahdibayar; - $hariini_tunai=$debit_tunai-$kredit_tunai; - $kelmarin_tunai=$jumlah_tunai-$hariini_tunai; - $update_tunaiupah=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_upah=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$KOD_ANS])->json(); - - $hariini_upah=$get_upah[0]['hariini']; - $kelmarin_upah=$get_upah[0]['kelmarin']; - $jumlah_upah=$get_upah[0]['jumlah']; - $debit_upah=$get_upah[0]['debit']; - $recno_upah=$get_upah[0]['recno']; - $kredit_upah=$get_upah[0]['kredit']; - $kredit_upah=$kredit_upah+$upahdibayar; - $hariini_upah=$debit_upah-$kredit_upah; - $kelmarin_upah=$jumlah_upah-$hariini_upah; - $update_tunaiupahU=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ - 'recno'=>$recno_upah, - 'debit'=>$debit_upah, - 'kredit'=>$kredit_upah, - 'hariini'=>$hariini_upah, - 'kelmarin'=>$kelmarin_upah, - - ]); - - - - - - - - - - } public function LaporanSerahan(Request $request) diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index e4ac06a..b45eb97 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -3182,6 +3182,15 @@ class KhazanahController extends Controller return view('print.laporan_marhunterkumpul', compact('marhun','cawangan_detail','tarikh_cetak','tebus_date','api_url')); } + public function laporanRingkasanTerkumpul(){ + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + return view('khazanah.laporan.ringkasanterkumpul',compact('cawangan_info','api_url')); + } + public function laporanRingkasanHarian(){ $auth_user = Auth::user(); $api_url = config('api.url'); @@ -3278,21 +3287,33 @@ class KhazanahController extends Controller $current = Carbon::now(); $current = new Carbon(); $tarikh_cetak = $current->toDateString(); - if($request->datetimepicker1 == null){ - $tebus_date = $current->toDateString(); - }else{ - $split_date = explode('-',$request->datetimepicker1); - $tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; - } - $marhun = Http::get(config('api.url'). '/api/gadai/laporan/ringkasan/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json(); - $marhun = $marhun[0]; - $keseluruhanupahsimpan = $marhun['lelongupahsimpan'] + $marhun['tebus'][0]['upahsimpan'] + $marhun['advansur'][0]['upahsimpan']; + if($request->datemula == null){ + $mula_date = '2017-01-01'; + }else{ + $split_date = explode('-', $request->datemula); + $mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + if($request->datehingga == null){ + $hingga_date = $current->toDateString(); + }else{ + $split_date = explode('-', $request->datehingga); + $hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + $laporan_ringkasan = Http::get(config('api.url') . '/api/laporan/terkumpul',[ + 'kodcaw' => $auth_user['cawangan'], + 'mula' => $mula_date, + 'akhir' => $hingga_date + ])->json(); + + $laporan_ringkasan = $laporan_ringkasan[0]; $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); $cawangan_detail=$cawangan[0]; - // dd($gadai); - return view('print.laporan_ringkasanterkumpul', compact('keseluruhanupahsimpan','marhun','cawangan_detail','tarikh_cetak','tebus_date','api_url')); + + return view('print.laporan_ringkasanterkumpulv2', compact('laporan_ringkasan','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url')); } public function laporanKawalanStok(){ @@ -3486,335 +3507,6 @@ class KhazanahController extends Controller $amaun=$request->amaun; - if($request->jenisgldetail == 'serahan') - { - - - - $KOD_SERAH='1000/020'; - $TUNAI='1000/010'; - $get_glCode_Details=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$KOD_SERAH])->json(); - - $gl_cdetails=$get_glCode_Details[0]; - $keterangan=$get_glCode_Details[0]['descpt']; //keterangan glcode - $actype=$get_glCode_Details[0]['acttype']; //keterangan acctype - - $get_current_GLejer_Details=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$KOD_SERAH])->json(); - if(sizeof($get_current_GLejer_Details)==0) - { - - $jumlah=0.0; - - - $getGLedjer=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$KOD_SERAH])->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'=>$KOD_SERAH])->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'=>$KOD_SERAH])->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'=>$KOD_SERAH, - 'descpt'=>$keterangan, - 'debit'=>$amaun, - 'kredit'=>0.0, - 'hariini'=>$HariIni, - 'kelmarin'=>$kelmarin, - 'jumlah'=>$jumlah, - 'bulanini'=>$jumlahBulan_ini, - 'tahunini'=>$Jumlah_TahunIni, - 'acttype'=> $actype - - ]); - - $get_lejer=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$TUNAI])->json(); - - $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+$amaun; - $Hari_Ini=$debit-$kredit; - $Kelmarin=$jumlah-$Hari_Ini; - $update_lejerTunai=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ - 'recno'=>$recno, - 'debit'=>$debit, - 'kredit'=>$kredit, - 'hariini'=>$Hari_Ini, - 'kelmarin' =>$kelmarin, - - ]); - - } - else - { - - $hariIni_serah=$get_current_GLejer_Details=[0]['hariini']; - $jumlah_serah=$get_current_GLejer_Details=[0]['kelmarin']; - $kredit_serah=$get_current_GLejer_Details=[0]['kredit']; - $debit_serah=$get_current_GLejer_Details=[0]['debit']; - $recno_serah=$get_current_GLejer_Details=[0]['recno']; - - - - $debit_serah=$debit_serah+$amaun; - $hariIni_serah=$debit_serah-$kredit_serah; - $kelmarin_serah=$jumlah_serah-$hariIni_serah; - $update_lejerSerah=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ - 'recno'=>$recno_serah, - 'debit'=>$debit_serah, - 'kredit'=>$kredit_serah, - 'hariini'=>$hariIni_serah, - 'kelmarin' =>$kelmarin_serah, - - ]); - - - $get_lejer=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$TUNAI])->json(); - - $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+$amaun; - $Hari_Ini=$debit-$kredit; - $Kelmarin=$jumlah-$Hari_Ini; - $update_lejerTunai=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ - 'recno'=>$recno, - 'debit'=>$debit, - 'kredit'=>$kredit, - 'hariini'=>$Hari_Ini, - 'kelmarin' =>$Kelmarin, - - ]); - - } - - - - } - - - - - if($request->jenisgldetail == 'pendahuluan') - { - - - - $KOD_SERAH='7000/102'; - $TUNAI='1000/010'; - $get_glCode_Details=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=>$KOD_SERAH])->json(); - - $gl_cdetails=$get_glCode_Details[0]; - $keterangan=$get_glCode_Details[0]['descpt']; //keterangan glcode - $actype=$get_glCode_Details[0]['acttype']; //keterangan acctype - - $get_current_GLejer_Details=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$KOD_SERAH])->json(); - if(sizeof($get_current_GLejer_Details)==0) - { - - $jumlah=0.0; - - - $getGLedjer=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$KOD_SERAH])->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'=>$KOD_SERAH])->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'=>$KOD_SERAH])->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'=>$KOD_SERAH, - 'descpt'=>$keterangan, - 'debit'=>0.0, - 'kredit'=>$amaun, - 'hariini'=>$HariIni, - 'kelmarin'=>$kelmarin, - 'jumlah'=>$jumlah, - 'bulanini'=>$jumlahBulan_ini, - 'tahunini'=>$Jumlah_TahunIni, - 'acttype'=> $actype - - ]); - - $get_lejer=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$TUNAI])->json(); - - $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']; - - $debit=$debit+$amaun; - $Hari_Ini=$debit-$kredit; - $Kelmarin=$jumlah-$Hari_Ini; - $update_lejerTunai=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ - 'recno'=>$recno, - 'debit'=>$debit, - 'kredit'=>$kredit, - 'hariini'=>$Hari_Ini, - 'kelmarin' =>$kelmarin, - - ]); - - } - else - { - - $hariIni_serah=$get_current_GLejer_Details=[0]['hariini']; - $jumlah_serah=$get_current_GLejer_Details=[0]['kelmarin']; - $kredit_serah=$get_current_GLejer_Details=[0]['kredit']; - $debit_serah=$get_current_GLejer_Details=[0]['debit']; - $recno_serah=$get_current_GLejer_Details=[0]['recno']; - - - - $kredit_serah=$kredit_serah+$amaun; - $hariIni_serah=$debit_serah-$kredit_serah; - $kelmarin_serah=$jumlah_serah-$hariIni_serah; - $update_lejerSerah=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ - 'recno'=>$recno_serah, - 'debit'=>$debit_serah, - 'kredit'=>$kredit_serah, - 'hariini'=>$hariIni_serah, - 'kelmarin' =>$kelmarin_serah, - - ]); - - - $get_lejer=Http::get(config('api.url').'/api/getGlejer/'.$auth_user['cawangan'],['glcode'=>$TUNAI])->json(); - - $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']; - - $debit=$debit+$amaun; - $Hari_Ini=$debit-$kredit; - $Kelmarin=$jumlah-$Hari_Ini; - $update_lejerTunai=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$auth_user['cawangan'],[ - 'recno'=>$recno, - 'debit'=>$debit, - 'kredit'=>$kredit, - 'hariini'=>$Hari_Ini, - 'kelmarin' =>$Kelmarin, - - ]); - - } - - - - } - - - - - - - - - - - - - $peti_besi_terkini=Http::get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json(); if(sizeof($peti_besi_terkini) == 0){ @@ -3826,7 +3518,6 @@ class KhazanahController extends Controller ])->json(); }else{ - $pendahuluanserahan = Http::put(config('api.url').'/api/UpdateVaultPendahuluanSerahan/'. $auth_user['cawangan'],[ 'jenispendahuluanserahan' => $request->jenisgldetail, @@ -4518,4 +4209,56 @@ class KhazanahController extends Controller return view('print.suratgadaianhilang', compact('polis','gadai','customers','cawangan_detail','api_url')); } + public function PemilihanAnsUpah() + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + + return view('khazanah.laporan.ansuranupah', compact('cawangan_info','api_url')); + } + + public function LaporanUpah() + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + + return view('khazanah.laporan.upah', compact('cawangan_info','api_url')); + } + + public function cetaklaporan_Upah(Request $request) + { + $api_url = config('api.url'); + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + + if($request->datemula == null){ + $mula_date = '2017-01-01'; + }else{ + $split_date = explode('-', $request->datemula); + $mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + if($request->datehingga == null){ + $hingga_date = $current->toDateString(); + }else{ + $split_date = explode('-', $request->datehingga); + $hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + $advansur = Http::get(config('api.url'). '/api/AnsuranByRangeTarikh/' . $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]; + + return view('print.laporan_upah', compact('advansur','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url')); + } + } 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 @@
- +
@@ -292,6 +292,56 @@ var tele = "{{ $auth_user['name'] }}"; + function serahankemaskini(data) + { + + $.ajax({ + type: 'get', + url: "{{ route('periksa.alirantunai') }}", + success: function(balasbalik){ + if(balasbalik == 'sama') + { + openuptambahdanserah(data); + }else{ + + $.ajax({ + type: 'get', + url: "{{ route('kemaskini.alirantunai') }}", + data: { "bakiakhir" : balasbalik['bakisemasa'], + "pendahuluan" : balasbalik['pendahuluan'], + "serahan" : balasbalik['serahan'], + "gadaian" : balasbalik['gadaian'], + "penebusan" : balasbalik['penebusan'] + }, + success: function(balas){ + if(balas == 'berjaya') + { + Swal.fire({ + icon: 'success', + title: 'Berjaya', + text: 'Kemaskini Berjaya!', + closeOnClickOutside: false + }).then(function() { + location.reload(); + }); + + }else{ + Swal.fire({ + icon: 'danger', + title: 'Tidak Berjaya', + text: 'Kemaskini tidak berjaya!', + closeOnClickOutside: false + }).then(function() { + location.reload(); + }); + } + } + }); + } + } + }); + } + function periksaalirantunai() { diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php index 9876021..cc15ea7 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/info.blade.php @@ -470,6 +470,10 @@ "ordering": false }); + var bayaranupah = $('#tablehistoryupah').DataTable({ + "ordering": false + }); + const formatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 2 }); @@ -821,6 +825,13 @@ rekodasal(gadai); } }); + $.ajax({ + method:'get', + url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid, + success:function(ansuran){ + rekodansuran(ansuran); + } + }); } }else if($("input[name='options']:checked").val() == 'sudah_tebus'){ let histid = $('input[name="sudahtebus"]:checked').val(); @@ -858,6 +869,13 @@ rekodasal(gadai); } }); + $.ajax({ + method:'get', + url: api_url + '/api/ansuran/' + "{{ $cawangan_info['kodcaw'] }}" + '/' + histid, + success:function(ansuran){ + rekodansuran(ansuran); + } + }); } } } @@ -868,6 +886,24 @@ $('#nilaimarhunmodal').text('RM ' + formatter.format(gadaian[0][0]['nilaimarhun'])); } + function rekodansuran(data){ + var counter = 1; + + bayaranupah.clear().draw(); + $.each(data,function(index,bayaran){ + + var urlroute = '{{ route("resit.advansur", ":id") }}'; + urlroute = urlroute.replace(':id', bayaran['norujukan']); + bayaranupah.row.add([ + counter, + bayaran['tarikh'], + "RM " + bayaran['upahDibayar'], + 'Cetak' + ]).draw(); + counter = counter + 1; + }); + } + function historybayarantable(data){ var counter = 1; diff --git a/resources/views/khazanah/laporan/ansuranupah.blade.php b/resources/views/khazanah/laporan/ansuranupah.blade.php new file mode 100644 index 0000000..a50bc9b --- /dev/null +++ b/resources/views/khazanah/laporan/ansuranupah.blade.php @@ -0,0 +1,112 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+ + +
+ +
+
+
+ Ansuran +
+
+
+
+ Upah +
+
+
+
+
+
+
+
+ + + +@endsection diff --git a/resources/views/khazanah/laporan/gadaian.blade.php b/resources/views/khazanah/laporan/gadaian.blade.php index dd4b71e..61f1da9 100644 --- a/resources/views/khazanah/laporan/gadaian.blade.php +++ b/resources/views/khazanah/laporan/gadaian.blade.php @@ -28,7 +28,7 @@
Tarikh
- +
@@ -78,7 +78,7 @@ "ordering": false }); $(document).ready( function () { - $('#datetimepicker1').datepicker({ + $('#datetarikh').datepicker({ format: 'dd-mm-yyyy' }); var current = new Date(); @@ -95,7 +95,7 @@ }); }); - $('#datetimepicker1').change(function(){ + $('#datetarikh').change(function(){ var input_date = this.value; var split_date = input_date.split('-'); var today_date = split_date[2] + '-' +split_date[1]+'-'+split_date[0]; @@ -121,17 +121,13 @@ tablegadai.clear().draw(); $.each(data,function(index,gadai){ - $.ajax({ - method:'get', - url:api_url + '/api/customers/' + gadai['nokp'], - success:function(customer){ total_pinjaman += Number(gadai['pinjaman']); total_upah12 += Number(gadai['upah12']); total_nm += Number(gadai['nilaimarhun']); total_berat += Number(gadai['berat']); tablegadai.row.add([ counter, - customer['nama'], + gadai['nama'], gadai['nokp'], gadai['norujukan'], formatter.format(gadai['pinjaman']), @@ -144,11 +140,8 @@ $('#nmtotal').text(formatter.format(total_nm.toFixed(2))); $('#berattotal').text(formatter.format(total_berat.toFixed(2))); counter = counter + 1; - } - }); }); } @endsection - diff --git a/resources/views/khazanah/laporan/index.blade.php b/resources/views/khazanah/laporan/index.blade.php index 959af9b..f7f3e5a 100644 --- a/resources/views/khazanah/laporan/index.blade.php +++ b/resources/views/khazanah/laporan/index.blade.php @@ -26,7 +26,7 @@ Pelanggan Baru
- Ringkasan Terkumpul + Ringkasan Terkumpul
Aging Bulan @@ -70,7 +70,7 @@
- Ansuran + Ansuran & Upah
Stok Audit diff --git a/resources/views/khazanah/laporan/penebusan.blade.php b/resources/views/khazanah/laporan/penebusan.blade.php index b722677..79e3f74 100644 --- a/resources/views/khazanah/laporan/penebusan.blade.php +++ b/resources/views/khazanah/laporan/penebusan.blade.php @@ -28,7 +28,8 @@
Tarikh
- + +
@@ -40,17 +41,16 @@ Bil - Nama + Nama No K/P No Rujukan - Tarikh Tebus Pembiayaan (RM) Keuntungan (RM) Bayaran (RM) - TOTAL + TOTAL @@ -76,30 +76,31 @@ "ordering": true }); $(document).ready( function () { - $('#datetimepicker1').datepicker({ + $('#datetarikh').datepicker({ format: 'dd-mm-yyyy' }); + var current = new Date(); var current_date = current.getDate(); var current_month = current.getMonth()+1; var current_year = current.getFullYear(); - var today_date = current_year + '-' +current_month+'-'+current_date; + var today_date = current_year + '-' + current_month + '-' + current_date; $.ajax({ method:'get', - url: api_url + '/api/tebus/laporan/'+kodcaw+'/' + today_date, + url: api_url + '/api/tebus/laporan/' +kodcaw+ '/' + today_date, success: function(tebus){ tebustable(tebus); } }); }); - $('#datetimepicker1').change(function(){ + $('#datetarikh').change(function(){ var input_date = this.value; var split_date = input_date.split('-'); - var today_date = split_date[2] + '-' +split_date[1]+'-'+split_date[0]; + var today_date = split_date[2] + '-' + split_date[1] + '-' + split_date[0]; $.ajax({ method:'get', - url: api_url + '/api/tebus/laporan/'+kodcaw+'/' + today_date, + url: api_url + '/api/tebus/laporan/' + kodcaw + '/' + today_date, success: function(tebus){ tebustable(tebus); } @@ -110,7 +111,6 @@ }); - const formatter = new Intl.NumberFormat('en-US', { minimumFractionDigits: 2 }); @@ -120,40 +120,62 @@ var total_pinjaman = 0; var total_keuntungan = 0; var total_bayaran = 0; + + console.log(data); tabletebus.clear().draw(); $.each(data,function(index,tebus){ - $.ajax({ - url:api_url + '/api/gadai/norujukan/' + tebus['norujukan'], - method:'get', - success:function(gadai){ - $.ajax({ - url:api_url + '/api/customers/' + gadai[0][0]['nokp'], - method:'get', - success:function(customer){ - total_pinjaman += parseFloat(tebus['pinjaman']); - total_keuntungan += parseFloat(tebus['bakiupah']); - total_bayaran += parseFloat(tebus['bakipjm']); - tabletebus.row.add([ - counter, - customer['nama'], - gadai[0][0]['nokp'], - tebus['norujukan'], - tebus['t_tebus'], - formatter.format(tebus['pinjaman']), - formatter.format(tebus['bakiupah']), - formatter.format(tebus['bakipjm']) - ]).draw(); - counter = counter + 1; - $('#pinjamantotal').text(formatter.format(total_pinjaman.toFixed(2))); - $('#keuntungantotal').text(formatter.format(total_keuntungan.toFixed(2))); - $('#bayarantotal').text(formatter.format(total_bayaran.toFixed(2))); - - } - }); - } - }); + total_pinjaman += parseFloat(tebus['pinjaman']); + total_keuntungan += parseFloat(tebus['bakiupah']); + total_bayaran += parseFloat(tebus['bakipjm']); + tabletebus.row.add([ + counter, + tebus['nama'], + tebus['nokp'], + tebus['norujukan'], + formatter.format(tebus['pinjaman']), + formatter.format(tebus['bakiupah']), + formatter.format(tebus['bakipjm']) + ]).draw(); + counter = counter + 1; + $('#pinjamantotal').text(formatter.format(total_pinjaman.toFixed(2))); + $('#keuntungantotal').text(formatter.format(total_keuntungan.toFixed(2))); + $('#bayarantotal').text(formatter.format(total_bayaran.toFixed(2))); }); + + + // $.each(data,function(index,tebus){ + // $.ajax({ + // url:api_url + '/api/gadai/norujukan/' + tebus['norujukan'], + // method:'get', + // success:function(gadai){ + // $.ajax({ + // url:api_url + '/api/customers/' + gadai[0][0]['nokp'], + // method:'get', + // success:function(customer){ + // total_pinjaman += parseFloat(tebus['pinjaman']); + // total_keuntungan += parseFloat(tebus['bakiupah']); + // total_bayaran += parseFloat(tebus['bakipjm']); + // tabletebus.row.add([ + // counter, + // customer['nama'], + // gadai[0][0]['nokp'], + // tebus['norujukan'], + // tebus['t_tebus'], + // formatter.format(tebus['pinjaman']), + // formatter.format(tebus['bakiupah']), + // formatter.format(tebus['bakipjm']) + // ]).draw(); + // counter = counter + 1; + // $('#pinjamantotal').text(formatter.format(total_pinjaman.toFixed(2))); + // $('#keuntungantotal').text(formatter.format(total_keuntungan.toFixed(2))); + // $('#bayarantotal').text(formatter.format(total_bayaran.toFixed(2))); + + // } + // }); + // } + // }); + // }); // console.log('Total Pinjam : ' + total_pinjaman); // $('#jumlah_pinjaman').text('RM '+ total_pinjaman); diff --git a/resources/views/khazanah/laporan/ringkasanterkumpul.blade.php b/resources/views/khazanah/laporan/ringkasanterkumpul.blade.php new file mode 100644 index 0000000..29e492d --- /dev/null +++ b/resources/views/khazanah/laporan/ringkasanterkumpul.blade.php @@ -0,0 +1,70 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+ @csrf +
+
+ Mula +
+ + +
+ Hingga +
+ + + + +
+
+
+
+ +
+
+
+
+
+ +@endsection + diff --git a/resources/views/khazanah/laporan/upah.blade.php b/resources/views/khazanah/laporan/upah.blade.php new file mode 100644 index 0000000..2600868 --- /dev/null +++ b/resources/views/khazanah/laporan/upah.blade.php @@ -0,0 +1,214 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+ @csrf +
+
+ Mula +
+ + +
+ Hingga +
+ + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + +
BilTarikhNo RujukanTellerPinjamanJBGUpah Dibayar
TOTAL
+
+
+ +
+
+
+
+
+ +@endsection + diff --git a/resources/views/khazanah/pendahuluanserahanmain.blade.php b/resources/views/khazanah/pendahuluanserahanmain.blade.php index 4d6230a..c99617f 100644 --- a/resources/views/khazanah/pendahuluanserahanmain.blade.php +++ b/resources/views/khazanah/pendahuluanserahanmain.blade.php @@ -298,7 +298,7 @@ $('#denominasiHQModal').modal('hide'); $('#pendahuluanserahanModal').modal('hide'); - + location.reload(); }); }else if(data == 'GAGAL'){ diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 57f4d5e..a5fb0ab 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -172,7 +172,7 @@ }); - @elseif($auth_user['roles'] == 'teller') + @elseif($auth_user['role_harian'] == 'teller')
+ @@ -44,6 +47,21 @@ +
+
+ + + + + + + + + + + +
BilTarikhUpahAction
+

diff --git a/resources/views/print/laporan_gadaian.blade.php b/resources/views/print/laporan_gadaian.blade.php index f7b6e19..addd58a 100644 --- a/resources/views/print/laporan_gadaian.blade.php +++ b/resources/views/print/laporan_gadaian.blade.php @@ -180,14 +180,14 @@ $formattedweddingdate = $myDateTime->format('d-m-Y'); echo($formattedweddingdate) @endphp - - + + @@ -214,9 +214,9 @@ - @php $counter = 1; $totalpinjaman = 0; @endphp + @php $counter = 1; $totalpinjaman = 0; $totalberat = 0; $totalnm = 0; $totalupah = 0;@endphp @foreach($gadai as $index=>$item) - @php $totalpinjaman += $item['pinjaman'] @endphp + @php $totalpinjaman += $item['pinjaman']; $totalberat += $item['berat']; $totalnm += $item['nilaimarhun']; $totalupah += $item['upah12']; @endphp @if($index > 0) @if($item['teller'] != $gadai[$index - 1]['teller']) @@ -235,12 +235,9 @@ - + @@ -275,8 +272,25 @@ @endif @endforeach
Tarikh Cetak @php $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); $formattedweddingdate = $myDateTime->format('d-m-Y'); echo($formattedweddingdate) @endphp
Keuntungan Peratus (%)
{{ $counter }} {{$item['norujukan']}} - @php - $customer_detail = Http::get($api_url . '/api/customers/' . $item['nokp'])->json(); - echo $customer_detail['nama']; - @endphp + {{ $item['nama'] }} {{$customer_detail['alamat1']}}{{ $item['alamat1'] }} {{ $item['nokp'] }} {{ $item['masa'] }} {{ number_format($item['berat'],2) }}
+

+ + + + + + + + + + + + + + + +
Berat (g/m)Nilai Marhun (RM)Pembiayaan (RM)Upah/Keuntungan (RM)
JUMLAH KESELURUHAN{{ number_format($totalberat,2) }}{{ number_format($totalnm,2) }}{{ number_format($totalpinjaman,2) }}{{ number_format($totalupah,2) }}
-
JUMLAH KESELURUHAN GADAIAN : RM {{ number_format($totalpinjaman,2) }}
+{{--
JUMLAH KESELURUHAN GADAIAN : RM {{ number_format($totalpinjaman,2) }}
--}}

@@ -298,22 +312,6 @@ -

Laporan Transaksi Gadaian

-
- - - - - - - - - - - - -
BilJenisPenebusan(RM)
0 Rugi Lelong 0.00
- diff --git a/resources/views/print/laporan_penebusan.blade.php b/resources/views/print/laporan_penebusan.blade.php index 49fbfca..0fcc15a 100644 --- a/resources/views/print/laporan_penebusan.blade.php +++ b/resources/views/print/laporan_penebusan.blade.php @@ -145,12 +145,6 @@ - - - - - - {{-- --}} @@ -186,7 +180,7 @@ - + - - - - - - @@ -219,9 +207,9 @@ Bayaran(RM) Jumlah(RM) - @php $counter = 1; $totalbayaran = 0;@endphp + @php $counter = 1; $totalbayaran = 0; $totalpinjaman = 0; $totalupah = 0;@endphp @foreach($tebus as $index=>$item) - @php $totalbayaran += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; @endphp + @php $totalbayaran += ($item['jenistebus'] === 'S') ? ($item['pinjaman']+$item['bakiupah']) : $item['bakipjm']; $totalpinjaman += $item['pinjaman']; $totalupah += $item['bakiupah'];@endphp @if($index > 0) @if($item['teller'] != $tebus[$index - 1]['teller']) @@ -238,18 +226,11 @@ {{ $counter }} {{ $item['norujukan'] }} - - @php - $gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json(); - $customer_detail = Http::get($api_url . '/api/customers/' . $gadai_detail[0][0]['nokp'])->json(); - - echo $customer_detail['nama']; - @endphp - - {{$gadai_detail[0][0]['nokp']}} + {{ $item['nama'] }} + {{ $item['nokp'] }} @php - $myDateTime = DateTime::createFromFormat('Y-m-d', $gadai_detail[0][0]['t_gadai']); + $myDateTime = DateTime::createFromFormat('Y-m-d', $item['t_gadai']); $formattedweddingdate = $myDateTime->format('d-m-Y'); echo($formattedweddingdate); @endphp @@ -296,24 +277,19 @@ @endforeach -
JUMLAH KESELURUHAN BAYARAN : RM {{ number_format($totalbayaran,2) }}
- -
-
- +

+
- - - - - + + + + - - - - - + + + +
.................................................................. .................................................................. Pembiayaan (RM)Upah/Keuntungan (RM)Jumlah (RM)
DI SEMAK DI SAHKAN JUMLAH KESELURUHAN{{ number_format($totalpinjaman,2) }}{{ number_format($totalupah,2) }}{{ number_format($totalbayaran,2) }}
@@ -349,12 +325,26 @@ {{ number_format($upahlama['total'],2) }} Not Applicable + + +{{--
JUMLAH KESELURUHAN BAYARAN : RM {{ number_format($totalbayaran,2) }}
--}} + +
+
+ - - - - - + + + + + + + + + + + +
0 Baki Lelong 0.00 Not Applicable Not Applicable .................................................................. ..................................................................
DI SEMAK DI SAHKAN
@@ -363,3 +353,5 @@ + + diff --git a/resources/views/print/laporan_ringkasanterkumpulv2.blade.php b/resources/views/print/laporan_ringkasanterkumpulv2.blade.php new file mode 100644 index 0000000..f294468 --- /dev/null +++ b/resources/views/print/laporan_ringkasanterkumpulv2.blade.php @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + +

+

Tarikh Mula: {{ $mula_date }} Tarikh Hingga : {{ $hingga_date }} Tarikh Cetak : {{ $tarikh_cetak }}

+ +
+
+
+
+

A) LAPORAN TERKUMPUL

+
+
1. PEMBIAYAAN
+
RM {{ number_format($laporan_ringkasan['total_gadai'],2) }}
+
2. PENEBUSAN
+
RM {{ number_format($laporan_ringkasan['total_tebus'],2) }}
+
3. ANSURAN PEMBIAYAAN
+
RM {{ number_format($laporan_ringkasan['total_ansuran'],2) }}
+
4. BAYARAN ONLINE
+
RM 0.00
+
5. KEUNTUNGAN
+
RM {{ number_format($laporan_ringkasan['total_keuntungan'],2) }}
+
6. KEUNTUNGAN ONLINE
+
RM 0.00
+
+
+
+
+
+

B) BIL TRANSAKSI

+
+
1. PEMBIAYAAN
+
{{ $laporan_ringkasan['bilangan_gadai'] }}
+
2. PENEBUSAN
+
{{ $laporan_ringkasan['bilangan_tebus'] }}
+
3. ANSURAN PEMBIAYAAN
+
{{ $laporan_ringkasan['bilangan_ansuran'] }}
+
4. BAYARAN ONLINE
+
0
+
5. PELANGGAN BARU
+
{{ $laporan_ringkasan['bilangan_customer_baru'] }}
+
+
+
+ +
+
+
+
+

F) LELONG

+
+
1. LELONG HARI INI
+
RM {{ number_format($laporan_ringkasan['jumlah_lelong'],2) }}
+
2. BAKI
+
RM {{ number_format($laporan_ringkasan['baki_lelong'],2) }}
+
3. RUGI
+
RM {{ number_format($laporan_ringkasan['rugi_lelong'],2) }}
+
4. CAJ LELONG
+
RM {{ number_format($laporan_ringkasan['cas_lelong'],2) }}
+
5. BIL
+
{{ $laporan_ringkasan['bilangan_lelong'] }}
+
+
+
+
+
+

G) BAYAR BAKI LELONG

+
+
RM
+
+
+
+
+ +
+
+
+
+

H) PERATUSAN PEMBIAYAAN

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MARGIN70%75%80%
1PEMBIAYAANRM {{ number_format($laporan_ringkasan['gadai_70'],2) }}RM {{ number_format($laporan_ringkasan['gadai_75'],2) }}RM {{ number_format($laporan_ringkasan['gadai_80'],2) }}
2NILAI MARHUNRM {{ number_format($laporan_ringkasan['nilaimarhun_70'],2) }}RM {{ number_format($laporan_ringkasan['nilaimarhun_75'],2) }}RM {{ number_format($laporan_ringkasan['nilaimarhun_80'],2) }}
3BILANGAN{{ $laporan_ringkasan['bilangan_70'] }}{{ $laporan_ringkasan['bilangan_75'] }}{{ $laporan_ringkasan['bilangan_80'] }}
+
+
+
+
+

+
+
+
+
DISEMAK
+
+
+
................................................
+
+
+
+
+
DISAHKAN
+
+
+
................................................
+
+
+
\ No newline at end of file diff --git a/resources/views/print/laporan_upah.blade.php b/resources/views/print/laporan_upah.blade.php new file mode 100644 index 0000000..cfb975b --- /dev/null +++ b/resources/views/print/laporan_upah.blade.php @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + {{-- --}} + {{-- --}} + + + + + + {{-- + + + + + + + --}} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LAPORAN UPAH
TARIKH CETAK: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp +
MULA:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $mula_date); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp HINGGA:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $hingga_date); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp
+ +
+ + + + + + + + + + + @php $counter = 1; $totalbayaran = 0; $totalpembiayaan = 0; $totalpembiayaanteller = 0; $totalbayaranteller = 0; @endphp + @foreach($advansur as $index=>$item) + @php $totalbayaran += $item['upahDibayar']; $totalpembiayaan += $item['pinjaman'];$totalbayaranteller += $item['upahDibayar']; $totalpembiayaanteller += $item['pinjaman']; @endphp + @if($index > 0) + @if($item['teller'] != $advansur[$index - 1]['teller']) + + + + @php $counter = 1;$totalpembiayaanteller = 0; $totalbayaranteller = 0; @endphp + @endif + @else + + + + @php $counter = 1;$totalpembiayaanteller = 0; $totalbayaranteller = 0; @endphp + + @endif + + + + + + + + + + + @php $counter++; @endphp + @if($index+1 < sizeof($advansur)) + @if($item['teller'] != $advansur[$index + 1]['teller']) + + + + + + + @php @endphp + @endif +@else + + + + + + +@endif + @endforeach +
BilTarikhNo RujukanTellerPinjamanJBGUpah Dibayar
Teller : {{ $item['teller'] }}
Teller : {{ $item['teller'] }}
{{ $counter }}{{ $item['tarikh'] }}{{ $item['norujukan'] }}{{ $item['teller'] }}{{ number_format($item['pinjaman'],2) }}{{ $item['jbg'] }}{{ number_format($item['upahDibayar'],2) }}
{{ $counter-1 }} Jumlah Bagi Teller : {{ $item['teller'] }}{{ number_format($totalpembiayaanteller,2) }} {{ number_format($totalbayaranteller,2) }}
{{ $counter-1 }} Jumlah Bagi Teller : {{ $item['teller'] }}{{ number_format($totalpembiayaanteller,2) }} {{ number_format($totalbayaranteller,2) }}
+

+ + + + + + + + + + + +
Pembiayaan (RM)Upah Dibayar (RM)
JUMLAH KESELURUHAN{{ number_format($totalpembiayaan,2) }}{{ number_format($totalbayaran,2) }}
+ +
+


+ + + + + + + + + + + + + + + + + + + +
.................................................................. .................................................................. ..................................................................
Disediakan Disemak Disahkan
+ + + + + + diff --git a/routes/web.php b/routes/web.php index fbc9f25..a783457 100644 --- a/routes/web.php +++ b/routes/web.php @@ -181,6 +181,9 @@ Route::put('/simpantuntutbaki',['as'=>'lelong.tuntutbaki','uses'=>'LelongControl //Laporan Baru Route::get('/laporan/lelongan',['as'=>'laporan.lelongan','uses'=>'KhazanahController@laporanLelongan'])->middleware('auth','khazanah'); Route::post('laporan/lelongan/cetak',['as'=>'lelongan.laporancetak','uses'=>'KhazanahController@cetaklaporanLelongan'])->middleware('auth','khazanah'); +Route::get('/laporan/homepage/ansuranupah',['as'=>'homepage.ansuranupah','uses'=>'KhazanahController@PemilihanAnsUpah'])->middleware('auth','khazanah'); +Route::get('/laporan/upah',['as'=>'laporan.upah','uses'=>'KhazanahController@LaporanUpah'])->middleware('auth','khazanah'); +Route::post('laporan/upah/cetak',['as'=>'upah.laporancetak','uses'=>'KhazanahController@cetaklaporan_Upah'])->middleware('auth','khazanah'); Route::get('/laporan/ansuran',['as'=>'laporan.ansuran','uses'=>'KhazanahController@laporanAnsuran'])->middleware('auth','khazanah'); Route::post('laporan/ansuran/cetak',['as'=>'ansuran.laporancetak','uses'=>'KhazanahController@cetakLaporanAnsuran'])->middleware('auth','khazanah'); Route::get('/laporan/pelangganbaru',['as'=>'laporan.pelangganbaru','uses'=>'KhazanahController@laporanPelangganBaru'])->middleware('auth','khazanah'); @@ -199,6 +202,7 @@ Route::get('/laporan/marhunterkumpul',['as'=>'laporan.marhunterkumpul','uses'=>' Route::post('laporan/marhunterkumpul/cetak',['as'=>'marhunterkumpul.laporancetak','uses'=>'KhazanahController@cetakLaporanMarhunTerkumpul'])->middleware('auth','khazanah'); Route::get('laporan/ringkasanharian/',['as'=>'laporan.ringkasanharian','uses'=>'KhazanahController@laporanRingkasanHarian'])->middleware('auth','khazanah'); Route::get('laporan/ringkasanharian/cetak',['as'=>'ringkasanharian.laporancetak','uses'=>'KhazanahController@cetakLaporanRingkasanHarian'])->middleware('auth','khazanah'); +Route::get('laporan/ringkasanterkumpul/',['as'=>'laporan.ringkasanterkumpul','uses'=>'KhazanahController@laporanRingkasanTerkumpul'])->middleware('auth','khazanah'); Route::get('laporan/ringkasanterkumpul/cetak',['as'=>'ringkasanterkumpul.laporancetak','uses'=>'KhazanahController@cetakLaporanRingkasanTerkumpul'])->middleware('auth','khazanah'); Route::get('/laporan/agingbulanan', [ 'as'=>'laporan.agingbulanan', 'uses'=>'KhazanahController@laporanAging_Bulanan'])->middleware('auth','khazanah'); Route::post('/laporan/agingbulanan/cetak', ['as'=>'agingbulan.cetaklaporan', 'uses'=>'KhazanahController@cetaklaporang_Aging'])->middleware('auth','khazanah');