From f97393ec7ec4ad48509f0477cf886050c661ca54 Mon Sep 17 00:00:00 2001 From: aiman Date: Thu, 25 Sep 2025 11:59:19 +0800 Subject: [PATCH 01/20] Update WTD - Add jana simulasi feature 2024 --- .env.prod | 70 ++++++++ .nvmrc | 1 + app/Http/Controllers/WTDController.php | 152 ++++++++++++++--- app/View/Components/JanaSimulasi.php | 28 ++++ app/View/Components/SenaraiSimulasi.php | 28 ++++ public/js/app.js.LICENSE.txt | 153 ++++++++++++++++++ public/mix-manifest.json | 4 +- resources/js/WTD/selection.vue | 9 +- resources/js/components/Cawangan.vue | 10 +- .../views/components/jana-simulasi.blade.php | 7 + .../components/senarai-simulasi.blade.php | 15 ++ resources/views/layouts/app.blade.php | 12 +- .../views/wtd/simulasi/janaSimulasi.blade.php | 105 ++++++++++++ .../views/wtd/simulasi/pengesahan.blade.php | 89 ++++++++++ resources/views/wtd/simulasi/rekod.blade.php | 54 +++++++ resources/views/wtd/simulasi/show.blade.php | 131 +++++++++++++++ routes/web.php | 19 +++ 17 files changed, 851 insertions(+), 36 deletions(-) create mode 100644 .env.prod create mode 100644 .nvmrc create mode 100644 app/View/Components/JanaSimulasi.php create mode 100644 app/View/Components/SenaraiSimulasi.php create mode 100644 public/js/app.js.LICENSE.txt create mode 100644 resources/views/components/jana-simulasi.blade.php create mode 100644 resources/views/components/senarai-simulasi.blade.php create mode 100644 resources/views/wtd/simulasi/janaSimulasi.blade.php create mode 100644 resources/views/wtd/simulasi/pengesahan.blade.php create mode 100644 resources/views/wtd/simulasi/rekod.blade.php create mode 100644 resources/views/wtd/simulasi/show.blade.php diff --git a/.env.prod b/.env.prod new file mode 100644 index 0000000..2a4e713 --- /dev/null +++ b/.env.prod @@ -0,0 +1,70 @@ +APP_NAME=Laravel +APP_ENV=production +#APP_KEY=base64:x3sTPftRy/BL+DsI7+jXtiiCtUxO9Bei0OcjM15I1rQ= +APP_KEY=WbPGkYNmXZ6ZQplGlvl0iZ7zyW1b09xa +APP_DEBUG=false +APP_URL=http://admin.arrahn +API_ARRAHN_PORTAL_URL=https://pay.arrahn.com.my +API_URL=http://apiujrah.arrahn + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=172.16.4.102 +DB_PORT=3306 +DB_DATABASE=kaunterpkb +DB_USERNAME=zone2 +DB_PASSWORD=G0dz!ll4@2020 + +BROADCAST_DRIVER=pusher +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=480 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_MAILER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +#PUSHER_APP_ID=1132716 +#PUSHER_APP_KEY=27b70f118373dcb31ab3 +#PUSHER_APP_SECRET=ef2e62ddbc1647979bf4 + +#PUSHER_APP_ID=1220266 +#PUSHER_APP_KEY=3fb52a0bf6cc1363c736 +#PUSHER_APP_SECRET=0a27feb7c4b2f0177467 + +#PUSHER_APP_ID=4163674 +#PUSHER_APP_KEY=3nqb1ss0jlhi9w9vpi8v +#PUSHER_APP_SECRET=7dfx03w2i7ue0z6qoit3 + +PUSHER_APP_ID=1220266 +PUSHER_APP_KEY=da67a7e1a3a138b9b28e +PUSHER_APP_SECRET=114c38f6edcf085e4d7f + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" +# MIX_API_URL=http://api.arrahn +MIX_API_URL=http://apiujrah.arrahn +MIX_API_URL_ZONE1=http://apiujrah.arrahn +MIX_API_URL_ZONE2=http://apiujrah.arrahn +MIX_API_URL_ZONE3=http://apiujrah.arrahn + + +#TWILIO_WHATSAPP_NUMBER="+14155238886" +#TWILIO_SID="AC0b21863a1f21c39f153f9f7ce2551479" +#TWILIO_AUTH_TOKEN="ce474f07f586b3b150bf15a560e6d3b3" diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..9a03714 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/app/Http/Controllers/WTDController.php b/app/Http/Controllers/WTDController.php index 7ad1bee..927702d 100644 --- a/app/Http/Controllers/WTDController.php +++ b/app/Http/Controllers/WTDController.php @@ -19,8 +19,8 @@ class WTDController extends Controller // $this->middleware('auth'); // } - public function index(){ - + public function index() + { return view('wtd.index'); } @@ -30,27 +30,25 @@ class WTDController extends Controller $norujukan = json_decode($request->norujukan); - $tuntutbaki = Http::get(config('api.url').'/admin/wtd/senarai',['norujukan' => $norujukan,'kodcaw' => $request->cawangan])->json(); + $tuntutbaki = Http::get(config('api.url') . '/admin/wtd/senarai', ['norujukan' => $norujukan, 'kodcaw' => $request->cawangan])->json(); - $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'. $request->cawangan)->json(); - $cawangan_detail=$cawangan[0]; + $cawangan = Http::get(config('api.url') . '/api/cawangan/detail/' . $request->cawangan)->json(); + $cawangan_detail = $cawangan[0]; $current = Carbon::now(); $tarikh_cetak = $current->toDateString(); $api_url = config('api.url'); - $mula = $request->mula; + $mula = $request->mula; $hingga = $request->hingga; // $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); // $tarikhcetakan = $myDateTime->format('d-m-Y'); - - if(isset($request->jenis)) - { - if($request->jenis == 'pdf') - { - $pdf = PDF::loadView('wtd.cetakan', compact('tuntutbaki','cawangan_detail','tarikh_cetak','api_url','mula','hingga'))->setPaper('a4', 'potrait'); - return $pdf->download('wtd_' . $request->cawangan .'_'. $tarikh_cetak . '.pdf'); - }else{ - return view('wtd.cetakanexcel', compact('tuntutbaki','cawangan_detail','tarikh_cetak','api_url','mula','hingga')); + + if (isset($request->jenis)) { + if ($request->jenis == 'pdf') { + $pdf = PDF::loadView('wtd.cetakan', compact('tuntutbaki', 'cawangan_detail', 'tarikh_cetak', 'api_url', 'mula', 'hingga'))->setPaper('a4', 'potrait'); + return $pdf->download('wtd_' . $request->cawangan . '_' . $tarikh_cetak . '.pdf'); + } else { + return view('wtd.cetakanexcel', compact('tuntutbaki', 'cawangan_detail', 'tarikh_cetak', 'api_url', 'mula', 'hingga')); } } } @@ -61,21 +59,123 @@ class WTDController extends Controller $current = Carbon::now(); $tarikh_cetak = $current->toDateString(); - $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'. $request->cawangan)->json(); - $cawangan_detail=$cawangan[0]; + $cawangan = Http::get(config('api.url') . '/api/cawangan/detail/' . $request->cawangan)->json(); + $cawangan_detail = $cawangan[0]; - $wtdDalamProses = Http::get(config('api.url'). '/admin/wtd/dalamproses' ,['batchno' => $request->batchno,'kodcaw' => $request->cawangan])->json(); - if(isset($request->jenis)) - { - if($request->jenis == 'pdf') - { - $pdf = PDF::loadView('wtd.dalamprosespdf', compact('tarikh_cetak','cawangan_detail','wtdDalamProses','api_url'))->setPaper('a4', 'landscape'); - return $pdf->download('wtd_' . $request->cawangan .'_'. $tarikh_cetak . '.pdf'); - }else{ + $wtdDalamProses = Http::get(config('api.url') . '/admin/wtd/dalamproses', ['batchno' => $request->batchno, 'kodcaw' => $request->cawangan])->json(); + if (isset($request->jenis)) { + if ($request->jenis == 'pdf') { + $pdf = PDF::loadView('wtd.dalamprosespdf', compact('tarikh_cetak', 'cawangan_detail', 'wtdDalamProses', 'api_url'))->setPaper('a4', 'landscape'); + return $pdf->download('wtd_' . $request->cawangan . '_' . $tarikh_cetak . '.pdf'); + } else { - return view('wtd.dalamprosesexcel', compact('tarikh_cetak','cawangan_detail','wtdDalamProses','api_url')); + return view('wtd.dalamprosesexcel', compact('tarikh_cetak', 'cawangan_detail', 'wtdDalamProses', 'api_url')); } } } + + public function janaSimulasi(Request $request) + { + $cawangan = Http::get(config('api.url') . '/api/cawangan/')->json(); + + return view('wtd.simulasi.janaSimulasi', compact('cawangan')); + } + + public function showSimulasi(Request $request) + { + $request->validate([ + 'kodcaw' => 'required', + 'tahun' => 'required', + ], [ + 'kodcaw.required' => 'Sila Pilih Cawangan Terlebih Dahulu.', + 'tahun.required' => 'Sila Masukkan Tahun Terlebih Dahulu.', + ]); + + $senaraiSimulasi = Http::get(config('api.url') . '/admin/wtd/janaSimulasi', ['kodcaw' => $request->kodcaw, 'tahun' => $request->tahun])->json(); + + $year = $request->tahun; + + // dd($senaraiSimulasi, $request->kodcaw, $request->tahun); + + return view('wtd.simulasi.show', compact('senaraiSimulasi', 'year')); + } + + public function showRekod(Request $request) + { + $bulan = $request->input('month'); + $bulanNumber = date('n', strtotime($bulan)); + + $rekod = Http::get(config('api.url') . '/admin/wtd/rekodSimulasi', ['kodcaw' => $request->kodcaw, 'month' => $bulanNumber, 'year' => $request->year])->json(); + + $totalBaki = collect($rekod)->sum('baki'); + + // dd($rekod, $bulanNumber, $totalBaki, $bulan); + + return view('wtd.simulasi.rekod', compact('bulan', 'rekod', 'totalBaki')); + } + + public function prosesWTD(Request $request) + { + // dd($request->input()); + $request->validate([ + 'data.*.bulan' => 'required|string', + 'data.*.jumlah_norujukan' => 'required|numeric', + 'data.*.pembiayaan' => 'required|numeric', + 'data.*.baki' => 'required|numeric', + 'data.*.selected' => 'nullable', + ]); + + // Process the selected data + $data = $request->input('data', []); + $insertedRecords = []; + $kodcaw = $request->data[0]['kodcaw']; + + foreach ($data as $item) { + if (isset($item['selected'])) { + $insertedRecords[] = [ + 'bulan' => $item['bulan'], + 'tahun' => $request->tahun, + 'kodcaw' => $kodcaw, + 'jumlah_sag' => $item['jumlah_norujukan'], + 'pembiayaan' => $item['pembiayaan'], + 'baki' => $item['baki'], + 'created_at' => now(), + 'updated_at' => now(), + ]; + } + } + $response = Http::post(config('api.url') . '/admin/wtd/prosesSimulasi', [ + 'input' => $insertedRecords + ])->json(); + + // dd($data, $insertedRecords, $kodcaw, $response); + + return view('wtd.simulasi.pengesahan', compact('insertedRecords', 'response', 'kodcaw')); + } + + public function pengesahanSimulasi(Request $request) + { + $response = Http::post(config('api.url') . '/admin/wtd/pengesahanSimulasi', [ + 'records' => $request->records, + 'kodcaw' => $request->kodcaw, + ])->json(); + + return view('wtd.index'); + } + + public function serahbaki() + { + return view('wtd.simulasi.serahbaki'); + } + + public function simulasiToDraft(Request $request) + { + $response = Http::post(config('api.url') . '/admin/wtd/simulasiToDraft', [ + 'bulan' => $request->bulan, + + ])->json(); + + dd($response); + } } diff --git a/app/View/Components/JanaSimulasi.php b/app/View/Components/JanaSimulasi.php new file mode 100644 index 0000000..d54a7af --- /dev/null +++ b/app/View/Components/JanaSimulasi.php @@ -0,0 +1,28 @@ + + * @license MIT + */ + +/*! + * Vue.js v2.7.8 + * (c) 2014-2022 Evan You + * Released under the MIT License. + */ + +/*! + * jQuery JavaScript Library v3.6.0 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2021-03-02T17:08Z + */ + +/*! + * vue-friendly-iframe v0.20.0 (https://github.com/officert/vue-friendly-iframe) + * (c) 2021 Tim Officer + * Released under the MIT License. + */ + +/*! + * vuex v3.6.2 + * (c) 2021 Evan You + * @license MIT + */ + +/*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +/*! svg.draggable.js - v2.2.2 - 2019-01-08 + * https://github.com/svgdotjs/svg.draggable.js + * Copyright (c) 2019 Wout Fierens; Licensed MIT */ + +/*! svg.filter.js - v2.0.2 - 2016-02-24 + * https://github.com/wout/svg.filter.js + * Copyright (c) 2016 Wout Fierens; Licensed MIT */ + +/** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + +/**! + * @fileOverview Kickass library to create and place poppers near their reference elements. + * @version 1.16.1 + * @license + * Copyright (c) 2016 Federico Zivolo and contributors + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +//! moment.js diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 1cc3d6f..2d60117 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,4 +1,4 @@ { - "/js/app.js": "/js/app.js?id=41f31e4c4d0a3f1615de3f2a5b78988c", - "/css/app.css": "/css/app.css?id=9cdabf7932d415c4f5598da3580b0fa1" + "/js/app.js": "/js/app.js", + "/css/app.css": "/css/app.css" } diff --git a/resources/js/WTD/selection.vue b/resources/js/WTD/selection.vue index 70c1c51..0c368c7 100644 --- a/resources/js/WTD/selection.vue +++ b/resources/js/WTD/selection.vue @@ -2,12 +2,17 @@
+ + + + - + +
diff --git a/resources/js/components/Cawangan.vue b/resources/js/components/Cawangan.vue index a9d3621..a26cc5c 100644 --- a/resources/js/components/Cawangan.vue +++ b/resources/js/components/Cawangan.vue @@ -1,5 +1,5 @@ + + + + + \ No newline at end of file diff --git a/resources/views/akaun/laporan_brgkes.blade.php b/resources/views/akaun/laporan_brgkes.blade.php index bf5b4ce..b39a2ad 100644 --- a/resources/views/akaun/laporan_brgkes.blade.php +++ b/resources/views/akaun/laporan_brgkes.blade.php @@ -246,7 +246,7 @@ @endforeach --}} - +{{--
@@ -274,6 +274,37 @@ @endforeach +
Bil Tarikh{{ number_format($item['untungcajlain'], 2) }}
--}} + + + + + + + + + + + + + +@php $bil = 1; @endphp + +@foreach($palsu as $item) + + + + + + + + + + + + +@endforeach +
BilTarikhNo RujukanNotaPembiayaan (RM)Nilai Marhun (RM)JBGUntung (RM)1% (RM)Caj Lain (RM)
{{ $bil++ }}{{ $item['tarikh'] }}{{ $item['norujukan'] }}{{ $item['nota'] }}{{ number_format($item['pembiayaan'], 2) }}{{ number_format($item['nilaimarhun'], 2) }}{{ number_format($item['jbg'], 2) }}{{ number_format($item['untung'], 2) }}{{ number_format($item['untungonepercent'], 2) }}{{ number_format($item['untungcajlain'], 2) }}


From a440270b7c5d43e18d5ac9b61686d3113144469b Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Tue, 14 Oct 2025 10:44:58 +0800 Subject: [PATCH 05/20] add searching di laporan --- app/Http/Controllers/AkaunController.php | 2 +- resources/js/Akaun/Home.vue | 313 ++++++++--------------- 2 files changed, 112 insertions(+), 203 deletions(-) diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index 12c1345..02fa01d 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -1964,7 +1964,7 @@ public function cetakLaporanAnsuranRangeDate(Request $request){ } } - return view('akaun.laporan_brgkes', compact('hostname','cawangan_detail','mula_date','hingga_date','tarikh_cetak','api_url','palsu','palsu')); + return view('akaun.laporan_brgkes', compact('hostname','cawangan_detail','mula_date','hingga_date','tarikh_cetak','api_url','palsu','status')); } diff --git a/resources/js/Akaun/Home.vue b/resources/js/Akaun/Home.vue index 1d1514d..547b9eb 100644 --- a/resources/js/Akaun/Home.vue +++ b/resources/js/Akaun/Home.vue @@ -1,205 +1,114 @@ - - + + + + + + \ No newline at end of file From eb45c62a8199b10233307d7cc97ca859007479c6 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 29 Oct 2025 10:29:14 +0800 Subject: [PATCH 06/20] adjust sikit --- resources/js/components/Searchbarangkes.vue | 330 ++++++++-------- resources/js/pages/Detailssag.vue | 401 ++++++++++++-------- 2 files changed, 398 insertions(+), 333 deletions(-) diff --git a/resources/js/components/Searchbarangkes.vue b/resources/js/components/Searchbarangkes.vue index acab1cb..f158631 100644 --- a/resources/js/components/Searchbarangkes.vue +++ b/resources/js/components/Searchbarangkes.vue @@ -1,197 +1,189 @@ diff --git a/resources/js/pages/Detailssag.vue b/resources/js/pages/Detailssag.vue index 6db243b..36d8f32 100644 --- a/resources/js/pages/Detailssag.vue +++ b/resources/js/pages/Detailssag.vue @@ -1,144 +1,223 @@ - - - \ No newline at end of file +} + From 9be2e24da6589dc3fdece56fa4efb595368bd813 Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Sun, 2 Nov 2025 09:30:27 +0800 Subject: [PATCH 07/20] fix upcoming years for akru bulan --- resources/js/Akaun/AkruBulan.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/resources/js/Akaun/AkruBulan.vue b/resources/js/Akaun/AkruBulan.vue index f3cc1eb..033f62d 100644 --- a/resources/js/Akaun/AkruBulan.vue +++ b/resources/js/Akaun/AkruBulan.vue @@ -20,8 +20,7 @@
+ +
+ @if (sizeof($wakil) != 0) + + + + + + + + + + + + + + +
Maklumat Pelanggan
Nama:{{ $customers_info['nama'] }}
No K/P: + @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp +
+ @endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Baki Pembiayaan: RM {{ number_format($gadai['bakipjm'], 2) }}
Keuntungan: RM {{ number_format($transaction_tebus['onepercent'], 2) }}
(-) Rebat Untung: RM + {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} +
Lain-Lain Caj: RM {{ number_format($transaction_tebus['ujrah'], 2) }}
(-) Rebat Lain-Lain Caj: RM + {{ number_format(($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }}
Jumlah Bayaran: RM + {{ number_format($transaction_tebus['duit_masuk'], 2) }}
+
+ + + + +
Marhun: {{ $gadai['marhun'] }}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
.................................................... .................................................... ....................................................
Teller{{ sizeof($wakil) != 0 ? 'Wakil' : 'Pelanggan' }}Khazanah
{{ Auth::user()->name }}{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} {{ $khazanah_user->name }}
+
+ + + +
+
+ User Image + User Image +
+
+ + {{ $cawangan_info["details_caw"] }} (arOS V2) + +
+
+ UNTUK KEGUNAAN PEJABAT +
+
+
+
+
T
+ + + @if (sizeof($wakil) != 0) + + + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + + + + + + + + + + + + + + + + + @else + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction_tebus['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + + + + + + + + + + @endif +
Nama Wakil:{{ $wakil['nama'] }} No SAG: {{ $gadai['norujukan'] }}
No K/P Wakil:{{ $wakil['nokp'] }} Tarikh Bayar: @php + $time = new DateTime($penebusan['t_tebus']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
No Telefon:{{ $wakil['telefon'] }} Masa Bayaran : {{ $masa }}
Alamat :{{ $wakil['alamat1'] }} Tempoh Simpan: {{ $gadai['tempoh'] }}
No Wakil:{{ sizeof($surat_wakil) == 0 ? '-' : $surat_wakil['no_surat'] }}
Nama: {{ $customers_info['nama'] }} No SAG: {{ $gadai['norujukan'] }}
No K/P : @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp Tarikh Bayar: @php + $time = new DateTime($penebusan['t_tebus']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
Masa Bayaran: {{ $masa }}
Tempoh Simpan: {{ $gadai['tempoh'] }}
+
+ + +
+ @if (sizeof($wakil) != 0) + + + + + + + + + + + + + + +
Maklumat Pelanggan
Nama:{{ $customers_info['nama'] }}
No K/P: + @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp +
+ @endif + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Baki Pembiayaan: RM {{ number_format($gadai['bakipjm'], 2) }}
Keuntungan: RM {{ number_format($transaction_tebus['onepercent'], 2) }}
(-) Rebat Untung: RM + {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} +
Lain-Lain Caj: RM {{ number_format($transaction_tebus['ujrah'], 2) }}
(-) Rebat Lain-Lain Caj: RM + {{ number_format($($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }}
Jumlah Bayaran: RM + {{ number_format($transaction_tebus['duit_masuk'], 2) }}
+
+ + + + + +
Marhun: {{ $gadai['marhun'] }}
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
.................................................... .................................................... ....................................................
Teller{{ sizeof($wakil) != 0 ? 'Wakil' : 'Pelanggan' }}Khazanah
{{ $transaction_tebus['teller'] }}{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }}{{ $khazanah_user->name }}
+ + + + + + + + + + + + + +
Duit Pelanggan: RM {{ number_format($transaction_tebus['duitpelanggan'], 2) }}
Jumlah Perlu Dibayar: RM {{ number_format($transaction_tebus['duit_masuk'], 2) }}
Baki: RM {{ number_format($transaction_tebus['bakipelanggan'], 2) }}
+ + + + + + + + + + +
.................................................... .................................................... .................................................... ....................................................
+ From d9f302e7bfb623f227f570dbd01b78a44c2e66b7 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Mon, 24 Nov 2025 10:01:32 +0800 Subject: [PATCH 09/20] fix semula nama teller --- resources/views/resit/resittebus_ujrah.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/resit/resittebus_ujrah.blade.php b/resources/views/resit/resittebus_ujrah.blade.php index 31d2539..845c742 100644 --- a/resources/views/resit/resittebus_ujrah.blade.php +++ b/resources/views/resit/resittebus_ujrah.blade.php @@ -915,7 +915,7 @@ - {{ $transaction_tebus['teller'] }} + {{ Auth::user()->name }} {{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} From c70d428ae18b8cf8764331ee5ac0d829b84519b6 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Tue, 25 Nov 2025 09:25:44 +0800 Subject: [PATCH 10/20] resit ansuran --- app/Http/Controllers/ResitController.php | 19 +- .../views/resit/resitansuran_ujrah.blade.php | 705 ++++++++++++++++++ 2 files changed, 720 insertions(+), 4 deletions(-) create mode 100644 resources/views/resit/resitansuran_ujrah.blade.php diff --git a/app/Http/Controllers/ResitController.php b/app/Http/Controllers/ResitController.php index 75cbe3a..00a22d1 100644 --- a/app/Http/Controllers/ResitController.php +++ b/app/Http/Controllers/ResitController.php @@ -18,11 +18,13 @@ class ResitController extends Controller public function resit($id) { - + $auth_user = Auth::user(); $totaltransaction = 0; $transaction = Http::get(config('api.url') . '/api/transaction/id/'. $id)->json(); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + if(sizeof($transaction) != 0) $transaction = $transaction[0]; @@ -33,7 +35,14 @@ class ResitController extends Controller $customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json(); - return view('resit.resitansuran',compact('transaction','gadai','customers_info')); + $wakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getwakil/' . $auth_user['cawangan'] . '/code/' . $transaction['nowakil'])->json(); + + if($gadai['tagbaru'] == 1){ + return view('resit.resitansuran_ujrah',compact('transaction','gadai','customers_info')); + + }else{ + return view('resit.resitansuran',compact('transaction','gadai','customers_info')); + } } public function resittebusseparuh($id) @@ -151,10 +160,12 @@ class ResitController extends Controller $transaction_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/one/'. $id)->json(); - $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); + // $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); + $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'] ?? 'dummy_cawangan')->select('name')->first() ?? (object) ['name' => 'Dummy User']; + if($gadai['tagbaru'] == 1){ - return view('print.resittebus_ujrah',compact('surat_wakil','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); + return view('resit.resittebus_ujrah',compact('surat_wakil','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); }else{ return view('resit.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); diff --git a/resources/views/resit/resitansuran_ujrah.blade.php b/resources/views/resit/resitansuran_ujrah.blade.php new file mode 100644 index 0000000..1fbf275 --- /dev/null +++ b/resources/views/resit/resitansuran_ujrah.blade.php @@ -0,0 +1,705 @@ + + + + + + + + + + + + + + +
+ +
+ KOPKB Logo + ARRAHN Logo +
+ + +
+ + {{ $cawangan_info["details_caw"] }} + +
+ + +
+ UNTUK KEGUNAAN PELANGGAN +
+
+
+
+
A
+ + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + +
Nama: {{ $customers_info['nama'] }} No SAG: {{ $transaction['norujukan'] }}
No K/P : @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp Tarikh Bayar: @php + $time = new DateTime($transaction['created_at']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
Masa Bayaran: {{ $masa }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $jumlah_perlu_dibayar = $transaction['bayaran_pembiayaan'] + $transaction['bayaran_keuntungan'] + $transaction['ujrah']; + @endphp + + +
Ansuran Pembiayaan: RM {{ number_format($transaction['bayaran_pembiayaan'], 2) }}
Keuntungan: RM {{ number_format($transaction['onepercent'], 2) }}
Lain-Lain Caj: RM {{ number_format($transaction['ujrah'], 2) }}
Jumlah Bayaran: RM {{ number_format($transaction['duit_masuk'], 2) }}
+ {{-- + + + +
Marhun: {{ $gadai['marhun'] }}
--}} +
+ + + + + + + + + + + + + + + + + + +
.................................................... ....................................................
PelangganTeller
{{ $customers_info['nama'] }}{{ Auth::user()->name }}
+
+ + +
+
+ User Image + User Image +
+
+ + {{ $cawangan_info["details_caw"] }} (arOS V2) + +
+
+ UNTUK KEGUNAAN PEJABAT +
+
+
+
+
A
+ + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $masa_bayaran = strtotime($transaction['tarikh_bayaran']); + $masa = date('H:i:s', $masa_bayaran); + @endphp + + +
Nama: {{ $customers_info['nama'] }} No SAG: {{ $transaction['norujukan'] }}
No K/P : @php + if ($customers_info['kpbaru'] == '') { + echo $customers_info['kplama']; + } else { + echo $customers_info['kpbaru']; + } + @endphp Tarikh Bayar: @php + $time = new DateTime($transaction['created_at']); + $date = $time->format('d/m/Y'); + echo $date; + @endphp
Masa Bayaran: {{ $masa }}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $jumlah_perlu_dibayar = $transaction['bayaran_pembiayaan'] + $transaction['bayaran_keuntungan'] + $transaction['ujrah']; + @endphp + + +
Ansuran Pembiayaan: RM {{ number_format($transaction['bayaran_pembiayaan'], 2) }}
Keuntungan: RM {{ number_format($transaction['onepercent'], 2) }}
Lain-Lain Caj: RM {{ number_format($transaction['ujrah'], 2) }}
Jumlah Bayaran: RM {{ number_format($transaction['duit_masuk'], 2) }}
+ {{-- + + + +
Marhun: {{ $gadai['marhun'] }}
--}} +
+ + + + + + + + + + + + + + + + + + +
.................................................... ....................................................
PelangganTeller
{{ $customers_info['nama'] }}{{ Auth::user()->name }}
+ + + + + + + + + + + + + +
Duit Pelanggan: RM {{ number_format($transaction['duitpelanggan'], 2) }}
Jumlah Perlu Dibayar: RM {{ number_format($transaction['duit_masuk'], 2) }}
Baki: RM {{ number_format($transaction['bakipelanggan'], 2) }}
+ + + + + + + + + + +
.................................................... .................................................... .................................................... ....................................................
+ From 5521b6053ba385021722684d1ec09d05bbb3b0ef Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Tue, 25 Nov 2025 09:29:37 +0800 Subject: [PATCH 11/20] remove api khazanah --- app/Http/Controllers/ResitController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/Http/Controllers/ResitController.php b/app/Http/Controllers/ResitController.php index 00a22d1..0472600 100644 --- a/app/Http/Controllers/ResitController.php +++ b/app/Http/Controllers/ResitController.php @@ -160,9 +160,7 @@ class ResitController extends Controller $transaction_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/one/'. $id)->json(); - // $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); - $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'] ?? 'dummy_cawangan')->select('name')->first() ?? (object) ['name' => 'Dummy User']; - + $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); if($gadai['tagbaru'] == 1){ return view('resit.resittebus_ujrah',compact('surat_wakil','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); From 53038b358d8b0d43dc835cf6251eb656e0f75205 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 26 Nov 2025 15:54:26 +0800 Subject: [PATCH 12/20] Bug fixes were applied to receipt A and T for both non-ujrah and ujrah --- app/Http/Controllers/ResitController.php | 15 ++++--- resources/views/resit/resitansuran.blade.php | 17 ++++--- .../views/resit/resitansuran_ujrah.blade.php | 10 ++--- resources/views/resit/resittebus.blade.php | 4 +- .../views/resit/resittebus_ujrah.blade.php | 45 +++++++++---------- 5 files changed, 43 insertions(+), 48 deletions(-) diff --git a/app/Http/Controllers/ResitController.php b/app/Http/Controllers/ResitController.php index 0472600..de1a507 100644 --- a/app/Http/Controllers/ResitController.php +++ b/app/Http/Controllers/ResitController.php @@ -23,8 +23,6 @@ class ResitController extends Controller $transaction = Http::get(config('api.url') . '/api/transaction/id/'. $id)->json(); - $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - if(sizeof($transaction) != 0) $transaction = $transaction[0]; @@ -35,13 +33,15 @@ class ResitController extends Controller $customers_info = Http::get(config('api.url') . '/api/customers/'. $gadai['nokp'])->json(); + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/' . $gadai['kodcaw'])->json(); + $wakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/getwakil/' . $auth_user['cawangan'] . '/code/' . $transaction['nowakil'])->json(); if($gadai['tagbaru'] == 1){ - return view('resit.resitansuran_ujrah',compact('transaction','gadai','customers_info')); + return view('resit.resitansuran_ujrah',compact('transaction','gadai','customers_info','cawangan_info','wakil')); }else{ - return view('resit.resitansuran',compact('transaction','gadai','customers_info')); + return view('resit.resitansuran',compact('transaction','gadai','customers_info','cawangan_info','wakil')); } } @@ -136,6 +136,8 @@ class ResitController extends Controller $transaction = Http::get(config('api.url') . '/api/transaction/'. $id)->json(); + $transaction_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/one/'. $id)->json(); + foreach($transaction as $trans) { $totaltransaction += $trans['duit_masuk']; @@ -152,6 +154,7 @@ class ResitController extends Controller $totalBayaranAnsuran = Http::get(config('api.url') . '/api/transaction/norujukan/total/ansuran',['norujukan'=>$id])->json(); + $totalrebate = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/reports/totalrebate',['norujukan'=>$id])->json(); $surat_wakil = []; if(sizeof($wakil) != 0) { $wakil = $wakil[0]; @@ -163,10 +166,10 @@ class ResitController extends Controller $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); if($gadai['tagbaru'] == 1){ - return view('resit.resittebus_ujrah',compact('surat_wakil','transaction_tebus', 'transaction','gadai','cawangan_info','customers_info','wakil','totaltransaction','totalBayaranAnsuran', 'khazanah_user')); + return view('resit.resittebus_ujrah',compact('transaction','transaction_tebus','totalrebate','khazanah_user','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); }else{ - return view('resit.resittebus',compact('transaction','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); + return view('resit.resittebus',compact('transaction','transaction_tebus','totalrebate','khazanah_user','gadai','cawangan_info','customers_info','penebusan','wakil','totaltransaction','totalBayaranAnsuran')); } } diff --git a/resources/views/resit/resitansuran.blade.php b/resources/views/resit/resitansuran.blade.php index cea6591..05b7010 100644 --- a/resources/views/resit/resitansuran.blade.php +++ b/resources/views/resit/resitansuran.blade.php @@ -440,14 +440,13 @@ hr.new5 { -DiSemak - - Cagaran Di Keluarkan - - Cagaran Diterima - - Ar-Rahn
{{ Auth::user()->name }} - + DiSemak + + Cagaran Di Keluarkan + + Cagaran Diterima + + Ar-Rahn
{{ optional(Auth::user())->name ?? '' }} @@ -549,7 +548,7 @@ hr.new5 { Cagaran Diterima - Ar-Rahn
{{ Auth::user()->name }} + Ar-Rahn
{{ optional(Auth::user())->name ?? '' }} diff --git a/resources/views/resit/resitansuran_ujrah.blade.php b/resources/views/resit/resitansuran_ujrah.blade.php index 1fbf275..6994440 100644 --- a/resources/views/resit/resitansuran_ujrah.blade.php +++ b/resources/views/resit/resitansuran_ujrah.blade.php @@ -546,12 +546,11 @@ Teller - - + {{-- {{ $customers_info['nama'] }} {{ Auth::user()->name }} - + --}}
@@ -670,12 +669,11 @@ Teller - - + {{-- {{ $customers_info['nama'] }} {{ Auth::user()->name }} - + --}} diff --git a/resources/views/resit/resittebus.blade.php b/resources/views/resit/resittebus.blade.php index 9030924..aa53475 100644 --- a/resources/views/resit/resittebus.blade.php +++ b/resources/views/resit/resittebus.blade.php @@ -473,7 +473,7 @@ hr.new5 { - + @@ -575,7 +575,7 @@ hr.new5 { - + diff --git a/resources/views/resit/resittebus_ujrah.blade.php b/resources/views/resit/resittebus_ujrah.blade.php index 845c742..9b2a1bc 100644 --- a/resources/views/resit/resittebus_ujrah.blade.php +++ b/resources/views/resit/resittebus_ujrah.blade.php @@ -629,22 +629,22 @@ - + - + + {{ number_format($totalrebate['ujrah'], 2) }} @@ -683,17 +683,14 @@ - - + {{-- --}} + {{-- --}} - - - - - - - - + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} {{-- --}} + {{-- --}}
Cagaran Diterima Ar-Rahn
{{ Auth::user()->name }}
Ar-Rahn
{{ optional(Auth::user())->name ?? '' }}
Cagaran Diterima Ar-Rahn
{{ Auth::user()->name }}
Ar-Rahn
{{ optional(Auth::user())->name ?? '' }}
Keuntungan: RM {{ number_format($transaction_tebus['onepercent'], 2) }}: RM {{ number_format($penebusan['onepercent'], 2) }}
(-) Rebat Untung : RM - {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} + {{ number_format($totalrebate['onepercent'], 2) }}
Lain-Lain Caj: RM {{ number_format($transaction_tebus['ujrah'], 2) }} : RM {{ number_format($penebusan['ujrah'], 2) }}
(-) Rebat Lain-Lain Caj : RM - {{ number_format(($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }}
Khazanah
{{ Auth::user()->name }}
{{ Auth::user()->name }}{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} {{ $khazanah_user->name }}
{{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} {{ $khazanah_user->name }}{{ $khazanah_user->name ?? '' }}

@@ -859,22 +856,22 @@ Keuntungan - : RM {{ number_format($transaction_tebus['onepercent'], 2) }} + : RM {{ number_format($penebusan['onepercent'], 2) }} (-) Rebat Untung : RM - {{ number_format(($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet']), 2) }} + {{ number_format($totalrebate['onepercent'], 2) }} Lain-Lain Caj - : RM {{ number_format($transaction_tebus['ujrah'], 2) }} + : RM {{ number_format($penebusan['ujrah'], 2) }} (-) Rebat Lain-Lain Caj : RM - {{ number_format($($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 2) }} + {{ number_format($totalrebate['ujrah'], 2) }} @@ -914,16 +911,14 @@ Khazanah - + {{-- {{ Auth::user()->name }} {{ sizeof($wakil) != 0 ? $wakil['nama'] : $customers_info['nama'] }} - - {{ $khazanah_user->name }} - - - - + --}} + {{-- {{ $khazanah_user->name }} --}} + {{-- {{ $khazanah_user->name ?? '-' }} + --}} From 99ddf75543b049a1451236ca1aa5d4fa10c6c263 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 26 Nov 2025 16:30:39 +0800 Subject: [PATCH 13/20] changes images --- resources/views/resit/resitansuran_ujrah.blade.php | 5 ++--- resources/views/resit/resittebus_ujrah.blade.php | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/resources/views/resit/resitansuran_ujrah.blade.php b/resources/views/resit/resitansuran_ujrah.blade.php index 6994440..d8de948 100644 --- a/resources/views/resit/resitansuran_ujrah.blade.php +++ b/resources/views/resit/resitansuran_ujrah.blade.php @@ -432,7 +432,7 @@
- KOPKB Logo + KOPKB Logo ARRAHN Logo
@@ -557,8 +557,7 @@
- User Image + User Image User Image
diff --git a/resources/views/resit/resittebus_ujrah.blade.php b/resources/views/resit/resittebus_ujrah.blade.php index 9b2a1bc..17dbd6d 100644 --- a/resources/views/resit/resittebus_ujrah.blade.php +++ b/resources/views/resit/resittebus_ujrah.blade.php @@ -466,7 +466,7 @@
- KOPKB Logo + KOPKB Logo ARRAHN Logo
@@ -698,8 +698,7 @@
- User Image + User Image User Image
From 9cf010b7ea38972e329898e906be8aaaeca3ea8a Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Sun, 30 Nov 2025 11:02:54 +0800 Subject: [PATCH 14/20] fix utk kiraan resit --- app/Http/Controllers/ResitController.php | 4 +++- resources/views/resit/resittebus_ujrah.blade.php | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Http/Controllers/ResitController.php b/app/Http/Controllers/ResitController.php index de1a507..9482f08 100644 --- a/app/Http/Controllers/ResitController.php +++ b/app/Http/Controllers/ResitController.php @@ -154,7 +154,8 @@ class ResitController extends Controller $totalBayaranAnsuran = Http::get(config('api.url') . '/api/transaction/norujukan/total/ansuran',['norujukan'=>$id])->json(); - $totalrebate = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/reports/totalrebate',['norujukan'=>$id])->json(); + // $totalrebate = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/reports/totalrebate',['norujukan'=>$id])->json(); + $surat_wakil = []; if(sizeof($wakil) != 0) { $wakil = $wakil[0]; @@ -162,6 +163,7 @@ class ResitController extends Controller } $transaction_tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/transaction/one/'. $id)->json(); + $totalrebate = ['ujrah' => ($transaction_tebus['ujrah'] - $transaction_tebus['ujrah_rebet']), 'onepercent' => ($transaction_tebus['onepercent'] - $transaction_tebus['onepercent_rebet'])]; $khazanah_user = User::where('role_harian', 'khazanah')->where('cawangan', $auth_user['cawangan'])->select('name')->first(); diff --git a/resources/views/resit/resittebus_ujrah.blade.php b/resources/views/resit/resittebus_ujrah.blade.php index 17dbd6d..0df9d07 100644 --- a/resources/views/resit/resittebus_ujrah.blade.php +++ b/resources/views/resit/resittebus_ujrah.blade.php @@ -629,7 +629,7 @@ Keuntungan - : RM {{ number_format($penebusan['onepercent'], 2) }} + : RM {{ number_format($transaction_tebus['onepercent'], 2) }} (-) Rebat Untung @@ -639,7 +639,7 @@ Lain-Lain Caj - : RM {{ number_format($penebusan['ujrah'], 2) }} + : RM {{ number_format($transaction_tebus['ujrah'], 2) }} (-) Rebat Lain-Lain Caj @@ -855,7 +855,7 @@ Keuntungan - : RM {{ number_format($penebusan['onepercent'], 2) }} + : RM {{ number_format($transaction_tebus['onepercent'], 2) }} (-) Rebat Untung @@ -865,7 +865,7 @@ Lain-Lain Caj - : RM {{ number_format($penebusan['ujrah'], 2) }} + : RM {{ number_format($transaction_tebus['ujrah'], 2) }} (-) Rebat Lain-Lain Caj From 554d5707106d9d022b1a3e52d63b4d4187cb8ecc Mon Sep 17 00:00:00 2001 From: Cyclone Date: Sat, 29 Nov 2025 22:12:39 +0800 Subject: [PATCH 15/20] added account-statements for specific norujukan --- .../AccountStatementController.php | 66 ++++ resources/views/accounts-statements.blade.php | 373 ++++++++++++++++++ routes/web.php | 55 +++ 3 files changed, 494 insertions(+) create mode 100644 app/Http/Controllers/AccountStatementController.php create mode 100644 resources/views/accounts-statements.blade.php diff --git a/app/Http/Controllers/AccountStatementController.php b/app/Http/Controllers/AccountStatementController.php new file mode 100644 index 0000000..a8a1685 --- /dev/null +++ b/app/Http/Controllers/AccountStatementController.php @@ -0,0 +1,66 @@ +json()[0][0]; + $transaction = Http::get(config('api.url').'/portal/transaksipelanggan',['norujukan' => 'KB2240919-0004'])->json(); + $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'. $gadaian['kodcaw'])->json()[0]; + $customer = Http::get(config('api.url') . '/api/customers/' . $gadaian['nokp'])->json(); + $poskod = Http::get(config('api.url') . '/api/poskod/' . $customer['poskod'])->json(); + + $accountHolder = [ + 'name' => $customer['nama'], + 'address' => $customer['alamat1'] . '
' . $customer['alamat2'], + 'city_state_zip' => $customer['poskod'] . ', ' . $poskod['daerah']['namadaerah'] . ', ' . $poskod['negeri']['negeri'], + ]; + + + $bankDetails = [ + 'name' => 'PERMODALAN KELANTAN BERHAD', + 'address' => $cawangan['alamat1'] . '
' . $cawangan['alamat2'], + 'email' => 'firstcitizensbank@domain.com', + 'branch' => $cawangan['namacaw'], + ]; + + + // Calculate total pages (e.g., 10 transactions per page + one row for header/footer on page 1) + // This is a rough estimate; the Blade file will handle the actual print pagination using CSS. + + $transaction_count = count(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'A')); + $totalPages = ceil($transaction_count / 10); + + $ansuranTransaction = array_values(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'A')); + $originLoan = $gadaian['pinjaman']; + $bakipinjaman = $originLoan; + $ansuranTransaction = array_map(function($trans) use(&$bakipinjaman) { + $bakipinjaman -= $trans['bayaran_pembiayaan']; + return array_merge($trans, ['bakipinjaman' => $bakipinjaman]); + }, $ansuranTransaction); + + $tebusTransaction = array_values(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'T'))[0]; + + + + return view('accounts-statements', compact('tebusTransaction','ansuranTransaction','transaction_count','gadaian','transaction','accountHolder', 'bankDetails')); + } + + /** + * Helper function to format currency. + * In a real app, this would be a Blade helper or filter. + * We'll format it directly in the view for simplicity in this example. + */ +} \ No newline at end of file diff --git a/resources/views/accounts-statements.blade.php b/resources/views/accounts-statements.blade.php new file mode 100644 index 0000000..8c4907d --- /dev/null +++ b/resources/views/accounts-statements.blade.php @@ -0,0 +1,373 @@ + + + + + + + Bank Statement - {{ $bankDetails['name'] }} + + + + + + + + @php + // Helper function to format currency for the template + function formatCurrency($amount) + { + return is_numeric($amount) ? 'RM ' . number_format($amount, 2) : '-'; + } + @endphp + +
+ + +
+
+

{{ $bankDetails['name'] }} +

+

{!! $bankDetails['address'] !!}

+
+
+
{{ $gadaian['norujukan'] }}
+
+ IC: + {{ $gadaian['nokp'] }} + + Tarikh Pembiayaan: + {{ $gadaian['t_gadai'] }} + + Tempoh Pembiayaan: + {{ $gadaian['tempoh'] }} +
+
+
+ + +
+ +
+

{{ $accountHolder['name'] }}

+

{!! $accountHolder['address'] !!}

+

{{ $accountHolder['city_state_zip'] }}

+
+ +
+

{{ $bankDetails['branch'] }}

+

Page 1 of 1

+
+
+ + +
+

Ringkasan Pembiayaan

+
+ +
+
Pembiayaan:
+
{{ formatCurrency($gadaian['pinjaman']) }} +
+
+
+
Nilai Marhun:
+
{{ formatCurrency($gadaian['nilaimarhun']) }}
+
+
+
+
1 Percent:
+
{{ formatCurrency($gadaian['ujrah']) }}
+
Ujrah:
+
{{ formatCurrency($gadaian['onepercent']) }}
+
+
+
Keuntungan:
+
{{ formatCurrency($gadaian['ujrah'] + $gadaian['onepercent']) }}
+
+ +
+ + +
+
Harga Jualan:
+
{{ formatCurrency($gadaian['hargajualan']) }}
+
+
+
Jumlah Transaksi:
+
{{ $transaction_count }}
+
+
+
Harga Tebus:
+
{{ formatCurrency($tebusTransaction['duit_masuk']) }} +
+
+
+
+ + +
+

Transaksi

+ + + + + + + + + + + + + + + + @php $totalUpah = 0; $totalBayaran = 0; $totalPembiayaan = 0; $totalRebet = 0; @endphp + @foreach ($ansuranTransaction as $transaction) + + + + + + + + + + + @php $totalUpah += $transaction['bayaran_keuntungan']; $totalBayaran += $transaction['duit_masuk']; $totalPembiayaan += $transaction['bayaran_pembiayaan']; $totalRebet += ($transaction['bayaran_keuntungan'] - $transaction['keuntungan_rebet']);@endphp + @endforeach + + + + + + + + + + +
TarikhDeskripsiTempohBayaranUpahPembiayaanRebetBaki
{{ date('d/m/Y', strtotime($transaction['created_at'])) }}{{ ($transaction['teller'] == 'Online') ? 'Bayaran Online' : 'Bayaran Kaunter' }} + {{ $transaction['beza_tempoh'] }} + + @if ($transaction['duit_masuk']) + {{ formatCurrency($transaction['duit_masuk']) }} + @else + - + @endif + + @if ($transaction['bayaran_keuntungan']) + {{ formatCurrency($transaction['bayaran_keuntungan']) }} + @else + - + @endif + + @if ($transaction['bayaran_pembiayaan']) + {{ formatCurrency($transaction['bayaran_pembiayaan']) }} + @else + - + @endif + + {{ formatCurrency($transaction['bayaran_keuntungan'] - $transaction['keuntungan_rebet']) }} + + {{ formatCurrency($transaction['bakipinjaman']) }} +
Jumlah: + {{ formatCurrency($totalBayaran) }} + {{ formatCurrency($totalUpah) }} + {{ formatCurrency($totalPembiayaan) }} + {{ formatCurrency($totalRebet) }} +
+
+ +
+
+

+ SEMAKAN TERAKHIR

+
+ +
+
+
JUMLAH
+ + {{-- Beginning Balance --}} +
Baki Pembiayaan
+
+ {{ formatCurrency($tebusTransaction['bayaran_pembiayaan']) }} +
+ + {{-- Deposits and Additions --}} +
Keuntungan 1%
+
+ {{ formatCurrency($tebusTransaction['onepercent']) }} +
+ + {{-- ATM & Debit Card Withdrawals --}} +
Rebet Keuntungan 1%
+
+ {{ formatCurrency($tebusTransaction['onepercent'] - $tebusTransaction['onepercent_rebet']) }} +
+ + {{-- Deposits and Additions --}} +
Ujrah
+
+ {{ formatCurrency($tebusTransaction['ujrah']) }} +
+ + {{-- ATM & Debit Card Withdrawals --}} +
Rebet Ujrah
+
+ {{ formatCurrency($tebusTransaction['ujrah'] - $tebusTransaction['ujrah_rebet']) }} +
+ + {{-- +
Ujrah
+
+ + -122.50 +
--}} + + {{-- Separator Line (Visual emphasis for Ending Balance calculation) --}} +
+ + {{-- Ending Balance --}} +
Jumlah Bayaran
+
+ {{ formatCurrency($tebusTransaction['duit_masuk']) }} +
+
+
+ + +
+

Ini ialah penyata akaun yang dijana secara automatik. Sila hubungi kami untuk sebarang percanggahan

+
+
+ + +
+ +
+ + + + diff --git a/routes/web.php b/routes/web.php index ca34b4a..ec481b0 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6,6 +6,7 @@ use App\Http\Controllers\OnlineTransactionController; use App\Http\Controllers\OnlineTransactionGadaianController; use App\Http\Controllers\OnlineTransactionLogController; use App\Http\Controllers\OnlineTransactionTrailController; +use App\Http\Controllers\AccountStatementController; use App\Http\Controllers\AutoSerahanController; use App\Http\Controllers\SimulasiWTDController; use App\Http\Controllers\WTDController; @@ -219,6 +220,60 @@ Route::get('/autoserahan/reject', [AutoSerahanController::class,'reject'])->nam Route::get('/autoserahan/list', [AutoSerahanController::class,'getList'])->name('autoserahan.get'); Route::get('/autoserahan/rekod', [AutoSerahanController::class,'record'])->name('autoserahan.rekod'); +//Account Statements + +Route::get('/autoserahan/rekod', [AutoSerahanController::class,'record'])->name('autoserahan.rekod'); + +Route::get('/accounts/statements', [AccountStatementController::class,'showStatement'])->name('accountstatement.rekod'); +// Route::get('/accounts', function () { + + + +// $accountHolder = [ +// 'name' => 'John Smith', +// 'address' => '2450 Courage St, STE 108', +// 'city_state_zip' => 'Brownsville, TX 78521', +// ]; + +// $bankDetails = [ +// 'name' => 'PERMODALAN KELANTAN BERHAD', +// 'address' => '231 Valley Farms Street Santa Monica, CA 90403', +// 'email' => 'firstcitizensbank@domain.com', +// 'branch' => 'Main Branch - Santa Monica', +// 'account_number' => '111-234-567-890', +// 'statement_date' => '10/31/2025', +// 'period_covered' => '10/01/2025 to 10/31/2025', +// ]; + +// $summary = [ +// 'opening_balance' => 175800.00, +// 'total_credit' => 510000.00, +// 'total_debit' => 94000.00, +// 'closing_balance' => 591800.00, +// 'account_type' => 'Current Account', +// 'transaction_count' => 8, +// ]; + +// $transactions = [ +// // Note: The PDF format has Debit/Credit columns reversed in some tools, +// // but standard accounting puts Credits first. We'll follow the PDF logic +// // where amounts are placed under the correct column (Credit or Debit). +// ['date' => '10/02/2025', 'description' => 'Payment - Credit Card', 'credit' => null, 'debit' => 5400.00, 'balance' => 170400.00], +// ['date' => '10/03/2025', 'description' => 'Payment - Insurance', 'credit' => null, 'debit' => 3000.00, 'balance' => 167400.00], +// ['date' => '10/05/2025', 'description' => 'Account Transfer In', 'credit' => 500000.00, 'debit' => null, 'balance' => 667400.00], +// ['date' => '10/10/2025', 'description' => 'Cheque Deposit', 'credit' => 10000.00, 'debit' => null, 'balance' => 677400.00], +// ['date' => '10/15/2025', 'description' => 'Payment - Electricity', 'credit' => null, 'debit' => 1500.00, 'balance' => 675900.00], +// ['date' => '10/20/2025', 'description' => 'Payment - Water Utility', 'credit' => null, 'debit' => 600.00, 'balance' => 675300.00], +// ['date' => '10/25/2025', 'description' => 'Payment - Car Loan', 'credit' => null, 'debit' => 3500.00, 'balance' => 671800.00], +// ['date' => '10/30/2025', 'description' => 'Account Transfer Out', 'credit' => null, 'debit' => 80000.00, 'balance' => 591800.00], +// ]; + + + +// return view('accounts-statements', compact('accountHolder', 'bankDetails', 'summary', 'transactions')); +// }); + + Route::get('{any}', function () { return view('home'); })->where('any','.*'); From 863388ac6aa83db7dadf09a0d80f2b1e84a9f2eb Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Mon, 1 Dec 2025 19:49:00 +0800 Subject: [PATCH 16/20] fix A4 printed cut out and added gadaian --- .../AccountStatementController.php | 15 +- resources/views/accounts-statements.blade.php | 266 +++++++++++++----- 2 files changed, 200 insertions(+), 81 deletions(-) diff --git a/app/Http/Controllers/AccountStatementController.php b/app/Http/Controllers/AccountStatementController.php index a8a1685..f081da1 100644 --- a/app/Http/Controllers/AccountStatementController.php +++ b/app/Http/Controllers/AccountStatementController.php @@ -14,10 +14,8 @@ class AccountStatementController extends Controller */ public function showStatement(Request $request) { - - - $gadaian = Http::get(config('api.url').'/api/gadai/norujukan/'.'KB2240919-0004')->json()[0][0]; - $transaction = Http::get(config('api.url').'/portal/transaksipelanggan',['norujukan' => 'KB2240919-0004'])->json(); + $gadaian = Http::get(config('api.url').'/api/gadai/norujukan/'.$request->norujukan)->json()[0][0]; + $transaction = Http::get(config('api.url').'/portal/transaksipelanggan',['norujukan' => $request->norujukan])->json(); $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'. $gadaian['kodcaw'])->json()[0]; $customer = Http::get(config('api.url') . '/api/customers/' . $gadaian['nokp'])->json(); $poskod = Http::get(config('api.url') . '/api/poskod/' . $customer['poskod'])->json(); @@ -28,17 +26,12 @@ class AccountStatementController extends Controller 'city_state_zip' => $customer['poskod'] . ', ' . $poskod['daerah']['namadaerah'] . ', ' . $poskod['negeri']['negeri'], ]; - $bankDetails = [ - 'name' => 'PERMODALAN KELANTAN BERHAD', + 'name' => $cawangan['cawangan'], 'address' => $cawangan['alamat1'] . '
' . $cawangan['alamat2'], - 'email' => 'firstcitizensbank@domain.com', 'branch' => $cawangan['namacaw'], ]; - - // Calculate total pages (e.g., 10 transactions per page + one row for header/footer on page 1) - // This is a rough estimate; the Blade file will handle the actual print pagination using CSS. $transaction_count = count(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'A')); $totalPages = ceil($transaction_count / 10); @@ -53,8 +46,6 @@ class AccountStatementController extends Controller $tebusTransaction = array_values(array_filter($transaction, fn($trans) => $trans['trans_type'] == 'T'))[0]; - - return view('accounts-statements', compact('tebusTransaction','ansuranTransaction','transaction_count','gadaian','transaction','accountHolder', 'bankDetails')); } diff --git a/resources/views/accounts-statements.blade.php b/resources/views/accounts-statements.blade.php index 8c4907d..9a71036 100644 --- a/resources/views/accounts-statements.blade.php +++ b/resources/views/accounts-statements.blade.php @@ -4,7 +4,7 @@ - Bank Statement - {{ $bankDetails['name'] }} + Account Statements - {{ $bankDetails['name'] }}