fix aliran tunai
This commit is contained in:
@@ -98,350 +98,6 @@ class AliranTunaiController extends Controller
|
||||
$GT = $GT[0];
|
||||
}
|
||||
|
||||
// ---LEJER AM-----
|
||||
//data untuk lejer AM...pitih pendahuluan kepada cawangan 2021-02-12
|
||||
//dapatkan glcode daripada table product
|
||||
$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";
|
||||
|
||||
$tunaigadteb=Http::get(config('api.url').'/api/getTunaiGadTeb/'. $auth_user['cawangan'],['kodlaluan' => $auth_user['name']])->json();
|
||||
if(sizeof($tunaigadteb)==0)
|
||||
{
|
||||
$tunaigadteb=Http::post(config('api.url').'/api/daftarTunaiGadteb/'.$auth_user['cawangan'],[
|
||||
'kodcaw'=>$auth_user['cawangan'],
|
||||
'teller'=>$auth_user['name'],
|
||||
'prkod'=>$prCode,
|
||||
'gadai'=>0.00,
|
||||
'tebus'=>0.00,
|
||||
'upah'=>0.00,
|
||||
'lain'=>0.00,
|
||||
'bakilelong'=>0.00,
|
||||
'byrbakilelong'=>0.00
|
||||
])->json();
|
||||
}
|
||||
|
||||
|
||||
//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
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
$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
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
$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'];
|
||||
|
||||
$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)
|
||||
{ //start kalau xdak data
|
||||
$jumlah=0.0;
|
||||
|
||||
$getGLedjer=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangArrahn])->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_CodeHutangArrahn])->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_CodeHutangArrahn])->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_CodeHutangArrahn,
|
||||
'descpt' =>$keterangan_PenghutangArrahn,
|
||||
'debit'=>0.0,
|
||||
'kredit'=>0.0,
|
||||
'hariini'=>$HariIni,
|
||||
'kelmarin'=>$kelmarin,
|
||||
'jumlah'=>$jumlah,
|
||||
'bulanini'=>$jumlahBulan_ini,
|
||||
'tahunini'=>$Jumlah_TahunIni,
|
||||
'acttype'=> $actype_PenghutangArrahn
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
|
||||
$GL_penghutang_Akru=Http::get(config('api.url').'/api/getGlCode/'. $auth_user['cawangan'],['glcode'=> $GL_CodeHutangAkru])->json();
|
||||
|
||||
$keterangan_Penghutang_Akru=$GL_penghutang_Akru[0]['descpt']; //keterangan glcode
|
||||
$actype_PenghutangArrahn_Akru=$GL_penghutang_Akru[0]['acttype'];
|
||||
|
||||
$get_current_GLejer_Details_PA=Http::get(config('api.url').'/api/getGlejer/'. $auth_user['cawangan'],['glcode'=>$GL_CodeHutangAkru])->json();
|
||||
|
||||
if(sizeof($get_current_GLejer_Details_PA)==0)
|
||||
{ //start kalau xdak data
|
||||
$jumlah=0.0;
|
||||
|
||||
$getGLedjer=Http::get(config('api.url').'/api/getSemalam_Glejer/'.$auth_user['cawangan'],['glcode'=> $GL_CodeHutangAkru])->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_CodeHutangAkru])->json();
|
||||
|
||||
if( sizeof($get_GlejerBulan_Tahun)==0)
|
||||
{
|
||||
$jumlahBulan_ini=0.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$jumlahBulan_ini=$get_GlejerBulan_Tahun[0]['jumlah'];
|
||||
$jumlahBulan_ini=$jumlah-$jumlahBulan_ini;
|
||||
}
|
||||
$Jumlah_TahunIni=0.0;
|
||||
$get_Glejer_Tahun=Http::get(config('api.url').'/api/getLejerYear/'.$auth_user['cawangan'],['glcode'=>$GL_CodeHutangAkru])->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_CodeHutangAkru,
|
||||
'descpt' =>$keterangan_Penghutang_Akru,
|
||||
'debit'=>0.0,
|
||||
'kredit'=>0.0,
|
||||
'hariini'=>$HariIni,
|
||||
'kelmarin'=>$kelmarin,
|
||||
'jumlah'=>$jumlah,
|
||||
'bulanini'=>$jumlahBulan_ini,
|
||||
'tahunini'=>$Jumlah_TahunIni,
|
||||
'acttype'=> $actype_PenghutangArrahn_Akru
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//--- GL LEJER AM TAMAT-----//
|
||||
|
||||
|
||||
|
||||
$api_url = config('api.url');
|
||||
|
||||
$gadai_tebus = Http::get(config('api.url').'/api/gadaitebus/listharini/'.$auth_user['cawangan'],['tarikh' => $harini->toDateString()])->json();
|
||||
|
||||
Reference in New Issue
Block a user