diff --git a/app/Events/PendahuluanSerahan.php b/app/Events/PendahuluanSerahan.php index b6ca1ff..71ba288 100644 --- a/app/Events/PendahuluanSerahan.php +++ b/app/Events/PendahuluanSerahan.php @@ -14,10 +14,12 @@ class PendahuluanSerahan implements ShouldBroadcast public $pengesahan; public $cawangan; public $kodlaluan; + public $jenis; - public function __construct($pengesahan,$cawangan,$kodlaluan) + public function __construct($pengesahan,$jenis,$cawangan,$kodlaluan) { $this->pengesahan = $pengesahan; + $this->jenis = $jenis; $this->cawangan = $cawangan; $this->kodlaluan = $kodlaluan; } diff --git a/app/Events/Teller/NotifyDeposit.php b/app/Events/Teller/NotifyDeposit.php new file mode 100644 index 0000000..a10bc46 --- /dev/null +++ b/app/Events/Teller/NotifyDeposit.php @@ -0,0 +1,34 @@ +jenis = $jenis; + $this->cawangan = $cawangan; + $this->kodlaluan = $kodlaluan; + } + + public function broadcastOn() + { + return ['notify-deposit']; + } + + public function broadcastAs() + { + return 'deposit-event'; + } +} \ No newline at end of file diff --git a/app/Http/Controllers/AliranTunaiController.php b/app/Http/Controllers/AliranTunaiController.php index b31b784..32acd64 100644 --- a/app/Http/Controllers/AliranTunaiController.php +++ b/app/Http/Controllers/AliranTunaiController.php @@ -624,5 +624,77 @@ class AliranTunaiController extends Controller return view('aliran_tunai.laporan.laporanalirantunai',compact('tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail','addtunai','alirantunai','teller')); } + public function LaporanTunaiTeller(Request $request){ + + + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $current = Carbon::now(); + $current = new Carbon(); + + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + $tarikh_cetak = $current->toDateString(); + + $array_requestteller = []; + //wang Syilling Initialize + $rekodsen1 = 0; $rekodsen5 = 0; $rekodsen10 = 0; + $rekodsen20 = 0; $rekodsen50 = 0; + + //Wang Ringgit Initialize + $rekodring1 = 0; $rekodring5 = 0; $rekodring10 = 0; + $rekodring20 = 0; $rekodring50 = 0; $rekodring100 = 0; + + $requestteller = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/requestTeller/getrekod/'.$auth_user['cawangan'],["teller" => Auth::user()->name,"recno" => $request->recno ])->json(); + if($requestteller[0]['modal'] != 0){ + $jenisserah = 'pendahuluan'; + }else{ + $jenisserah = 'serahan'; + } + + foreach($requestteller as $index => $reqtel) + { + $rekodsen1 += $reqtel['txtsen1']; + $rekodsen5 += $reqtel['txtsen5']; + $rekodsen10 += $reqtel['txtsen10']; + $rekodsen20 += $reqtel['txtsen20']; + $rekodsen50 += $reqtel['txtsen50']; + + $rekodring1 += $reqtel['txtring1']; + $rekodring5 += $reqtel['txtring5']; + $rekodring10 += $reqtel['txtring10']; + $rekodring20 += $reqtel['txtring20']; + $rekodring50 += $reqtel['txtring50']; + $rekodring100 += $reqtel['txtring100']; + } + + array_push($array_requestteller,[ "rekodsen1" => $rekodsen1,"rekodsen5" => $rekodsen5,"rekodsen10" => $rekodsen10,"rekodsen20" => $rekodsen20,"rekodsen50" => $rekodsen50 + ,"rekodring1" => $rekodring1,"rekodring5" => $rekodring5,"rekodring10" => $rekodring10,"rekodring20" => $rekodring20,"rekodring50" => $rekodring50,"rekodring100" => $rekodring100]); + + return view('aliran_tunai.laporan.laporanrekodteller',compact('tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail','array_requestteller','jenisserah')); + } + + public function LaporanAccStatement(Request $request){ + + $auth_user = Auth::user(); + $current = Carbon::now(); + $api_url = config('api.url'); + + $tarikh_cetak = $current->toDateString(); + + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + $tarikh = date("Y-m-d", $request->tarikh); + + $acc_statement = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/record/accountstatement/' . $auth_user['cawangan'] ,['teller' => $auth_user['name'],'tarikh' => $tarikh])->json(); + + return view('aliran_tunai.laporan.account_statement',compact('tarikh_cetak','tarikh','cawangan_info','cawangan','api_url','cawangan_detail','acc_statement')); + } + } diff --git a/app/Http/Controllers/EventTriggerController.php b/app/Http/Controllers/EventTriggerController.php new file mode 100644 index 0000000..37803d3 --- /dev/null +++ b/app/Http/Controllers/EventTriggerController.php @@ -0,0 +1,20 @@ +middleware('auth'); + } + + public function TellerCash(){ + event(new NotifyDeposit("pendahuluan",Auth::user()->cawangan,Auth::user()->name)); + } + + +} diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 16838c9..48eb3f6 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -28,6 +28,7 @@ use Carbon\Carbon; use PDF; use DateTime; use App\Helper; +use Log; class KhazanahController extends Controller { @@ -723,32 +724,6 @@ class KhazanahController extends Controller $bakiperubatan = 0; - switch ($request->jenismodal) { - case "selenggara": - $kategori = "Baiki dan Selenggara"; - $tag = 2; - break; - case "keraian": - $kategori = "Keraian & Promosi"; - $tag = 3; - break; - case "belanjaam": - $kategori = "Belanja AM"; - $tag = 1; - break; - case "perubatan": - $kategori = "Belanja AM - Perubatan"; - $tag = 1; - break; - case "dapur": - $kategori = "Belanja AM - Barangan Dapur"; - $tag = 1; - break; - case "pos": - $kategori = "Belanja AM - Postage"; - $tag = 1; - break; - } if($request->jenismodal === 'perubatan') @@ -761,146 +736,29 @@ class KhazanahController extends Controller } } + $request->merge(['kodlaluan' => $auth_user['name']]); + $data_request = $request->except('_token'); - - $denominasilist = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url') .'/api/DenominasiController/'. $auth_user['cawangan'])->json(); - - //bundle initialize - $rekodb1 = $denominasilist[0]['bd1']; $rekodb5 = $denominasilist[0]['bd5']; $rekodb10 = $denominasilist[0]['bd10']; $rekodb20 = $denominasilist[0]['bd20']; - $rekodb50 = $denominasilist[0]['bd50']; $rekodb100 = $denominasilist[0]['bd100']; - - //wang Syilling Initialize - $rekodsen1 = $denominasilist[0]['txtsen1']; $rekodsen5 = $denominasilist[0]['txtsen5']; $rekodsen10 = $denominasilist[0]['txtsen10']; - $rekodsen20 = $denominasilist[0]['txtsen20']; $rekodsen50 = $denominasilist[0]['txtsen50']; - - //Wang Ringgit Initialize - $rekodring1 = $denominasilist[0]['txtring1']; $rekodring5 = $denominasilist[0]['txtring5']; $rekodring10 = $denominasilist[0]['txtring10']; - $rekodring20 = $denominasilist[0]['txtring20']; $rekodring50 = $denominasilist[0]['txtring50']; $rekodring100 = $denominasilist[0]['txtring100']; - - //Tolok Rekod - $rekodsen1 -= intval($request->ambilansen1); - $rekodsen5 -= intval($request->ambilansen5); - $rekodsen10 -= intval($request->ambilansen10); - $rekodsen20 -= intval($request->ambilansen20); - $rekodsen50 -= intval($request->ambilansen50); - - $rekodring1 -= intval($request->ambilanring1); - $rekodring5 -= intval($request->ambilanring5); - $rekodring10 -= intval($request->ambilanring10); - $rekodring20 -= intval($request->ambilanring20); - $rekodring50 -= intval($request->ambilanring50); - $rekodring100 -= intval($request->ambilanring100); - - $denominasicreate = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/DenominasiUpdate/'.$auth_user['cawangan'],[ - 'bd1' => $rekodb1, - 'bd5'=> $rekodb5, - 'bd10'=> $rekodb10, - 'bd20'=> $rekodb20, - 'bd50'=> $rekodb50, - 'bd100'=> $rekodb100, - 'txtring1'=> $rekodring1, - 'txtring5'=> $rekodring5, - 'txtsen1'=> $rekodsen1, - 'txtsen5'=> $rekodsen5, - 'txtsen10'=> $rekodsen10, - 'txtsen20'=> $rekodsen20, - 'txtsen50'=> $rekodsen50, - 'txtring10'=> $rekodring10, - 'txtring20'=> $rekodring20, - 'txtring50'=> $rekodring50, - 'txtring100'=> $rekodring100, - 'txtring1000'=> "0", - 'jumlahbundle'=> "0", - 'txtjumlah'=> "0", - 'jumlahkeping' => "0" - ]); - - $myDateTime = DateTime::createFromFormat('Y-m-d', $request->tarikhbil); - $tarikhbil = $myDateTime->format('dmY'); - - $panjar = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/CreatePanjar/'. $auth_user['cawangan'],[ - - 'deskripsi' => $request->deskripsi, - 'bayaran' => $request->bayaran, - 'tag' => $tag, - 'kategori' => $kategori, - 'id' => $auth_user['name'], - 'bakiperubatan' => $bakiperubatan, - 'nobaucer' => $request->baucer, - 'nobil' => $tarikhbil, - 'tuntutoleh' => $request->tuntutan - - ])->json(); - - $updateVault = Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/UpdateVault/Panjar/'.$auth_user['cawangan'],[ - 'totpanjar'=>$request->bayaran - ]); - - $panjareach = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url') .'/api/SenaraiPanjar/listeach/'. $auth_user['cawangan'],['nobaucer' => $request->baucer])->json(); - - $recnopanjar = $panjareach['recno']; - - $rekodsen1 -= intval($request->ambilansen1); - $rekodsen5 -= intval($request->ambilansen5); - $rekodsen10 -= intval($request->ambilansen10); - $rekodsen20 -= intval($request->ambilansen20); - $rekodsen50 -= intval($request->ambilansen50); - - $rekodring1 -= intval($request->ambilanring1); - $rekodring5 -= intval($request->ambilanring5); - $rekodring10 -= intval($request->ambilanring10); - $rekodring20 -= intval($request->ambilanring20); - $rekodring50 -= intval($request->ambilanring50); - $rekodring100 -= intval($request->ambilanring100); - - $denopanjar = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/requestdenopanjar/'.$auth_user['cawangan'],[ - 'kodlaluan' => $auth_user['name'], - 'serahan' => floatval($request->bayaran), - 'bd1' => 0, - 'bd5' => 0, - 'bd10' => 0, - 'bd20' => 0, - 'bd50' => 0, - 'bd100' => 0, - 'txtring1' => intval($request->ambilanring1), - 'txtring5' => intval($request->ambilanring5), - 'txtring10' => intval($request->ambilanring10), - 'txtring20' => intval($request->ambilanring20), - 'txtring50' => intval($request->ambilanring50), - 'txtring100' => intval($request->ambilanring100), - 'txtring1000' => 0, - 'txtsen1' => intval($request->ambilansen1), - 'txtsen5' => intval($request->ambilansen5), - 'txtsen10' => intval($request->ambilansen10), - 'txtsen20' => intval($request->ambilansen20), - 'txtsen50' => intval($request->ambilansen50), - 'jenis' => $request->jenismodal, - 'recno' => intval($recnopanjar) - ]); - - $upVault = $updateVault->getStatusCode(); - $upDeno = $denominasicreate->getStatusCode(); - $updenopanjar = $denopanjar->getStatusCode(); - - if($upVault == 200 && empty($panjar) == false && $upDeno == 200 && $updenopanjar == 200) + $updatepanjar = Http::withOptions(['verify' => config('app.api_verify')])->post( config('api.url') .'/api/panjar/createpanjar/'. $auth_user['cawangan'],$data_request)->json(); + + if($updatepanjar['result'] == 'success') { if($request->jenismodal === 'perubatan') { - $listUser=User::where('name','=',$request->tuntutan)->get(); - - $totalsebenar = floatval($listUser[0]->perubatan) - floatval($request->bayaran); - - $overrideuser = User::where('cawangan','=',$auth_user['cawangan']) + $listUser = User::where('name','=',$request->tuntutan)->first(); + $listUser = optional($listUser)->toArray(); + $totalsebenar = floatval($listUser['perubatan_asal']) - floatval($updatepanjar['totalperubatan']); + User::where('cawangan','=',$auth_user['cawangan']) ->where('name','=',$request->tuntutan) ->update(array( 'perubatan' => $totalsebenar )); } - return redirect('/panjar')->with('messageinformation','Panjar Berjaya Disimpan.'); + return redirect('/panjar')->with('messageinformation',['message' => 'Panjar Berjaya Disimpan.','status' => 'success']); }else{ - return redirect('/panjar')->with('messageinformation','Panjar Mengalami Masalah Untuk Disimpan.'); + return redirect('/panjar')->with('messageinformation',['message' => 'Panjar Mengalami Masalah Untuk Disimpan.','status' => 'error']); } return response($updateVault); @@ -912,87 +770,20 @@ class KhazanahController extends Controller $api_url = config('api.url'); $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - $denopanjar = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url') .'/api/getdenopanjar/'. $auth_user['cawangan'],['recno' => $request->recno])->json(); + $request->merge(['kodlaluan' => $auth_user['name']]); + $data_request = $request->except('_token'); - $senaraipanjar = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url') .'/api/SenaraiPanjar/listeach/'. $auth_user['cawangan'],['nobaucer' => $request->nobaucer])->json(); + $updatepanjar = Http::withOptions(['verify' => config('app.api_verify')])->post( config('api.url') .'/api/panjar/deletepanjar/'. $auth_user['cawangan'],$data_request)->json(); - if(sizeof($denopanjar) > 0) - $denopanjar = $denopanjar[0]; - - $denominasilist = Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url') .'/api/DenominasiController/'. $auth_user['cawangan'])->json(); - - //bundle initialize - $rekodb1 = $denominasilist[0]['bd1']; $rekodb5 = $denominasilist[0]['bd5']; $rekodb10 = $denominasilist[0]['bd10']; $rekodb20 = $denominasilist[0]['bd20']; - $rekodb50 = $denominasilist[0]['bd50']; $rekodb100 = $denominasilist[0]['bd100']; - - //wang Syilling Initialize - $rekodsen1 = $denominasilist[0]['txtsen1']; $rekodsen5 = $denominasilist[0]['txtsen5']; $rekodsen10 = $denominasilist[0]['txtsen10']; - $rekodsen20 = $denominasilist[0]['txtsen20']; $rekodsen50 = $denominasilist[0]['txtsen50']; - - //Wang Ringgit Initialize - $rekodring1 = $denominasilist[0]['txtring1']; $rekodring5 = $denominasilist[0]['txtring5']; $rekodring10 = $denominasilist[0]['txtring10']; - $rekodring20 = $denominasilist[0]['txtring20']; $rekodring50 = $denominasilist[0]['txtring50']; $rekodring100 = $denominasilist[0]['txtring100']; - - //Tolok Rekod - $rekodsen1 += intval($denopanjar['txtsen1']); - $rekodsen5 += intval($denopanjar['txtsen5']); - $rekodsen10 += intval($denopanjar['txtsen10']); - $rekodsen20 += intval($denopanjar['txtsen20']); - $rekodsen50 += intval($denopanjar['txtsen50']); - - $rekodring1 += intval($denopanjar['txtring1']); - $rekodring5 += intval($denopanjar['txtring5']); - $rekodring10 += intval($denopanjar['txtring10']); - $rekodring20 += intval($denopanjar['txtring20']); - $rekodring50 += intval($denopanjar['txtring50']); - $rekodring100 += intval($denopanjar['txtring100']); - - $denominasicreate = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/DenominasiUpdate/'.$auth_user['cawangan'],[ - 'bd1' => $rekodb1, - 'bd5'=> $rekodb5, - 'bd10'=> $rekodb10, - 'bd20'=> $rekodb20, - 'bd50'=> $rekodb50, - 'bd100'=> $rekodb100, - 'txtring1'=> $rekodring1, - 'txtring5'=> $rekodring5, - 'txtsen1'=> $rekodsen1, - 'txtsen5'=> $rekodsen5, - 'txtsen10'=> $rekodsen10, - 'txtsen20'=> $rekodsen20, - 'txtsen50'=> $rekodsen50, - 'txtring10'=> $rekodring10, - 'txtring20'=> $rekodring20, - 'txtring50'=> $rekodring50, - 'txtring100'=> $rekodring100, - 'txtring1000'=> "0", - 'jumlahbundle'=> "0", - 'txtjumlah'=> "0", - 'jumlahkeping' => "0" - ]); - - $deletepanjar = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url') . '/api/DeletePanjar/'. $auth_user['cawangan'],[ - 'recno' => $request->recno, - 'users' => $auth_user['name'] - ])->json(); - - $updateVault = Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/UpdateVault/DeletePanjar/'.$auth_user['cawangan'],[ - 'totpanjar'=>$denopanjar['serahan'] - ]); - - $upVault = $updateVault->getStatusCode(); - $upDeno = $denominasicreate->getStatusCode(); - - if($upVault == 200 && $upDeno == 200) + if($updatepanjar['result'] == 'success') { - if($denopanjar['jenis'] === 'perubatan') + if($updatepanjar['jenis'] === 'perubatan') { - $listUser = User::where('name','=',$senaraipanjar['tuntutoleh'])->get(); - - $totalsebenar = floatval($listUser[0]->perubatan) + floatval($denopanjar['serahan']); - - $overrideuser = User::where('cawangan','=',$auth_user['cawangan']) - ->where('name','=',$senaraipanjar['tuntutoleh']) + $listUser = User::where('name','=',$updatepanjar['tuntutoleh'])->first(); + $listUser = optional($listUser)->toArray(); + $totalsebenar = floatval($listUser['perubatan_asal']) - floatval($updatepanjar['totalperubatan']); + User::where('cawangan','=',$auth_user['cawangan']) + ->where('name','=',$updatepanjar['tuntutoleh']) ->update(array( 'perubatan' => $totalsebenar )); @@ -1156,7 +947,7 @@ class KhazanahController extends Controller ]); - event(new PendahuluanSerahan("Lulus",$auth_user['cawangan'],$request->teller)); + event(new PendahuluanSerahan("Lulus","pendahuluan",$auth_user['cawangan'],$request->teller)); $updaterequest=Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/requestTeller/update/'. $auth_user['cawangan'],[ 'kodlaluan' => $request->teller, @@ -1236,7 +1027,7 @@ class KhazanahController extends Controller ]); - event(new PendahuluanSerahan("Lulus",$auth_user['cawangan'],$request->teller)); + event(new PendahuluanSerahan("Lulus","serahan",$auth_user['cawangan'],$request->teller)); $updaterequest=Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/requestTeller/update/'. $auth_user['cawangan'],[ 'kodlaluan' => $request->teller, @@ -1247,144 +1038,41 @@ class KhazanahController extends Controller return redirect()->route('khazanah.serahan'); } - public function kemaskiniPendahuluan(Request $request) //Daftar Pendahuluan kepada Kaunter + public function kemaskiniPendahuluan(Request $request) { - // return $this->denominasicalculationpendahuluan($request); + $auth_user = Auth::user(); + $api_url = config('api.url'); + $peti_besi_terkini=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json(); - $auth_user = Auth::user(); - $api_url = config('api.url'); - $peti_besi_terkini=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json(); + if(sizeof($peti_besi_terkini) == 0) + { + $peti_besi_terkini=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan'])->json(); + $baki_awal = $peti_besi_terkini["bakiakhir"]; + } + else + { + $baki_awal = $peti_besi_terkini[0]["bakiakhir"]; + } - if(sizeof($peti_besi_terkini) == 0) - { - $peti_besi_terkini=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan'])->json(); - $baki_awal=$peti_besi_terkini["bakiakhir"]; - } - else - { - $baki_awal=$peti_besi_terkini[0]["bakiakhir"]; - } + $amount = $request->amt; - $amount = $request->amt; + if($amount > $baki_awal){ + return redirect()->route('khazanah.pendahulu')->with('message', 'Jumlah yang dipinta melebihi baki dalam peti besi!.'); + } + else{ + $response_data = $request->except('_token'); + $test = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/panjar/updatetunai/'.$auth_user['cawangan'],$response_data)->json(); + + if($test == 'success'){ + event(new PendahuluanSerahan("Lulus","pendahuluan",$auth_user['cawangan'],$request->teller)); + return redirect()->route('khazanah.pendahulu'); + }else{ + return redirect()->route('khazanah.pendahulu')->with('error','Permohonan tidak berjaya! Permohonan Semula perlu melebihi 1 minit.'); + } + } - if($amount>$baki_awal) - { - //WI ERROR MESSAGE SKIT - // dd($baki_awal); - return redirect()->route('khazanah.serahan')->with('message', 'Jumlah yang dipinta melebihi baki dalam peti besi!.'); - } - else - { - - $tarikh=$request->tarikh; - $kodlaluan=$request->teller; - $tambah=$request->amt; - $kurang=0.0; - $nota=$request->nota; - $kodcaw=$auth_user['cawangan']; - - $addTunai=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/add/addTunai/'.$auth_user['cawangan'],[ - 'kodcaw'=>$kodcaw, - 'kodlaluan'=>$kodlaluan, - 'tambah'=>$tambah, - 'kurang'=>$kurang, - 'nota'=>$nota - ]); - - $getTunai=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $kodlaluan])->json(); - - if(sizeof($getTunai) == 0) - { - dd($getTunai); - } - else - { - $bakiawal=0;$masuk=0;$yuran=0;$keluar=0;$baki=0;$tmbh=0;$kurang=0; - - $BakiAkhirT=0;$BakiAwalT=0;$tambahT=0; - - $getTunai2=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $kodlaluan])->json(); - $bakiAwal=$getTunai2['bakiawal']; - $keluar=$getTunai2['keluar']; - $baki=$getTunai2['baki']; - $kurangT=$getTunai2['kurang']; - $tam=$getTunai2['tambah']; - $masukT=$getTunai2['masuk']; - - if($bakiAwal==0) - { - $BakiAwalT=0; - } - else - { - $BakiAwalT=$bakiAwal; - } - - $tambahT=$tambah + $tam; - - $kurang=$kurangT; - $keluarT = $keluar; - // $bakiAkhirT= $bakiAwal + $tambahT + $masukT - $keluarT - $kurang; - $bakiAkhirT = $baki + $tambah; - - $updateTunai=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/updateTunai/'.$auth_user['cawangan'], [ - 'kodlaluan'=>$kodlaluan, - 'tambah'=>$tambahT, - 'kurang'=>$kurang, - 'bakiakhir'=>$bakiAkhirT - ]); - - $latestVault=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json(); - $masukV=$latestVault[0]['masuk']; - $keluarV=$latestVault[0]['keluar']; - $pendahuluanV=$latestVault[0]['pendahuluan']; - $serahanV=$latestVault[0]['serahan']; - $bakiAwalV=$latestVault[0]['bakiawal']; - $totpanjar = $latestVault[0]['totpanjar']; - - // return; - // dd($tambahT); - // $keluarV=$tambahT; - $keluarV = $tambah + $keluarV; - - $GetLatestBakiTunai=Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/api/getLatestBaki/'.$auth_user['cawangan'])->json(); - - $bakiTerkini=$GetLatestBakiTunai; - $bakiAkhirV=$bakiAwalV - $keluarV + $masukV + $pendahuluanV - $serahanV - $totpanjar; - // $bakiEOD=$bakiAkhirV+$GetLatestBakiTunai; //try test - $bakiEOD = $bakiAkhirV; - - // dd($bakiEOD); - // $createTempVault=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan']); - - // dd($bakiAkhirV); - //get temporary latest vault/ petibesi - - - - $updateVault=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/UpdateVault/'.$auth_user['cawangan'],[ - - 'masuk'=>$masukV, - 'keluar'=>$keluarV, - 'bakiawal'=>$bakiAwalV, - 'bakiakhir'=>$bakiAkhirV, - 'bakieod'=>$bakiEOD - - ]); - - //-----PROCESS SELESAI----------------------------------- - //display final result - - return $this->denominasicalculationpendahuluan($request); - //dd($updateVault); - - - } //endif - - } //end - - } //End + } public function KemaskiniSerahan(Request $request) { @@ -1397,146 +1085,17 @@ class KhazanahController extends Controller if(sizeof($peti_besi_terkini) == 0) { $peti_besi_terkini=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/daftarVault/'.$auth_user['cawangan'])->json(); - $baki_awal=$peti_besi_terkini["bakiakhir"]; } - else - { - $baki_awal=$peti_besi_terkini[0]["bakiakhir"]; + $response_data = $request->except('_token'); + $test = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/panjar/serahantunai/'.$auth_user['cawangan'],$response_data)->json(); + + if($test == 'success'){ + event(new PendahuluanSerahan("Lulus","serahan",$auth_user['cawangan'],$request->teller)); + return redirect()->route('khazanah.serahan'); + }else{ + return redirect()->route('khazanah.serahan')->with('error','Permohonan tidak berjaya! Permohonan Semula perlu melebihi 1 minit.'); } - - $amount = $request->amt; - - $tarikh=$request->tarikh; - $kodlaluan=$request->teller; - - $kurang=$request->amt; - $nota=$request->nota; - $kodcaw=$auth_user['cawangan']; - $tambahT = 0; - $kurangvault = $request->amt; - - $addTunai=Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/add/addTunai/'.$auth_user['cawangan'],[ - 'kodcaw'=>$kodcaw, - 'kodlaluan'=>$kodlaluan, - 'tambah'=>$tambahT, - 'kurang'=>$kurang, - 'nota'=>$nota]); - - $getTunai=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $kodlaluan])->json(); - - if(sizeof($getTunai) == 0) - { - // dd($getTunai); - } - else - { - $getTunai2=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/GetCurrentTunai/'.$auth_user['cawangan'],['kodlaluan' => $kodlaluan])->json(); - $bakiAwalT=$getTunai2['bakiawal']; - $keluarT=$getTunai2['keluar']; - $baki=$getTunai2['baki']; - $tambahT=$getTunai2['tambah']; - $kurangT=$getTunai2['kurang']; - $masukT=$getTunai2['masuk']; - - $serahanakhir = $kurang; - $tambah_T=0;$kurang_T=0;$baki_AwalT=0.0; - - if($tambahT==0) - $tambah_T=0; - - else - $tambah_T=$tambahT; - - - if($kurangT==0) - $kurang_T=$kurang; - - else - { - $kurang=$kurang+$kurangT; - $kurang_T=$kurang; - } - - if($bakiAwalT==0) - $baki_AwalT=0; - - else - $baki_AwalT=$bakiAwalT; - - //$bakiAkhirT=$baki_AwalT+$tambah_T+$masukT-$keluarT-$kurang_T; //untuk kegunaan urgent - $bakiAkhirT = $baki - $serahanakhir; - - $updateTunai=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/updateTunai/'.$auth_user['cawangan'], [ - 'kodlaluan'=>$kodlaluan, - 'tambah'=>$tambah_T, - 'kurang'=>$kurang_T, - 'bakiakhir'=>$bakiAkhirT - ]); - - - $latestVault=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/VaultController/'.$auth_user['cawangan'])->json(); - - $masukV=$latestVault[0]['masuk']; - $keluarV=$latestVault[0]['keluar']; - $pendahuluanV=$latestVault[0]['pendahuluan']; - $serahanV=$latestVault[0]['serahan']; - $bakiAwalV=$latestVault[0]['bakiawal']; - $totpanjar = $latestVault[0]['totpanjar']; - - - $masuk_V = 0;$pendahuluan_V = 0;$keluar_V = 0;$serahan_V = 0; - - if($masukV == 0) - { - $masuk_V = 0 + $kurangvault; - } - else - { - $masuk_V = $masukV + $kurangvault; - } - - if($keluarV == 0) - $keluar_V = 0; - - else - $keluar_V=$keluarV; - - - if($pendahuluanV == 0) - $pendahuluan_V = 0; - - else - $pendahuluan_V = $pendahuluanV; - - - if($serahanV == 0) - $serahan_V = 0; - - else - $serahan_V = $serahanV; - - } - - $GetLatestBakiTunai=Http::withOptions(['verify' => config('app.api_verify')])->get( config('api.url').'/api/getLatestBaki/'.$auth_user['cawangan'])->json(); - $sumBaki=$GetLatestBakiTunai; - - - $bakiAkhirV = $bakiAwalV - $keluar_V + $masuk_V + $pendahuluan_V - $serahan_V - $totpanjar; - - $BakiEOD=$bakiAkhirV; - //$BakiEOD=$bakiAkhirV+$sumBaki; - - $updateVault=Http::withOptions(['verify' => config('app.api_verify')])->put( config('api.url').'/api/UpdateVault/'.$auth_user['cawangan'],[ - 'masuk'=>$masuk_V, - 'keluar'=>$keluar_V, - 'bakiawal'=>$bakiAwalV, - 'bakiakhir'=>$bakiAkhirV, - 'bakieod'=>$BakiEOD - ]); - - //--FINAL RESULT...KENA RIDERECT KE PAGE SEBELUMNYA.. - - return $this->denominasicalculationserahan($request); + } @@ -3232,12 +2791,12 @@ class KhazanahController extends Controller $nombor = $request->no; $kodlaluan = $request->kodlaluan; - $updatebatal = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/requestTeller/batal/'.$kodcaw,[ + Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.url').'/api/requestTeller/batal/'.$kodcaw,[ 'no'=>$nombor, 'kodlaluan'=>$kodlaluan ]); - event(new PendahuluanSerahan("Batal",$auth_user['cawangan'],$kodlaluan)); + event(new PendahuluanSerahan("Batal","all",$auth_user['cawangan'],$kodlaluan)); return response('Berjaya'); } diff --git a/app/Http/Controllers/PerubatanController.php b/app/Http/Controllers/PerubatanController.php new file mode 100644 index 0000000..7815f23 --- /dev/null +++ b/app/Http/Controllers/PerubatanController.php @@ -0,0 +1,66 @@ +middleware('auth'); + } + + public function index(){ + $api_url = config('api.url'); + $auth_user = Auth::user(); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + $paginate = User::paginate(5); + + return view('operasi.perubatan.index',compact('cawangan_info','api_url','auth_user','paginate')); + + } + + public function search(Request $request){ + $api_url = config('api.url'); + $auth_user = Auth::user(); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + + $search = $request->input('search'); + + $query = User::query(); + + if ($search) { + $query->where('name', 'LIKE', "%{$search}%"); + } + $paginate = $query->paginate(5); + $paginate->appends($request->all()); + + return view('operasi.perubatan.index',compact('cawangan_info','api_url','auth_user','paginate')); + } + + public function update(Request $request){ + $api_url = config('api.url'); + $auth_user = Auth::user(); + + $user = User::where('id', $request->id)->first(); + $user = optional($user)->toArray(); + + $amount = str_replace(',', '', $request->amount); + + $total_perubatan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/panjar/getperubatan/'. $user['cawangan'],[ + 'tuntutoleh' => $user['name'] + ])->json(); + + $remaining = floatval($amount) - floatval($total_perubatan); + + $response = User::where('id', $request->id)->update(['perubatan_asal' => $amount,'perubatan' => $remaining]); + + return $response; + } +} diff --git a/database/migrations/2024_11_06_000000_add_users_perubatanasal_table.php b/database/migrations/2024_11_06_000000_add_users_perubatanasal_table.php new file mode 100644 index 0000000..2dc1c89 --- /dev/null +++ b/database/migrations/2024_11_06_000000_add_users_perubatanasal_table.php @@ -0,0 +1,35 @@ +decimal('perubatan_asal', 11, 2); + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + // public function down() + // { + // Schema::dropIfExists('users'); + // } +} diff --git a/public/css/main.css b/public/css/main.css index 7c3b343..5baef76 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -94,3 +94,22 @@ span#basic-hargaemas { padding: 5px 10px; text-align: center; } + + @keyframes heartbeat { + 0% { + transform: scale(1); + } + 30% { + transform: scale(1.2); + } + 60% { + transform: scale(1); + } + 100% { + transform: scale(1); + } +} + +.heartbeat { + animation: heartbeat 1s infinite; +} diff --git a/public/js/Class/SubscribePusher.js b/public/js/Class/SubscribePusher.js new file mode 100644 index 0000000..ec27795 --- /dev/null +++ b/public/js/Class/SubscribePusher.js @@ -0,0 +1,20 @@ +class SubscribePusher { + constructor(subscribe, event, apikey) { + this.subscribe = subscribe; + this.event = event; + this.apikey = apikey; + this.pusher = new Pusher(this.apikey, { + cluster: 'ap1', // Replace 'your_cluster' with the actual cluster of your Pusher app + }); + } + + channel_subscribe(callback) { + let channel = this.pusher.subscribe(this.subscribe); + channel.bind(this.event, function(data){ + callback(data); + }); + } +} + + +export default SubscribePusher; \ No newline at end of file diff --git a/public/js/main.js b/public/js/main.js index e1620b1..32041b6 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -434,6 +434,17 @@ async function openuptambahdanserah(e) } else { + $.ajax({ + method: "GET", + url: event_tellercash, + success:function(data){ + console.log('successfull trigger'); + }, + error: function(xhRequest, ajaxOptions, thrownError){ + console.log(xhRequest,thrownError); + } + }) + $.ajax({ method:"POST", url: api_url + '/api/requestTeller/' + kodcaw, @@ -465,7 +476,8 @@ async function openuptambahdanserah(e) var channel = pusher.subscribe('pendahuluanserahan-notice'); channel.bind('penserahan-event', function(data) { - if(data.pengesahan === 'Lulus' && data.cawangan == kodcaw && data.kodlaluan == teller) + console.log(data); + if(data.pengesahan === 'Lulus' && data.jenis == 'pendahuluan' && data.cawangan == kodcaw && data.kodlaluan == teller) { Swal.fire({ icon: 'success', @@ -474,7 +486,7 @@ async function openuptambahdanserah(e) }).then(function(){ location.reload(); }); - }else{ + }else if(data.pengesahan == 'Batal' && data.jenis == 'all' && data.cawangan == kodcaw && data.kodlaluan == teller){ Swal.fire({ icon: 'error', title: 'Tambah Pendahuluan', @@ -482,6 +494,14 @@ async function openuptambahdanserah(e) }).then(function(){ location.reload(); }); + }else{ + Swal.fire({ + icon: 'error', + title: 'Tambah Pendahuluan', + text: 'Tambah Pendahuluan tidak berjaya!' + }).then(function(){ + location.reload(); + }); } @@ -580,6 +600,14 @@ function tambahdanserahanfunc(e) if(id == "serahanmodal") { + $.ajax({ + method: "GET", + url: event_tellercash, + success:function(data){ + console.log('successfull trigger'); + } + }) + $.ajax({ method:"POST", url: api_url + '/api/requestTeller/' + kodcaw, @@ -630,7 +658,7 @@ function tambahdanserahanfunc(e) channel.bind('penserahan-event', function(data) { // let message = JSON.stringify(data); - if(data.pengesahan === 'Lulus' && data.cawangan == kodcaw && data.kodlaluan == teller) + if(data.pengesahan === 'Lulus' && data.jenis == 'serahan' && data.cawangan == kodcaw && data.kodlaluan == teller) { Swal.fire({ icon: 'success', @@ -640,6 +668,14 @@ function tambahdanserahanfunc(e) window.open(laporanroute, '_blank'); location.reload(); }); + }else if(data.pengesahan == 'Batal' && data.jenis == 'all' && data.cawangan == kodcaw && data.kodlaluan == teller){ + Swal.fire({ + icon: 'error', + title: 'Serahan Modal', + text: 'Serahan modal tidak diluluskan!' + }).then(function(){ + location.reload(); + }); }else{ Swal.fire({ icon: 'error', diff --git a/public/js/notification.js b/public/js/notification.js new file mode 100644 index 0000000..5655959 --- /dev/null +++ b/public/js/notification.js @@ -0,0 +1,108 @@ +import NotifyKhazanah from './Class/SubscribePusher.js'; +let channel = 'notify-deposit'; +let event = 'deposit-event'; +let apikey = window.apikey; + +const Toast = Swal.mixin({ + toast: true, + position: 'top-end', + showConfirmButton: false, + timer: 5000, + timerProgressBar: true, + didOpen: (toast) => { + toast.addEventListener('mouseenter', Swal.stopTimer) + toast.addEventListener('mouseleave', Swal.resumeTimer) + } +}) + +const notify = new NotifyKhazanah(channel,event,apikey); +notify.channel_subscribe((data) => { + console.log(data); + Toast.fire({ + icon: 'info', + title: 'Permohonan Kelulusan Wang Tunai Teller!' + }); + const currentPath = window.location.pathname; + + if (currentPath === "/home") { + notify_main(); + } else if (currentPath === "/menu") { + notify_khazanah_main(); + }else if(currentPath === '/pendahuluan'){ + notify_pendahuluan(); + }else if(currentPath === '/serahan'){ + notify_serahan(); + } + +}); + +let requestApi = (url, method, datarequest, callback) => { + $.ajax({ + method: method, + url: url, + data: datarequest, + success: function(data) { + callback(data); + }, + error: function(xhRequest, ajaxOptions, thrownError) { + console.error("Request failed:", xhRequest, thrownError); + } + }); +}; + + +let notify_main = () =>{ + const button = document.getElementById("btn-khazanah"); + + if(!button){ + return; + } + + button.classList.add('btn-danger'); + button.classList.add('heartbeat'); +} + +let notify_khazanah_main = () =>{ + requestApi(window.api + '/api/requestTeller/get/' + window.kodcaw,"GET",{}, (response) =>{ + let countModal = 0; + let countSerahan = 0; + + response.forEach((req) => { + if (req.modal !== 0) { + countModal++; + } else if (req.serahan !== 0) { + countSerahan++; + } + }); + + let btn_serahan = document.getElementById('btn-ser'); + let btn_pendahuluan = document.getElementById('btn-pend'); + let span_element_ser = btn_serahan.querySelector('span'); + let span_element_pend = btn_pendahuluan.querySelector('span'); + + if(!btn_serahan.classList.contains('btn-danger') && countSerahan > 0){ + btn_serahan.classList.add('btn-danger'); + span_element_ser.innerText = countSerahan; + } + + if(!btn_pendahuluan.classList.contains('btn-danger') && countModal > 0){ + btn_pendahuluan.classList.add('btn-danger'); + span_element_pend.innerText = countModal; + } + + }); +} + +let notify_pendahuluan = () =>{ + timer_reload(); +} + +let notify_serahan = () =>{ + timer_reload(); +} + +let timer_reload = () =>{ + setTimeout(() => { + window.location.reload(); + }, 3000); +} diff --git a/public/js/perubatan.js b/public/js/perubatan.js new file mode 100644 index 0000000..b48fd7a --- /dev/null +++ b/public/js/perubatan.js @@ -0,0 +1,95 @@ +let editfunc = (pageid) => { + let editbtn = document.getElementById('divedit-' + pageid); + let divbtn = document.getElementById('div-' + pageid); + let inputbtn = document.getElementById('input-' + pageid); + + if(editbtn.classList.contains('d-block')){ + editbtn.classList.remove('d-block'); + editbtn.classList.add('d-none'); + } + + if(divbtn.classList.contains('d-none')){ + divbtn.classList.remove('d-none'); + divbtn.classList.add('d-block'); + } + inputbtn.disabled = false; + +} + +let savefunc = (pageid) => { + let amount = document.getElementById("input-" + pageid); + + Swal.fire({ + title: 'Memuatkan...', + allowEscapeKey : false, + allowOutsideClick: false, + didOpen: function () { + Swal.showLoading(); + } + }); + + $.ajax({ + url : updateurl, + method : 'PUT', + data : { + "amount" : amount.value, + "id" : pageid, + "_token": $('meta[name="csrf-token"]').attr('content') + }, + success:function(response){ + if(response == 0){ + Swal.fire({ + icon: 'error', + title: 'Perubahan Nilai Perubatan Tidak Berjaya!', + }); + return false; + } + + Swal.fire({ + icon: 'success', + title: 'Perubahan Nilai Perubatan Berjaya!', + showCancelButton: false, + confirmButtonText: "Okay!", + allowEscapeKey: false, + allowOutsideClick: false + }).then((result) => { + if (result.isConfirmed) { + window.location.reload(); + } + }); + + } + }); + + + // let editbtn = document.getElementById('editButton-' + pageid); + // let divbtn = document.getElementById('div-' + pageid); + + // if(editbtn.classList.contains('d-block')){ + // editbtn.classList.remove('d-block'); + // editbtn.classList.add('d-none'); + // } + + // if(divbtn.classList.contains('d-none')){ + // divbtn.classList.remove('d-none'); + // divbtn.classList.add('d-block'); + // } +} + +let cancelfunc = (pageid) => { + let editbtn = document.getElementById('divedit-' + pageid); + let divbtn = document.getElementById('div-' + pageid); + let inputbtn = document.getElementById('input-' + pageid); + + if(editbtn.classList.contains('d-none')){ + editbtn.classList.remove('d-none'); + editbtn.classList.add('d-block'); + } + + if(divbtn.classList.contains('d-block')){ + divbtn.classList.remove('d-block'); + divbtn.classList.add('d-none'); + } + + inputbtn.disabled = true; +} \ No newline at end of file diff --git a/resources/views/aliran_tunai/index.blade.php b/resources/views/aliran_tunai/index.blade.php index a8dedd0..d1ebd87 100644 --- a/resources/views/aliran_tunai/index.blade.php +++ b/resources/views/aliran_tunai/index.blade.php @@ -174,6 +174,7 @@ Pembiayaan Penebusan B/F + Tindakan @@ -187,6 +188,7 @@ {{ number_format($tp['keluar'],2) }} {{ number_format($tp['masuk'],2) }} {{ number_format($tp['baki'],2) }} + @endforeach @endif @@ -214,6 +216,7 @@ Debit (RM) Kredit (RM) Nota + Tindakan @@ -225,6 +228,7 @@ {{ number_format($at['tambah'],2) }} {{ number_format($at['kurang'],2) }} {{ $at['nota'] }} + @endforeach @endif @@ -602,8 +606,24 @@ }); } + function rekodprint(recno){ + + let urlroute = '{{ route("laporan.tunaiteller") }}'; + urlroute += '?recno=' + encodeURIComponent(recno); + window.open(urlroute, '_blank'); + } + + function rec_acc_statement(tarikh){ + console.log(tarikh); + let urlroute = '{{ route("laporan.acc_statement" )}}'; + urlroute += '?tarikh=' + tarikh; + + window.open(urlroute, '_blank'); + } + let pusherenv = "{{ env('PUSHER_APP_KEY') }}"; let laporanroute = "{{ route('laporan.serahantellerberkala') }}"; + let event_tellercash = "{{ route('event.tellercash') }}"; @endsection diff --git a/resources/views/aliran_tunai/laporan/account_statement.blade.php b/resources/views/aliran_tunai/laporan/account_statement.blade.php new file mode 100644 index 0000000..8cd75d0 --- /dev/null +++ b/resources/views/aliran_tunai/laporan/account_statement.blade.php @@ -0,0 +1,493 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + +
Laporan Kenyataan Akaun
+ + + + +
+ + +
ID {{ (Auth::user()->name) ? Auth::user()->name : ''}}
Tarikh Laporan {{ $tarikh }} Tarikh Cetak {{ $tarikh_cetak }}
+
+ + + + + + + + + + + + @foreach ($acc_statement as $acc) + + + + + + + @endforeach + +
TarikhDebitKreditNota
{{ $acc['tarikh'] }}{{ number_format($acc['tambah'],2) }}{{ number_format($acc['kurang'],2) }}{{ $acc['nota'] }}
+ +
+ + + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
+ \ No newline at end of file diff --git a/resources/views/aliran_tunai/laporan/laporanrekodteller.blade.php b/resources/views/aliran_tunai/laporan/laporanrekodteller.blade.php new file mode 100644 index 0000000..5ed231c --- /dev/null +++ b/resources/views/aliran_tunai/laporan/laporanrekodteller.blade.php @@ -0,0 +1,546 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + +
Laporan Pemeriksaan Wang Peti Besi (Cash Box)
+ + + + + +
+ + + + +
ID {{ (Auth::user()->name) ? Auth::user()->name : ''}} Jenis {{ strtoupper($jenisserah) }}
Tarikh Laporan {{ $tarikh_cetak }} Tarikh Cetak {{ $tarikh_cetak }}
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
RMKUANTITIJUMLAH (RM)
RM100{{ $array_requestteller[0]['rekodring100'] }}@php $totalsemua = 0; $total = ($array_requestteller[0]['rekodring100'] * 100); $totalsemua += $total; echo number_format($total,2); @endphp
RM 50{{ $array_requestteller[0]['rekodring50'] }}@php $total = ($array_requestteller[0]['rekodring50'] * 50); $totalsemua += $total; echo number_format($total,2); @endphp
RM 20{{ $array_requestteller[0]['rekodring20'] }}@php $total = ($array_requestteller[0]['rekodring20'] * 20); $totalsemua += $total; echo number_format($total,2); @endphp
RM 10{{ $array_requestteller[0]['rekodring10'] }}@php $total = ($array_requestteller[0]['rekodring10'] * 10); $totalsemua += $total; echo number_format($total,2); @endphp
RM 5{{ $array_requestteller[0]['rekodring5'] }}@php $total = ($array_requestteller[0]['rekodring5'] * 5); $totalsemua += $total; echo number_format($total,2); @endphp
RM 1.00{{ $array_requestteller[0]['rekodring1'] }}@php $total = ($array_requestteller[0]['rekodring1'] * 1); $totalsemua += $total; echo number_format($total,2); @endphp
RM 0.50{{ $array_requestteller[0]['rekodsen50'] }}@php $total = ($array_requestteller[0]['rekodsen50'] * 0.5); $totalsemua += $total; echo number_format($total,2); @endphp
RM 0.20{{ $array_requestteller[0]['rekodsen20'] }}@php $total = ($array_requestteller[0]['rekodsen20'] * 0.2); $totalsemua += $total; echo number_format($total,2); @endphp
RM0.10{{ $array_requestteller[0]['rekodsen10'] }}@php $total = ($array_requestteller[0]['rekodsen10'] * 0.1); $totalsemua += $total; echo number_format($total,2); @endphp
RM 0.05{{ $array_requestteller[0]['rekodsen5'] }}@php $total = ($array_requestteller[0]['rekodsen5'] * 0.05); $totalsemua += $total; echo number_format($total,2); @endphp
RM 0.01{{ $array_requestteller[0]['rekodsen1'] }}@php $total = ($array_requestteller[0]['rekodsen1'] * 0.01); $totalsemua += $total; echo number_format($total,2); @endphp
JUMLAH (RM){{ number_format($totalsemua,2) }}
+ +
CATATAN:
@if($jenisserah == 'pendahuluan') + Pendahuluan daripada peti besi + @else + Serahan kepada peti besi + @endif + ialah sebanyak RM {{ number_format($totalsemua,2) }} +
+
+ + + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
+ \ No newline at end of file diff --git a/resources/views/homepage/khazanah/home.blade.php b/resources/views/homepage/khazanah/home.blade.php index bcb1270..66578f8 100644 --- a/resources/views/homepage/khazanah/home.blade.php +++ b/resources/views/homepage/khazanah/home.blade.php @@ -255,6 +255,7 @@
Khazanah
diff --git a/resources/views/homepage/operasi/home.blade.php b/resources/views/homepage/operasi/home.blade.php index a4135e9..a86275b 100644 --- a/resources/views/homepage/operasi/home.blade.php +++ b/resources/views/homepage/operasi/home.blade.php @@ -18,6 +18,7 @@ Kakitangan Parameter Komoditi + Perubatan
diff --git a/resources/views/khazanah/menu.blade.php b/resources/views/khazanah/menu.blade.php index dfa8713..95c8a11 100644 --- a/resources/views/khazanah/menu.blade.php +++ b/resources/views/khazanah/menu.blade.php @@ -18,9 +18,9 @@ Penyelesaian Pem. {{ count($listserah) }} - Pendahuluan {{ $countmodal }} + Pendahuluan {{ $countmodal }} - Serahan {{ $countserahan }} + Serahan {{ $countserahan }} diff --git a/resources/views/khazanah/panjar.blade.php b/resources/views/khazanah/panjar.blade.php index 6e4dbb8..c3a35c5 100644 --- a/resources/views/khazanah/panjar.blade.php +++ b/resources/views/khazanah/panjar.blade.php @@ -20,10 +20,13 @@
@if(Session::has('messageinformation')) + @php + $session = Session::get("messageinformation"); + @endphp @endif diff --git a/resources/views/khazanah/pendahuluan.blade.php b/resources/views/khazanah/pendahuluan.blade.php index 634b216..21b9472 100644 --- a/resources/views/khazanah/pendahuluan.blade.php +++ b/resources/views/khazanah/pendahuluan.blade.php @@ -16,7 +16,11 @@
- + @if (session('error')) +
+ {{ session('error') }} +
+ @endif
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 4d974ac..cc68dc2 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -49,6 +49,15 @@ {{-- Pusher --}} + @if(Auth::user()->roles == 'ppc' || Auth::user()->roles == 'pc') + + + @endif + + +@endsection diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php new file mode 100644 index 0000000..0b4defb --- /dev/null +++ b/resources/views/vendor/pagination/bootstrap-4.blade.php @@ -0,0 +1,47 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/default.blade.php new file mode 100644 index 0000000..0db70b5 --- /dev/null +++ b/resources/views/vendor/pagination/default.blade.php @@ -0,0 +1,46 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/semantic-ui.blade.php b/resources/views/vendor/pagination/semantic-ui.blade.php new file mode 100644 index 0000000..ef0dbb1 --- /dev/null +++ b/resources/views/vendor/pagination/semantic-ui.blade.php @@ -0,0 +1,36 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php new file mode 100644 index 0000000..4bb4917 --- /dev/null +++ b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php @@ -0,0 +1,27 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-default.blade.php new file mode 100644 index 0000000..36bdbc1 --- /dev/null +++ b/resources/views/vendor/pagination/simple-default.blade.php @@ -0,0 +1,19 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/simple-tailwind.blade.php b/resources/views/vendor/pagination/simple-tailwind.blade.php new file mode 100644 index 0000000..1c5e52f --- /dev/null +++ b/resources/views/vendor/pagination/simple-tailwind.blade.php @@ -0,0 +1,25 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/resources/views/vendor/pagination/tailwind.blade.php b/resources/views/vendor/pagination/tailwind.blade.php new file mode 100644 index 0000000..4b92aab --- /dev/null +++ b/resources/views/vendor/pagination/tailwind.blade.php @@ -0,0 +1,102 @@ +@if ($paginator->hasPages()) + +@endif diff --git a/routes/web.php b/routes/web.php index 75efc37..d31216d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -87,6 +87,8 @@ Route::get('/daftar_marhun',['as'=>'daftar_marhun','uses'=>'MarhunController@ind Route::get('/penebusan/{norujukan}',['as'=>'penebusan','uses' => 'PenebusanController@index'])->middleware('auth'); Route::get('/lelongan/{norujukan}',['as'=>'lelongan','uses' => 'LelongController@index'])->middleware('auth','teller'); Route::get('/aliran_tunai','AliranTunaiController@index')->middleware('auth','teller'); +Route::get('/aliran_tunai/laporantunaiteller',['as'=>'laporan.tunaiteller','uses' => 'AliranTunaiController@LaporanTunaiTeller'])->middleware('auth','teller'); +Route::get('/aliran_tunai/account_statement',['as'=>'laporan.acc_statement','uses' => 'AliranTunaiController@LaporanAccStatement'])->middleware('auth','teller'); Route::get('/aliran_tunai/laporanserahan',['as'=>'laporan.serahanteller','uses' => 'AliranTunaiController@LaporanSerahan'])->middleware('auth','teller'); Route::get('/aliran_tunai/laporanserahanberkala',['as'=>'laporan.serahantellerberkala','uses' => 'AliranTunaiController@LaporanSerahanBerkala'])->middleware('auth','teller'); Route::get('/aliran_tunai/laporanalirantunai/{teller}',['as'=>'laporan.alirantunai','uses' => 'AliranTunaiController@LaporanAliranTunai'])->middleware('auth','teller'); @@ -471,4 +473,11 @@ Route::get('supports/driver/mykad-reader/download',['as'=>'mykadreader.driver.do return Storage::disk('supports')->download('MykadReaderDriver.zip'); }])->middleware('auth','teller'); +/* Event Trigger */ +Route::get('/event/tellercash',['as'=>'event.tellercash','uses'=>'EventTriggerController@TellerCash'])->middleware('auth'); + +/* Perubatan */ +Route::get('/perubatan',['as'=>'perubatan','uses'=>'PerubatanController@index'])->middleware('auth','operasi'); +Route::get('/perubatan/search',['as'=>'perubatan.search','uses'=>'PerubatanController@search'])->middleware('auth','operasi'); +Route::put('/perubatan/update',['as'=>'perubatan.update','uses'=>'PerubatanController@update'])->middleware('auth','operasi');