buat upah buat ubah wakil
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****************************//
|
||||
|
||||
|
||||
@@ -1062,7 +1064,7 @@ class AliranTunaiController extends Controller
|
||||
|
||||
|
||||
|
||||
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){
|
||||
@@ -1218,15 +1220,70 @@ 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();
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -82,32 +82,32 @@ class PenebusanController extends Controller
|
||||
//************** 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'];
|
||||
|
||||
|
||||
|
||||
@@ -116,230 +116,230 @@ class PenebusanController extends Controller
|
||||
|
||||
|
||||
|
||||
//check sama ada jumlah bayaran melebihi keuntungan semasa..kalau lebih dia akan masuk dalam bayaran pendahuluan...
|
||||
if($jumbayaran<$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();
|
||||
// $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'];
|
||||
// $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;
|
||||
// $debit_Tunai=$debit_Tunai+$jumbayaran+$bakiPinjaman;
|
||||
// $kredit_Tunai=$kredit_Tunai+$bakiPinjaman;
|
||||
|
||||
$hariIni_Tunai=$debit_Tunai-$kredit_Tunai;
|
||||
$kelmarin_Tunai=$jumlah_Tunai-$hariIni_Tunai;
|
||||
// $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,
|
||||
// $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();
|
||||
// ]);
|
||||
// $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'];
|
||||
// $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;
|
||||
// $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,
|
||||
// $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();
|
||||
// $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_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;
|
||||
// // $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,
|
||||
// $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_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;
|
||||
// $kredit_untung=$kredit_untung+$bayaran_latest_untung;
|
||||
|
||||
$hariini_untung=$debit_untung-$kredit_untung;
|
||||
$kelmarin_untung=$jumlah_untung-$hariini_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,
|
||||
// $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();
|
||||
// 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'];
|
||||
// $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;
|
||||
// $debit_Tunai=$debit_Tunai+$jumbayaran+$bakiPinjaman;
|
||||
// $kredit_Tunai=$kredit_Tunai+$bakiPinjaman;
|
||||
|
||||
$hariini_Tunai=$debit_Tunai-$kredit_Tunai;
|
||||
$kelmarin_Tunai=$jumlah_Tunai-$hariini_Tunai;
|
||||
// $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,
|
||||
// $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();
|
||||
// $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'];
|
||||
// $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;
|
||||
// $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,
|
||||
// $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();
|
||||
// $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_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;
|
||||
// $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,
|
||||
// $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();
|
||||
// $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'];
|
||||
// $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;
|
||||
// $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,
|
||||
// $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();
|
||||
// $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'];
|
||||
// $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;
|
||||
// $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,
|
||||
// $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*******************************
|
||||
|
||||
|
||||
@@ -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,6 +757,49 @@
|
||||
});
|
||||
}
|
||||
|
||||
function daftarwakilfunction(nokp)
|
||||
{
|
||||
$('#nokp').val(nokp);
|
||||
|
||||
$.ajax({
|
||||
method:'GET',
|
||||
url: "{{ route('wakil.caricustomer') }}",
|
||||
data:{ "icno" : nokp },
|
||||
success:function(data){
|
||||
|
||||
$('#WakilModal').modal();
|
||||
$('#nama').val('');
|
||||
$('#alamat').val(data['']);
|
||||
$('#notel').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')
|
||||
{
|
||||
$('#nama').val(data['nama']);
|
||||
$('#alamat').val(data['alamat1']);
|
||||
$('#notel').val(data['telefon']);
|
||||
$('#nopelanggan').val(data['nopelanggan']);
|
||||
}
|
||||
|
||||
|
||||
},error: function (request, status, error) {
|
||||
console.log(request.responseText);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function ubahfunc(e){
|
||||
|
||||
@@ -835,7 +879,7 @@
|
||||
let mohon = "Ubah Wakil";
|
||||
let norujukan = $('input[name="sudahtebus"]:checked').val();
|
||||
|
||||
console.log(mohon + ' ' + norujukan);
|
||||
// console.log(mohon + ' ' + norujukan);
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
@@ -853,6 +897,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
||||
cluster: 'ap1',
|
||||
encrypted: true
|
||||
@@ -861,7 +906,7 @@
|
||||
var channel = pusher.subscribe('notice-ubahhapus');
|
||||
channel.bind('my-ubahhapus', function(data) {
|
||||
|
||||
if(data.norujukan == ubahid)
|
||||
if(data.norujukan == norujukan)
|
||||
{
|
||||
if(data.kelulusan == 'lulus')
|
||||
{
|
||||
@@ -897,23 +942,92 @@
|
||||
if(amaun)
|
||||
{
|
||||
$.ajax({
|
||||
method:'post',
|
||||
method:'get',
|
||||
url: api_url + '/api/getwakil/' + kodcaw + '/' + amaun,
|
||||
data: {
|
||||
// "_token": "{{ csrf_token() }}",
|
||||
// "norujukan" : ubahid,
|
||||
// "mohon" : mohon
|
||||
},
|
||||
success:function(data){
|
||||
|
||||
if(data.length > 0)
|
||||
{
|
||||
let namawakilsedia = data[0]['nama'];
|
||||
let nokpwakilsedia = data[0]['nokp'];
|
||||
let nowakilsedia = data[0]['nowakil'];
|
||||
|
||||
console.log(data[0]['nama']);
|
||||
console.log(data[0]['nokp']);
|
||||
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){
|
||||
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
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);
|
||||
});
|
||||
}
|
||||
},error: function(xhr, status, error) {
|
||||
var err = eval("(" + xhr.responseText + ")");
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user