From 698b9cfacefe354204b636f81d6afc41cf7be769 Mon Sep 17 00:00:00 2001 From: Amirah Date: Thu, 18 Jan 2024 14:43:09 +0800 Subject: [PATCH] combine laporan stokaudit (aktif dan tak aktif) --- app/Http/Controllers/AkaunController.php | 35 ++ resources/js/Akaun/Home.vue | 7 + resources/js/Akaun/StokAuditCombine.vue | 123 ++++++ resources/js/routes.js | 4 + .../akaun/laporan_stokaudit_combine.blade.php | 368 ++++++++++++++++++ routes/web.php | 2 + 6 files changed, 539 insertions(+) create mode 100644 resources/js/Akaun/StokAuditCombine.vue create mode 100644 resources/views/akaun/laporan_stokaudit_combine.blade.php diff --git a/app/Http/Controllers/AkaunController.php b/app/Http/Controllers/AkaunController.php index 9c259f4..2c2848f 100644 --- a/app/Http/Controllers/AkaunController.php +++ b/app/Http/Controllers/AkaunController.php @@ -1502,4 +1502,39 @@ class AkaunController extends Controller // } } + + public function cetaklaporan_stokaudit_combine(Request $request){ + + $api_url = $request->hostname; + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + if($request->datetimepicker1 == null){ + $tebus_date = $current->toDateString(); + }else{ + $tebus_date = $request->datetimepicker1; + } + + $cawangan=Http::get($api_url.'/api/cawangan/detail/'.$request->kodcaw)->json(); + $cawangan_detail=$cawangan[0]; + + if(isset($request->jenis)) + { + if($request->jenis == 'pdf') + { + $stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json(); + $stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json(); + $pdf = PDF::loadView('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url'))->setPaper('a4', 'potrait'); + return $pdf->download('laporan_stokaudit_' . $request->kodcaw .'_'. $tebus_date . '.pdf'); + } + else{ + + $stokaudit_aktif = Http::get($api_url. '/api/stokaudit/aktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json(); + $stokaudit_takaktif = Http::get($api_url. '/api/stokaudit/takaktif/'. $request->kodcaw,['tarikh' => $tebus_date])->json(); + return view('akaun.laporan_stokaudit_combine', compact('stokaudit_aktif','stokaudit_takaktif','cawangan_detail','tarikh_cetak','tebus_date','api_url')); + + } + } + } } diff --git a/resources/js/Akaun/Home.vue b/resources/js/Akaun/Home.vue index 725afdb..dfaf726 100644 --- a/resources/js/Akaun/Home.vue +++ b/resources/js/Akaun/Home.vue @@ -26,6 +26,13 @@ +
+ + Windster Logo +

Stok Audit Baru

+
+
+
Windster Logo diff --git a/resources/js/Akaun/StokAuditCombine.vue b/resources/js/Akaun/StokAuditCombine.vue new file mode 100644 index 0000000..32cd92c --- /dev/null +++ b/resources/js/Akaun/StokAuditCombine.vue @@ -0,0 +1,123 @@ + + + + diff --git a/resources/js/routes.js b/resources/js/routes.js index 850a94a..97986fc 100644 --- a/resources/js/routes.js +++ b/resources/js/routes.js @@ -29,6 +29,8 @@ import Online from './Akaun/Online' import TuntutLelong from './Akaun/TuntutLelong' import Dashboard from './Dashboard/index' import BilanganPengadai from './Akaun/BilanganPengadai' +import StokAuditCombine from './Akaun/StokAuditCombine' + @@ -92,6 +94,8 @@ export default new VueRouter({ { path: '/akaunhome/online', component: Online }, { path: '/akaunhome/tuntutrugi', component: TuntutLelong }, { path: '/akaunhome/BilanganPengadai', component: BilanganPengadai }, + { path: '/akaunhome/StokAuditCombine', component: StokAuditCombine }, + diff --git a/resources/views/akaun/laporan_stokaudit_combine.blade.php b/resources/views/akaun/laporan_stokaudit_combine.blade.php new file mode 100644 index 0000000..997b600 --- /dev/null +++ b/resources/views/akaun/laporan_stokaudit_combine.blade.php @@ -0,0 +1,368 @@ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
Laporan Stok Audit 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', $tebus_date); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) + @endphp +
+ +
+ + + + + + + + + + + + + + + + @php $counter = 1;$totalpinjaman = 0; @endphp + @foreach($stokaudit_aktif['rekod'] as $index=>$item) + @php if($item['hargajualan'] == null) $totalpinjaman += $item['pinjaman']; else $totalpinjaman += + $item['bakipjm']; @endphp + + + + + + + + + + + + + {{-- --}} + + + @php $counter++; @endphp + @endforeach + + + + + + + + + + + +
BilNorujukanJBGNo. KPBeratNilai Marhun (RM)Pembiayaan Asal (RM)Baki Pembiayaan (RM)Kadar UpahTempoh Belum BayarKeuntungan Belum Bayar (RM)Lanjutan
{{ $counter }}{{$item['norujukan']}}{{ $item['tempoh'] }}{{$item['nokp']}}{{ number_format($item['berat'],2) }}{{ number_format($item['nilaimarhun'],2) }}{{ number_format($item['pinjaman'],2) }}{{ number_format($item['bakipjm'],2) }}{{ number_format($item['kadarupah'],2) }}{{ number_format($item['tempoh'] - $item['tempohbayar'],2) }}{{ number_format($item['tunggakan'],2) }}{{ number_format($item['pinjaman'],2) }}{{$item['lelong_tawarruq']}}
Jumlah{{ number_format($stokaudit_aktif['totalberat'],2) }}{{ number_format($stokaudit_aktif['totalnilaimarhun'],2) }}{{ number_format($stokaudit_aktif['totalpinjaman'],2) }}{{ number_format($stokaudit_aktif['totalbakipjm'],2) }}{{ number_format($stokaudit_aktif['totaltunggakan'],2) }}
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + +
Laporan Stok Audit Tidak Aktif 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', $tebus_date); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate) + @endphp +
+ +
+ + + + + + + + + + + + @php $counter = 1;$totalpinjaman = 0; @endphp + @foreach($stokaudit_takaktif['rekod'] as $index=>$item) + @php if($item['hargajualan'] == null) $totalpinjaman += $item['pinjaman']; else $totalpinjaman += + $item['bakipjm']; @endphp + + + + + + + + + + + @php $counter++; @endphp + @endforeach + + + + + + + +
BilNorujukanJBGNo. KPBeratNilai Marhun (RM)PembiayaanLanjutan
{{ $counter }}{{$item['norujukan']}}{{ $item['jbg'] }}{{$item['nokp']}}{{ number_format($item['berat'],2) }}{{ number_format($item['nilaimarhun'],2) }}@php if($item['hargajualan'] == null) echo number_format($item['pinjaman'],2); else echo + number_format($item['bakipjm'],2); @endphp{{$item['lelong_tawarruq']}}
Jumlah{{ number_format($stokaudit_takaktif['totalberat'],2) }}{{ number_format($stokaudit_takaktif['totalnilaimarhun'],2) }}{{ number_format($totalpinjaman,2) }}
+ +
+
+ + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
+
\ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 94a7277..fe46914 100644 --- a/routes/web.php +++ b/routes/web.php @@ -116,6 +116,8 @@ Route::get('/akaunhome/cetakserahtebus',['as'=>'cetak.serahtebus','uses'=>'App\H Route::get('/akaunhome/cetakonline',['as'=>'cetak.online','uses'=>'App\Http\Controllers\AkaunController@cetak_laporan_online'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); Route::get('/akaunhome/cetaktuntutrugi',['as'=>'cetak.tuntutrugilelong','uses'=>'App\Http\Controllers\AkaunController@cetak_tuntutrugilelong'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); Route::get('/akaunhome/cetakbilanganpengadai',['as'=>'cetak.bilpengadai','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_bilangan_pengadai'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); +Route::get('/akaunhome/cetakstokauditCombine',['as'=>'cetak.stokauditCombine','uses'=>'App\Http\Controllers\AkaunController@cetaklaporan_stokaudit_combine'])->middleware(['roleChecker:admin,akaun,operasi,kpo,callcenter']); +