From 19b5f5ea1741e1b3796a5b9660918ec4f4840fa2 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 16 Jul 2025 12:03:23 +0800 Subject: [PATCH 01/79] laporan barang kes --- app/Http/Controllers/AkaunController.php | 49 +++ resources/js/Akaun/Barangkes.vue | 120 +++++++ resources/js/Akaun/Home.vue | 5 + .../js/components/util/BarangkesModal.vue | 187 +++++++++++ resources/js/pages/Barangkes.vue | 100 ++++++ resources/js/routes.js | 2 + .../views/akaun/laporan_brgkes.blade.php | 308 ++++++++++++++++++ resources/views/pelanggan/barangkes.blade.php | 18 + routes/web.php | 1 + 9 files changed, 790 insertions(+) create mode 100644 resources/js/Akaun/Barangkes.vue create mode 100644 resources/js/components/util/BarangkesModal.vue create mode 100644 resources/js/pages/Barangkes.vue create mode 100644 resources/views/akaun/laporan_brgkes.blade.php create mode 100644 resources/views/pelanggan/barangkes.blade.php diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index 7946316..66fe70f 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -1890,6 +1890,55 @@ class AkaunController extends Controller )); } + public function cetak_laporanbarangkes(Request $request) + { + $api_url = $request->hostname; + // $api_url = ($request->hostname) ? $request->hostname : config('api.url'); + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + + if($request->datemula == null){ + $mula_date = '2017-01-01'; + }else{ + $mula_date = $request->datemula; + } + + if($request->datehingga == null){ + $hingga_date = $current->toDateString(); + }else{ + $hingga_date = $request->datehingga; + } + + $barangkes = Http::get($request->hostname . '/api/barangkes/laporan/', ['kodcaw' => $request->kodcaw,'alasan' => $request->sltalasan,'tarikh_mula' => $mula_date,'tarikh_akhir' => $hingga_date])->json(); + + $palsu = Http::get($request->hostname . '/api/palsu/laporan/', ['kodcaw' => $request->kodcaw,'tarikh_mula' => $mula_date,'tarikh_akhir' => $hingga_date])->json(); + + if (!is_array($palsu)) { + $palsu = []; // utk nak tengok data tubik ke dok + } + + $cawangan_info = Http::get($request->hostname . '/api/cawangan/'. $request->kodcaw)->json(); + $cawangan = Http::get($request->hostname . '/api/cawangan/detail/'. $request->kodcaw)->json(); + $cawangan_detail=$cawangan[0]; + + $hostname = $request->hostname; + + if(isset($request->jenis)) + { + if($request->jenis == 'pdf') + { + $pdf = PDF::loadView('akaun.laporan_brgkes', compact('hostname','palsu','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'))->setPaper('a4', 'potrait'); + return $pdf->download('laporan_brgkes' . $request->kodcaw .'_'. $mula_date .'_'. $hingga_date . '.pdf'); + }else{ + return view('akaun.laporan_brgkes', compact('hostname','palsu','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url')); + } + } + + return view('akaun.laporan_brgkes', compact('hostname','cawangan_detail','mula_date','hingga_date','tarikh_cetak','api_url','palsu')); + + } } diff --git a/resources/js/Akaun/Barangkes.vue b/resources/js/Akaun/Barangkes.vue new file mode 100644 index 0000000..00cb8c7 --- /dev/null +++ b/resources/js/Akaun/Barangkes.vue @@ -0,0 +1,120 @@ + + + \ No newline at end of file diff --git a/resources/js/Akaun/Home.vue b/resources/js/Akaun/Home.vue index 52d9bb7..1d1514d 100644 --- a/resources/js/Akaun/Home.vue +++ b/resources/js/Akaun/Home.vue @@ -185,6 +185,11 @@

Laporan Lelong

+
+ +

Barang Kes

+
+
diff --git a/resources/js/components/util/BarangkesModal.vue b/resources/js/components/util/BarangkesModal.vue new file mode 100644 index 0000000..c3abdad --- /dev/null +++ b/resources/js/components/util/BarangkesModal.vue @@ -0,0 +1,187 @@ + + + + + diff --git a/resources/js/pages/Barangkes.vue b/resources/js/pages/Barangkes.vue new file mode 100644 index 0000000..7ac480d --- /dev/null +++ b/resources/js/pages/Barangkes.vue @@ -0,0 +1,100 @@ + + + diff --git a/resources/js/routes.js b/resources/js/routes.js index eb1fbf0..419eacb 100644 --- a/resources/js/routes.js +++ b/resources/js/routes.js @@ -61,6 +61,7 @@ import AuditPage from './Audit/Audit' import KeuntunganSebenarPage from './Audit/KeuntunganSebenar' import UpahSimpanPage from './Audit/UpahSimpan' import LaporanLelong from './Akaun/LaporanLelong.vue' +import Barangkes from './Akaun/Barangkes.vue' @@ -105,6 +106,7 @@ export default new VueRouter({ { path: '/akaunhome/imbangdugabackup', component: ImbangDugaBackup }, { path: '/akaunhome/saghilang', component: SagHilang }, { path: '/akaunhome/laporanlelong', component: LaporanLelong }, + { path: '/akaunhome/barangkes', component: Barangkes }, diff --git a/resources/views/akaun/laporan_brgkes.blade.php b/resources/views/akaun/laporan_brgkes.blade.php new file mode 100644 index 0000000..bf5b4ce --- /dev/null +++ b/resources/views/akaun/laporan_brgkes.blade.php @@ -0,0 +1,308 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + @php + $api_url = request()->hostname; + @endphp + + @if(Str::contains($api_url, 'apiv3.arrahn')) + + @else + + @endif + + + + + + + + + + + + + + + + + + + + + + + + + + +
LAPORAN BARANG KES(arOSv3)LAPORAN BARANG KES
TARIKH CETAK: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp +
TARIKH:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $mula_date); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp HINGGA:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $hingga_date); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp
+ +
+{{-- + + + + + + + + + + + + + + @foreach($polis as $index=>$sh) + + + + + @php + $noic = Http::withOptions(['verify' => config('app.api_verify')])->get($hostname . '/api/customers/' .$sh['nokp'] )->json(); + @endphp + + + + + + + @php + $koddaerah = Http::withOptions(['verify' => config('app.api_verify')])->get($hostname . '/api/daerah/' .$sh['koddaerah'] )->json(); + $kodnegeri = Http::withOptions(['verify' => config('app.api_verify')])->get($hostname . '/api/negeri/' .$sh['kodnegeri'] )->json(); + @endphp + + + + + + @endforeach +
BilTarikhIC PelangganNama PelangganNorujukanAlasanNilai Marhun(RM)PembiayaanSebulanJumlahMargin
{{ $loop->iteration}} {{ $sh['tarikh'] }} {{ $sh['nokp'] }} {{ $noic['nama'] }} {{ $sh['norujukan'] }} {{ $sh['komen1'] }}{{ number_format($item['nilaimarhun'],2) }}{{ number_format($item['pinjaman'],2) }} {{ $koddaerah['namadaerah'] }} {{ $kodnegeri['negeri'] }} {{ $sh['sttebus'] }} {{ $sh['t_update'] }}
--}} + + + + + + + + + + + + + + + @foreach($palsu as $index => $item) + + + + + + + + + + + + + @endforeach +
BilTarikhNo RujukanNotaPembiayaan (RM)Nilai Marhun (RM)JBGUntung (RM)1% (RM)Caj Lain (RM)
{{ $loop->iteration }}{{ $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) }}
+ +

+ +
+


+ + + + + + + + + + + + + + + + + + + +
.................................................................. .................................................................. ..................................................................
Disediakan Disemak Disahkan
+ + + + + + diff --git a/resources/views/pelanggan/barangkes.blade.php b/resources/views/pelanggan/barangkes.blade.php new file mode 100644 index 0000000..cdb2d67 --- /dev/null +++ b/resources/views/pelanggan/barangkes.blade.php @@ -0,0 +1,18 @@ +@extends('layouts.app') + +@section('content') + +
+
+ +
+ + + + + +
+
+ @include('layouts.footer') +
+@endsection diff --git a/routes/web.php b/routes/web.php index 61c6e1c..64f861c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -131,6 +131,7 @@ Route::get('/akaunhome/cetakpenebusanRangeDate',['as'=>'cetak.penebusanRangeDate Route::get('/akaunhome/imbangdugabackup',['as'=>'cetak.imbangdugabackup','uses'=>'App\Http\Controllers\AkaunController@cetak_imbangdugaharian'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); Route::get('/akaunhome/cetak_saghilang',['as'=>'cetak.saghilang','uses'=>'App\Http\Controllers\AkaunController@cetak_laporansaghilang'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); Route::get('/akaunhome/cetak_laporanlelong',['as'=>'cetak.laporanlelong','uses'=>'App\Http\Controllers\AkaunController@cetak_laporanlelong'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); +Route::get('/akaunhome/cetak_barangkes',['as'=>'cetak.laporanbarangkes','uses'=>'App\Http\Controllers\AkaunController@cetak_laporanbarangkes'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); From 0eb6915d4065403e2664d8dd5667213b903c10b3 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Sun, 27 Jul 2025 15:52:09 +0800 Subject: [PATCH 02/79] fix call api baki lelong --- resources/views/akaun/laporan_tuntutbaki.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/akaun/laporan_tuntutbaki.blade.php b/resources/views/akaun/laporan_tuntutbaki.blade.php index 50785f2..dc3425f 100644 --- a/resources/views/akaun/laporan_tuntutbaki.blade.php +++ b/resources/views/akaun/laporan_tuntutbaki.blade.php @@ -244,8 +244,9 @@ {{ $counter }} @php - - $gadaidetail = Http::get($api_url . '/api/gadai/norujukan/' . $item['norujukan'])->json(); + // $gadaidetail = Http::get($api_url . '/api/gadai/norujukan/' . $item['norujukan'])->json(); - code asal + // $gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/gadai/norujukankodcaw/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); + $gadaidetail = Http::get($api_url . '/api/gadai/norujukankodcaw/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); $customer_detail = Http::get($api_url . '/api/customers/' . $gadaidetail[0][0]['nokp'])->json(); echo $customer_detail['nama']; @endphp From 457ff93fdaaf0da87ed4686a77feb872a425d326 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Mon, 4 Aug 2025 09:33:28 +0800 Subject: [PATCH 03/79] fix seperate laporan ansuran pembiayaan --- app/Http/Controllers/AkaunController.php | 99 ++++++++++++------- resources/js/Akaun/Ansuran.vue | 39 ++++++-- .../views/akaun/laporan_ansuran.blade.php | 27 ++++- 3 files changed, 120 insertions(+), 45 deletions(-) diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index 66fe70f..32e8b26 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -492,7 +492,7 @@ class AkaunController extends Controller return view('akaun.laporan_petibesi', compact('petibesi','cawangan_detail','tarikh_cetak','tebus_date','api_url','hutang')); } - + public function cetaklaporan_laporan_pendserahan(Request $request) { @@ -1656,44 +1656,71 @@ class AkaunController extends Controller } - public function cetakLaporanAnsuranRangeDate(Request $request){ - $api_url = $request->hostname; - $auth_user = Auth::user(); - $current = Carbon::now(); - $current = new Carbon(); - $tarikh_cetak = $current->toDateString(); - - if($request->datemula == null){ - $mula_date = $current->toDateString(); - }else{ - $split_date = explode('-',$request->datemula); - $mula_date = $request->datemula; - } - - if($request->datehingga == null){ - $hingga_date = $current->toDateString(); - }else{ - $split_date2 = explode('-',$request->datehingga); - $hingga_date = $request->datehingga; - } - $request->hostname = config('app.env') == 'production' ? 'http://apiujrah.arrahn' : $request->hostname; - $tebus = Http::get($request->hostname. '/api/ansuranujrah/laporan/'. $request->kodcaw,['mula' => $mula_date,'akhir' => $hingga_date])->json(); - $cawangan=Http::get($request->hostname.'/api/cawangan/detail/'.$request->kodcaw)->json(); - $cawangan_detail=$cawangan[0]; - if(isset($request->jenis)) - { - if($request->jenis == 'pdf') - { - $pdf = PDF::loadView('akaun.laporan_ansuran', compact('tebus','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url'))->setPaper('a4', 'potrait'); - return $pdf->download('laporan_ansuran_' . $request->kodcaw .'_'. $mula_date .'-'. $hingga_date .'.pdf'); - - }else{ - return view('akaun.laporan_ansuran', compact('tebus','cawangan_detail','tarikh_cetak','api_url','mula_date','hingga_date')); - } - } +public function cetakLaporanAnsuranRangeDate(Request $request){ + $api_url = $request->hostname; + $auth_user = Auth::user(); + $current = Carbon::now(); + $tarikh_cetak = $current->toDateString(); + // Tarikh mula + if ($request->datemula == null) { + $mula_date = $current->toDateString(); + } else { + $mula_date = $request->datemula; } + // Tarikh hingga + if ($request->datehingga == null) { + $hingga_date = $current->toDateString(); + } else { + $hingga_date = $request->datehingga; + } + + // Tetapkan hostname ikut environment + $request->hostname = config('app.env') == 'production' ? 'http://apiujrah.arrahn' : $request->hostname; + + $response = Http::get($request->hostname . '/api/ansuranujrah/laporan/' . $request->kodcaw, [ + 'mula' => $mula_date, + 'akhir' => $hingga_date, + 'jenis' => $request->laporanansuran + ]); + + if ($response->failed() || !$response->json()) { + $tebus = []; // fallback elak error di view + } else { + $tebus = $response->json(); + } + + $cawangan = Http::get($request->hostname . '/api/cawangan/detail/' . $request->kodcaw)->json(); + $cawangan_detail = $cawangan[0] ?? ['nama' => 'Tiada data']; + + // Tajuk laporan ikut jenis + $reportTitles = [ + 'online' => 'Laporan Ansuran Pembiayaan (Arrahn Pay)', + 'kaunter' => 'Laporan Ansuran Pembiayaan (Kaunter aros)', + 'all' => 'Laporan Ansuran Pembiayaan Semua' + ]; + + $jenisLaporan = $request->laporanansuran; + $fileTitle = $reportTitles[$jenisLaporan] ?? 'Laporan_Tidak_Diketahui'; + + // PDF atau view biasa + if (isset($request->jenis)) { + if ($request->jenis == 'pdf') { + $pdf = PDF::loadView('akaun.laporan_ansuran', compact( + 'tebus', 'cawangan_detail', 'tarikh_cetak', 'mula_date', 'hingga_date', 'api_url', 'jenisLaporan' + ))->setPaper('a4', 'potrait'); + + return $pdf->download('laporan_ansuran_' . $request->kodcaw . '_' . $mula_date . '-' . $hingga_date . '.pdf'); + } else { + return view('akaun.laporan_ansuran', compact( + 'tebus', 'cawangan_detail', 'tarikh_cetak', 'api_url', 'jenisLaporan', 'mula_date', 'hingga_date' + )); + } + } +} + + public function cetakLaporanPenebusanRangeDate(Request $request){ $api_url = $request->hostname; $auth_user = Auth::user(); diff --git a/resources/js/Akaun/Ansuran.vue b/resources/js/Akaun/Ansuran.vue index e3cd785..ee617c9 100644 --- a/resources/js/Akaun/Ansuran.vue +++ b/resources/js/Akaun/Ansuran.vue @@ -13,7 +13,7 @@
-
+
@@ -22,6 +22,23 @@ Hingga
+
+
+ + +
+ +
+ + +
+ +
+ + +
+
+
@@ -34,14 +51,24 @@
+ + \ No newline at end of file From f97393ec7ec4ad48509f0477cf886050c661ca54 Mon Sep 17 00:00:00 2001 From: aiman Date: Thu, 25 Sep 2025 11:59:19 +0800 Subject: [PATCH 04/79] 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 33538445a92d3ea2982a87b74d843caec110ae91 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Tue, 14 Oct 2025 10:44:58 +0800 Subject: [PATCH 08/79] 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 c7a8f8103973b97d644e86097c9cd8a81c7eda82 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 29 Oct 2025 10:29:14 +0800 Subject: [PATCH 09/79] 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 72a08fa0222ec8b36a623ddde5b1dfb20076237d Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Sun, 2 Nov 2025 09:30:27 +0800 Subject: [PATCH 10/79] 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 bfe6a35abce27108d5588d6090ab9d5a2cf8a09e Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Mon, 24 Nov 2025 10:01:32 +0800 Subject: [PATCH 12/79] 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 a65055ca751cd2822d5b2dd1d015f6bc7ae9ae8e Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Tue, 25 Nov 2025 09:25:44 +0800 Subject: [PATCH 13/79] 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 e65650b7255e22d43e8f9e879e2be49795c2e309 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Tue, 25 Nov 2025 09:29:37 +0800 Subject: [PATCH 14/79] 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 3f60ac89d90428839074640899e7e64449cedf28 Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 26 Nov 2025 15:54:26 +0800 Subject: [PATCH 15/79] 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 105bd7bcda04ac1928e46e011798bc0484a1778d Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Wed, 26 Nov 2025 16:30:39 +0800 Subject: [PATCH 16/79] 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 58b5bc015f6272f8aab395e690ae94e71aa9453d Mon Sep 17 00:00:00 2001 From: Cyclone Date: Sat, 29 Nov 2025 22:12:39 +0800 Subject: [PATCH 17/79] 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 c815605..e201a0e 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 Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Http; @@ -200,6 +201,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 18c7c2ddc8a8ae629d01fd6df098a4169bfa8a7a Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Sun, 30 Nov 2025 11:02:54 +0800 Subject: [PATCH 18/79] 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 22205c4f4c7b0c92518d5452915e121425b67504 Mon Sep 17 00:00:00 2001 From: Hafifie PKB Date: Mon, 1 Dec 2025 19:49:00 +0800 Subject: [PATCH 19/79] 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'] }} + \ 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 27/79] 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 28/79] 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 29/79] 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 31/79] 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 32/79] 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 33/79] 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 34/79] 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 35/79] 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 36/79] 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 37/79] 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 38/79] 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'] }} + #header th { + padding-top: 12px; + padding-bottom: 12px; + text-align: left; + padding: 4px; + color: black; + } + /* Scan Table Styles */ + #scan { + border-collapse: collapse; + width: 100%; + } + #scan td, #scan th { + padding: 8px; + font-size: 11px; + } + #scan tr:nth-child(even) { + background-color: #ffffff; + } - + #details tr:hover { + background-color: #ddd; + } + #details th { + padding-top: 12px; + font-weight: bold; + padding-bottom: 12px; + text-align: left; + padding: 4px; + color: black; + } - - - - - - - + #sign th { + padding-top: 12px; + padding-bottom: 12px; + text-align: left; + padding: 4px; + color: black; + } + /* Statistics Table Styles */ + #statistik { + width: 100%; + border-collapse: collapse; + margin: 20px 0; + } + #statistik th, #statistik td { + border: 1px solid #ddd; + padding: 12px; + text-align: center; + } + #statistik th { + background-color: #f2f2f2; + font-weight: bold; + } + .header-row { + background-color: #e0e0e0; + font-size: 18px; + } + .bangsa { background-color: #fce4ec; } + .pekerjaan { background-color: #e8f5e9; } + .nilai { background-color: #e1f5fe; } + .pembiayaan-col { background-color: #ffe4d9; } + .jenis { background-color: #e8eaf6; } + .page-break { + page-break-after: always; + } + .section-title { + font-size: 20px; + font-weight: bold; + margin: 30px 0 20px 0; + padding: 10px; + background-color: #f0f0f0; + border-left: 5px solid #333; + } + + + + - - {{-- --}} - {{-- --}} - - - - - - {{-- - - - - - - - --}} + + + +
- + @php $api_url = request()->hostname; - @endphp + @endphp - @if(Str::contains($api_url, 'apiv3.arrahn')) - - @else - - @endif - - - - - - - - - - - - - - - - - - - - - - - + @if(Str::contains($api_url, 'api_arrahnv3.test')) + + @else + + @endif + + + + + + + + + + + + + + + + + + + + + +
LAPORAN PEMBIAYAAN (arOSv3)LAPORAN PEMBIAYAAN -
Tarikh Mula: @php - $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_mula); - $formattedweddingdate = $myDateTime->format('d-m-Y'); - echo($formattedweddingdate) - @endphp Tarikh Hingga: @php - $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_akhir); - $formattedweddingdate = $myDateTime->format('d-m-Y'); - echo($formattedweddingdate) - @endphp Tarikh Cetak: @php - $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); - $formattedweddingdate = $myDateTime->format('d-m-Y'); - echo($formattedweddingdate) - @endphp
-
LAPORAN PEMBIAYAAN (arOSv3)LAPORAN PEMBIAYAAN
Tarikh Mula: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_mula); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) + @endphp + Tarikh Hingga: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_akhir); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) + @endphp + Tarikh Cetak: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) + @endphp +

- - - - - - - - - - - - - - - - - @php - $counter = 1; - $totalpinjaman = 0; - $totalberat = 0; - $totalnm = 0; - $totalupah = 0; - $bil = 0; - $full_total_ujrah = 0; - $full_total_onepercent = 0; - @endphp - @foreach($gadai as $index=>$item) - @php - $ujrah = isset($item['ujrah']) ? $item['ujrah'] : 0; - $onepercent = isset($item['onepercent']) ? $item['onepercent'] : 0; + + + + + + + + + + + + + + + + + @php + $counter = 1; + $totalpinjaman = 0; + $totalberat = 0; + $totalnm = 0; + $totalupah = 0; + $bil = 0; + $full_total_ujrah = 0; + $full_total_onepercent = 0; + @endphp + @foreach($gadai as $index=>$item) + @php + $ujrah = isset($item['ujrah']) ? $item['ujrah'] : 0; + $onepercent = isset($item['onepercent']) ? $item['onepercent'] : 0; - $totalpinjaman += $item['pinjaman']; - $totalberat += $item['berat']; - $totalnm += $item['nilaimarhun']; - $totalupah += $item['upah12']; - $full_total_ujrah += $ujrah * 12; - $full_total_onepercent += $onepercent * 12; - @endphp - @if($index > 0) - @if($item['teller'] != $gadai[$index - 1]['teller']) + $totalpinjaman += $item['pinjaman']; + $totalberat += $item['berat']; + $totalnm += $item['nilaimarhun']; + $totalupah += $item['upah12']; + $full_total_ujrah += $ujrah * 12; + $full_total_onepercent += $onepercent * 12; + @endphp + @if($index > 0) + @if($item['teller'] != $gadai[$index - 1]['teller']) + + + + @php + $totalpinjamanteller = 0; + $totalnmteller = 0; + $totalberatteller = 0; + $totalujrah = 0; + $totalonepercent = 0; + @endphp + @endif + @else - @php + @php $totalpinjamanteller = 0; $totalnmteller = 0; $totalberatteller = 0; + $totalupah12 = 0; $totalujrah = 0; - $totalonepercent = 0; + $totalonepercent= 0; @endphp @endif - @else - + + + + + + + + + + + + + + + @php $counter++; @endphp @php - $totalpinjamanteller = 0; - $totalnmteller = 0; - $totalberatteller = 0; - $totalupah12 = 0; - $totalujrah = 0; - $totalonepercent= 0; + $totalpinjamanteller += $item['pinjaman']; + $totalnmteller += $item['nilaimarhun']; + $totalberatteller += $item['berat']; + $totalupah12 += $item['upah12']; + $totalujrah += $ujrah*12; + $totalonepercent += $onepercent*12; @endphp - - @endif - - - - - - - - - - - - - - - - - @php $counter++; @endphp - @php - $totalpinjamanteller += $item['pinjaman']; - $totalnmteller += $item['nilaimarhun']; - $totalberatteller += $item['berat']; - $totalupah12 += $item['upah12']; - $totalujrah += $ujrah*12; - $totalonepercent += $onepercent*12; - @endphp - @if($index+1 < sizeof($gadai)) - @if($item['teller'] != $gadai[$index + 1]['teller']) - @php if($item['teller'] != '')$bil += ($counter-1); @endphp + @if($index+1 < sizeof($gadai)) + @if($item['teller'] != $gadai[$index + 1]['teller']) + @php if($item['teller'] != '')$bil += ($counter-1); @endphp + + + + + + + + + + @php + $counter = 1; + $totalupah12 = 0; + $totalpinjamanteller = 0; + $totalnmteller = 0; + $totalujrah = 0; + $totalonepercent = 0; + @endphp + @endif + @else + @php $bil += ($counter-1); @endphp @@ -319,77 +349,180 @@ - - @php - $counter = 1; - $totalupah12 = 0; - $totalpinjamanteller = 0; - $totalnmteller = 0; - $totalujrah = 0; - $totalonepercent = 0; - @endphp @endif - @else - @php $bil += ($counter-1); @endphp - - - - - - - - - - - @endif - @endforeach + @endforeach
BilNorujukanNamaAlamatTarikh PembiayaanNo K/PMasaBeratN MarhunPembiayaanCaj-caj LainKeuntungan 1%KeuntunganPeratus (%)
BilNorujukanNamaAlamatTarikh PembiayaanNo K/PMasaBeratN MarhunPembiayaanLain-Lain CajKeuntungan 1%KeuntunganPeratus (%)
Teller : {{ $item['teller'] }}
Teller : {{ $item['teller'] }}
Teller : {{ $item['teller'] }}{{ $counter }}{{$item['norujukan']}}{{ $item['nama'] }}{{ $item['alamat1'] }}{{ $item['t_gadai'] }}{{ $item['nokp'] }}{{ $item['masa'] }}{{ number_format($item['berat'],2) }}{{ number_format($item['nilaimarhun'],2) }}{{ number_format($item['pinjaman'],2) }}{{ number_format($ujrah*12,2) }}{{ number_format($onepercent*12,2) }}{{ number_format($item['upah12'],2) }}{{ $item['percentpinj'] }}
{{ $counter }}{{$item['norujukan']}} - {{ $item['nama'] }} - {{ $item['alamat1'] }}{{ $item['t_gadai'] }}{{ $item['nokp'] }}{{ $item['masa'] }}{{ number_format($item['berat'],2) }}{{ number_format($item['nilaimarhun'],2) }}{{ number_format($item['pinjaman'],2) }}{{ number_format($ujrah*12,2) }}{{ number_format($onepercent*12,2) }}{{ number_format($item['upah12'],2) }}{{ $item['percentpinj'] }}
{{ $counter-1 }} Jumlah surat bagi teller : {{ $item['teller'] }}{{ number_format($totalberatteller,2) }} {{ number_format($totalnmteller,2) }} {{ number_format($totalpinjamanteller,2) }} {{ number_format($totalujrah,2) }}{{ number_format($totalonepercent,2) }}{{ number_format($totalupah12,2) }}
{{ $counter-1 }} Jumlah surat bagi teller : {{ $item['teller'] }} {{ number_format($totalberatteller,2) }} {{ number_format($totalujrah,2) }} {{ number_format($totalonepercent,2) }} {{ number_format($totalupah12,2) }}
{{ $counter-1 }} Jumlah surat bagi teller : {{ $item['teller'] }}{{ number_format($totalberatteller,2) }} {{ number_format($totalnmteller,2) }} {{ number_format($totalpinjamanteller,2) }} {{ number_format($totalujrah,2) }}{{ number_format($totalonepercent,2) }}{{ number_format($totalupah12,2) }}
+

- - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + +
JUMLAH BILANGAN = {{ $bil }}Berat (g/m)Nilai Marhun (RM)Pembiayaan (RM)Caj-caj Lain (RM)Keuntungan 1% (RM)Keuntungan (RM)
JUMLAH KESELURUHAN{{ number_format($totalberat,2) }}{{ number_format($totalnm,2) }}{{ number_format($totalpinjaman,2) }}{{ number_format($full_total_ujrah,2) }}{{ number_format($full_total_onepercent,2) }}{{ number_format($totalupah,2) }}
JUMLAH BILANGAN = {{ $bil }}Berat (g/m)Nilai Marhun (RM)Pembiayaan (RM)Caj-caj Lain (RM)Keuntungan 1% (RM)Keuntungan (RM)
JUMLAH KESELURUHAN{{ number_format($totalberat,2) }}{{ number_format($totalnm,2) }}{{ number_format($totalpinjaman,2) }}{{ number_format($full_total_ujrah,2) }}{{ number_format($full_total_onepercent,2) }}{{ number_format($totalupah,2) }}
-{{--
JUMLAH KESELURUHAN GADAIAN : RM {{ number_format($totalpinjaman,2) }}
--}} - -
-
+

- - - - - - - - - - - - - - + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
+ +
+ +
STATISTIK JENIS PEMBIAYAAN
+ + + + + + + + + + + + + + + + + + + + + + + + + + + @php + // Get all arrays from statistik + $bangsaData = $statistik['reportCustomerRace']; + $pekerjaanData = $statistik['reportCustomerJob']; + $marhunData = $statistik['reportMarhunValue']; + $pembiayaanData = $statistik['reportLoanAmount']; + $marginData = $statistik['reportMarhunMargin']; + $jenisPembiayaanData = $statistik['reportPembiayaan']; + + // Get maximum rows needed + $maxRows = max( + count($bangsaData), + count($pekerjaanData), + count($marhunData), + count($pembiayaanData), + count($marginData), + count($jenisPembiayaanData) + ); + + // Convert to indexed arrays (preserving order) + $bangsaKeys = array_keys($bangsaData); + $bangsa = array_values($bangsaData); + + $pekerjaanKeys = array_keys($pekerjaanData); + $pekerjaan = array_values($pekerjaanData); + + $marhunKeys = array_keys($marhunData); + $marhun = array_values($marhunData); + + $pembiayaanKeys = array_keys($pembiayaanData); + $pembiayaan = array_values($pembiayaanData); + + $marginKeys = array_keys($marginData); + $margin = array_values($marginData); + + $jenisPembiayaanKeys = array_keys($jenisPembiayaanData); + $jenisPembiayaan = array_values($jenisPembiayaanData); + + // Labels for jenis pembiayaan + $jenisLabels = [ + 'pembiayaanbaru' => 'Pembiayaan Baru', + 'pembiayaansemula' => 'Pembiayaan Semula', + 'lelongan' => 'Lelongan' + ]; + + // Check if there's any data at all + $hasAnyData = count($bangsaData) > 0 || count($pekerjaanData) > 0 || + count($marhunData) > 0 || count($pembiayaanData) > 0 || + count($marginData) > 0 || count($jenisPembiayaanData) > 0; + @endphp + + @if($hasAnyData) + @for($i = 0; $i < $maxRows; $i++) + + {{-- Bangsa: Nama | Jumlah --}} + + + + {{-- Pekerjaan: Jenis | Jumlah --}} + + + + {{-- Nilai Marhun: RM | Berat (g) --}} + + + + {{-- Pembiayaan: RM | Bil --}} + + + + {{-- Pembiayaan Margin: RM | % --}} + + + + {{-- Jenis Pembiayaan: Jenis | Bil --}} + + + + @endfor + @else + {{-- Show "Not Available" if no data at all --}} + + + + @endif + +
BangsaPekerjaanNilai MarhunPembiayaanPembiayaan MarginJenis Pembiayaan
JenisBilJenisBilRMBilRMBil%BilJenisBil
{{ $bangsaKeys[$i] ?? '-' }}{{ $bangsa[$i] ?? '-' }}{{ $pekerjaanKeys[$i] ?? '-' }}{{ $pekerjaan[$i] ?? '-' }}{{ $marhunKeys[$i] ?? '-' }}{{ isset($marhun[$i]) ? number_format($marhun[$i]) : '-' }}{{ $pembiayaanKeys[$i] ?? '-' }}{{ isset($pembiayaan[$i]) ? number_format($pembiayaan[$i]) : '-' }}{{ $marginKeys[$i] ?? '-' }}{{ isset($margin[$i]) ? number_format($margin[$i]) : '-' }} + @if(isset($jenisPembiayaanKeys[$i])) + {{ $jenisLabels[$jenisPembiayaanKeys[$i]] ?? ucfirst($jenisPembiayaanKeys[$i]) }} + @else + - + @endif + {{ $jenisPembiayaan[$i] ?? '-' }}
+ Not Available +
+ + \ No newline at end of file From 6719edaa97029308e26a3c5b6a561a24e7665602 Mon Sep 17 00:00:00 2001 From: Nisha Muhd Date: Tue, 6 Jan 2026 12:44:24 +0800 Subject: [PATCH 47/79] laporan_rumusan_wtd --- app/Exports/WTDDetailExport.php | 41 +++++ app/Http/Controllers/WTDController.php | 50 +++++- resources/views/indexOverallReport.blade.php | 6 + resources/views/reports/wtd/excel.blade.php | 80 +++++++++ resources/views/reports/wtd/index.blade.php | 165 +++++++++++++++++++ routes/reports.php | 5 + 6 files changed, 345 insertions(+), 2 deletions(-) create mode 100644 app/Exports/WTDDetailExport.php create mode 100644 resources/views/reports/wtd/excel.blade.php create mode 100644 resources/views/reports/wtd/index.blade.php diff --git a/app/Exports/WTDDetailExport.php b/app/Exports/WTDDetailExport.php new file mode 100644 index 0000000..3155ac9 --- /dev/null +++ b/app/Exports/WTDDetailExport.php @@ -0,0 +1,41 @@ +kodcaw = $kodcaw; + $this->startDate = $startDate; + $this->endDate = $endDate; + } + + public function view(): View + { + $data = Http::get(config('api.url') . '/admin/wtd/summaryWtd', [ + 'startDate' => $this->startDate, + 'endDate' => $this->endDate, + ])->json(); + + $branch = collect($data)->firstWhere('kodcaw', $this->kodcaw); + $details = collect($branch['details'] ?? []); + + return view('reports.wtd.excel', [ + 'details' => $details, // data WTD + 'branch' => $branch, + 'generatedAt' => now()->format('d/m/Y H:i'), + 'startDate' => $this->startDate, + 'endDate' => $this->endDate, + ]); + } + +} diff --git a/app/Http/Controllers/WTDController.php b/app/Http/Controllers/WTDController.php index 927702d..07e52aa 100644 --- a/app/Http/Controllers/WTDController.php +++ b/app/Http/Controllers/WTDController.php @@ -2,7 +2,6 @@ namespace App\Http\Controllers; - use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Session; @@ -10,7 +9,8 @@ use Illuminate\Support\Facades\Http; use Carbon\Carbon; use PDF; -use Maatwebsite\Excel\Excel; +use Maatwebsite\Excel\Facades\Excel; +use App\Exports\WTDDetailExport; class WTDController extends Controller { @@ -178,4 +178,50 @@ class WTDController extends Controller dd($response); } + + public function summaryWtd(Request $request) + { + $current = Carbon::now(); + + $getReportDate = function ($date_string) use ($current) { + return $date_string ? $date_string : $current->toDateString(); + }; + + $request->hostname = config('api.url'); + + $startDate = $getReportDate($request->startDate); + $endDate = $getReportDate($request->endDate); + + + + // $summarywtd = Http::get($request->hostname . '/admin/wtd/summaryWtd', [ + // 'startDate' => $startDate, + // 'endDate' => $endDate, + // ])->effectiveUri()->__toString(); + + // dd($summarywtd); + + + $summarywtd = Http::get($request->hostname . '/admin/wtd/summaryWtd', [ + 'startDate' => $startDate, + 'endDate' => $endDate, + ])->json(); + + + if (!is_array($summarywtd)) { + $summarywtd = []; + } + + return view('reports.wtd.index', compact('summarywtd', 'startDate', 'endDate')); + } + + public function exportExcel(Request $request, $kodcaw) + { + return Excel::download( + new WTDDetailExport( + $kodcaw, + $request->startDate, + $request->endDate + ),"Detail_Laporan_WTD_{$kodcaw}.xlsx"); + } } diff --git a/resources/views/indexOverallReport.blade.php b/resources/views/indexOverallReport.blade.php index 6a5bc19..cb53006 100644 --- a/resources/views/indexOverallReport.blade.php +++ b/resources/views/indexOverallReport.blade.php @@ -110,6 +110,12 @@

Saringan Gadaian

+
diff --git a/resources/views/reports/wtd/excel.blade.php b/resources/views/reports/wtd/excel.blade.php new file mode 100644 index 0000000..1abc8a8 --- /dev/null +++ b/resources/views/reports/wtd/excel.blade.php @@ -0,0 +1,80 @@ + + + + + + + + + + + + + +
+ LAPORAN RUMUSAN WTD +
+ Cawangan : {{ $branch['details_caw'] ?? '-' }} ({{ $branch['kodcaw'] ?? '-' }}) +
+ Tarikh : {{ $startDate }} hingga {{ $endDate }} +
+ Tarikh Dijana : {{ $generatedAt }} +
+ +
+ + + + + + + + + + + + + + + + + @php + $bil = 1; + $sum_baki = 0; + $jumlah = 0; + @endphp + + @foreach ($details as $item) + + @php + $jumlah = $item['jumlah']; + @endphp + + + + + + + + + + + @php + $sum_baki += $item['jumlah']; + @endphp + @endforeach + + + + + + + +
BilBatch WTDNo RujukanNo KPNamaTarikh ProsesJumlah (RM)
{{ $bil++ }}{{ $item['batchno'] ?? 0 }}{{ $item['norujukan'] ?? null }}{{ $item['nokp'] ?? null }}{{ $item['nama_cust'] ?? null }}{{ $item['t_proses'] ?? null }}{{ number_format($jumlah, 2) }}
+ JUMLAH KESELURUHAN + + {{ number_format($sum_baki, 2) }} +
+ + + diff --git a/resources/views/reports/wtd/index.blade.php b/resources/views/reports/wtd/index.blade.php new file mode 100644 index 0000000..330fc57 --- /dev/null +++ b/resources/views/reports/wtd/index.blade.php @@ -0,0 +1,165 @@ +@extends('layouts.app') + +@section('content') + +
+
+ +
+ + + + +
+
+
+
Laporan Selesai WTD +
+
+
+
+
+ Mula + + Hingga + + +
+ +
+
+
+
+
+
+
+
+ + +
+
+ + +
+
+ + +
+ + + + + + + + + + + + + + @php + $totalsag = 0; // jumlah semua surat + $totalbaki = 0; + @endphp + + + + @forelse ($summarywtd ?? [] as $wtd) + @php + // Jumlah semua surat + $totalsag += $wtd['jumlah_surat'] ?? 0; + $totalbaki += $wtd['sum_baki'] ?? 0; + @endphp + + + + + + + + + @empty + + + + @endforelse + + + + + + + + + +
+ No + + Kod Cawangan + + Cawangan + + Jumlah Surat + + Jumlah WTD Dihantar + + Action +
+
{{ $loop->iteration }}
+
+
{{ $wtd['kodcaw'] }}
+
+
{{ $wtd['details_caw'] }}
+
+
{{ $wtd['jumlah_surat'] }}
+
+
{{ number_format($wtd['sum_baki'], 2) }}
+
+ +
+ Data not available +
+ Jumlah Keseluruhan + + {{ $totalsag }} + + {{ number_format($totalbaki, 2) }} +
+ +
+
+
+ @include('layouts.footer') +
+@endsection diff --git a/routes/reports.php b/routes/reports.php index 60e3404..fbff1ed 100644 --- a/routes/reports.php +++ b/routes/reports.php @@ -14,6 +14,7 @@ use App\Http\Controllers\Reports\PetibesiController; use App\Http\Controllers\Reports\AnalisaController; use App\Http\Controllers\Reports\BakiLelongController; use App\Http\Controllers\SaringanGadaianController; +use App\Http\Controllers\WTDController; use Illuminate\Support\Facades\Route; Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->group(function () { @@ -49,4 +50,8 @@ Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->gro Route::get('saringan-gadaian-index', [SaringanGadaianController::class, 'index'])->name('reports.saringan-gadaian.index'); Route::get('saringan-gadaian-excel/{kodcaw}', [SaringanGadaianController::class, 'exportExcel'])->name('reports.gadaian.cawangan.excel'); + + Route::get('summary-wtd-index', [WTDController::class, 'summaryWtd'])->name('reports.summary-wtd.index'); + Route::get('summary-wtd-excel/{kodcaw}', [WTDController::class, 'exportExcel'])->name('reports.wtd.cawangan.excel'); + }); From 8eda954d4b11b0b3dbe407642b7ae91ae47ba44a Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Tue, 6 Jan 2026 20:58:35 +0800 Subject: [PATCH 48/79] remove kodcaw --- resources/views/akaun/laporan_tuntutbaki.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/akaun/laporan_tuntutbaki.blade.php b/resources/views/akaun/laporan_tuntutbaki.blade.php index dc3425f..166eb62 100644 --- a/resources/views/akaun/laporan_tuntutbaki.blade.php +++ b/resources/views/akaun/laporan_tuntutbaki.blade.php @@ -246,7 +246,7 @@ @php // $gadaidetail = Http::get($api_url . '/api/gadai/norujukan/' . $item['norujukan'])->json(); - code asal // $gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/gadai/norujukankodcaw/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); - $gadaidetail = Http::get($api_url . '/api/gadai/norujukankodcaw/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); + $gadaidetail = Http::get($api_url . '/api/gadai/norujukan/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); $customer_detail = Http::get($api_url . '/api/customers/' . $gadaidetail[0][0]['nokp'])->json(); echo $customer_detail['nama']; @endphp From 4c0484cac8e0ac455233c44768b25f81e975d637 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 14 Jan 2026 09:23:54 +0800 Subject: [PATCH 49/79] update task uum --- app/Exports/DataPelangganDetailExport.php | 126 +++++++++ .../reports/data-pelanggan/index.blade.php | 223 ++++++++++++++++ .../reports/data-pelanggan/show.blade.php | 241 ++++++++++++++++++ 3 files changed, 590 insertions(+) create mode 100644 app/Exports/DataPelangganDetailExport.php create mode 100644 resources/views/reports/data-pelanggan/index.blade.php create mode 100644 resources/views/reports/data-pelanggan/show.blade.php diff --git a/app/Exports/DataPelangganDetailExport.php b/app/Exports/DataPelangganDetailExport.php new file mode 100644 index 0000000..26edc6f --- /dev/null +++ b/app/Exports/DataPelangganDetailExport.php @@ -0,0 +1,126 @@ +pelanggan = collect($pelanggan); + $this->year = $year; + } + + /** + * Data source + */ + public function collection(): Collection + { + return $this->pelanggan; + } + + /** + * Start data from row 5 (sebab ada tajuk) + */ + public function startCell(): string + { + return 'A5'; + } + + /** + * Header column + */ + public function headings(): array + { + return [ + 'No', + 'Nama Pelanggan', + 'Umur', + 'Jantina', + 'Pekerjaan', + 'Lokasi', + 'Tempoh Pajakan', + 'Tarikh Mula', + 'Tarikh Tamat', + 'Hari Sejak Transaksi Terakhir', + 'Bil Transaksi', + 'Bil Tebus', + 'Jumlah Pinjaman (RM)', + 'Jumlah Ujrah (RM)', + 'Tujuan Gadaian', + 'Status Aktif', + 'Cara Bayaran', + 'Tarikh Lelong', + ]; + } + + /** + * Map setiap row + */ + public function map($row): array + { + return [ + ++$this->no, + strtoupper($row['nama']), + $row['umur'], + $row['jantina'], + $row['pekerjaan'], + $row['daerah'], + $row['tempoh_pajakan'], + $row['tarikh_mula'], + $row['tarikh_tamat'], + $row['hari_sejak_transaksi'], + $row['bil_transaksi'], + $row['bil_tebus'], + number_format($row['jumlah_pinjaman'], 2), + number_format($row['jumlah_ujrah'], 2), + $row['tujuan_gadai'], + $row['status_aktif'], + $row['cara_bayaran'], + $row['tarikh_lelong'] ?? '-', + ]; + } + + /** + * Styling Excel + */ + public function styles(Worksheet $sheet) + { + // Tajuk utama + $sheet->mergeCells('A1:R1'); + $sheet->setCellValue('A1', 'LAPORAN DATA PELANGGAN'); + $sheet->getStyle('A1')->getFont()->setBold(true)->setSize(14); + $sheet->getStyle('A1')->getAlignment()->setHorizontal('center'); + + // Tahun + $sheet->mergeCells('A2:R2'); + $sheet->setCellValue('A2', 'TAHUN : ' . $this->year); + $sheet->getStyle('A2')->getFont()->setBold(true); + $sheet->getStyle('A2')->getAlignment()->setHorizontal('center'); + + // Header table + $sheet->getStyle('A5:R5')->getFont()->setBold(true); + $sheet->getStyle('A5:R5')->getAlignment()->setHorizontal('center'); + + // Auto width + foreach (range('A', 'R') as $col) { + $sheet->getColumnDimension($col)->setAutoSize(true); + } + } +} diff --git a/resources/views/reports/data-pelanggan/index.blade.php b/resources/views/reports/data-pelanggan/index.blade.php new file mode 100644 index 0000000..08f63f2 --- /dev/null +++ b/resources/views/reports/data-pelanggan/index.blade.php @@ -0,0 +1,223 @@ +@extends('layouts.app') + +@section('content') + + +
+
+
+ + {{-- Breadcrumb --}} + + + +
+ + {{-- Error Alert --}} + @if ($errors->any()) +
+ +
+ @endif + +
+
+ + {{-- Header --}} +
+ + + + + Laporan Data Pelanggan + +
+ + {{-- FORM --}} +
+ + +
+ + {{-- Tahun --}} +
+ + +
+ + Tahun + + + + + {{-- Hidden generate type --}} + + + {{-- Excel --}} + + + {{-- PDF --}} + +
+
+ +
+
+ +
+
+
+
+
+ + @include('layouts.footer') +
+ +{{-- Loading Overlay --}} + + +@endsection + +{{-- ======================= +| Scripts +|======================= --}} +@push('additional_scripts') + +@endpush + + diff --git a/resources/views/reports/data-pelanggan/show.blade.php b/resources/views/reports/data-pelanggan/show.blade.php new file mode 100644 index 0000000..dfee142 --- /dev/null +++ b/resources/views/reports/data-pelanggan/show.blade.php @@ -0,0 +1,241 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
Laporan Data Pelanggan + Tarikh Cetak: {{ $tarikh_cetak }} +
TAHUN LAPORAN{{ $tebus_date }}
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + @foreach($pelanggan as $index => $row) + + + + + + + + + + + + + + + + + + + + + @endforeach + +
NoNama PelangganUmurJantinaPekerjaanLokasiTempoh PajakanTarikh MulaTarikh TamatHari Sejak Transaksi TerakhirBil TransaksiBil TebusJumlah Pinjaman (RM)Jumlah Ujrah (RM)Tujuan GadaianStatus AktifCara BayaranTarikh Lelong
{{ $index + 1 }}{{ strtoupper($row['nama']) }}{{ $row['umur'] }}{{ $row['jantina'] }}{{ $row['pekerjaan'] }}{{ $row['daerah'] }}{{ $row['tempoh_pajakan'] }}{{ $row['tarikh_mula'] }}{{ $row['tarikh_tamat'] }}{{ $row['hari_sejak_transaksi'] }}{{ $row['bil_transaksi'] }}{{ $row['bil_tebus'] }}{{ number_format($row['jumlah_pinjaman'], 2) }}{{ number_format($row['jumlah_ujrah'], 2) }}{{ $row['tujuan_gadai'] }}{{ $row['status_aktif'] }}{{ $row['cara_bayaran'] }}{{ $row['tarikh_lelong'] }}
+ +
+
+ + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
From a8ecda14abc864181bd3056c4c8e3f4dfd689712 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 14 Jan 2026 09:34:27 +0800 Subject: [PATCH 50/79] update menu --- resources/views/indexOverallReport.blade.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/views/indexOverallReport.blade.php b/resources/views/indexOverallReport.blade.php index cb53006..16fe820 100644 --- a/resources/views/indexOverallReport.blade.php +++ b/resources/views/indexOverallReport.blade.php @@ -116,6 +116,12 @@

Selesai WTD

+
From ee8bf400b50b10cbda629431087ec338ac963920 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 14 Jan 2026 09:37:30 +0800 Subject: [PATCH 51/79] update menu --- routes/reports.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routes/reports.php b/routes/reports.php index fbff1ed..36e6ce6 100644 --- a/routes/reports.php +++ b/routes/reports.php @@ -51,7 +51,9 @@ Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->gro Route::get('saringan-gadaian-index', [SaringanGadaianController::class, 'index'])->name('reports.saringan-gadaian.index'); Route::get('saringan-gadaian-excel/{kodcaw}', [SaringanGadaianController::class, 'exportExcel'])->name('reports.gadaian.cawangan.excel'); - Route::get('summary-wtd-index', [WTDController::class, 'summaryWtd'])->name('reports.summary-wtd.index'); - Route::get('summary-wtd-excel/{kodcaw}', [WTDController::class, 'exportExcel'])->name('reports.wtd.cawangan.excel'); + Route::get('summary-wtd-index', [WTDController::class, 'summaryWtd'])->name('reports.summary-wtd.index'); + Route::get('summary-wtd-excel/{kodcaw}', [WTDController::class, 'exportExcel'])->name('reports.wtd.cawangan.excel'); + Route::get('data-pelanggan-index', [AnalisaController::class, 'dataPelanggan'])->name('reports.dataPelanggan.index'); + Route::get('data-pelanggan-show', [AnalisaController::class, 'dataPelangganShow'])->name('reports.dataPelanggan.show'); }); From 6c781051ad726f37fa30f80127423fb4e956a5d5 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 14 Jan 2026 09:40:03 +0800 Subject: [PATCH 52/79] update analisa controller --- .../Controllers/Reports/AnalisaController.php | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/app/Http/Controllers/Reports/AnalisaController.php b/app/Http/Controllers/Reports/AnalisaController.php index 8293b60..a3059b4 100644 --- a/app/Http/Controllers/Reports/AnalisaController.php +++ b/app/Http/Controllers/Reports/AnalisaController.php @@ -11,6 +11,7 @@ use Maatwebsite\Excel\Facades\Excel; use Illuminate\Support\Facades\Auth; use App\Exports\LaporanKeseluruhan\PelangganbaruAllExportExcel; use App\Exports\LaporanKeseluruhan\PelangganaktifAllExportExcel; +use App\Exports\DataPelangganDetailExport; class AnalisaController extends Controller { @@ -90,5 +91,52 @@ class AnalisaController extends Controller return view('reports.pelangganaktif.index', compact('pelangganaktif', 'startDate', 'endDate')); } + public function dataPelanggan(Request $request) + { + $request->hostname = config('api.url'); + $current = new Carbon(); + + $month = $request->filled('month') ? $request->month : $current->month; + $year = $request->filled('year') ? $request->year : $current->year; + + return view('reports.data-pelanggan.index', compact('month', 'year')); + } + + public function dataPelangganShow(Request $request) + { + $validated = $request->validate([ + 'year' => 'required|digits:4' + ]); + + $year = $validated['year']; + $tarikh_cetak = now()->format('d/m/Y'); + $tebus_date = 'Tahun ' . $year; + + $request->hostname = config('api.url'); + + $response = Http::get($request->hostname . '/api/reports/data-pelanggan', [ + 'year' => $year, + ])->json(); + + $summary = $response['summary']; + $pelanggan = $response['pelanggan']; + + if ($request->generateType === 'pdf') { + return view( + 'reports.data-pelanggan.show', + compact('summary','pelanggan','tarikh_cetak','tebus_date','year') + ); + } + elseif ($request->generateType === 'excel') { + return Excel::download( + new DataPelangganDetailExport($pelanggan, $year), + "Laporan-Data-Pelanggan-{$year}.xlsx" + ); + } + + } + + + } From 8d541cb82f79eef340bcee182c669a8e1433cd7f Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Thu, 15 Jan 2026 12:33:34 +0800 Subject: [PATCH 53/79] update nopelanggan dalam task uum --- app/Exports/DataPelangganDetailExport.php | 2 ++ resources/views/reports/data-pelanggan/show.blade.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/Exports/DataPelangganDetailExport.php b/app/Exports/DataPelangganDetailExport.php index 26edc6f..9ff4f78 100644 --- a/app/Exports/DataPelangganDetailExport.php +++ b/app/Exports/DataPelangganDetailExport.php @@ -51,6 +51,7 @@ class DataPelangganDetailExport implements return [ 'No', 'Nama Pelanggan', + 'No.Pelanggan', 'Umur', 'Jantina', 'Pekerjaan', @@ -78,6 +79,7 @@ class DataPelangganDetailExport implements return [ ++$this->no, strtoupper($row['nama']), + $row['nopelanggan'], $row['umur'], $row['jantina'], $row['pekerjaan'], diff --git a/resources/views/reports/data-pelanggan/show.blade.php b/resources/views/reports/data-pelanggan/show.blade.php index dfee142..f366006 100644 --- a/resources/views/reports/data-pelanggan/show.blade.php +++ b/resources/views/reports/data-pelanggan/show.blade.php @@ -176,6 +176,7 @@ No Nama Pelanggan + No.Pelanggan Umur Jantina Pekerjaan @@ -200,6 +201,7 @@ {{ $index + 1 }} {{ strtoupper($row['nama']) }} + {{ $row['nopelanggan'] }} {{ $row['umur'] }} {{ $row['jantina'] }} {{ $row['pekerjaan'] }} From 361eb481c1d97285e8818d204975d4a9d73ac58a Mon Sep 17 00:00:00 2001 From: Nisha Muhd Date: Thu, 15 Jan 2026 12:59:18 +0800 Subject: [PATCH 54/79] nisha-checking-wtd --- app/Http/Controllers/WTDController.php | 39 ++++- resources/views/layouts/sidebar.blade.php | 12 ++ resources/views/wtd/debug/home.blade.php | 48 ++++++ resources/views/wtd/debug/index.blade.php | 198 ++++++++++++++++++++++ routes/web.php | 4 + 5 files changed, 295 insertions(+), 6 deletions(-) create mode 100644 resources/views/wtd/debug/home.blade.php create mode 100644 resources/views/wtd/debug/index.blade.php diff --git a/app/Http/Controllers/WTDController.php b/app/Http/Controllers/WTDController.php index 07e52aa..be243a2 100644 --- a/app/Http/Controllers/WTDController.php +++ b/app/Http/Controllers/WTDController.php @@ -192,15 +192,10 @@ class WTDController extends Controller $startDate = $getReportDate($request->startDate); $endDate = $getReportDate($request->endDate); - - // $summarywtd = Http::get($request->hostname . '/admin/wtd/summaryWtd', [ // 'startDate' => $startDate, // 'endDate' => $endDate, - // ])->effectiveUri()->__toString(); - - // dd($summarywtd); - + // ])->effectiveUri()->__toString(); $summarywtd = Http::get($request->hostname . '/admin/wtd/summaryWtd', [ 'startDate' => $startDate, @@ -224,4 +219,36 @@ class WTDController extends Controller $request->endDate ),"Detail_Laporan_WTD_{$kodcaw}.xlsx"); } + + public function home() + { + return view('wtd.debug.home'); + } + + public function trail(Request $request) + { + $current = Carbon::now(); + + $getReportDate = function ($date_string) use ($current) { + return $date_string ? $date_string : $current->toDateString(); + }; + + $request->hostname = config('api.url'); + + $startDate = $getReportDate($request->startDate); + $endDate = $getReportDate($request->endDate); + + $debugwtd = Http::get($request->hostname . '/admin/wtd/debugWtd', [ + 'startDate' => $startDate, + 'endDate' => $endDate, + ])->json(); + + + if (!is_array($debugwtd)) { + $debugwtd = []; + } + + return view('wtd.debug.index', compact('debugwtd', 'startDate', 'endDate')); + } + } diff --git a/resources/views/layouts/sidebar.blade.php b/resources/views/layouts/sidebar.blade.php index 5357de1..2b19829 100644 --- a/resources/views/layouts/sidebar.blade.php +++ b/resources/views/layouts/sidebar.blade.php @@ -129,6 +129,18 @@ + + +
  • +
    + + + + Debug Proses WTD +
    +
  • +
    + {{--
  • diff --git a/resources/views/wtd/debug/home.blade.php b/resources/views/wtd/debug/home.blade.php new file mode 100644 index 0000000..9ca200f --- /dev/null +++ b/resources/views/wtd/debug/home.blade.php @@ -0,0 +1,48 @@ +@extends('layouts.app') + +@section('content') + +
    +
    + + +
    + @include('layouts.footer') +@endsection diff --git a/resources/views/wtd/debug/index.blade.php b/resources/views/wtd/debug/index.blade.php new file mode 100644 index 0000000..3d5d787 --- /dev/null +++ b/resources/views/wtd/debug/index.blade.php @@ -0,0 +1,198 @@ +@extends('layouts.app') + +@section('content') + +
    +
    + +
    + + + + +
    +
    +
    +
    Selesai WTD +
    +
    +
    +
    +
    + Mula + + Hingga + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + + +
    +
    + + +
    +
    + + +
    + + + + + + + + + + + + + + + @php + $totalserahbaki = 0; + $totaltuntutbaki = 0; + $totalwtd = 0; + @endphp + + + + @forelse ($debugwtd ?? [] as $dwtd) + @php + // Total + $totalserahbaki += $dwtd['serahb'] ?? 0; + $totaltuntutbaki += $dwtd['tuntutb'] ?? 0; + $totalwtd += $dwtd['twtd'] ?? 0; + @endphp + + + + + + + + + + + + @empty + + + + @endforelse + + + + + + + + + + +
    + No + + Kod Cawangan + + Cawangan + + Table Serahbaki + + Table Tuntutbaki + + Table WTD + + Action +
    +
    {{ $loop->iteration }}
    +
    +
    {{ $dwtd['kodcaw'] }}
    +
    +
    {{ $dwtd['details_caw'] }}
    +
    +
    {{ number_format($dwtd['serahb'], 2) }} + @if($dwtd['serahb'] == $dwtd['tuntutb'] && $dwtd['serahb'] == $dwtd['twtd']) + + @else + + @endif +
    +
    +
    {{ number_format($dwtd['tuntutb'], 2) }} + @if($dwtd['serahb'] == $dwtd['tuntutb'] && $dwtd['serahb'] == $dwtd['twtd']) + + @else + + @endif +
    +
    +
    {{ number_format($dwtd['twtd'], 2) }} + @if($dwtd['serahb'] == $dwtd['tuntutb'] && $dwtd['serahb'] == $dwtd['twtd']) + + @else + + @endif +
    +
    +
    + + @if($dwtd['serahb'] == $dwtd['tuntutb'] && $dwtd['serahb'] == $dwtd['twtd']) + + @else + Perlu Semakan + @endif +
    +
    + Data not available +
    + Jumlah Keseluruhan + + {{ number_format($totalserahbaki, 2) }} + + {{ number_format($totaltuntutbaki, 2) }} + + {{ number_format($totalwtd, 2) }} +
    + +
    +
    +
    + @include('layouts.footer') +
    +@endsection diff --git a/routes/web.php b/routes/web.php index adb4dcf..34c818c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -186,6 +186,10 @@ Route::post('/wtd/simulasi/simulasiToDraft', [WTDController::class, 'simulasiToD Route::get('/wtd/simulasi/serahbaki', [WTDController::class, 'serahbaki']); +//debug proses wtd +Route::get('/wtd/debugWTD/home', [WTDController::class, 'home'])->name('wtd.debugWTD.home'); +Route::get('/wtd/debugWTD/trail', [WTDController::class, 'trail'])->name('wtd.debugWTD.trail'); + //Audit Route::get('/audit',['as'=>'audit.index','uses'=>'App\Http\Controllers\AkaunController@AuditGenerator']); From 8460ea060e8fca4486a6d54873a908b61d8969fe Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Sun, 18 Jan 2026 08:47:16 +0800 Subject: [PATCH 55/79] update outstanding --- app/Exports/DataPelangganDetailExport.php | 1 + resources/views/reports/data-pelanggan/show.blade.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/app/Exports/DataPelangganDetailExport.php b/app/Exports/DataPelangganDetailExport.php index 9ff4f78..adc661e 100644 --- a/app/Exports/DataPelangganDetailExport.php +++ b/app/Exports/DataPelangganDetailExport.php @@ -61,6 +61,7 @@ class DataPelangganDetailExport implements 'Tarikh Tamat', 'Hari Sejak Transaksi Terakhir', 'Bil Transaksi', + 'Bil Outstanding', 'Bil Tebus', 'Jumlah Pinjaman (RM)', 'Jumlah Ujrah (RM)', diff --git a/resources/views/reports/data-pelanggan/show.blade.php b/resources/views/reports/data-pelanggan/show.blade.php index f366006..f82728b 100644 --- a/resources/views/reports/data-pelanggan/show.blade.php +++ b/resources/views/reports/data-pelanggan/show.blade.php @@ -186,6 +186,7 @@ Tarikh Tamat Hari Sejak Transaksi Terakhir Bil Transaksi + Bil Outstanding Bil Tebus Jumlah Pinjaman (RM) Jumlah Ujrah (RM) @@ -211,6 +212,7 @@ {{ $row['tarikh_tamat'] }} {{ $row['hari_sejak_transaksi'] }} {{ $row['bil_transaksi'] }} + {{ $row['bil_outstanding'] }} {{ $row['bil_tebus'] }} {{ number_format($row['jumlah_pinjaman'], 2) }} {{ number_format($row['jumlah_ujrah'], 2) }} From b9810884e3d28f0cfd51a7bd681c85da9eaee8a4 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Sun, 18 Jan 2026 09:01:45 +0800 Subject: [PATCH 56/79] update outstanding excel --- app/Exports/DataPelangganDetailExport.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/Exports/DataPelangganDetailExport.php b/app/Exports/DataPelangganDetailExport.php index adc661e..fc2eacc 100644 --- a/app/Exports/DataPelangganDetailExport.php +++ b/app/Exports/DataPelangganDetailExport.php @@ -90,6 +90,7 @@ class DataPelangganDetailExport implements $row['tarikh_tamat'], $row['hari_sejak_transaksi'], $row['bil_transaksi'], + $row['bil_outstanding'], $row['bil_tebus'], number_format($row['jumlah_pinjaman'], 2), number_format($row['jumlah_ujrah'], 2), From c56c78e7878c5fbf53f814d2f1733786c6a3bc77 Mon Sep 17 00:00:00 2001 From: Amirah Date: Tue, 27 Jan 2026 15:00:48 +0800 Subject: [PATCH 57/79] Bug fix laporan saringan gadaian excel --- resources/views/reports/saringan-gadaian/index.blade.php | 2 +- routes/reports.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/reports/saringan-gadaian/index.blade.php b/resources/views/reports/saringan-gadaian/index.blade.php index 381b606..11e56bf 100644 --- a/resources/views/reports/saringan-gadaian/index.blade.php +++ b/resources/views/reports/saringan-gadaian/index.blade.php @@ -178,7 +178,7 @@
    - Download diff --git a/routes/reports.php b/routes/reports.php index 36e6ce6..e33ac7e 100644 --- a/routes/reports.php +++ b/routes/reports.php @@ -49,7 +49,7 @@ Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->gro Route::get('gadaitebusmasa/{kod_cawangan}', [GadaianController::class, 'downloadGadaiTebusMasaCawanganExcel'])->name('reports.gadaitebusmasa.cawangan.excel'); Route::get('saringan-gadaian-index', [SaringanGadaianController::class, 'index'])->name('reports.saringan-gadaian.index'); - Route::get('saringan-gadaian-excel/{kodcaw}', [SaringanGadaianController::class, 'exportExcel'])->name('reports.gadaian.cawangan.excel'); + Route::get('saringan-gadaian-excel/{kodcaw}', [SaringanGadaianController::class, 'exportExcel'])->name('reports.saringan.gadaian.cawangan.excel'); Route::get('summary-wtd-index', [WTDController::class, 'summaryWtd'])->name('reports.summary-wtd.index'); Route::get('summary-wtd-excel/{kodcaw}', [WTDController::class, 'exportExcel'])->name('reports.wtd.cawangan.excel'); From 2ea39372bee855ae7f9b10bac3bab369f529667a Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Tue, 27 Jan 2026 16:50:52 +0800 Subject: [PATCH 58/79] update laporan lelongan keseluruhan --- .../LelonganAllExportExcel.php | 6 ++ app/Exports/LelonganExport.php | 18 ++++ app/Exports/LelonganFullExport.php | 56 ++++++++++++ app/Exports/LelonganPerTellerExport.php | 1 + app/Exports/LelonganSummaryExport.php | 1 + .../views/exports/lelongan/cawangan.blade.php | 3 + .../views/exports/lelongan/full.blade.php | 91 +++++++++++++++++++ .../views/exports/lelongan/summary.blade.php | 3 + .../reports/laporan-lelong/index.blade.php | 22 +++++ 9 files changed, 201 insertions(+) create mode 100644 app/Exports/LelonganFullExport.php create mode 100644 resources/views/exports/lelongan/full.blade.php diff --git a/app/Exports/LaporanKeseluruhan/LelonganAllExportExcel.php b/app/Exports/LaporanKeseluruhan/LelonganAllExportExcel.php index 667bb35..c7cdf43 100644 --- a/app/Exports/LaporanKeseluruhan/LelonganAllExportExcel.php +++ b/app/Exports/LaporanKeseluruhan/LelonganAllExportExcel.php @@ -34,6 +34,7 @@ class LelonganAllExportExcel extends DefaultValueBinder implements FromArray, Wi 'Baki Pembiayaan (RM)', 'Keuntungan (RM)', 'Caj Lelong (RM)', + 'Harga Asas (RM)', 'Harga Jual (RM)', 'Baki (RM)', ]; @@ -57,6 +58,7 @@ class LelonganAllExportExcel extends DefaultValueBinder implements FromArray, Wi $sum_pinjaman = 0; $sum_bakiupah = 0; $sum_cajlelong = 0; + $sum_hargaasas = 0; $sum_hargajual = 0; $sum_baki = 0; @@ -73,6 +75,7 @@ class LelonganAllExportExcel extends DefaultValueBinder implements FromArray, Wi number_format((float) ($data['sum_bakipjm'] ?? 0), 2), number_format((float) ($data['sum_bakiupah'] ?? 0), 2), number_format((float) ($data['sum_cajlelong'] ?? 0), 2), + number_format((float) ($data['sum_hargaasas'] ?? 0), 2), number_format((float) ($data['sum_hargajual'] ?? 0), 2), number_format((float) ($data['sum_baki'] ?? 0), 2), @@ -87,6 +90,7 @@ class LelonganAllExportExcel extends DefaultValueBinder implements FromArray, Wi $sum_bakipjm += (float) $data['sum_bakipjm']; $sum_bakiupah += (float) $data['sum_bakiupah']; $sum_cajlelong += (float) $data['sum_cajlelong']; + $sum_hargaasas += (float) $data['sum_hargaasas']; $sum_hargajual += (float) $data['sum_hargajual']; $sum_baki += (float) $data['sum_baki']; @@ -102,6 +106,7 @@ class LelonganAllExportExcel extends DefaultValueBinder implements FromArray, Wi number_format($sum_bakipjm, 2), number_format($sum_bakiupah, 2), number_format($sum_cajlelong, 2), + number_format($sum_hargaasas, 2), number_format($sum_hargajual, 2), number_format($sum_baki, 2), @@ -128,6 +133,7 @@ class LelonganAllExportExcel extends DefaultValueBinder implements FromArray, Wi (float) str_replace(',', '', $data[7] ?? 0), // Total Untung 1% (float) str_replace(',', '', $data[8] ?? 0), // Total Ujrah (float) str_replace(',', '', $data[9] ?? 0), // Total Ujrah + (float) str_replace(',', '', $data[10] ?? 0), // Total Ujrah ]; } diff --git a/app/Exports/LelonganExport.php b/app/Exports/LelonganExport.php index 8109596..992d4f2 100644 --- a/app/Exports/LelonganExport.php +++ b/app/Exports/LelonganExport.php @@ -48,6 +48,24 @@ class LelonganExport implements WithMultipleSheets $sheets[] = new LelonganPerTellerExport($this->cawangan_detail, $this->query, $teller_with_lelongan_data); } + // Sheet untuk senarai penuh lelongan (gabung semua teller) + $full_lelongan_data = []; + + foreach ($this->lelongan as $teller => $data) { + if (isset($data['lelongan']) && is_array($data['lelongan'])) { + foreach ($data['lelongan'] as $item) { + $item['teller'] = $teller; // optional: simpan info teller + $full_lelongan_data[] = $item; + } + } + } + + $sheets[] = new LelonganFullExport( + $this->cawangan_detail, + $this->query, + $full_lelongan_data + ); + return $sheets; } } diff --git a/app/Exports/LelonganFullExport.php b/app/Exports/LelonganFullExport.php new file mode 100644 index 0000000..a2a9228 --- /dev/null +++ b/app/Exports/LelonganFullExport.php @@ -0,0 +1,56 @@ +cawangan_detail = $cawangan_detail; + $this->query = $query; + $this->lelongan_full_data = $lelongan_full_data; + } + + public function view(): View + { + return view('exports.lelongan.full', [ + 'cawangan_detail' => $this->cawangan_detail, + 'query' => $this->query, + 'lelongan_data' => $this->lelongan_full_data, + ]); + } + + public function title(): string + { + return 'SENARAI LELONGAN PENUH'; + } + + public function columnFormats(): array + { + return [ + 'E' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // Berat + 'F' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // Nilai Marhun + 'G' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // Pinjaman + 'H' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // Keuntungan + 'I' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // caj lelong + 'J' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // baki + 'K' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // baki + 'L' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // baki + 'M' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // baki + 'N' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // baki + 'O' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, // baki + + ]; + } +} diff --git a/app/Exports/LelonganPerTellerExport.php b/app/Exports/LelonganPerTellerExport.php index 9c79588..09674a8 100644 --- a/app/Exports/LelonganPerTellerExport.php +++ b/app/Exports/LelonganPerTellerExport.php @@ -71,6 +71,7 @@ class LelonganPerTellerExport extends DefaultValueBinder implements FromView, Sh 'J' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, 'K' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, 'L' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, + 'M' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, ]; } diff --git a/app/Exports/LelonganSummaryExport.php b/app/Exports/LelonganSummaryExport.php index f6dad6d..8c11d07 100644 --- a/app/Exports/LelonganSummaryExport.php +++ b/app/Exports/LelonganSummaryExport.php @@ -68,6 +68,7 @@ class LelonganSummaryExport extends DefaultValueBinder implements FromView, Shou 'J' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, 'C' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, 'D' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, + 'K' => NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1, ]; } diff --git a/resources/views/exports/lelongan/cawangan.blade.php b/resources/views/exports/lelongan/cawangan.blade.php index b1d7c59..7c9cbb7 100644 --- a/resources/views/exports/lelongan/cawangan.blade.php +++ b/resources/views/exports/lelongan/cawangan.blade.php @@ -48,6 +48,7 @@ Baki Pembiayaan (RM) Keuntungan (RM) Caj Lelong (RM) + Harga Asas (RM) Harga Jual (RM) Baki(RM) @@ -68,6 +69,7 @@ {{ $lelongan_detail['bakipjm'] }} {{ $lelongan_detail['keuntungan'] }} {{ $lelongan_detail['cajlelong'] }} + {{ $lelongan_detail['hargaasas'] }} {{ $lelongan_detail['hargajual'] }} {{ $lelongan_detail['baki'] }} @@ -87,6 +89,7 @@ {{ $teller_with_lelongan_data['data']['summary_lelongan_teller']['total_bakipjm'] }} {{ $teller_with_lelongan_data['data']['summary_lelongan_teller']['total_keuntungan'] }} {{ $teller_with_lelongan_data['data']['summary_lelongan_teller']['total_cajlelong'] }} + {{ $teller_with_lelongan_data['data']['summary_lelongan_teller']['total_hargaasas'] }} {{ $teller_with_lelongan_data['data']['summary_lelongan_teller']['total_hargajual'] }} {{ $teller_with_lelongan_data['data']['summary_lelongan_teller']['total_baki'] }} diff --git a/resources/views/exports/lelongan/full.blade.php b/resources/views/exports/lelongan/full.blade.php new file mode 100644 index 0000000..5897d43 --- /dev/null +++ b/resources/views/exports/lelongan/full.blade.php @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @php + $total_berat = 0; + $total_nilaimarhun = 0; + $total_pinjaman = 0; + $total_hargajual = 0; + $total_keuntungan = 0; + $total_cajlelong = 0; + $total_baki = 0; + $total_hargaasas = 0; + $row_no = 1; + @endphp + + @foreach ($lelongan_data as $item) + @php + $total_berat += (float) $item['berat']; + $total_nilaimarhun += (float) $item['nilai_marhun']; + $total_pinjaman += (float) $item['pinjaman']; + $total_hargajual += (float) $item['hargajual']; + $total_keuntungan += (float) ($item['keuntungan'] ?? 0); + $total_cajlelong += (float) ($item['cajlelong'] ?? 0); + $total_baki += (float) ($item['baki'] ?? 0); + $total_hargaasas += (float) ($item['hargaasas'] ?? 0); + @endphp + + + + + + + + + + + + + + + + + + @endforeach + + + + + + + + + + + + + + + +
    + SENARAI LELONGAN KESELURUHAN +
    + Cawangan: {{ $cawangan_detail['nama'] ?? '-' }} | + Tarikh: {{ $query['startDate'] ?? '-' }} hingga {{ $query['endDate'] ?? '-' }} +
     
    #No RujukanNamaNo KPMarhunBeratNilai Marhun (RM)Pembiayaan (RM)%Baki Pembiayaan (RM)Keuntungan (RM)Caj Lelong (RM)Harga Asas (RM)Harga Jual (RM)Baki (RM)
    {{ $row_no++ }}{{ $item['no_rujukan'] ?? '' }}{{ $item['nama'] ?? '' }}'{{ $item['no_kp'] ?? '' }}{{ $item['marhun'] ?? 0 }}{{ $item['berat'] ?? 0 }}{{ $item['nilai_marhun'] ?? 0 }}{{ $item['pinjaman'] ?? 0 }}{{ $item['peratusan_margin_pinjaman'] ?? 0 }}{{ $item['bakipjm'] ?? 0 }}{{ $item['keuntungan'] ?? 0 }}{{ $item['cajlelong'] ?? 0 }}{{ $item['hargaasas'] ?? 0 }}{{ $item['hargajual'] ?? 0 }}{{ $item['baki'] ?? 0 }}
    Jumlah{{ number_format($total_berat, 2) }}{{ number_format($total_nilaimarhun, 2) }}{{ number_format($total_pinjaman, 2) }}{{ number_format($total_pinjaman, 2) }}{{ number_format($total_keuntungan, 2) }}{{ number_format($total_cajlelong, 2) }}{{ number_format($total_hargaasas ?? 0, 2) }}{{ number_format($total_hargajual, 2) }}{{ number_format($total_baki, 2) }}
    diff --git a/resources/views/exports/lelongan/summary.blade.php b/resources/views/exports/lelongan/summary.blade.php index 6875bde..eff8995 100644 --- a/resources/views/exports/lelongan/summary.blade.php +++ b/resources/views/exports/lelongan/summary.blade.php @@ -35,6 +35,7 @@ Baki Pembiayaan(RM) Keuntungan(RM) Caj Lelong(RM) + Harga Asas(RM) Harga Jual(RM) Baki(RM) @@ -49,6 +50,7 @@ {{ $data['summary_lelongan_teller']['total_bakipjm'] }} {{ $data['summary_lelongan_teller']['total_keuntungan'] }} {{ $data['summary_lelongan_teller']['total_cajlelong'] }} + {{ $data['summary_lelongan_teller']['total_hargaasas'] }} {{ $data['summary_lelongan_teller']['total_hargajual'] }} {{ $data['summary_lelongan_teller']['total_baki'] }} @@ -64,6 +66,7 @@ {{ $summary_lelongan['total_bakipjm'] }} {{ $summary_lelongan['total_keuntungan'] }} {{ $summary_lelongan['total_cajlelong'] }} + {{ $summary_lelongan['total_hargaasas'] }} {{ $summary_lelongan['total_hargajual'] }} {{ $summary_lelongan['total_baki'] }} diff --git a/resources/views/reports/laporan-lelong/index.blade.php b/resources/views/reports/laporan-lelong/index.blade.php index 2deef26..8110630 100644 --- a/resources/views/reports/laporan-lelong/index.blade.php +++ b/resources/views/reports/laporan-lelong/index.blade.php @@ -110,6 +110,10 @@ class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider"> Caj Lelong(RM) + + Harga Asas(RM) + Harga Jual(RM) @@ -133,6 +137,7 @@ $totalkeuntungan = 0; $totalcajlelong = 0; $totalhargajual= 0; + $totalhargaasas= 0; $totalbaki= 0; @endphp @@ -146,6 +151,7 @@ $totalkeuntungan += $lelong['sum_bakiupah']; $totalcajlelong+= $lelong['sum_cajlelong']; $totalhargajual+= $lelong['sum_hargajual']; + $totalhargaasas+= $lelong['sum_hargaasas']; $totalbaki+= $lelong['sum_baki']; @endphp @@ -227,6 +233,14 @@
    + +
    +
    +

    + {{ number_format($lelong['sum_hargaasas'], 2) }}

    +
    +
    +
    @@ -330,6 +344,14 @@
    + +
    +
    +

    + {{ number_format($totalhargaasas,2) }}

    +
    +
    +
    From 8cdd8fa51f932d9646f32debf7216a3af0a8d33c Mon Sep 17 00:00:00 2001 From: Ain Izazi Date: Mon, 2 Feb 2026 16:25:42 +0800 Subject: [PATCH 59/79] fix report petibesi adminv2 --- app/Http/Controllers/AkaunController.php | 5 ++--- resources/views/layouts/app.blade.php | 9 +++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index 8b08e16..25fa38d 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -868,9 +868,8 @@ class AkaunController extends Controller $petibesi = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/laporanpetibesi/'. $request->kodcaw .'/'. $tebus_date)->json(); - if(!$petibesi) - { - return redirect()->back()->with('errormessage', 'Tiada data pada tarikh tersebut.'); + if (($petibesi['error'] ?? null) === 'Tiada data pada tarikh tersebut') { + return redirect()->back()->with('peti_besi_error_message', 'Tiada data pada tarikh tersebut.'); } if(isset($request->jenis)) diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index bd8ac88..e0dff38 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -257,6 +257,15 @@ +@endpush diff --git a/resources/views/reports/data-pelanggan-bycaw/show.blade.php b/resources/views/reports/data-pelanggan-bycaw/show.blade.php new file mode 100644 index 0000000..25473b1 --- /dev/null +++ b/resources/views/reports/data-pelanggan-bycaw/show.blade.php @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + +
    Laporan Data Pelanggan + Tarikh Cetak: {{ $tarikh_cetak }} +
    TAHUN LAPORAN{{ $tebus_date }}
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @foreach($pelanggan as $index => $row) + + + + + + + + + + + + + + + + + + + + + + + + @endforeach + +
    NoCawanganNo.PelangganUmurJantinaPekerjaanLokasiTempoh PajakanTarikh MulaTarikh TamatHari Sejak Transaksi TerakhirBil TransaksiBil OutstandingBil TebusJumlah Pinjaman (RM)Jumlah Ujrah (RM)Tujuan GadaianStatus AktifCara BayaranTarikh Lelong
    {{ $index + 1 }}{{ $row['cawangan'] }}{{ $row['nopelanggan'] }}{{ $row['umur'] }}{{ $row['jantina'] }}{{ $row['pekerjaan'] }}{{ $row['daerah'] }}{{ $row['tempoh_pajakan'] }}{{ $row['tarikh_mula'] }}{{ $row['tarikh_tamat'] }}{{ $row['hari_sejak_transaksi'] }}{{ $row['bil_transaksi'] }}{{ $row['bil_outstanding'] }}{{ $row['bil_tebus'] }}{{ number_format($row['jumlah_pinjaman'], 2) }}{{ number_format($row['jumlah_ujrah'], 2) }}{{ $row['tujuan_gadai'] }}{{ $row['status_aktif'] }}{{ $row['cara_bayaran'] }}{{ $row['tarikh_lelong'] }}
    + +
    +
    + + + + + + + + + + + + + + + +
    .................................................................. ..................................................................
    DI SEMAK DI SAHKAN
    diff --git a/routes/reports.php b/routes/reports.php index e33ac7e..2276692 100644 --- a/routes/reports.php +++ b/routes/reports.php @@ -56,4 +56,8 @@ Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->gro Route::get('data-pelanggan-index', [AnalisaController::class, 'dataPelanggan'])->name('reports.dataPelanggan.index'); Route::get('data-pelanggan-show', [AnalisaController::class, 'dataPelangganShow'])->name('reports.dataPelanggan.show'); + + Route::get('data-pelanggan-bycaw-index', [AnalisaController::class, 'dataPelangganBycaw'])->name('reports.dataPelangganBycaw.index'); + Route::get('data-pelanggan-bycaw-show', [AnalisaController::class, 'dataPelangganBycawShow'])->name('reports.dataPelangganBycaw.show'); + }); From d85f741e2643d99ffd9bb9c49169e7ff5e7b0a0d Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Sun, 22 Feb 2026 14:14:33 +0800 Subject: [PATCH 62/79] tambah field barang kes dalam laporan outstanding main --- resources/views/reports/outstanding/index.blade.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/resources/views/reports/outstanding/index.blade.php b/resources/views/reports/outstanding/index.blade.php index a1482a4..25046b7 100644 --- a/resources/views/reports/outstanding/index.blade.php +++ b/resources/views/reports/outstanding/index.blade.php @@ -51,6 +51,8 @@ No Kod Cawangan Cawangan + Bil Pembiayaan (BRG KES) + Jumlah Pembiayaan (RM) Bil Pembiayaan (SAG LAMA) Jumlah Pembiayaan (RM) Bil Pembiayaan (SAG BARU) @@ -61,8 +63,10 @@ @php + $totalbilgadaikes = 0; // KES $totalbilgadai = 0; // LAMA $totalbilgadai2 = 0; // BARU + $totalpinjamankes = 0; // KES $totalpinjaman = 0; // LAMA $totalpinjaman2 = 0; // BARU @@ -72,6 +76,8 @@ @forelse ($outstanding as $outs) @php + $totalbilgadaikes += $outs['total_gadaian_kes']; + $totalpinjamankes += $outs['sum_pinjaman_kes']; $totalbilgadai += $outs['total_gadaian']; $totalpinjaman += $outs['sum_pinjaman']; $totalbilgadai2 += $outs['total_gadaian2']; @@ -84,6 +90,8 @@ {{ $loop->iteration }} {{ $outs['kodcaw'] }} {{ $outs['details_caw'] }} + {{ $outs['total_gadaian_kes'] }} + {{ number_format($outs['sum_pinjaman_kes'], 2) }} {{ $outs['total_gadaian'] }} {{ number_format($outs['sum_pinjaman'], 2) }} {{ $outs['total_gadaian2'] }} @@ -99,6 +107,8 @@ @endforelse Jumlah Keseluruhan + {{ $totalbilgadaikes }} + {{ number_format($totalpinjamankes,2) }} {{ $totalbilgadai }} {{ number_format($totalpinjaman,2) }} {{ $totalbilgadai2 }} From 5c9e848f283e1ce2c2e9ba43dcb16d36857c24d6 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Sun, 22 Feb 2026 14:21:36 +0800 Subject: [PATCH 63/79] update excel laporan outstanding --- app/Exports/LaporanKeseluruhan/OutstandingAllExportExcel.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Exports/LaporanKeseluruhan/OutstandingAllExportExcel.php b/app/Exports/LaporanKeseluruhan/OutstandingAllExportExcel.php index 39f7911..e97c643 100644 --- a/app/Exports/LaporanKeseluruhan/OutstandingAllExportExcel.php +++ b/app/Exports/LaporanKeseluruhan/OutstandingAllExportExcel.php @@ -24,6 +24,8 @@ class OutstandingAllExportExcel implements FromCollection, WithHeadings return [ 'Kod Cawangan', 'Cawangan', + 'Bil Pembiayaan (BRG KES)', + 'Jumlah Pembiayaan (RM)', 'Bil Pembiayaan (SAG LAMA)', 'Jumlah Pembiayaan (RM)', 'Bil Pembiayaan (SAG BARU)', From a92ddca1f542d96f76a44075cc42e70f31f8737d Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Mon, 23 Feb 2026 15:24:47 +0800 Subject: [PATCH 64/79] tambah function untuk stok audit semasa --- .../Reports/StokAuditController.php | 39 ++++-- .../views/reports/stok-audit/index.blade.php | 130 ++++++++++++------ 2 files changed, 113 insertions(+), 56 deletions(-) diff --git a/app/Http/Controllers/Reports/StokAuditController.php b/app/Http/Controllers/Reports/StokAuditController.php index a135393..2a04943 100644 --- a/app/Http/Controllers/Reports/StokAuditController.php +++ b/app/Http/Controllers/Reports/StokAuditController.php @@ -25,38 +25,53 @@ class StokAuditController extends Controller public function show(Request $request) { + $tarikh_cetak = Carbon::now()->toDateString(); // tarikh cetak + + if ($request->dateOption === 'current') { + $date = Carbon::now(); + $tebus_date = $date->format('d-m-Y'); // tarikh semasa + $monthName = $date->translatedFormat('F'); // bulan semasa + } else { $validated = $request->validate( ['monthYear' => 'required'], ['monthYear.required' => 'Sila isi tarikh sebelum hantar', ]); - $current = Carbon::now(); - $tarikh_cetak = $current->toDateString(); $tokens = explode('-', $validated['monthYear']); $month = ltrim($tokens[0], '0'); $year = $tokens[1]; - // Set the locale to Malaysian - App::setLocale('ms'); - - // Create a Carbon instance representing the date - $date = Carbon::createFromDate($year, $month, 1); // Set the day to 1st of the month - - // Get the name of the month in Malaysian local + $date = Carbon::createFromDate($year, $month, 1); // set day = 1 $monthName = $date->translatedFormat('F'); + $tebus_date = $monthName . ' ' . $year; + } + + $month = $date->month; + $year = $date->year; $request->hostname = config('api.url'); $stokAudit = Http::get($request->hostname . '/api/reports/stok-audit', [ 'month' => $month, 'year' => $year, + 'dateOption' => $request->dateOption ])->json(); - $tebus_date = $monthName . ' ' . $year; - $file_title = sprintf("Laporan-StokAudit %s (%s - %s).xlsx", 'Semua cawanangan', $monthName, $year); + $file_title = sprintf( + "Laporan-StokAudit %s (%s).xlsx", + 'Semua cawangan', + $tebus_date + ); if ($request->generateType === 'pdf') { - return view('reports.stok-audit.show', compact('tebus_date', 'tarikh_cetak', 'stokAudit', 'month', 'year')); + return view('reports.stok-audit.show', compact( + 'stokAudit', + 'month', + 'year', + 'monthName', + 'tarikh_cetak', + 'tebus_date' + )); } else { return Excel::download(new StokAuditExport($stokAudit), $file_title); } diff --git a/resources/views/reports/stok-audit/index.blade.php b/resources/views/reports/stok-audit/index.blade.php index 37bbf22..ac7b5e4 100644 --- a/resources/views/reports/stok-audit/index.blade.php +++ b/resources/views/reports/stok-audit/index.blade.php @@ -15,10 +15,7 @@
    @if ($errors->any())
    - -
    - - + + +
    @@ -111,6 +117,18 @@ export default { }); document.getElementById("formstokaudit").submit(); }, + async generateexcelaudit(){ + await this.setJenis('excelaudit'); + Vue.swal({ + title: 'Memuatkan...', + allowEscapeKey : false, + allowOutsideClick: false, + showCancelButton: false, + showConfirmButton: false, + timer: 8000, + }); + document.getElementById("formstokaudit").submit(); + }, Urlredirect: function() { return window.route('cetak.stokaudit'); }, From a3ad23c48c5e9d3c8b98f6a20e06396841231743 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 11 Mar 2026 13:53:08 +0800 Subject: [PATCH 66/79] update column --- app/Exports/SAExportAudit.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/Exports/SAExportAudit.php b/app/Exports/SAExportAudit.php index 757f3d9..b52a876 100644 --- a/app/Exports/SAExportAudit.php +++ b/app/Exports/SAExportAudit.php @@ -139,6 +139,14 @@ class SAExportAudit implements FromCollection, WithHeadings, WithTitle, WithMapp $sheet->getStyle("C5:C{$lastRow}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); $sheet->getStyle("D5:D{$lastRow}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); + // Wrap text untuk semua column + $sheet->getStyle("A5:{$lastCol}{$lastRow}")->getAlignment()->setWrapText(true); + + // Auto-fit semua column berdasarkan content + foreach (range('A', $lastCol) as $col) { + $sheet->getColumnDimension($col)->setAutoSize(true); + } + return []; } From 4c8427af48ef57186a020a90f6cfd93899a2cd1a Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 11 Mar 2026 14:00:55 +0800 Subject: [PATCH 67/79] update column marhun --- app/Exports/SAExportAudit.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/app/Exports/SAExportAudit.php b/app/Exports/SAExportAudit.php index b52a876..0ec04fb 100644 --- a/app/Exports/SAExportAudit.php +++ b/app/Exports/SAExportAudit.php @@ -125,15 +125,19 @@ class SAExportAudit implements FromCollection, WithHeadings, WithTitle, WithMapp $sheet->getStyle('A5:K5')->getFont()->setBold(true); - // Border untuk semua data $lastRow = $sheet->getHighestRow(); $lastCol = 'K'; - $sheet->getStyle("A5:{$lastCol}{$lastRow}")->getBorders()->getAllBorders()->setBorderStyle(Border::BORDER_THIN); + + // Border untuk semua data + $sheet->getStyle("A5:{$lastCol}{$lastRow}") + ->getBorders() + ->getAllBorders() + ->setBorderStyle(Border::BORDER_THIN); // Bold TOTAL row $sheet->getStyle("A{$lastRow}:{$lastCol}{$lastRow}")->getFont()->setBold(true); - // Align center for some columns + // Align center untuk column tertentu $sheet->getStyle("A5:A{$lastRow}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); $sheet->getStyle("B5:B{$lastRow}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); $sheet->getStyle("C5:C{$lastRow}")->getAlignment()->setHorizontal(Alignment::HORIZONTAL_CENTER); @@ -142,11 +146,16 @@ class SAExportAudit implements FromCollection, WithHeadings, WithTitle, WithMapp // Wrap text untuk semua column $sheet->getStyle("A5:{$lastCol}{$lastRow}")->getAlignment()->setWrapText(true); - // Auto-fit semua column berdasarkan content + // Auto-fit semua column kecuali Marhun foreach (range('A', $lastCol) as $col) { - $sheet->getColumnDimension($col)->setAutoSize(true); + if ($col !== 'D') { // skip Marhun + $sheet->getColumnDimension($col)->setAutoSize(true); + } } + // Untuk column Marhun (D), kita boleh set width minimum supaya tak terlalu besar + $sheet->getColumnDimension('D')->setWidth(18); // boleh adjust ikut perlu + return []; } From 412162705e236d93f247e44e3a99486def7854ef Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 11 Mar 2026 14:06:18 +0800 Subject: [PATCH 68/79] update non numeric --- app/Exports/SAExportAudit.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Exports/SAExportAudit.php b/app/Exports/SAExportAudit.php index 0ec04fb..966d8a7 100644 --- a/app/Exports/SAExportAudit.php +++ b/app/Exports/SAExportAudit.php @@ -38,10 +38,10 @@ class SAExportAudit implements FromCollection, WithHeadings, WithTitle, WithMapp 'No KP' => '', 'Marhun' => '', 'Tempoh' => '', - 'Berat (g)' => $data->sum('Berat (g)'), - 'Nilai Marhun' => $data->sum('Nilai Marhun'), - 'Pinjaman' => $data->sum('Pinjaman'), - 'Baki Pinjaman' => $data->sum('Baki Pinjaman'), + 'Berat (g)' => $data->sum(fn($row) => floatval($row['Berat (g)'] ?? 0)), + 'Nilai Marhun' => $data->sum(fn($row) => floatval($row['Nilai Marhun'] ?? 0)), + 'Pinjaman' => $data->sum(fn($row) => floatval($row['Pinjaman'] ?? 0)), + 'Baki Pinjaman' => $data->sum(fn($row) => floatval($row['Baki Pinjaman'] ?? 0)), ]; $data->push($totals); From b8cd3d181d1c409fb0d78ffb1ca6da2da9bc812c Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Wed, 11 Mar 2026 14:11:13 +0800 Subject: [PATCH 69/79] update naming --- app/Exports/SAExportAudit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Exports/SAExportAudit.php b/app/Exports/SAExportAudit.php index 966d8a7..fc09759 100644 --- a/app/Exports/SAExportAudit.php +++ b/app/Exports/SAExportAudit.php @@ -64,9 +64,9 @@ class SAExportAudit implements FromCollection, WithHeadings, WithTitle, WithMapp 'BERAT (G)', 'BERAT AUDIT', 'NILAI MARHUN (RM)', - 'PINJAMAN (RM)', - 'BAKI PINJAMAN (RM)', - 'TEMPOH', + 'PEMBIAYAAN (RM)', + 'BAKI PEMBIAYAAN (RM)', + 'JBG', 'CATATAN' ] ]; From 7416cc9cd0260af7246222e568efddf539e1d610 Mon Sep 17 00:00:00 2001 From: Amirah Date: Wed, 8 Apr 2026 10:11:31 +0800 Subject: [PATCH 70/79] Add column upah 12 on laporan gadai keseluruhan --- .../views/reports/gadaian/index.blade.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/resources/views/reports/gadaian/index.blade.php b/resources/views/reports/gadaian/index.blade.php index 1060397..3a1daf8 100644 --- a/resources/views/reports/gadaian/index.blade.php +++ b/resources/views/reports/gadaian/index.blade.php @@ -89,6 +89,10 @@ Pinjaman(RM) + + + Pendapatan 12 Bulan(RM) @@ -101,6 +105,7 @@ $totalberat = 0; $totalnm = 0; $totalpinjaman = 0; + $totalupah12 = 0; @endphp @forelse ($gadaian as $gadai) @@ -109,6 +114,8 @@ $totalberat += $gadai['sum_berat']; $totalnm += $gadai['sum_nilai_marhun']; $totalpinjaman += $gadai['sum_pinjaman']; + $totalupah12 += $gadai['sum_upah_12']; + @endphp @@ -164,6 +171,14 @@ {{ number_format($gadai['sum_pinjaman'], 2) }}

    + + +
    +
    +

    + {{ number_format($gadai['sum_upah_12'], 2) }}

    +
    +
    @@ -228,6 +243,14 @@
    + +
    +
    +

    + {{ number_format($totalupah12,2) }}

    +
    +
    +
    From 6ca7c0c5b8a577ba8b4080d7174f6284eaa08ded Mon Sep 17 00:00:00 2001 From: Afiq Hamzah Date: Sun, 10 May 2026 16:03:33 +0800 Subject: [PATCH 71/79] Fix null check on ImbangDuga query in ImbangdugaServices --- app/Services/ImbangdugaServices.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Services/ImbangdugaServices.php b/app/Services/ImbangdugaServices.php index e536012..0369697 100644 --- a/app/Services/ImbangdugaServices.php +++ b/app/Services/ImbangdugaServices.php @@ -277,10 +277,12 @@ class ImbangdugaServices { if($variable !== 'recno' && $variable !== 'kodcaw' && $variable !== 'tarikh' && $variable !== 'totalharta' && $variable !== 'totaltanggungan' && $variable !== 'tagtally' && $variable !== 'created_at' && $variable !== 'updated_at'){ if($variable == 'bakilelong'){ - $imbangdugadata = ImbangDuga::orderBy('glcode')->where([['single_var',$variable],['variable',$variable]])->first()->toArray(); + $imbangdugaRow = ImbangDuga::orderBy('glcode')->where([['single_var',$variable],['variable',$variable]])->first(); }else{ - $imbangdugadata = ImbangDuga::orderBy('glcode')->where('variable',$variable)->orWhere('single_var',$variable)->first()->toArray(); + $imbangdugaRow = ImbangDuga::orderBy('glcode')->where('variable',$variable)->orWhere('single_var',$variable)->first(); } + if(!$imbangdugaRow) continue; + $imbangdugadata = $imbangdugaRow->toArray(); if($imbangdugadata['jenis'] == 'harta'){ array_push($array_harta,['glcode' => $imbangdugadata['glcode'],'descpt' => $imbangdugadata['descpt'],'amaun' => $res]); }else{ From 26662e7fdd2b00744fda6ea2316e8aa3e9bf9ec9 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Thu, 28 May 2026 15:56:36 +0800 Subject: [PATCH 72/79] tambah laporan aging penebusan --- .../AgingTebusAllExportExcel.php | 222 ++++++++++++++ .../Controllers/Reports/AgingController.php | 75 ++++- resources/views/indexOverallReport.blade.php | 6 + .../views/reports/agingtebus/index.blade.php | 276 ++++++++++++++++++ routes/reports.php | 2 + 5 files changed, 580 insertions(+), 1 deletion(-) create mode 100644 app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php create mode 100644 resources/views/reports/agingtebus/index.blade.php diff --git a/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php b/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php new file mode 100644 index 0000000..fd83735 --- /dev/null +++ b/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php @@ -0,0 +1,222 @@ +aging = $aging; + $this->startDate = $startDate; + $this->endDate = $endDate; + } + + public function array(): array + { + $rows = []; + $totals = []; + + foreach ($this->aging as $branch) { + $row = [$branch['cawangan']]; + $i = 0; + + foreach ($branch['summary_by_tempoh'] as $summary) { + $row[] = $summary['count']; + $row[] = $summary['sum_bayaran_keuntungan_rebet']; + + // Totals per column + $totals[$i]['count'] = ($totals[$i]['count'] ?? 0) + $summary['count']; + $totals[$i]['sum_bayaran_keuntungan_rebet'] = ($totals[$i]['sum_bayaran_keuntungan_rebet'] ?? 0) + $summary['sum_bayaran_keuntungan_rebet']; + $i++; + } + + // Total per row (cawangan) + $jumlahBil = collect($branch['summary_by_tempoh'])->sum('count'); + $jumlahRM = collect($branch['summary_by_tempoh'])->sum('sum_bayaran_keuntungan_rebet'); + $row[] = $jumlahBil; + $row[] = $jumlahRM; + + // Add to column totals + $totals['jumlah']['count'] = ($totals['jumlah']['count'] ?? 0) + $jumlahBil; + $totals['jumlah']['sum_bayaran_keuntungan_rebet'] = ($totals['jumlah']['sum_bayaran_keuntungan_rebet'] ?? 0) + $jumlahRM; + + $rows[] = $row; + } + + // Add final total row + $totalRow = ['Jumlah']; + foreach ($totals as $key => $val) { + $totalRow[] = $val['count']; + $totalRow[] = $val['sum_bayaran_keuntungan_rebet']; + } + + $rows[] = $totalRow; + + return $rows; + } + + + /** + * Multi-row headings (2 rows) + */ + public function headings(): array + { + $row1 = ['Cawangan']; + $row2 = ['']; + + if (!empty($this->aging[0]['summary_by_tempoh'])) { + foreach ($this->aging[0]['summary_by_tempoh'] as $summary) { + $row1[] = $summary['label']; + $row1[] = ''; // empty to allow merged cell + $row2[] = 'Bil'; + $row2[] = 'RM'; + } + } + + $row1[] = 'Jumlah'; + $row1[] = ''; // for merged "Jumlah" cell + $row2[] = 'Bil'; + $row2[] = 'RM'; + + return [$row1, $row2]; + } + + public function columnFormats(): array +{ + $formats = []; + $colIndex = 2; // Start at column B (Cawangan is A) + + $tempohCount = count($this->aging[0]['summary_by_tempoh'] ?? []); + for ($i = 0; $i < $tempohCount; $i++) { + // Bil column + $bilCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex++); + $formats[$bilCol] = NumberFormat::FORMAT_NUMBER; // ✅ No decimal + + // RM column + $rmCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex++); + $formats[$rmCol] = NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1; // RM with comma and decimals + } + + // Jumlah Bil + $jumlahBilCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex++); + $formats[$jumlahBilCol] = NumberFormat::FORMAT_NUMBER; // ✅ No decimal + + // Jumlah RM + $jumlahRMCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex++); + $formats[$jumlahRMCol] = NumberFormat::FORMAT_NUMBER_COMMA_SEPARATED1; + + return $formats; +} + + + public function bindValue(Cell $cell, $value) + { + if (is_numeric($value)) { + $cell->setValueExplicit($value, DataType::TYPE_NUMERIC); + return true; + } + + return parent::bindValue($cell, $value); + } + + /** + * Merge heading cells using AfterSheet event + */ + public function registerEvents(): array + { + return [ + AfterSheet::class => function(AfterSheet $event) { + + $sheet = $event->sheet->getDelegate(); + + // Tajuk laporan + $sheet->setCellValue('A1', 'LAPORAN AGING PENEBUSAN'); + + // Tarikh laporan + $sheet->setCellValue( + 'A2', + 'Tarikh : ' . + \Carbon\Carbon::parse($this->startDate)->format('d/m/Y') . + ' hingga ' . + \Carbon\Carbon::parse($this->endDate)->format('d/m/Y') + ); + + // Merge tajuk + $lastColumn = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex( + (count($this->aging[0]['summary_by_tempoh'] ?? []) * 2) + 3 + ); + + $sheet->mergeCells("A1:{$lastColumn}1"); + + // Style tajuk + $sheet->getStyle("A1:{$lastColumn}1")->applyFromArray([ + 'font' => [ + 'bold' => true, + 'size' => 14, + ], + 'alignment' => [ + 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER, + ], + ]); + + // Merge header tempoh + $colIndex = 2; // Start from column B + $tempohCount = count($this->aging[0]['summary_by_tempoh'] ?? []); + + $headingRow = 3; + + for ($i = 0; $i < $tempohCount; $i++) { + + $startCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex); + + $endCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex + 1); + + $sheet->mergeCells("{$startCol}{$headingRow}:{$endCol}{$headingRow}"); + + $colIndex += 2; + } + + // Merge Jumlah + $startCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex); + + $endCol = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($colIndex + 1); + + $sheet->mergeCells("{$startCol}{$headingRow}:{$endCol}{$headingRow}"); + }, + ]; + } + + // Mulakan sel untuk data bermula dari A4 (Baris 3 adalah header) + public function startCell(): string + { + return 'A3'; // Data bermula dari baris 4 + } +} diff --git a/app/Http/Controllers/Reports/AgingController.php b/app/Http/Controllers/Reports/AgingController.php index b74b5cc..a8f5905 100644 --- a/app/Http/Controllers/Reports/AgingController.php +++ b/app/Http/Controllers/Reports/AgingController.php @@ -9,7 +9,7 @@ use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Http; use Maatwebsite\Excel\Facades\Excel; use Illuminate\Support\Facades\Auth; -use App\Exports\LaporanKeseluruhan\AgingAllExportExcel; +use App\Exports\LaporanKeseluruhan\AgingTebusAllExportExcel; class AgingController extends Controller { @@ -81,4 +81,77 @@ class AgingController extends Controller } return view('reports.aging.index', compact('aging', 'endDate')); } + + public function agingtebus(Request $request) + { + $current = new Carbon(); + $request->hostname = config('api.url'); + // dd($request->hostname ); + $kod_cawangan = $request->kod_cawangan; + $action = $request->input('action', 'search'); + // dd($action); + + $getReportDate = function ($date_string) use ($current) { + if ($date_string == null) { + return $current->toDateString(); + } + + return $date_string; + }; + + $request->hostname = config('api.url'); + + $startDate = $getReportDate($request->startDate); + + $endDate = $getReportDate($request->endDate); + + $aging = Http::get($request->hostname . '/api/reports/agingtebus', [ + 'startDate' => $startDate, + 'endDate' => $endDate, + ])->json(); + + $aging = $aging ?? []; + + if ($action === 'excel') { + $file_title = sprintf("LaporanAging(%s).xlsx", $kod_cawangan, $startDate, $endDate); + return Excel::download(new AgingTebusAllExportExcel($aging,$startDate,$endDate), $file_title); + } + + return view('reports.agingtebus.index', compact('aging', 'startDate', 'endDate')); + } + public function showagingtebus(Request $request) + { + $current = Carbon::now(); + $action = $request->input('action', 'search'); + + $getReportDate = function ($date_string) use ($current) { + return $date_string ? $date_string : $current->toDateString(); + }; + + $hostname = config('api.url'); + + $startDate = $getReportDate($request->startDate); + $endDate = $getReportDate($request->endDate); + + $response = Http::get("$hostname/api/reports/agingtebus", [ + 'startDate' => $startDate, + 'endDate' => $endDate, + ]); + + $aging = $response->json() ?? []; // Ensure it's an array + + // Debugging: Check the response before using it + if (empty($aging)) { + return back()->with('error', 'Failed to fetch data from API.'); + } + + if ($action === 'excel') { + // Ensure $kod_cawangan is defined (Modify as per your data structure) + $kod_cawangan = $request->input('kod_cawangan', 'DEFAULT'); + + $file_title = sprintf("LaporanAgingTebus(%s).xlsx", $kod_cawangan, $startDate, $endDate); + return Excel::download(new AgingTebusAllExportExcel($aging, $startDate, $endDate), $file_title); + } + return view('reports.agingtebus.index', compact('aging', 'startDate', 'endDate')); + } } diff --git a/resources/views/indexOverallReport.blade.php b/resources/views/indexOverallReport.blade.php index 19abb71..979940d 100644 --- a/resources/views/indexOverallReport.blade.php +++ b/resources/views/indexOverallReport.blade.php @@ -128,6 +128,12 @@

    Data Pelanggan By Cawangan

    +
    diff --git a/resources/views/reports/agingtebus/index.blade.php b/resources/views/reports/agingtebus/index.blade.php new file mode 100644 index 0000000..af13fb6 --- /dev/null +++ b/resources/views/reports/agingtebus/index.blade.php @@ -0,0 +1,276 @@ +@extends('layouts.app') + +@section('content') + +
    +
    + +
    + + + + +
    +
    +
    +
    + + + + Laporan Aging Penebusan +
    + +
    + +
    +
    + + + +
    + + {{-- Dari --}} +
    + + + +
    + + {{-- Hingga --}} +
    + + + +
    + + + + {{-- Button Group --}} +
    + + {{-- Button Group --}} +
    + + {{-- Search --}} + + + {{-- Excel --}} + + +
    + +
    + +
    + +
    + +
    +
    +
    +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + +
    + + @if(empty($aging)) +
    + Tiada data dijumpai untuk tarikh {{ $endDate }}. +
    + @else + + +
    + + + + + + + @foreach ($aging[0]['summary_by_tempoh'] as $summary) + + @endforeach + + + + + + @foreach ($aging[0]['summary_by_tempoh'] as $summary) + + + @endforeach + + + + + + + @php + $counter = 1; + + $totalGrandCountByTempoh = array_fill( + 0, + count($aging[0]['summary_by_tempoh']), + 0 + ); + + $totalGrandKeuntunganByTempoh = array_fill( + 0, + count($aging[0]['summary_by_tempoh']), + 0 + ); + @endphp + + @foreach ($aging as $branch) + + @php + $totalCount = 0; + $totalKeuntungan = 0; + @endphp + + + + + + + @foreach ($branch['summary_by_tempoh'] as $index => $summary) + + {{-- Bil --}} + + + {{-- RM --}} + + + @php + // Total per cawangan + $totalCount += $summary['count']; + + $totalKeuntungan += + $summary['sum_bayaran_keuntungan_rebet']; + + // Grand total + $totalGrandCountByTempoh[$index] += + $summary['count']; + + $totalGrandKeuntunganByTempoh[$index] += + $summary['sum_bayaran_keuntungan_rebet']; + @endphp + + @endforeach + + {{-- Keseluruhan --}} + + + + + + @endforeach + + + + + + + + @foreach ($totalGrandCountByTempoh as $index => $grandCount) + + {{-- Grand total bil --}} + + + {{-- Grand total RM --}} + + + @endforeach + + {{-- Total keseluruhan --}} + + + + + + +
    Bil. Cawangan{{ $summary['label'] }} Keseluruhan
    Bil RM BilRM
    + {{ $counter++ }} + + {{ $branch['cawangan'] }} + + {{ $summary['count'] }} + + {{ number_format($summary['sum_bayaran_keuntungan_rebet'], 2) }} + + {{ $totalCount }} + + {{ number_format($totalKeuntungan, 2) }} +
    + Total + + {{ $grandCount }} + + {{ number_format($totalGrandKeuntunganByTempoh[$index], 2) }} + + {{ array_sum($totalGrandCountByTempoh) }} + + {{ number_format(array_sum($totalGrandKeuntunganByTempoh), 2) }} +
    +
    + + @endif +
    +
    +
    + @include('layouts.footer') + +
    +@endsection + + + diff --git a/routes/reports.php b/routes/reports.php index 2276692..eec89f5 100644 --- a/routes/reports.php +++ b/routes/reports.php @@ -60,4 +60,6 @@ Route::middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter, null'])->gro Route::get('data-pelanggan-bycaw-index', [AnalisaController::class, 'dataPelangganBycaw'])->name('reports.dataPelangganBycaw.index'); Route::get('data-pelanggan-bycaw-show', [AnalisaController::class, 'dataPelangganBycawShow'])->name('reports.dataPelangganBycaw.show'); + Route::get('agingtebus/view', [AgingController::class, 'agingtebus'])->name('reports.agingtebus.index'); + Route::get('laporan-agingtebus/view', [AgingController::class, 'showagingtebus'])->name('reports.agingtebus.show'); }); From 8c9ed2f14b3cf105f12f1d23a40deae7ddb1f977 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Tue, 2 Jun 2026 11:53:30 +0800 Subject: [PATCH 73/79] update tajuk --- resources/views/indexOverallReport.blade.php | 2 +- resources/views/reports/agingtebus/index.blade.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/indexOverallReport.blade.php b/resources/views/indexOverallReport.blade.php index 979940d..7bb55a9 100644 --- a/resources/views/indexOverallReport.blade.php +++ b/resources/views/indexOverallReport.blade.php @@ -131,7 +131,7 @@ diff --git a/resources/views/reports/agingtebus/index.blade.php b/resources/views/reports/agingtebus/index.blade.php index af13fb6..d7d92b9 100644 --- a/resources/views/reports/agingtebus/index.blade.php +++ b/resources/views/reports/agingtebus/index.blade.php @@ -8,7 +8,7 @@
    + :items="[{ 'title': 'Laporan Keseluruhan', 'icon': 'fas fa-users', 'url': '{{ route('reports') }}' }, { 'title': 'Laporan Keuntungan Penebusan By Tempoh', 'icon': 'fas fa-file' }]">
    @@ -18,7 +18,7 @@ - Laporan Aging Penebusan + Laporan Keuntungan Penebusan By Tempoh
    From 0b3979bb4fdbfd18151d146ef7a188b364076c21 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Tue, 2 Jun 2026 11:58:36 +0800 Subject: [PATCH 74/79] update tukar tajuk excel --- app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php b/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php index fd83735..93a0a65 100644 --- a/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php +++ b/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php @@ -158,7 +158,7 @@ class AgingTebusAllExportExcel extends DefaultValueBinder implements $sheet = $event->sheet->getDelegate(); // Tajuk laporan - $sheet->setCellValue('A1', 'LAPORAN AGING PENEBUSAN'); + $sheet->setCellValue('A1', 'LAPORAN KEUNTUNGAN PENEBUSAN BY TEMPOH'); // Tarikh laporan $sheet->setCellValue( From 52794fb4fd6626accff8c4a0211a74c0de86b7a6 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Tue, 2 Jun 2026 13:45:58 +0800 Subject: [PATCH 75/79] update tajuk --- app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php | 2 +- resources/views/indexOverallReport.blade.php | 2 +- resources/views/reports/agingtebus/index.blade.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php b/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php index 93a0a65..f3a1c4b 100644 --- a/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php +++ b/app/Exports/LaporanKeseluruhan/AgingTebusAllExportExcel.php @@ -158,7 +158,7 @@ class AgingTebusAllExportExcel extends DefaultValueBinder implements $sheet = $event->sheet->getDelegate(); // Tajuk laporan - $sheet->setCellValue('A1', 'LAPORAN KEUNTUNGAN PENEBUSAN BY TEMPOH'); + $sheet->setCellValue('A1', 'KEUNTUNGAN PENYELESAIAN PEMBIAYAAN BY TEMPOH'); // Tarikh laporan $sheet->setCellValue( diff --git a/resources/views/indexOverallReport.blade.php b/resources/views/indexOverallReport.blade.php index 7bb55a9..f4c58cb 100644 --- a/resources/views/indexOverallReport.blade.php +++ b/resources/views/indexOverallReport.blade.php @@ -131,7 +131,7 @@
    diff --git a/resources/views/reports/agingtebus/index.blade.php b/resources/views/reports/agingtebus/index.blade.php index d7d92b9..2c69e53 100644 --- a/resources/views/reports/agingtebus/index.blade.php +++ b/resources/views/reports/agingtebus/index.blade.php @@ -8,7 +8,7 @@
    + :items="[{ 'title': 'Laporan Keseluruhan', 'icon': 'fas fa-users', 'url': '{{ route('reports') }}' }, { 'title': 'Keuntungan Penyelesaian Pembiayaan By Tempoh', 'icon': 'fas fa-file' }]">
    @@ -18,7 +18,7 @@ - Laporan Keuntungan Penebusan By Tempoh + Keuntungan Penyelesaian Pembiayaan By Tempoh
    From 79b9a8a450e9a1e90d0e0858c3255c6fa01cbd88 Mon Sep 17 00:00:00 2001 From: Nur Izzati Date: Fri, 5 Jun 2026 22:57:05 +0800 Subject: [PATCH 76/79] update daftar senhitam --- .../js/components/util/BlacklistModal.vue | 93 ++++++++++++------- 1 file changed, 58 insertions(+), 35 deletions(-) diff --git a/resources/js/components/util/BlacklistModal.vue b/resources/js/components/util/BlacklistModal.vue index 654bc61..d32aec5 100644 --- a/resources/js/components/util/BlacklistModal.vue +++ b/resources/js/components/util/BlacklistModal.vue @@ -115,12 +115,19 @@ export default { }, methods: { toggleModal: function(){ - this.showModal = !this.showModal; - this.arrayCustomer = []; - this.specCust = []; + + this.showModal = !this.showModal; + + this.arrayCustomer = []; + this.specCust = {}; + this.nota = ''; + + if(this.$refs.btnDropdownRef){ + this.$refs.btnDropdownRef.value = ''; + } }, async toggleDropdown() { - + this.specCust = {}; await this.getData() if(this.arrayCustomer.length > 0) @@ -137,42 +144,52 @@ export default { } }, - getData: function() { + async getData() { let inputvalue = document.getElementById("frminput").value; - if(inputvalue) + if(!inputvalue) { - if(this.hasNumber(inputvalue)) - { - this.axios.get(this.$api1 + '/admin/searchByIC', { - params: { - ic: inputvalue, - kodcaw: this.$kodcaw - } - }).then(response => { - this.arrayCustomer = response.data + this.arrayCustomer = []; + return; + } - }).catch(error => { - console.log(error) - }) + try { - + let response; - }else{ - this.axios.get(this.$api1 + '/admin/searchByName', { - params: { - nama: inputvalue, - kodcaw: this.$kodcaw + if (this.hasNumber(inputvalue)) { + + response = await this.axios.get( + this.$api1 + '/admin/searchByIC', + { + params: { + ic: inputvalue, + kodcaw: this.$kodcaw + } + } + ); + + } else { + + response = await this.axios.get( + this.$api1 + '/admin/searchByName', + { + params: { + nama: inputvalue, + kodcaw: this.$kodcaw + } + } + ); } - }).then(response => { - this.arrayCustomer = response.data - }).catch(error => { - console.log(error) - }) - } + this.arrayCustomer = response.data || []; + + } catch (error) { + + console.log(error); + this.arrayCustomer = []; } }, @@ -221,6 +238,13 @@ export default { }, kemaskinifunc: function(){ + if (!this.specCust || !this.specCust.id) { + this.$toast.error( + "Sila pilih pelanggan daripada senarai carian terlebih dahulu." + ); + return; + } + axios.post(this.$hostname + '/admin/AddSenaraiHitam', { kodcaw: this.$kodcaw, @@ -229,19 +253,18 @@ export default { }).then(response => { - if(response.data == 'berjaya') + if(response.data && response.data.id) { this.showModal = false; - this.$toast.success("Kemaskini Sudah Berjaya!") + this.$toast.success("Kemaskini Sudah Berjaya!"); // vm.$forceUpdate(); - this.$emit('clickEvent_', this.pageNumber) - + this.$emit('clickEvent_', this.pageNumber); // setTimeout("window.location.reload()", 3000); }else{ this.showModal = false; - this.$toast.error("Kemaskini tidak berjaya") + this.$toast.error("Kemaskini tidak berjaya"); } }); From 76787a12ec8b2615dae47a2b714bd6e20ee2e5a9 Mon Sep 17 00:00:00 2001 From: Nisha Muhd Date: Thu, 11 Jun 2026 16:16:35 +0800 Subject: [PATCH 77/79] change-using api_url --- app/Http/Controllers/AkaunController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index bdaae3e..2075b04 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -581,9 +581,9 @@ class AkaunController extends Controller $request->hostname = config('app.env') == 'production' ? 'http://apiujrah.arrahn' : $request->hostname; - $tuntutbaki = Http::get($request->hostname. '/api/TuntutBakiRangeDate/'. $request->kodcaw,['mula' => $tarikh_mula,'akhir' => $tarikh_akhir])->json(); + $tuntutbaki = Http::get($api_url. '/api/TuntutBakiRangeDate/'. $request->kodcaw,['mula' => $tarikh_mula,'akhir' => $tarikh_akhir])->json(); - $cawangan=Http::get($request->hostname.'/api/cawangan/detail/'.$request->kodcaw)->json(); + $cawangan=Http::get($api_url.'/api/cawangan/detail/'.$request->kodcaw)->json(); $cawangan_detail=$cawangan[0]; if(isset($request->jenis)) @@ -1730,7 +1730,7 @@ public function cetakLaporanAnsuranRangeDate(Request $request){ // Tetapkan hostname ikut environment $request->hostname = config('app.env') == 'production' ? 'http://apiujrah.arrahn' : $request->hostname; - $response = Http::get($request->hostname . '/api/ansuranujrah/laporan/' . $request->kodcaw, [ + $response = Http::get($api_url . '/api/ansuranujrah/laporan/' . $request->kodcaw, [ 'mula' => $mula_date, 'akhir' => $hingga_date, 'jenis' => $request->laporanansuran @@ -1742,7 +1742,7 @@ public function cetakLaporanAnsuranRangeDate(Request $request){ $tebus = $response->json(); } - $cawangan = Http::get($request->hostname . '/api/cawangan/detail/' . $request->kodcaw)->json(); + $cawangan = Http::get($api_url . '/api/cawangan/detail/' . $request->kodcaw)->json(); $cawangan_detail = $cawangan[0] ?? ['nama' => 'Tiada data']; // Tajuk laporan ikut jenis From c7bfc618644c320ddb3b896d44ca0a3403c7813c Mon Sep 17 00:00:00 2001 From: Nisha Muhd Date: Thu, 18 Jun 2026 16:14:53 +0800 Subject: [PATCH 78/79] fixbugs-laptuntutbaki-ansuran --- app/Http/Controllers/AkaunController.php | 1 - resources/views/akaun/laporan_tuntutbaki.blade.php | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index 2075b04..15a5f66 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -883,7 +883,6 @@ class AkaunController extends Controller // ])->json(); // $laporan_ringkasan = $laporan_ringkasan[0]; - $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$request->kodcaw)->json(); $cawangan_detail=$cawangan[0]; diff --git a/resources/views/akaun/laporan_tuntutbaki.blade.php b/resources/views/akaun/laporan_tuntutbaki.blade.php index 166eb62..04ab64e 100644 --- a/resources/views/akaun/laporan_tuntutbaki.blade.php +++ b/resources/views/akaun/laporan_tuntutbaki.blade.php @@ -164,7 +164,7 @@ @php - $api_url = request()->hostname; + $api_url = $api_url; @endphp @if(Str::contains($api_url, 'apiv3.arrahn')) @@ -227,7 +227,7 @@ @foreach($tuntutbaki as $index=>$item) @php $totaljumlah += $item['jumlah'] @endphp @if($index > 0) - @if($item['teller'] != $tuntutbaki[$index - 1]['teller']) + @if($item['teller'] != ($tuntutbaki[$index - 1]['teller'] ?? null)) @@ -240,18 +240,20 @@ @php $totalpinjamanteller = 0;$totalcajlelong = 0; @endphp @endif + - + From 535b21dd6ce0699a526825ced8ddddc4d1e69593 Mon Sep 17 00:00:00 2001 From: Nisha Muhd Date: Mon, 22 Jun 2026 12:19:43 +0800 Subject: [PATCH 79/79] fix-brgkes-updatelength --- resources/js/components/Searchbarangkes.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/components/Searchbarangkes.vue b/resources/js/components/Searchbarangkes.vue index f158631..e3031bc 100644 --- a/resources/js/components/Searchbarangkes.vue +++ b/resources/js/components/Searchbarangkes.vue @@ -58,7 +58,7 @@ const length = this.inputValue.length; if (length > 0 && length < 10) { this.warningMessage = 'Input terlalu pendek. Minimum 10 aksara.'; -} else if (length > 17) { +} else if (length > 30) { this.warningMessage = 'Input terlalu panjang.'; } else { this.warningMessage = '';
    Teller : {{ $item['teller'] }}
    {{ $counter }} @php - // $gadaidetail = Http::get($api_url . '/api/gadai/norujukan/' . $item['norujukan'])->json(); - code asal - // $gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/gadai/norujukankodcaw/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); + //// $gadaidetail = Http::get($api_url . '/api/gadai/norujukan/' . $item['norujukan'])->json(); - code asal + //// $gadaidetail = Http::withOptions(['verify' => config('app.api_verify')])->get($api_url . '/api/gadai/norujukankodcaw/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); $gadaidetail = Http::get($api_url . '/api/gadai/norujukan/' . $item['kodcaw'] . '/' . $item['norujukan'])->json(); - $customer_detail = Http::get($api_url . '/api/customers/' . $gadaidetail[0][0]['nokp'])->json(); + $customer_detail = Http::get($api_url . '/api/customers/' . $gadaidetail[0]['nokp'])->json(); echo $customer_detail['nama']; @endphp + {{$gadaidetail[0][0]['nokp']}}{{$gadaidetail[0]['nokp']}} {{$item['norujukan']}} {{ $item['tarikh'] }} {{ $item['cajlelong'] }}