Merge branch 'pipiv2' into 'master'
Pipiv2 See merge request online-sistem1/kaunter!109
This commit is contained in:
@@ -105,8 +105,10 @@ class AliranTunaiController extends Controller
|
||||
|
||||
$tuntutbaki = Http::get(config('api.url').'/api/TuntutBaki/'.$auth_user['cawangan'])->json();
|
||||
|
||||
|
||||
|
||||
$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' => $requestkodlaluan[0]['kodlaluan']])->json();
|
||||
|
||||
// dd($advansur);
|
||||
//******************* INITIALIZE LEJER AM START HERE****************************//
|
||||
|
||||
|
||||
@@ -1052,16 +1054,7 @@ class AliranTunaiController extends Controller
|
||||
//************************ END LEJER AM**********************************
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return view('aliran_tunai.index',compact('cawangan_info','alirantunai','api_url','GT','denominasi','gadai_tebus','tuntutbaki'));
|
||||
return view('aliran_tunai.index',compact('cawangan_info','alirantunai','api_url','GT','denominasi','gadai_tebus','tuntutbaki','advansur'));
|
||||
}
|
||||
|
||||
public function alirantunaiGadai(Request $request){
|
||||
@@ -1217,15 +1210,72 @@ class AliranTunaiController extends Controller
|
||||
|
||||
$requestkodlaluan = Http::get(config('api.url').'/api/get/pengguna/'.$auth_user['cawangan'],["namateller" => Auth::user()->name ])->json();
|
||||
|
||||
$requestupah = Http::get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => $requestkodlaluan[0]['kodlaluan']])->json();
|
||||
$requestalirantunai = Http::get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => Auth::user()->name])->json();
|
||||
$perbezaan = 0;
|
||||
|
||||
$upah = $requestupah['baki'];
|
||||
$alirantunaisemasa = $requestalirantunai['baki'];
|
||||
if(Session::has('upahsemasa'))
|
||||
{
|
||||
$upah = Session::get('upahsemasa');
|
||||
|
||||
$totalalirantunai = floatval($upah) + floatval($alirantunaisemasa);
|
||||
$requestupah = Http::get(config('api.url') . '/api/ansuranupah/' . $auth_user['cawangan'],['kodlaluan' => $requestkodlaluan[0]['kodlaluan']])->json();
|
||||
|
||||
return response($totalalirantunai);
|
||||
|
||||
if($upah !== $requestupah)
|
||||
{
|
||||
$perbezaan = $requestupah - $upah;
|
||||
|
||||
Session::put('upahsemasa', $requestupah);
|
||||
|
||||
$requestalirantunai = Http::get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => Auth::user()->name])->json();
|
||||
|
||||
$masuk = $requestalirantunai['masuk'];
|
||||
$keluar = $requestalirantunai['keluar'];
|
||||
$baki = $requestalirantunai['baki'];
|
||||
|
||||
$total = floatval($baki) + $perbezaan;
|
||||
|
||||
// masuk dalam tunai aliran
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => Auth::user()->name,
|
||||
'keluar' => $keluar,
|
||||
'masuk' => $masuk,
|
||||
'bakiakhir' => $total
|
||||
])->json();
|
||||
|
||||
$updateTunai = 1;
|
||||
}else{
|
||||
$updateTunai = 0;
|
||||
}
|
||||
|
||||
}else{
|
||||
$requestupah = Http::get(config('api.url') . '/api/ansuranupah/' . $auth_user['cawangan'],['kodlaluan' => $requestkodlaluan[0]['kodlaluan']])->json();
|
||||
|
||||
if($requestupah !== 0)
|
||||
{
|
||||
Session::put('upahsemasa', $requestupah);
|
||||
|
||||
$requestalirantunai = Http::get(config('api.url') . '/api/GetCurrentTunai/' . $auth_user['cawangan'],['kodlaluan' => Auth::user()->name])->json();
|
||||
$masuk = $requestalirantunai['masuk'];
|
||||
$keluar = $requestalirantunai['keluar'];
|
||||
|
||||
$baki = $requestalirantunai['baki'];
|
||||
|
||||
$total = floatval($baki) + floatval($requestupah);
|
||||
|
||||
// masuk dalam tunai aliran
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunaiGT/'.$auth_user['cawangan'], [
|
||||
'kodlaluan' => Auth::user()->name,
|
||||
'keluar' => $keluar,
|
||||
'masuk' => $masuk,
|
||||
'bakiakhir' => $total
|
||||
])->json();
|
||||
|
||||
$updateTunai = 1;
|
||||
}else{
|
||||
$updateTunai = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return response($updateTunai);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1553,11 +1553,11 @@ class KhazanahController extends Controller
|
||||
if(sizeof($peti_besi_terkini) == 0)
|
||||
{
|
||||
$peti_besi_terkini=Http::post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan'])->json();
|
||||
$baki_awal=$peti_besi_terkini["bakiawal"];
|
||||
$baki_awal=$peti_besi_terkini["bakiakhir"];
|
||||
}
|
||||
else
|
||||
{
|
||||
$baki_awal=$peti_besi_terkini[0]["bakiawal"];
|
||||
$baki_awal=$peti_besi_terkini[0]["bakiakhir"];
|
||||
}
|
||||
|
||||
$amount = $request->amt;
|
||||
@@ -1565,7 +1565,8 @@ class KhazanahController extends Controller
|
||||
if($amount>$baki_awal)
|
||||
{
|
||||
//WI ERROR MESSAGE SKIT
|
||||
dd($baki_awal);
|
||||
// dd($baki_awal);
|
||||
return redirect()>route('khazanah.serahan')->with('message', 'Jumlah yang dipinta melebihi baki dalam peti besi!.');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1618,7 +1619,8 @@ class KhazanahController extends Controller
|
||||
|
||||
$kurang=$kurangT;
|
||||
$keluarT = $keluar;
|
||||
$bakiAkhirT=$bakiAwal+$tambahT+$masukT-$keluarT-$kurang;
|
||||
// $bakiAkhirT= $bakiAwal + $tambahT + $masukT - $keluarT - $kurang;
|
||||
$bakiAkhirT = $baki + $tambah;
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunai/'.$auth_user['cawangan'], [
|
||||
'kodlaluan'=>$kodlaluan,
|
||||
@@ -1689,20 +1691,18 @@ class KhazanahController extends Controller
|
||||
if(sizeof($peti_besi_terkini) == 0)
|
||||
{
|
||||
$peti_besi_terkini=Http::post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan'])->json();
|
||||
$baki_awal=$peti_besi_terkini["bakiawal"];
|
||||
$baki_awal=$peti_besi_terkini["bakiakhir"];
|
||||
}
|
||||
else
|
||||
{
|
||||
$baki_awal=$peti_besi_terkini[0]["bakiawal"];
|
||||
$baki_awal=$peti_besi_terkini[0]["bakiakhir"];
|
||||
}
|
||||
|
||||
$amount = $request->amt;
|
||||
|
||||
if($amount>$baki_awal)
|
||||
echo "Maaf, Serahan Lebih Besar Dari Baki Akhir Cash Box";
|
||||
|
||||
else
|
||||
{
|
||||
if($amount>$baki_awal){
|
||||
return redirect()>route('khazanah.serahan')->with('message', 'Jumlah yang dipinta melebihi baki dalam peti besi!.');
|
||||
}else{
|
||||
$tarikh=$request->tarikh;
|
||||
$kodlaluan=$request->teller;
|
||||
|
||||
@@ -1734,9 +1734,8 @@ class KhazanahController extends Controller
|
||||
$tambahT=$getTunai2['tambah'];
|
||||
$kurangT=$getTunai2['kurang'];
|
||||
$masukT=$getTunai2['masuk'];
|
||||
|
||||
//dd($getTunai2);
|
||||
|
||||
$serahanakhir = $kurang;
|
||||
$tambah_T=0;$kurang_T=0;$baki_AwalT=0.0;
|
||||
|
||||
if($tambahT==0)
|
||||
@@ -1761,21 +1760,19 @@ class KhazanahController extends Controller
|
||||
else
|
||||
$baki_AwalT=$bakiAwalT;
|
||||
|
||||
|
||||
$bakiAkhirT=$baki_AwalT+$tambah_T+$masukT-$keluarT-$kurang_T;
|
||||
//$bakiAkhirT=$baki_AwalT+$tambah_T+$masukT-$keluarT-$kurang_T; //untuk kegunaan urgent
|
||||
$bakiAkhirT = $baki - $serahanakhir;
|
||||
|
||||
$updateTunai=Http::put( config('api.url').'/api/updateTunai/'.$auth_user['cawangan'], [
|
||||
'kodlaluan'=>$kodlaluan,
|
||||
'tambah'=>$tambah_T,
|
||||
'kurang'=>$kurang_T,
|
||||
'bakiakhir'=>$bakiAkhirT
|
||||
'kodlaluan'=>$kodlaluan,
|
||||
'tambah'=>$tambah_T,
|
||||
'kurang'=>$kurang_T,
|
||||
'bakiakhir'=>$bakiAkhirT
|
||||
]);
|
||||
|
||||
//dd($baki_AwalT,$tambah_T,$masukT,$keluarT,$kurang_T,$bakiAkhirT);
|
||||
|
||||
$latestVault=Http::get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json();
|
||||
|
||||
//dd($latestVault);
|
||||
$masukV=$latestVault[0]['masuk'];
|
||||
$keluarV=$latestVault[0]['keluar'];
|
||||
$pendahuluanV=$latestVault[0]['pendahuluan'];
|
||||
@@ -1783,8 +1780,6 @@ class KhazanahController extends Controller
|
||||
$bakiAwalV=$latestVault[0]['bakiawal'];
|
||||
$totpanjar = $latestVault[0]['totpanjar'];
|
||||
|
||||
|
||||
//dd($latestVault);
|
||||
|
||||
$masuk_V = 0;$pendahuluan_V = 0;$keluar_V = 0;$serahan_V = 0;
|
||||
|
||||
@@ -1827,9 +1822,8 @@ class KhazanahController extends Controller
|
||||
|
||||
$bakiAkhirV = $bakiAwalV - $keluar_V + $masuk_V + $pendahuluan_V - $serahan_V - $totpanjar;
|
||||
|
||||
//dd($bakiAkhirV,$bakiAwalV,$keluar_V,$masuk_V,$pendahuluan_V,$serahan_V);
|
||||
$BakiEOD=$bakiAkhirV;
|
||||
// $BakiEOD=$bakiAkhirV+$sumBaki;
|
||||
//$BakiEOD=$bakiAkhirV+$sumBaki;
|
||||
|
||||
$updateVault=Http::put( config('api.url').'/api/UpdateVault/'.$auth_user['cawangan'],[
|
||||
'masuk'=>$masuk_V,
|
||||
@@ -1990,7 +1984,6 @@ class KhazanahController extends Controller
|
||||
$cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json();
|
||||
$stokaudit = Http::get(config('api.url'). '/api/gadai/cawangan/'. $auth_user['cawangan'])->json();
|
||||
|
||||
dd($stokaudit);
|
||||
return view('khazanah.laporan.stokaudit',compact('cawangan_info','api_url'));
|
||||
}
|
||||
|
||||
|
||||
@@ -57,9 +57,8 @@ class PenebusanController extends Controller
|
||||
|
||||
$totalmasuk = $request->bayaran + $masuk;
|
||||
|
||||
$bakiakhir = $bakiawal-$keluar+$totalmasuk+$pendahuluan-$serahan;
|
||||
|
||||
|
||||
// $bakiakhir = $bakiawal-$keluar+$totalmasuk+$pendahuluan-$serahan;
|
||||
$bakiakhir = $baki + $request->bayaran;
|
||||
|
||||
// Add on 20210411
|
||||
$gadaidetail = Http::get(config('api.url') . '/api/gadai/norujukan/'. $request->kodcaw.'/'.$request->norujukan)->json();
|
||||
@@ -79,272 +78,262 @@ class PenebusanController extends Controller
|
||||
'bakiakhir' => $bakiakhir
|
||||
]);
|
||||
|
||||
//************** KIRAAN LEJER AM BERMULA ****************
|
||||
//************** KIRAAN LEJER AM BERMULA ****************
|
||||
|
||||
|
||||
$Bayaran_Pendahuluan='1000/019';
|
||||
$GL_CODE='1000/010';
|
||||
$KOD_PINJAMAN='1000/017';
|
||||
$KOD_UT='1000/211';
|
||||
$KOD_US='2000/007';
|
||||
$Untung_Semasa='5000/017';
|
||||
$Bayaran_Pendahuluan='1000/019';
|
||||
$GL_CODE='1000/010';
|
||||
$KOD_PINJAMAN='1000/017';
|
||||
$KOD_UT='1000/211';
|
||||
$KOD_US='2000/007';
|
||||
$Untung_Semasa='5000/017';
|
||||
|
||||
$jumlahBayaran_ansuran=Http::get(config('api.url').'/api/ansuranByrKaunter/'.$request->kodcaw.'/'.$request->norujukan)->json();
|
||||
$jumlah_telah_bayaransuran=$jumlahBayaran_ansuran[0]['cash_in'];
|
||||
$jumbayaran=$request->bayaran;
|
||||
$jumlahBayaran_ansuran=Http::get(config('api.url').'/api/ansuranByrKaunter/'.$request->kodcaw.'/'.$request->norujukan)->json();
|
||||
$jumlah_telah_bayaransuran=$jumlahBayaran_ansuran[0]['cash_in'];
|
||||
$jumbayaran=$request->bayaran;
|
||||
|
||||
$Transaksi_keuntungan=Http::get(config('api.url').'/api/transaksi_keuntungan/'.$request->norujukan)->json();
|
||||
$bayaran_keuntungan=$Transaksi_keuntungan[0]['bayaran_keuntungan'];
|
||||
$bayaran_pembiayaan=$Transaksi_keuntungan[0]['bayaran_pembiayaan'];
|
||||
$tarikh_bayaran=$Transaksi_keuntungan[0]['tarikh_bayaran'];
|
||||
$Transaksi_keuntungan=Http::get(config('api.url').'/api/transaksi_keuntungan/'.$request->norujukan)->json();
|
||||
$bayaran_keuntungan=$Transaksi_keuntungan[0]['bayaran_keuntungan'];
|
||||
$bayaran_pembiayaan=$Transaksi_keuntungan[0]['bayaran_pembiayaan'];
|
||||
$tarikh_bayaran=$Transaksi_keuntungan[0]['tarikh_bayaran'];
|
||||
|
||||
//tahun gadaian
|
||||
$tahun_gadai=substr($tarikhgadai,0,4);
|
||||
$month_gadai=substr($tarikhgadai, 5,2);
|
||||
// bulan gadaian
|
||||
$year_bayar=substr($tarikh_bayaran, 0, 4);
|
||||
$month_bayar=substr($tarikh_bayaran, 5,2);
|
||||
//tahun gadaian
|
||||
$tahun_gadai=substr($tarikhgadai,0,4);
|
||||
$month_gadai=substr($tarikhgadai, 5,2);
|
||||
// bulan gadaian
|
||||
$year_bayar=substr($tarikh_bayaran, 0, 4);
|
||||
$month_bayar=substr($tarikh_bayaran, 5,2);
|
||||
|
||||
|
||||
$get_latest_bayarUntung=Http::get(config('api.url').'/api/latest_transaksi_untung/data/'.$request->norujukan)->json();
|
||||
$bayaran_latest_untung=$get_latest_bayarUntung[0]['bayaran_keuntungan'];
|
||||
$get_latest_bayarUntung=Http::get(config('api.url').'/api/latest_transaksi_untung/data/'.$request->norujukan)->json();
|
||||
$bayaran_latest_untung=$get_latest_bayarUntung[0]['bayaran_keuntungan'];
|
||||
|
||||
|
||||
//check sama ada jumlah bayaran melebihi keuntungan semasa..kalau lebih dia akan masuk dalam bayaran pendahuluan...
|
||||
if($jumbayaran<$bayaran_keuntungan)
|
||||
{
|
||||
|
||||
$LejerTunaiDitangan=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=> $GL_CODE])->json();
|
||||
|
||||
$hariini_Tunai=$LejerTunaiDitangan[0]['hariini'];
|
||||
$kelmarin_Tunai=$LejerTunaiDitangan[0]['kelmarin'];
|
||||
$jumlah_Tunai=$LejerTunaiDitangan[0]['jumlah'];
|
||||
$debit_Tunai=$LejerTunaiDitangan[0]['debit'];
|
||||
$recno_Tunai=$LejerTunaiDitangan[0]['recno'];
|
||||
$kredit_Tunai=$LejerTunaiDitangan[0]['kredit'];
|
||||
|
||||
|
||||
$debit_Tunai=$debit_Tunai+$jumbayaran+$bakiPinjaman;
|
||||
$kredit_Tunai=$kredit_Tunai+$bakiPinjaman;
|
||||
|
||||
$hariIni_Tunai=$debit_Tunai-$kredit_Tunai;
|
||||
$kelmarin_Tunai=$jumlah_Tunai-$hariIni_Tunai;
|
||||
|
||||
$update_TunaiDiTangan=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_Tunai,
|
||||
'debit'=>$debit_Tunai,
|
||||
'kredit'=>$kredit_Tunai,
|
||||
'hariini'=>$hariIni_Tunai,
|
||||
'kelmarin'=>$kelmarin_Tunai,
|
||||
|
||||
]);
|
||||
$get_lejerUT=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_UT])->json();
|
||||
|
||||
$hariini_UT=$get_lejerUT[0]['hariini'];
|
||||
$kelmarin_UT=$get_lejerUT[0]['kelmarin'];
|
||||
$jumlah_UT=$get_lejerUT[0]['jumlah'];
|
||||
$debit_UT= $get_lejerUT[0]['debit'];
|
||||
$recno_UT= $get_lejerUT[0]['recno'];
|
||||
$kredit_UT= $get_lejerUT[0]['kredit'];
|
||||
|
||||
|
||||
$debit_UT=$debit_UT-$bayaran_latest_untung;
|
||||
$hariini_UT=$debit_UT-$kredit_UT;
|
||||
$kelmarin_UT=$jumlah_UT-$hariini_UT;
|
||||
|
||||
$updateGlejer_UT=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_UT,
|
||||
'debit'=>$debit_UT,
|
||||
'kredit'=>$kredit_UT,
|
||||
'hariini'=>$hariini_UT,
|
||||
'kelmarin' =>$kelmarin_UT,
|
||||
|
||||
]);
|
||||
|
||||
$get_lejerUS=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_US])->json();
|
||||
|
||||
$hariini_US=$get_lejerUS[0]['hariini'];
|
||||
$kelmarin_US=$get_lejerUS[0]['kelmarin'];
|
||||
$jumlah_US=$get_lejerUS[0]['jumlah'];
|
||||
$debit_US= $get_lejerUS[0]['debit'];
|
||||
$recno_US= $get_lejerUS[0]['recno'];
|
||||
$kredit_US= $get_lejerUS[0]['kredit'];
|
||||
|
||||
|
||||
// $kredit_US=$kredit_US-$bayaran_keuntungan;
|
||||
$kredit_US=$kredit_US-$bayaran_latest_untung;
|
||||
$hariini_US=$debit_US-$kredit_US;
|
||||
$kelmarin_US=$jumlah_US-$hariini_US;
|
||||
|
||||
$updateGlejer_US=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_US,
|
||||
'debit'=>$debit_US,
|
||||
'kredit'=>$kredit_US,
|
||||
'hariini'=>$hariini_US,
|
||||
'kelmarin' =>$kelmarin_US,
|
||||
|
||||
]);
|
||||
|
||||
$get_latest_bayarUntung=Http::get(config('api.url').'/api/latest_transaksi_untung/data/'.$request->norujukan)->json();
|
||||
$bayaran_latest_untung=$get_latest_bayarUntung[0]['bayaran_keuntungan'];
|
||||
|
||||
$get_lejer_Untung=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$Untung_Semasa])->json();
|
||||
|
||||
$hariini_untung=$get_lejer_Untung[0]['hariini'];
|
||||
$kelmarin_untung=$get_lejer_Untung[0]['kelmarin'];
|
||||
$jumlah_untung=$get_lejer_Untung[0]['jumlah'];
|
||||
$debit_untung=$get_lejer_Untung [0]['debit'];
|
||||
$recno_untung=$get_lejer_Untung [0]['recno'];
|
||||
$kredit_untung=$get_lejer_Untung [0]['kredit'];
|
||||
|
||||
|
||||
|
||||
|
||||
//check sama ada jumlah bayaran melebihi keuntungan semasa..kalau lebih dia akan masuk dalam bayaran pendahuluan...
|
||||
if($jumbayaran<$bayaran_keuntungan)
|
||||
{
|
||||
$kredit_untung=$kredit_untung+$bayaran_latest_untung;
|
||||
|
||||
$hariini_untung=$debit_untung-$kredit_untung;
|
||||
$kelmarin_untung=$jumlah_untung-$hariini_untung;
|
||||
|
||||
$LejerTunaiDitangan=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=> $GL_CODE])->json();
|
||||
|
||||
$hariini_Tunai=$LejerTunaiDitangan[0]['hariini'];
|
||||
$kelmarin_Tunai=$LejerTunaiDitangan[0]['kelmarin'];
|
||||
$jumlah_Tunai=$LejerTunaiDitangan[0]['jumlah'];
|
||||
$debit_Tunai=$LejerTunaiDitangan[0]['debit'];
|
||||
$recno_Tunai=$LejerTunaiDitangan[0]['recno'];
|
||||
$kredit_Tunai=$LejerTunaiDitangan[0]['kredit'];
|
||||
$updateGlejer_Untung=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_untung,
|
||||
'debit'=>$debit_untung,
|
||||
'kredit'=>$kredit_untung,
|
||||
'hariini'=>$hariini_untung,
|
||||
'kelmarin' =>$kelmarin_untung,
|
||||
|
||||
|
||||
$debit_Tunai=$debit_Tunai+$jumbayaran+$bakiPinjaman;
|
||||
$kredit_Tunai=$kredit_Tunai+$bakiPinjaman;
|
||||
]);
|
||||
|
||||
$hariIni_Tunai=$debit_Tunai-$kredit_Tunai;
|
||||
$kelmarin_Tunai=$jumlah_Tunai-$hariIni_Tunai;
|
||||
|
||||
$update_TunaiDiTangan=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_Tunai,
|
||||
'debit'=>$debit_Tunai,
|
||||
'kredit'=>$kredit_Tunai,
|
||||
'hariini'=>$hariIni_Tunai,
|
||||
'kelmarin'=>$kelmarin_Tunai,
|
||||
|
||||
]);
|
||||
$get_lejerUT=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_UT])->json();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$LejerTunaiDitangan=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=> $GL_CODE])->json();
|
||||
|
||||
$hariini_UT=$get_lejerUT[0]['hariini'];
|
||||
$kelmarin_UT=$get_lejerUT[0]['kelmarin'];
|
||||
$jumlah_UT=$get_lejerUT[0]['jumlah'];
|
||||
$debit_UT= $get_lejerUT[0]['debit'];
|
||||
$recno_UT= $get_lejerUT[0]['recno'];
|
||||
$kredit_UT= $get_lejerUT[0]['kredit'];
|
||||
$hariini_Tunai=$LejerTunaiDitangan[0]['hariini'];
|
||||
$kelmarin_Tunai=$LejerTunaiDitangan[0]['kelmarin'];
|
||||
$jumlah_Tunai=$LejerTunaiDitangan[0]['jumlah'];
|
||||
$debit_Tunai=$LejerTunaiDitangan[0]['debit'];
|
||||
$recno_Tunai=$LejerTunaiDitangan[0]['recno'];
|
||||
$kredit_Tunai=$LejerTunaiDitangan[0]['kredit'];
|
||||
|
||||
$debit_Tunai=$debit_Tunai+$jumbayaran+$bakiPinjaman;
|
||||
$kredit_Tunai=$kredit_Tunai+$bakiPinjaman;
|
||||
|
||||
$hariini_Tunai=$debit_Tunai-$kredit_Tunai;
|
||||
$kelmarin_Tunai=$jumlah_Tunai-$hariini_Tunai;
|
||||
|
||||
$update_TunaiDiTangan=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_Tunai,
|
||||
'debit'=>$debit_Tunai,
|
||||
'kredit'=>$kredit_Tunai,
|
||||
'hariini'=>$hariini_Tunai,
|
||||
'kelmarin'=>$kelmarin_Tunai,
|
||||
|
||||
]);
|
||||
|
||||
$get_lejerUT=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_UT])->json();
|
||||
|
||||
$hariini_UT=$get_lejerUT[0]['hariini'];
|
||||
$kelmarin_UT=$get_lejerUT[0]['kelmarin'];
|
||||
$jumlah_UT=$get_lejerUT[0]['jumlah'];
|
||||
$debit_UT= $get_lejerUT[0]['debit'];
|
||||
$recno_UT= $get_lejerUT[0]['recno'];
|
||||
$kredit_UT= $get_lejerUT[0]['kredit'];
|
||||
|
||||
$debit_UT=$debit_UT-$bayaran_latest_untung;
|
||||
$hariini_UT=$debit_UT-$kredit_UT;
|
||||
$kelmarin_UT=$jumlah_UT-$hariini_UT;
|
||||
|
||||
$updateGlejer_UT=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_UT,
|
||||
'debit'=>$debit_UT,
|
||||
'kredit'=>$kredit_UT,
|
||||
'hariini'=>$hariini_UT,
|
||||
'kelmarin' =>$kelmarin_UT,
|
||||
|
||||
]);
|
||||
|
||||
$get_lejerUS=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_US])->json();
|
||||
|
||||
$hariini_US=$get_lejerUS[0]['hariini'];
|
||||
$kelmarin_US=$get_lejerUS[0]['kelmarin'];
|
||||
$jumlah_US=$get_lejerUS[0]['jumlah'];
|
||||
$debit_US= $get_lejerUS[0]['debit'];
|
||||
$recno_US= $get_lejerUS[0]['recno'];
|
||||
$kredit_US= $get_lejerUS[0]['kredit'];
|
||||
|
||||
$kredit_US=$kredit_US- $bayaran_latest_untung;
|
||||
$hariini_US=$debit_US-$kredit_US;
|
||||
$kelmarin_US=$jumlah_US-$hariini_US;
|
||||
|
||||
$updateGlejer_US=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_US,
|
||||
'debit'=>$debit_US,
|
||||
'kredit'=>$kredit_US,
|
||||
'hariini'=>$hariini_US,
|
||||
'kelmarin' =>$kelmarin_US,
|
||||
|
||||
]);
|
||||
|
||||
|
||||
$debit_UT=$debit_UT-$bayaran_latest_untung;
|
||||
$hariini_UT=$debit_UT-$kredit_UT;
|
||||
$kelmarin_UT=$jumlah_UT-$hariini_UT;
|
||||
$get_lejerBP=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=> $Bayaran_Pendahuluan])->json();
|
||||
|
||||
$updateGlejer_UT=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_UT,
|
||||
'debit'=>$debit_UT,
|
||||
'kredit'=>$kredit_UT,
|
||||
'hariini'=>$hariini_UT,
|
||||
'kelmarin' =>$kelmarin_UT,
|
||||
|
||||
]);
|
||||
|
||||
$get_lejerUS=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_US])->json();
|
||||
|
||||
$hariini_US=$get_lejerUS[0]['hariini'];
|
||||
$kelmarin_US=$get_lejerUS[0]['kelmarin'];
|
||||
$jumlah_US=$get_lejerUS[0]['jumlah'];
|
||||
$debit_US= $get_lejerUS[0]['debit'];
|
||||
$recno_US= $get_lejerUS[0]['recno'];
|
||||
$kredit_US= $get_lejerUS[0]['kredit'];
|
||||
$hariini_BP=$get_lejerBP[0]['hariini'];
|
||||
$kelmarin_BP=$get_lejerBP[0]['kelmarin'];
|
||||
$jumlah_BP=$get_lejerBP[0]['jumlah'];
|
||||
$debit_BP= $get_lejerBP[0]['debit'];
|
||||
$recno_BP= $get_lejerBP[0]['recno'];
|
||||
$kredit_BP= $get_lejerBP[0]['kredit'];
|
||||
|
||||
|
||||
// $kredit_US=$kredit_US-$bayaran_keuntungan;
|
||||
$kredit_US=$kredit_US-$bayaran_latest_untung;
|
||||
$hariini_US=$debit_US-$kredit_US;
|
||||
$kelmarin_US=$jumlah_US-$hariini_US;
|
||||
$kredit_BP=$debit_BP+$bayaran_pembiayaan;
|
||||
$hariini_BP=$debit_BP-$kredit_BP;
|
||||
$kelmarin_BP=$jumlah_BP-$hariini_BP;
|
||||
|
||||
$updateGlejer_US=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_US,
|
||||
'debit'=>$debit_US,
|
||||
'kredit'=>$kredit_US,
|
||||
'hariini'=>$hariini_US,
|
||||
'kelmarin' =>$kelmarin_US,
|
||||
$updateGlejer_BP=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_BP,
|
||||
'debit'=>$debit_BP,
|
||||
'kredit'=>$kredit_BP,
|
||||
'hariini'=>$hariini_BP,
|
||||
'kelmarin' =>$kelmarin_BP,
|
||||
|
||||
]);
|
||||
]);
|
||||
|
||||
$get_latest_bayarUntung=Http::get(config('api.url').'/api/latest_transaksi_untung/data/'.$request->norujukan)->json();
|
||||
$bayaran_latest_untung=$get_latest_bayarUntung[0]['bayaran_keuntungan'];
|
||||
$get_latest_bayarUntung=Http::get(config('api.url').'/api/latest_transaksi_untung/data/'.$request->norujukan)->json();
|
||||
$bayaran_latest_untung=$get_latest_bayarUntung[0]['bayaran_keuntungan'];
|
||||
$get_lejer_Untung=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$Untung_Semasa])->json();
|
||||
|
||||
$get_lejer_Untung=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$Untung_Semasa])->json();
|
||||
$hariini_untung=$get_lejer_Untung[0]['hariini'];
|
||||
$kelmarin_untung=$get_lejer_Untung[0]['kelmarin'];
|
||||
$jumlah_untung=$get_lejer_Untung[0]['jumlah'];
|
||||
$debit_untung=$get_lejer_Untung [0]['debit'];
|
||||
$recno_untung=$get_lejer_Untung [0]['recno'];
|
||||
$kredit_untung=$get_lejer_Untung [0]['kredit'];
|
||||
|
||||
$hariini_untung=$get_lejer_Untung[0]['hariini'];
|
||||
$kelmarin_untung=$get_lejer_Untung[0]['kelmarin'];
|
||||
$jumlah_untung=$get_lejer_Untung[0]['jumlah'];
|
||||
$debit_untung=$get_lejer_Untung [0]['debit'];
|
||||
$recno_untung=$get_lejer_Untung [0]['recno'];
|
||||
$kredit_untung=$get_lejer_Untung [0]['kredit'];
|
||||
$kredit_untung=$kredit_untung+$bayaran_latest_untung;
|
||||
$hariini_untung=$debit_untung-$kredit_untung;
|
||||
$kelmarin_untung=$jumlah_untung-$hariini_untung;
|
||||
|
||||
$updateGlejer_Untung=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_untung,
|
||||
'debit'=>$debit_untung,
|
||||
'kredit'=>$kredit_untung,
|
||||
'hariini'=>$hariini_untung,
|
||||
'kelmarin' =>$kelmarin_untung,
|
||||
|
||||
$kredit_untung=$kredit_untung+$bayaran_latest_untung;
|
||||
|
||||
$hariini_untung=$debit_untung-$kredit_untung;
|
||||
$kelmarin_untung=$jumlah_untung-$hariini_untung;
|
||||
]);
|
||||
|
||||
$updateGlejer_Untung=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_untung,
|
||||
'debit'=>$debit_untung,
|
||||
'kredit'=>$kredit_untung,
|
||||
'hariini'=>$hariini_untung,
|
||||
'kelmarin' =>$kelmarin_untung,
|
||||
}
|
||||
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$LejerTunaiDitangan=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=> $GL_CODE])->json();
|
||||
|
||||
$hariini_Tunai=$LejerTunaiDitangan[0]['hariini'];
|
||||
$kelmarin_Tunai=$LejerTunaiDitangan[0]['kelmarin'];
|
||||
$jumlah_Tunai=$LejerTunaiDitangan[0]['jumlah'];
|
||||
$debit_Tunai=$LejerTunaiDitangan[0]['debit'];
|
||||
$recno_Tunai=$LejerTunaiDitangan[0]['recno'];
|
||||
$kredit_Tunai=$LejerTunaiDitangan[0]['kredit'];
|
||||
|
||||
$debit_Tunai=$debit_Tunai+$jumbayaran+$bakiPinjaman;
|
||||
$kredit_Tunai=$kredit_Tunai+$bakiPinjaman;
|
||||
|
||||
$hariini_Tunai=$debit_Tunai-$kredit_Tunai;
|
||||
$kelmarin_Tunai=$jumlah_Tunai-$hariini_Tunai;
|
||||
|
||||
$update_TunaiDiTangan=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_Tunai,
|
||||
'debit'=>$debit_Tunai,
|
||||
'kredit'=>$kredit_Tunai,
|
||||
'hariini'=>$hariini_Tunai,
|
||||
'kelmarin'=>$kelmarin_Tunai,
|
||||
|
||||
]);
|
||||
|
||||
$get_lejerUT=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_UT])->json();
|
||||
|
||||
$hariini_UT=$get_lejerUT[0]['hariini'];
|
||||
$kelmarin_UT=$get_lejerUT[0]['kelmarin'];
|
||||
$jumlah_UT=$get_lejerUT[0]['jumlah'];
|
||||
$debit_UT= $get_lejerUT[0]['debit'];
|
||||
$recno_UT= $get_lejerUT[0]['recno'];
|
||||
$kredit_UT= $get_lejerUT[0]['kredit'];
|
||||
|
||||
$debit_UT=$debit_UT-$bayaran_latest_untung;
|
||||
$hariini_UT=$debit_UT-$kredit_UT;
|
||||
$kelmarin_UT=$jumlah_UT-$hariini_UT;
|
||||
|
||||
$updateGlejer_UT=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_UT,
|
||||
'debit'=>$debit_UT,
|
||||
'kredit'=>$kredit_UT,
|
||||
'hariini'=>$hariini_UT,
|
||||
'kelmarin' =>$kelmarin_UT,
|
||||
|
||||
]);
|
||||
|
||||
$get_lejerUS=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$KOD_US])->json();
|
||||
|
||||
$hariini_US=$get_lejerUS[0]['hariini'];
|
||||
$kelmarin_US=$get_lejerUS[0]['kelmarin'];
|
||||
$jumlah_US=$get_lejerUS[0]['jumlah'];
|
||||
$debit_US= $get_lejerUS[0]['debit'];
|
||||
$recno_US= $get_lejerUS[0]['recno'];
|
||||
$kredit_US= $get_lejerUS[0]['kredit'];
|
||||
|
||||
$kredit_US=$kredit_US- $bayaran_latest_untung;
|
||||
$hariini_US=$debit_US-$kredit_US;
|
||||
$kelmarin_US=$jumlah_US-$hariini_US;
|
||||
|
||||
$updateGlejer_US=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_US,
|
||||
'debit'=>$debit_US,
|
||||
'kredit'=>$kredit_US,
|
||||
'hariini'=>$hariini_US,
|
||||
'kelmarin' =>$kelmarin_US,
|
||||
|
||||
]);
|
||||
|
||||
|
||||
$get_lejerBP=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=> $Bayaran_Pendahuluan])->json();
|
||||
|
||||
$hariini_BP=$get_lejerBP[0]['hariini'];
|
||||
$kelmarin_BP=$get_lejerBP[0]['kelmarin'];
|
||||
$jumlah_BP=$get_lejerBP[0]['jumlah'];
|
||||
$debit_BP= $get_lejerBP[0]['debit'];
|
||||
$recno_BP= $get_lejerBP[0]['recno'];
|
||||
$kredit_BP= $get_lejerBP[0]['kredit'];
|
||||
|
||||
|
||||
$kredit_BP=$debit_BP+$bayaran_pembiayaan;
|
||||
$hariini_BP=$debit_BP-$kredit_BP;
|
||||
$kelmarin_BP=$jumlah_BP-$hariini_BP;
|
||||
|
||||
$updateGlejer_BP=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_BP,
|
||||
'debit'=>$debit_BP,
|
||||
'kredit'=>$kredit_BP,
|
||||
'hariini'=>$hariini_BP,
|
||||
'kelmarin' =>$kelmarin_BP,
|
||||
|
||||
]);
|
||||
|
||||
$get_latest_bayarUntung=Http::get(config('api.url').'/api/latest_transaksi_untung/data/'.$request->norujukan)->json();
|
||||
$bayaran_latest_untung=$get_latest_bayarUntung[0]['bayaran_keuntungan'];
|
||||
$get_lejer_Untung=Http::get(config('api.url').'/api/getGlejer/'.$request->kodcaw,['glcode'=>$Untung_Semasa])->json();
|
||||
|
||||
$hariini_untung=$get_lejer_Untung[0]['hariini'];
|
||||
$kelmarin_untung=$get_lejer_Untung[0]['kelmarin'];
|
||||
$jumlah_untung=$get_lejer_Untung[0]['jumlah'];
|
||||
$debit_untung=$get_lejer_Untung [0]['debit'];
|
||||
$recno_untung=$get_lejer_Untung [0]['recno'];
|
||||
$kredit_untung=$get_lejer_Untung [0]['kredit'];
|
||||
|
||||
$kredit_untung=$kredit_untung+$bayaran_latest_untung;
|
||||
$hariini_untung=$debit_untung-$kredit_untung;
|
||||
$kelmarin_untung=$jumlah_untung-$hariini_untung;
|
||||
|
||||
$updateGlejer_Untung=Http::put(config('api.url').'/api/kemasKiniGlejer/'.$request->kodcaw,[
|
||||
'recno'=>$recno_untung,
|
||||
'debit'=>$debit_untung,
|
||||
'kredit'=>$kredit_untung,
|
||||
'hariini'=>$hariini_untung,
|
||||
'kelmarin' =>$kelmarin_untung,
|
||||
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//***************KIRAAN LEJER AM TAMAT*******************************
|
||||
//***************KIRAAN LEJER AM TAMAT*******************************
|
||||
|
||||
return response()->json($updateTunai,200);
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -439,7 +439,7 @@ function tambahdanserahanfunc(e)
|
||||
var txt = $('#amaunkiraan').val();
|
||||
var txt2 = $('#amaundiminta').val();
|
||||
|
||||
if(txt != txt2)
|
||||
if(Number(txt) != Number(txt2))
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
|
||||
@@ -124,12 +124,13 @@
|
||||
<div class="card-body">
|
||||
|
||||
|
||||
<button type="button" onclick="kemaskiniupah()" class="btn btn-primary float-right" disabled>Kemaskini</button>
|
||||
<button type="button" onclick="kemaskiniupah()" class="btn btn-primary float-right">Kemaskini</button>
|
||||
<nav>
|
||||
<div class="nav nav-tabs mb-4" id="nav-tab" role="tablist">
|
||||
<a class="nav-item nav-link active" id="nav-home-tab" data-toggle="tab" href="#nav-home" role="tab" aria-controls="nav-home" aria-selected="true">Tunai</a>
|
||||
<a class="nav-item nav-link" id="nav-profile-tab" data-toggle="tab" href="#nav-profile" role="tab" aria-controls="nav-profile" aria-selected="false">Gadai / Tebus</a>
|
||||
<a class="nav-item nav-link" id="nav-contact-tab" data-toggle="tab" href="#nav-contact" role="tab" aria-controls="nav-contact" aria-selected="false">Tuntut Baki</a>
|
||||
<a class="nav-item nav-link" id="nav-upah-tab" data-toggle="tab" href="#nav-upah" role="tab" aria-controls="nav-upah" aria-selected="false">Upah Lama</a>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="tab-content" id="nav-tabContent">
|
||||
@@ -214,6 +215,33 @@
|
||||
</table>
|
||||
|
||||
</div>
|
||||
<div class="tab-pane fade" id="nav-upah" role="tabpanel" aria-labelledby="nav-upah-tab">
|
||||
|
||||
<table class="table table-striped table-hover text-center" id="tableupahlama">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th>Bil</th>
|
||||
<th>Tarikh</th>
|
||||
<th>Norujukan</th>
|
||||
<th>Upah Dibayar (RM)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{-- {{ dd($advansur) }} --}}
|
||||
@if(is_object($advansur) || is_array($advansur))
|
||||
@foreach($advansur as $ansur)
|
||||
<tr>
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td> {{ $ansur['tarikh'] }} </td>
|
||||
<td> {{ $ansur['norujukan'] }} </td>
|
||||
<td> {{ number_format($ansur['upahdibayar'],2) }} </td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -235,6 +263,11 @@
|
||||
var tabletuntutbaki = $('#tabletuntutbaki').DataTable({
|
||||
// "scrollX": true
|
||||
});
|
||||
|
||||
var tableupahlama = $('#tableupahlama').DataTable({
|
||||
// "scrollX": true
|
||||
});
|
||||
|
||||
var tele = "{{ $auth_user['name'] }}";
|
||||
|
||||
$(document).ready( function () {
|
||||
@@ -289,9 +322,26 @@
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: "{{ route('kemaskini.upah') }}",
|
||||
data: { "namateller" : tele },
|
||||
// data: { "namateller" : tele },
|
||||
success: function(data){
|
||||
console.log(data);
|
||||
if(data == 1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Kemaskini!',
|
||||
text: 'Proses Kemaskini!'
|
||||
}).then(function() {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
}else{
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Peringatan',
|
||||
text: 'Telah Dikemaskini!'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
@section('content')
|
||||
@include('modal.historytebus')
|
||||
@include('modal.wakil')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-12 col-lg-12">
|
||||
@@ -756,8 +757,134 @@
|
||||
});
|
||||
}
|
||||
|
||||
function daftarwakil()
|
||||
{
|
||||
let nopelanggan = $('#nopelangganwakil').val();
|
||||
let nowakil = $('#nowakil').val();
|
||||
let nama = $('#namawakil').val();
|
||||
let hubungan = $('#slthubungan').val();
|
||||
let alamat = $('#alamatwakil').val();
|
||||
let telefon = $('#notelwakil').val();
|
||||
let nota = $('#notawakil').val();
|
||||
let nokp = $('#nokpwakil').val();
|
||||
let norujukan = $('#norujukanwakil').val();
|
||||
|
||||
async function ubahfunc(e){
|
||||
|
||||
$.ajax({
|
||||
method:'POST',
|
||||
url: "{{ route('wakil.create') }}",
|
||||
data:{
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"nopelanggan" : nopelanggan,
|
||||
"nowakil" : nowakil,
|
||||
"nama" : nama,
|
||||
"hubungan" : hubungan,
|
||||
"alamat" : alamat,
|
||||
"telefon" : telefon,
|
||||
"nota" : nota,
|
||||
"icno" : nokp
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
if(data == 1)
|
||||
{
|
||||
$('#WakilModal').hide();
|
||||
$('#WakilModal').modal('hide');
|
||||
nw = nowakil;
|
||||
Swal.fire({
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false,
|
||||
confirmButtonText: '<i class="fa fa-thumbs-up"></i> Baik Boss!',
|
||||
icon: 'success',
|
||||
title: 'Berjaya Mendaftar Wakil Pelanggan!'
|
||||
}).then(function(){
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
url: api_url + '/api/ubahwakil/' + kodcaw,
|
||||
data:{ 'nowakil' : nw,
|
||||
'norujukan' : norujukan},
|
||||
success:function(data){
|
||||
|
||||
if(data === 1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
text: 'Penukaran Wakil berjaya'
|
||||
}).then(async function(){
|
||||
return true;
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
Swal.fire({
|
||||
icon: 'info',
|
||||
title: 'Pemberitahuan!',
|
||||
text: 'Wakil telah didaftarkan dengan IC tersebut!'
|
||||
}).then(async function(){
|
||||
return true;
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
},error: function (request, status, error) {
|
||||
console.log(request.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function daftarwakilfunction(nokp,norujukan)
|
||||
{
|
||||
$('#nokpwakil').val(nokp);
|
||||
$('#norujukanwakil').val(norujukan);
|
||||
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
url: "{{ route('wakil.caricustomer') }}",
|
||||
data:{ "icno" : nokp },
|
||||
success:function(data){
|
||||
|
||||
$('#WakilModal').modal();
|
||||
$('#namawakil').val('');
|
||||
$('#alamatwakil').val(data['']);
|
||||
$('#notelwakil').val(data['']);
|
||||
|
||||
//get first wakil
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
url: "{{ route('wakil.first') }}",
|
||||
success:function(getfirstwakil)
|
||||
{
|
||||
let firstwakil = parseInt(getfirstwakil);
|
||||
|
||||
$('#nowakil').val(firstwakil+1);
|
||||
}
|
||||
});
|
||||
|
||||
if(data != 'no-data')
|
||||
{
|
||||
$('#namawakil').val(data['nama']);
|
||||
$('#alamatwakil').val(data['alamat1']);
|
||||
$('#notelwakil').val(data['telefon']);
|
||||
$('#nopelangganwakil').val(data['nopelanggan']);
|
||||
}
|
||||
|
||||
|
||||
},error: function (request, status, error) {
|
||||
console.log(request.responseText);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function ubahfunc(e){
|
||||
|
||||
let ubahid = $('input[name="belum"]:checked').val();
|
||||
let harini = new Date();harini.setHours(0, 0, 0, 0);
|
||||
@@ -775,17 +902,17 @@
|
||||
}
|
||||
}else if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||
|
||||
let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
|
||||
// let test = $('input[name="sudahtebus"]:checked').closest('tr').children('td:eq(2)').text();
|
||||
// let tarikhgadai1 = new Date(test);tarikhgadai1.setHours(0, 0, 0, 0);
|
||||
|
||||
if(+harini !== +tarikhgadai1){
|
||||
Swal.fire({
|
||||
icon: 'error',
|
||||
title: 'Amaran',
|
||||
text: 'Ubah Gadai Tidak Dibenarkan'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
// if(+harini !== +tarikhgadai1){
|
||||
// Swal.fire({
|
||||
// icon: 'error',
|
||||
// title: 'Amaran',
|
||||
// text: 'Ubah Gadai Tidak Dibenarkan'
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
}
|
||||
|
||||
if(ubahid == null && $("input[name='options']:checked").val() == 'belum_tebus'){
|
||||
@@ -799,34 +926,221 @@
|
||||
}
|
||||
|
||||
if($("input[name='options']:checked").val() == 'sudah_tebus'){
|
||||
const { value: amaun } = await Swal.fire({
|
||||
title: 'Kad Pengenalan Wakil',
|
||||
input: 'text',
|
||||
inputPlaceholder: 'Kad Pengenalan',
|
||||
confirmButtonText: 'Terima',
|
||||
showCancelButton:true,
|
||||
cancelButtonText:'Batal',
|
||||
allowOutsideClick: true,
|
||||
inputValidator: (value) => {
|
||||
if (!value) {
|
||||
return 'Isikan tempat kosong diatas!'
|
||||
|
||||
const swalWithBootstrapButtons = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success ml-1',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
|
||||
swalWithBootstrapButtons.fire({
|
||||
title: 'Dapatkan Pengesahan Khazanah',
|
||||
text: "Ubah Maklumat Wakil",
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Hantar',
|
||||
cancelButtonText: 'Batal',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
Swal.fire({
|
||||
title: 'Tunggu Pengesahan Daripada Khazanah.',
|
||||
icon: 'info',
|
||||
width: 600,
|
||||
padding: '3em',
|
||||
background: '#fffff',
|
||||
showCancelButton: false,
|
||||
showConfirmButton: false,
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false
|
||||
})
|
||||
|
||||
let mohon = "Ubah Wakil";
|
||||
let norujukan = $('input[name="sudahtebus"]:checked').val();
|
||||
|
||||
// console.log(mohon + ' ' + norujukan);
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url: '{{ route("teller.createkelulusan") }}',
|
||||
data: {
|
||||
"_token": "{{ csrf_token() }}",
|
||||
"norujukan" : norujukan,
|
||||
"mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
||||
cluster: 'ap1',
|
||||
encrypted: true
|
||||
});
|
||||
|
||||
var channel = pusher.subscribe('notice-ubahhapus');
|
||||
channel.bind('my-ubahhapus', function(data) {
|
||||
|
||||
if(data.norujukan == norujukan)
|
||||
{
|
||||
if(data.kelulusan == 'lulus')
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Telah Disahkan'
|
||||
}).then(async function(){
|
||||
|
||||
const { value: amaun } = await Swal.fire({
|
||||
title: 'Kad Pengenalan Wakil',
|
||||
input: 'text',
|
||||
inputPlaceholder: 'Kad Pengenalan',
|
||||
confirmButtonText: 'Terima',
|
||||
showCancelButton:true,
|
||||
cancelButtonText:'Batal',
|
||||
allowOutsideClick: true,
|
||||
inputValidator: (value) => {
|
||||
if (!value) {
|
||||
return 'Isikan tempat kosong diatas!'
|
||||
}
|
||||
|
||||
if(value <= 0){
|
||||
return 'Masukkan No Kad Pengenalan yang betul!';
|
||||
}
|
||||
|
||||
if(isNaN(value))
|
||||
{
|
||||
return 'Kad Pengenalan hendaklah dalam bentuk nombor!'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(amaun)
|
||||
{
|
||||
$.ajax({
|
||||
method:'get',
|
||||
url: api_url + '/api/getwakil/' + kodcaw + '/' + amaun,
|
||||
success:function(data){
|
||||
|
||||
if(data.length > 0)
|
||||
{
|
||||
let namawakilsedia = data[0]['nama'];
|
||||
let nokpwakilsedia = data[0]['nokp'];
|
||||
let nowakilsedia = data[0]['nowakil'];
|
||||
|
||||
const PengesahanAkhirWakil = Swal.mixin({
|
||||
customClass: {
|
||||
confirmButton: 'btn btn-success ml-1',
|
||||
cancelButton: 'btn btn-danger'
|
||||
},
|
||||
buttonsStyling: false
|
||||
});
|
||||
|
||||
PengesahanAkhirWakil.fire({
|
||||
title: 'Pengesahan Akhir Wakil!',
|
||||
html: '<b class="text-danger">' + namawakilsedia + '</b><br><b class="text-danger">' + nokpwakilsedia + '</b>',
|
||||
icon: 'info',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Benar',
|
||||
cancelButtonText: 'Salah',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
|
||||
$.ajax({
|
||||
method:'put',
|
||||
async:false,
|
||||
url: api_url + '/api/ubahwakil/' + kodcaw,
|
||||
data:{ 'nowakil' : nowakilsedia,
|
||||
'norujukan' : norujukan},
|
||||
success:function(data){
|
||||
|
||||
if(data === 1)
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'success',
|
||||
title: 'Berjaya!',
|
||||
text: 'Penukaran Wakil berjaya'
|
||||
}).then(async function(){
|
||||
return true;
|
||||
location.reload();
|
||||
});
|
||||
}else{
|
||||
Swal.fire({
|
||||
icon: 'info',
|
||||
title: 'Pemberitahuan!',
|
||||
text: 'Wakil telah didaftarkan dengan IC tersebut!'
|
||||
}).then(async function(){
|
||||
return true;
|
||||
location.reload();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel){
|
||||
PengesahanAkhirWakil.fire(
|
||||
'Batal',
|
||||
'Tidak Berjaya Mengesahkan Wakil!',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
Swal.fire({
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
allowEnterKey: false,
|
||||
confirmButtonText: '<i class="fa fa-thumbs-up"></i> Daftar Wakil!',
|
||||
icon: 'info',
|
||||
title: 'Maklumat anda tiada dalam senarai wakil! Tekan button Daftar untuk mendaftar!'
|
||||
}).then(function(){
|
||||
daftarwakilfunction(amaun,norujukan);
|
||||
});
|
||||
}
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else if(data.kelulusan == 'batal')
|
||||
{
|
||||
Swal.fire({
|
||||
icon: 'warning',
|
||||
title: 'Telah Dibatalkan',
|
||||
text: `Komen : ${data.komen}`
|
||||
}).then(function(){
|
||||
// $("#terima_gadai").prop('disabled', false);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}else if (result.dismiss === Swal.DismissReason.cancel){
|
||||
swalWithBootstrapButtons.fire(
|
||||
'Batal',
|
||||
'Tidak Berjaya Mendapatkan Pengesahan Khazanah',
|
||||
'error'
|
||||
)
|
||||
}
|
||||
|
||||
if(value <= 0){
|
||||
return 'Masukkan No Kad Pengenalan yang betul!';
|
||||
}
|
||||
|
||||
if(isNaN(value))
|
||||
{
|
||||
return 'Kad Pengenalan hendaklah dalam bentuk nombor!'
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if(amaun)
|
||||
{
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<a href="{{ route('laporan.ansuran') }}" class="btn btn-dark btn-lg btn-block mb-3">Ansuran</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="{{ route('stokaudit.laporancetak') }}" class="btn btn-dark btn-lg btn-block mb-3">Stok Audit</a>
|
||||
<a href="{{ route('laporan.stokaudit') }}" class="btn btn-dark btn-lg btn-block mb-3">Stok Audit</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="{{ route('ringkasanharian.laporancetak') }}" class="btn btn-dark btn-lg btn-block mb-3">Ringkasan Harian</a>
|
||||
|
||||
@@ -19,14 +19,15 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="nopelanggan"/>
|
||||
<input type="hidden" id="nopelangganwakil"/>
|
||||
<input type="hidden" id="norujukanwakil"/>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-4">
|
||||
<label>No KP</label>
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<input type="text" class="form-control" id="nokp" name="nokp" readonly/>
|
||||
<input type="text" class="form-control" id="nokpwakil" name="nokpwakil" readonly/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -35,7 +36,7 @@
|
||||
<label>Nama</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control" id="nama" name="nama"/>
|
||||
<input type="text" class="form-control" id="namawakil" name="namawakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -45,7 +46,7 @@
|
||||
<label>Alamat</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control" id="alamat" name="alamat"/>
|
||||
<input type="text" class="form-control" id="alamatwakil" name="alamatwakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,7 +55,7 @@
|
||||
<label>No Tel</label>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<input type="text" class="form-control" id="notel" name="notel"/>
|
||||
<input type="text" class="form-control" id="notelwakil" name="notelwakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -63,7 +64,7 @@
|
||||
<label>Nota</label>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<input type="text" class="form-control" name="nota" id="nota"/>
|
||||
<input type="text" class="form-control" name="notawakil" id="notawakil"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1997,14 +1997,14 @@
|
||||
|
||||
function daftarwakil()
|
||||
{
|
||||
let nopelanggan = $('#nopelanggan').val();
|
||||
let nopelanggan = $('#nopelangganwakil').val();
|
||||
let nowakil = $('#nowakil').val();
|
||||
let nama = $('#nama').val();
|
||||
let nama = $('#namawakil').val();
|
||||
let hubungan = $('#slthubungan').val();
|
||||
let alamat = $('#alamat').val();
|
||||
let telefon = $('#notel').val();
|
||||
let nota = $('#nota').val();
|
||||
let nokp = $('#nokp').val();
|
||||
let alamat = $('#alamatwakil').val();
|
||||
let telefon = $('#notelwakil').val();
|
||||
let nota = $('#notawakil').val();
|
||||
let nokp = $('#nokpwakil').val();
|
||||
|
||||
|
||||
$.ajax({
|
||||
@@ -2052,7 +2052,7 @@
|
||||
|
||||
function daftarfunction(id)
|
||||
{
|
||||
$('#nokp').val(id);
|
||||
$('#nokpwakil').val(id);
|
||||
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
@@ -2061,9 +2061,9 @@
|
||||
success:function(data){
|
||||
|
||||
$('#WakilModal').modal();
|
||||
$('#nama').val('');
|
||||
$('#alamat').val(data['']);
|
||||
$('#notel').val(data['']);
|
||||
$('#namawakil').val('');
|
||||
$('#alamatwakil').val(data['']);
|
||||
$('#notelwakil').val(data['']);
|
||||
|
||||
//get first wakil
|
||||
$.ajax({
|
||||
@@ -2079,10 +2079,10 @@
|
||||
|
||||
if(data != 'no-data')
|
||||
{
|
||||
$('#nama').val(data['nama']);
|
||||
$('#alamat').val(data['alamat1']);
|
||||
$('#notel').val(data['telefon']);
|
||||
$('#nopelanggan').val(data['nopelanggan']);
|
||||
$('#namawakil').val(data['nama']);
|
||||
$('#alamatwakil').val(data['alamat1']);
|
||||
$('#notelwakil').val(data['telefon']);
|
||||
$('#nopelangganwakil').val(data['nopelanggan']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user