diff --git a/.DS_Store b/.DS_Store index 6bde683..5680452 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/.DS_Store b/app/.DS_Store new file mode 100644 index 0000000..137b520 Binary files /dev/null and b/app/.DS_Store differ diff --git a/app/Console/Commands/initiateTunai.php b/app/Console/Commands/initiateTunai.php new file mode 100644 index 0000000..dfb051b --- /dev/null +++ b/app/Console/Commands/initiateTunai.php @@ -0,0 +1,48 @@ +json(); + if($updateOnline == 'successful'){ + return 0; + }else{ + return 'failed'; + } + } +} diff --git a/app/Events/.DS_Store b/app/Events/.DS_Store new file mode 100644 index 0000000..e3f07ce Binary files /dev/null and b/app/Events/.DS_Store differ diff --git a/app/Events/Dashboard/KomoditiNotify.php b/app/Events/Dashboard/KomoditiNotify.php new file mode 100644 index 0000000..29be14d --- /dev/null +++ b/app/Events/Dashboard/KomoditiNotify.php @@ -0,0 +1,32 @@ +response = $response; + $this->cawangan = $cawangan; + } + + public function broadcastOn() + { + return ['komoditi-notify']; + } + + public function broadcastAs() + { + return 'trigger-komoditi'; + } +} \ No newline at end of file diff --git a/app/Events/Dashboard/PelangganNotify.php b/app/Events/Dashboard/PelangganNotify.php new file mode 100644 index 0000000..6790daf --- /dev/null +++ b/app/Events/Dashboard/PelangganNotify.php @@ -0,0 +1,32 @@ +response = $response; + $this->cawangan = $cawangan; + } + + public function broadcastOn() + { + return ['pelanggan-notify']; + } + + public function broadcastAs() + { + return 'trigger-pelanggan'; + } +} \ No newline at end of file diff --git a/app/Http/Controllers/AliranTunaiController.php b/app/Http/Controllers/AliranTunaiController.php index b78e0f9..6413a0c 100644 --- a/app/Http/Controllers/AliranTunaiController.php +++ b/app/Http/Controllers/AliranTunaiController.php @@ -483,7 +483,7 @@ class AliranTunaiController extends Controller if(strtoupper(Auth::user()->name) === 'LELONG'){ $penebusanbarcodescanned = floatval($lelongan); - $bakisemasa = floatval($bakiawal) + floatval($lelongan) - floatval($totalserahan); + $bakisemasa = floatval($bakiawal) + floatval($totalpendahuluan) + floatval($lelongan) - floatval($totalserahan); }else{ $bakisemasa = floatval($bakiawal) + floatval($totalpendahuluan) + floatval($penebusan) - (floatval($gadaian) + floatval($totalserahan)) - floatval($totaltuntutbaki); } diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index b54f825..1c20f12 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -118,7 +118,7 @@ class LoginController extends Controller return response()->json([ 'success' => false, 'message' => 'Invalid Email or Password', - ], 401); + ], 200); } } diff --git a/app/Http/Controllers/CustomersController.php b/app/Http/Controllers/CustomersController.php index 8424db8..e10d27a 100644 --- a/app/Http/Controllers/CustomersController.php +++ b/app/Http/Controllers/CustomersController.php @@ -13,6 +13,7 @@ use Illuminate\Support\Facades\Http; use Illuminate\Support\Facades\Auth; use Twilio\Rest\Client; use App\Komoditi; +use App\Events\Dashboard\PelangganNotify; use Carbon\Carbon; @@ -204,6 +205,7 @@ class CustomersController extends Controller ]); Session::put('customer_info',$customer_info); + event(new PelangganNotify('lulus',$auth_user['cawangan'])); return redirect()->route('customer_info')->with( ['customer_info' => $customer_info] ); } diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index c0babe9..5a10545 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -3388,6 +3388,42 @@ class KhazanahController extends Controller return view('print.laporan_wakil', compact('wakil','cawangan_detail','tarikh_cetak','api_url')); } + + public function laporanSAGHilang() + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $loopalasan = Http::get(config('api.url') . '/api/lookupalasan/')->json(); + + return view('khazanah.laporan.saghilang', compact('cawangan_info','api_url','loopalasan')); + } + + public function cetakLaporanSAGHilang(Request $request) + { + + $api_url = config('api.url'); + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + + if($request->datesaghilang == null){ + $date = $current->toDateString(); + }else{ + $split_date = explode('-', $request->datesaghilang); + $date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + + $polis = Http::get(config('api.url'). '/api/polis/laporan/',['kodcaw' => $auth_user['cawangan'], 'alasan' => $request->sltalasan, 'tarikh' => $date])->json(); + + $cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + return view('print.laporan_saghilang', compact('polis','cawangan_detail','date','tarikh_cetak','api_url')); + } diff --git a/app/Http/Controllers/OperasiController.php b/app/Http/Controllers/OperasiController.php index d535646..ce6ad94 100644 --- a/app/Http/Controllers/OperasiController.php +++ b/app/Http/Controllers/OperasiController.php @@ -7,6 +7,7 @@ namespace App\Http\Controllers; use App\Events\OperasiNotice; use App\Events\StatusLiked; use App\Events\NotifikasiKelulusan; +use App\Events\Dashboard\KomoditiNotify; use Illuminate\Support\Facades\Auth; use Illuminate\Http\Request; @@ -234,4 +235,10 @@ class OperasiController extends Controller return view('operasi.rekodtelahlulus',compact('cawangan_info','api_url','arraykelulusan')); } + + public function notifyKomoditi() + { + $auth_user = Auth::user(); + event(new KomoditiNotify('lulus',$auth_user['cawangan'])); + } } diff --git a/resources/views/customers/info.blade.php b/resources/views/customers/info.blade.php index 7543186..96e350d 100644 --- a/resources/views/customers/info.blade.php +++ b/resources/views/customers/info.blade.php @@ -826,7 +826,24 @@ if (tarikhtuntut == null) { - window.location.href = urlroute; + $.ajax({ + method: 'GET', + url : api_url + '/api/check/wtd', + data:{ + 'norujukan' : norujukan + }, + success:function(data){ + if(data == 'yes'){ + Swal.fire({ + icon: 'error', + title: 'Amaran', + text: 'Lelongan dalam process WTD' + }); + }else{ + window.location.href = urlroute; + } + } + }); }else{ Swal.fire({ icon: 'error', diff --git a/resources/views/gadaian/edit.blade.php b/resources/views/gadaian/edit.blade.php index e7874c1..8d57ab7 100644 --- a/resources/views/gadaian/edit.blade.php +++ b/resources/views/gadaian/edit.blade.php @@ -481,20 +481,21 @@ success:function(data){ $.each(data,function(index,jemas){ $("#marhun_edit").append(new Option(jemas['descpt'], jemas['marhun'])); + $('#nota_edit').val(res).trigger('change'); + + $('#sltkarat').val(karat); + $('#marhun_edit').val(jenismarhun); + $('#berat_edit').val(berat); + $('#nilaimarhun_edit').val(nm); + $('#harga_edit').val(harga); + $('#norujukedit').val(norujuk); + $('#recnoedit').val(recno[1]); + $('#editMarhunModal').modal(); }) } }); - $('#nota_edit').val(res).trigger('change'); - - $('#sltkarat').val(karat); - $('#marhun_edit').val(jenismarhun); - $('#berat_edit').val(berat); - $('#nilaimarhun_edit').val(nm); - $('#harga_edit').val(harga); - $('#norujukedit').val(norujuk); - $('#recnoedit').val(recno[1]); - $('#editMarhunModal').modal(); + } $("#sltkarat").change(function(e){ @@ -787,6 +788,7 @@ var pinjaman = Number($('#pinjaman').val()); var total_nilai_marhun = $('#total_nilai_marhun').val(); var nilai_marhun_total = Number(total_nilai_marhun.replace(/[^0-9.-]+/g,"")); + var pinjaman_asal = "{{ $gadaiannorujukan['pinjaman']}}"; var pembiayaan_max_teller = $('#pembiayaan_max_teller').val(); var pembiayaan_max_teller = Number(pembiayaan_max_teller.replace(/[^0-9.-]+/g,"")); @@ -808,7 +810,7 @@ 'kodlaluan': teller }, success:function(data){ - bakiakhir = data.baki; + bakiakhir = data.baki + pinjaman_asal; } }); diff --git a/resources/views/gadaian/index.blade.php b/resources/views/gadaian/index.blade.php index fda67c2..83d35bd 100644 --- a/resources/views/gadaian/index.blade.php +++ b/resources/views/gadaian/index.blade.php @@ -1073,20 +1073,21 @@ success:function(data){ $.each(data,function(index,jemas){ $("#marhun_edit").append(new Option(jemas['descpt'], jemas['marhun'])); + $('#nota_edit').val(res).trigger('change'); + + $('#sltkarat').val(karat); + $('#marhun_edit').val(jenismarhun); + $('#berat_edit').val(berat); + $('#nilaimarhun_edit').val(nm); + $('#harga_edit').val(harga); + $('#norujukedit').val(norujuk); + $('#recnoedit').val(recno[1]); + $('#editMarhunModal').modal(); }) } }); - $('#nota_edit').val(res).trigger('change'); - - $('#sltkarat').val(karat); - $('#marhun_edit').val(jenismarhun); - $('#berat_edit').val(berat); - $('#nilaimarhun_edit').val(nm); - $('#harga_edit').val(harga); - $('#norujukedit').val(norujuk); - $('#recnoedit').val(recno[1]); - $('#editMarhunModal').modal(); + } $('#terima_edit').on('click',function(){ diff --git a/resources/views/homepage/khazanah/home.blade.php b/resources/views/homepage/khazanah/home.blade.php index 81b7b69..d2252af 100644 --- a/resources/views/homepage/khazanah/home.blade.php +++ b/resources/views/homepage/khazanah/home.blade.php @@ -276,6 +276,7 @@ $.ajax({ method: 'put', + async:false, url: api + '/api/DenominasiUpdate/' + kodcaw, data: { "bd1" : bundle1, @@ -494,20 +495,20 @@ function simpanfunc() { + console.log('simpan'); + //Swal.fire({ + // title: 'Adakah anda pasti untuk mengemaskini denominasi?', + // text: "Sila pastikan denominasi anda betul!", + // icon: 'warning', + // showCancelButton: true, + // confirmButtonColor: '#3085d6', + // cancelButtonColor: '#d33', + // confirmButtonText: 'Simpan' + // }).then((result) => { - Swal.fire({ - title: 'Adakah anda pasti untuk mengemaskini denominasi?', - text: "Sila pastikan denominasi anda betul!", - icon: 'warning', - showCancelButton: true, - confirmButtonColor: '#3085d6', - cancelButtonColor: '#d33', - confirmButtonText: 'Simpan' - }).then((result) => { - - console.log(result); - return false; - }); + // console.log(result); + // return false; + // }); let amaundeno = $('#amaunkeseluruhan').val().replace(/[^0-9.-]+/g,""); diff --git a/resources/views/homepage/penilai/home.blade.php b/resources/views/homepage/penilai/home.blade.php index 2df87af..47557f2 100644 --- a/resources/views/homepage/penilai/home.blade.php +++ b/resources/views/homepage/penilai/home.blade.php @@ -345,8 +345,6 @@ // this.checked = true; $(this).prop('checked', true); } - - } }); diff --git a/resources/views/khazanah/laporan/index.blade.php b/resources/views/khazanah/laporan/index.blade.php index 6591ea5..b8234b8 100644 --- a/resources/views/khazanah/laporan/index.blade.php +++ b/resources/views/khazanah/laporan/index.blade.php @@ -25,7 +25,7 @@
-