From c54f0b21b5b8850e875af99a0bdde2dbcf80e56e Mon Sep 17 00:00:00 2001 From: BTMS1 Date: Mon, 20 Nov 2023 08:50:06 +0800 Subject: [PATCH 1/4] tambah function stok audit excel pdf dan job blast wasap --- app/Http/Controllers/KhazanahController.php | 98 ++++ .../views/excel/excel_stokauditkhas.blade.php | 346 ++++++++++++++ .../views/khazanah/laporan/index.blade.php | 3 + .../khazanah/laporan/stokauditkhas.blade.php | 151 ++++++ .../views/pdf/pdf_stokauditkhas.blade.php | 350 ++++++++++++++ .../print/laporan_stokauditkhas.blade.php | 434 ++++++++++++++++++ routes/web.php | 5 + 7 files changed, 1387 insertions(+) create mode 100644 resources/views/excel/excel_stokauditkhas.blade.php create mode 100644 resources/views/khazanah/laporan/stokauditkhas.blade.php create mode 100644 resources/views/pdf/pdf_stokauditkhas.blade.php create mode 100644 resources/views/print/laporan_stokauditkhas.blade.php diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 13638e4..6011318 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -4176,4 +4176,102 @@ class KhazanahController extends Controller return view('print.laporan_imbangduga-akru',compact('tarikh_imbangan', 'tarikh_imbangan2','hartasemasa','tanggungansemasa','totalhartasemasa','totaltanggungansemasa','tarikh_cetak','cawangan_info','cawangan','api_url','cawangan_detail')); } + public function laporanStokAuditKhas(){ + $auth_user = Auth::user(); + $api_url = config('api.url'); + + + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/gadai/cawangan/'. $auth_user['cawangan'])->json(); + + return view('khazanah.laporan.stokauditkhas',compact('cawangan_info','api_url')); + } + + public function cetakLaporanStokAuditKhas(Request $request){ + $api_url = config('api.url'); + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + $daritempoh = $request->daritempoh; + $hinggatempoh = $request->hinggatempoh; + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + // if($request->datetimepicker1 == null){ + // $tebus_date = $current->toDateString(); + // }else{ + // $split_date = explode('-',$request->datetimepicker1); + // $tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + // } + + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + if($request->radaktif === 'aktif') + { + $stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokauditkhas/aktif/'. $auth_user['cawangan'],['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh])->json(); + // dd($stokaudit); + return view('print.laporan_stokauditkhas', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info')); + } + // else{ + // $stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokauditkhas/takaktif/'. $auth_user['cawangan'],['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh])->json(); + // return view('print.laporan_stokauditkhasbelumaktif', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url')); + // } + + + // dd($gadai); + } + + public function cetakExportLaporanStokAuditKhas(Request $request){ + // dd($request->all()); + $api_url = config('api.url'); + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + $daritempoh = $request->daritempoh; + $hinggatempoh = $request->hinggatempoh; + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + $stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokauditkhas/aktif/'. $auth_user['cawangan'],['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh])->json(); + + if($request->type == 'excel') + { + return view('excel.excel_stokauditkhas', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info')); + } + elseif($request->type == 'whatsapp') + { + + $blastwhatsapp = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.url').'/api/blastwasap/'.$auth_user['cawangan'], + ['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh, 'namapengguna' => $auth_user['name'],])->json(); + // dd($blastwhatsapp); + if($blastwhatsapp == 'success'){ + return redirect()->route('laporan.stokauditkhas') + ->with('success','Blast Whatsapp Dalam Proses.'); + } + elseif($blastwhatsapp == 'failed'){ + return redirect()->route('laporan.stokauditkhas') + ->with('failed','Blast Whatsapp Tidak Berjaya, Sila Semak Semula Rekod Blasted.'); + } + + // return view('excel.excel_stokauditkhas', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info')); + } + else + { + $stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/stokauditkhas/aktif/'. $auth_user['cawangan'],['daritempoh' => $daritempoh, 'hinggatempoh' => $hinggatempoh])->json(); + return view('pdf.pdf_stokauditkhas', compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info')); + + // $pdf = PDF::loadView('pdf.pdf_stokauditkhas',compact('stokaudit','cawangan_detail','tarikh_cetak','daritempoh','hinggatempoh','api_url','cawangan_info')) + // ->setPaper('a4', 'potrait'); + + // return $pdf->download('Stok Audit Khas.pdf'); + + } + + + // dd($gadai); + } + } diff --git a/resources/views/excel/excel_stokauditkhas.blade.php b/resources/views/excel/excel_stokauditkhas.blade.php new file mode 100644 index 0000000..8b048df --- /dev/null +++ b/resources/views/excel/excel_stokauditkhas.blade.php @@ -0,0 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
Laporan Stok Audit 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; + @endphp + {{-- {{dd($stokaudit['rekod'])}} --}} + @foreach ($stokaudit['rekod'] as $index => $item) + @php + if ($item['listsag'][0]['hargajualan'] == null) { + $totalpinjaman += $item['listsag'][0]['pinjaman']; + } else { + $totalpinjaman += $item['listsag'][0]['bakipjm']; + } + @endphp + + + + + + + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + + @php $counter++; @endphp + @endforeach + + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + {{-- --}} + +
BilNamaNo. KPNo. TelefonNorujukanTempohBeratNilai Marhun (RM)Pembiayaan Asal (RM)Baki Pembiayaan (RM)Kadar UpahTempoh Belum BayarKeuntungan Belum Bayar (RM)Lanjutan
{{ $counter }}{{ $item['info']['nama'] ?? '-' }}'{{ $item['nokp'] }}6{{ $item['info']['telefon'] ?? '' }}@foreach($item['listsag'] as $item1){{ $item1['norujukan']}},
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['tempoh']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['berat']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['nilaimarhun']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['pinjaman']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['bakipjm']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['kadarupah']}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tempoh'] - $item1['tempohbayar'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tunggakan'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['lelong_tawarruq']}}
@endforeach
Jumlah{{ number_format($stokaudit['totalberat'], 2) }}{{ number_format($stokaudit['totalnilaimarhun'], 2) }}{{ number_format($stokaudit['totalpinjaman'], 2) }}{{ number_format($stokaudit['totalbakipjm'], 2) }}{{ number_format($stokaudit['totaltunggakan'], 2) }}
+ + + + + + + + diff --git a/resources/views/khazanah/laporan/index.blade.php b/resources/views/khazanah/laporan/index.blade.php index 5f124b3..b24cf1c 100644 --- a/resources/views/khazanah/laporan/index.blade.php +++ b/resources/views/khazanah/laporan/index.blade.php @@ -82,6 +82,9 @@
Serah Marhun Tebus
+
+ SA(Blast Wasap) +
diff --git a/resources/views/khazanah/laporan/stokauditkhas.blade.php b/resources/views/khazanah/laporan/stokauditkhas.blade.php new file mode 100644 index 0000000..fda0e8f --- /dev/null +++ b/resources/views/khazanah/laporan/stokauditkhas.blade.php @@ -0,0 +1,151 @@ +@extends('layouts.app') + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @elseif ($message = Session::get('failed')) +
+

{{ $message }}

+
+ @endif + +
+
+
+
+ @csrf +
+
+ Dari Tempoh +
+ +
+ +
+
+
+
+ Hingga Tempoh +
+ + +
+
+ +
+

+
+
+ + {{-- --}} +
+ +
+ +
+ +
+
+
+
+
+ +@endsection + diff --git a/resources/views/pdf/pdf_stokauditkhas.blade.php b/resources/views/pdf/pdf_stokauditkhas.blade.php new file mode 100644 index 0000000..1284c53 --- /dev/null +++ b/resources/views/pdf/pdf_stokauditkhas.blade.php @@ -0,0 +1,350 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
Laporan Stok Audit 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; + @endphp + {{-- {{dd($stokaudit['rekod'])}} --}} + @foreach ($stokaudit['rekod'] as $index => $item) + @php + if ($item['listsag'][0]['hargajualan'] == null) { + $totalpinjaman += $item['listsag'][0]['pinjaman']; + } else { + $totalpinjaman += $item['listsag'][0]['bakipjm']; + } + @endphp + + + + + + + + + + + + {{-- --}} + {{-- --}} + + {{-- --}} + + @php $counter++; @endphp + @endforeach + + + + + + + {{-- + --}} + + {{-- --}} + +
BilNamaNo. KPNo. TelefonNorujukanTempohBeratNilai Marhun (RM)Pembiayaan Asal (RM)Baki Pembiayaan (RM)Kadar UpahTempoh Belum BayarKeuntungan Belum Bayar (RM)Lanjutan
{{ $counter }}{{ $item['info']['nama'] ?? '-' }}{{ $item['nokp'] }}{{ $item['info']['telefon'] ?? '-' }}@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['tempoh']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['berat']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['nilaimarhun']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['pinjaman']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['bakipjm']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['kadarupah']}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tempoh'] - $item1['tempohbayar'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tunggakan'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['lelong_tawarruq']}}
@endforeach
Jumlah{{ number_format($stokaudit['totalberat'], 2) }}{{ number_format($stokaudit['totalnilaimarhun'], 2) }}{{ number_format($stokaudit['totalpinjaman'], 2) }}{{ number_format($stokaudit['totalbakipjm'], 2) }}{{ number_format($stokaudit['totaltunggakan'], 2) }}
+ + + + + + + + diff --git a/resources/views/print/laporan_stokauditkhas.blade.php b/resources/views/print/laporan_stokauditkhas.blade.php new file mode 100644 index 0000000..f8c389d --- /dev/null +++ b/resources/views/print/laporan_stokauditkhas.blade.php @@ -0,0 +1,434 @@ +@extends('layouts.app') + + + + + + + + + + + + + + + + + + + + + +@section('content') +
+
+
+
+ + + +
+ +
+ @csrf + + + + + + + + + + + + + + + + +
Laporan Stok Audit Khas (Blast Whatsapp) Tarikh Cetak: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo $formattedweddingdate; + @endphp +
Dari Tempoh: {{$daritempoh}} hingga Tempoh: {{$hinggatempoh}}
+ +
+ + + + + + + + + + + + + + {{-- --}} + {{-- --}} + + {{-- --}} + + @php + $counter = 1; + $totalpinjaman = 0; + @endphp + + @foreach ($stokaudit['rekod'] as $index => $item) + @php + if ($item['listsag'][0]['hargajualan'] == null) { + $totalpinjaman += $item['listsag'][0]['pinjaman']; + } else { + $totalpinjaman += $item['listsag'][0]['bakipjm']; + } + + if ($item['blasted'] == null) { + $status = 'Belum'; + } else { + $status = 'Selesai'; + } + @endphp + + + + + + + + + + + + + + {{-- --}} + {{-- --}} + + {{-- --}} + + @php $counter++; @endphp + @endforeach + + + + + + + {{-- + --}} + + {{-- --}} + +
BilStatusNamaNo. KPNo. TelefonNorujukanTempohBeratNilai Marhun (RM)Pembiayaan Asal (RM)Baki Pembiayaan (RM)Kadar UpahTempoh Belum BayarKeuntungan Belum Bayar (RM)Lanjutan
{{ $counter }}{{ $status ?? '-' }}{{ $item['info']['nama'] ?? '-' }}{{ $item['nokp'] }}{{ $item['info']['telefon'] ?? '-' }}@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['tempoh']}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['berat']}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['nilaimarhun'], 2)}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['pinjaman'], 2)}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['bakipjm'], 2)}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['kadarupah']}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tempoh'] - $item1['tempohbayar'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tunggakan'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['lelong_tawarruq']}}
@endforeach
Jumlah{{ number_format($stokaudit['totalberat'], 2) }}{{ number_format($stokaudit['totalnilaimarhun'], 2) }}{{ number_format($stokaudit['totalpinjaman'], 2) }}{{ number_format($stokaudit['totalbakipjm'], 2) }}{{ number_format($stokaudit['totaltunggakan'], 2) }}
+ +
+
+{{-- + + + + + + + + + + + + + + +
.................................................................. ..................................................................
DI SEMAK DI SAHKAN
--}} +
+
+
+
+
+ + + +@endsection diff --git a/routes/web.php b/routes/web.php index 4c4acfa..cdc1cfd 100644 --- a/routes/web.php +++ b/routes/web.php @@ -279,6 +279,11 @@ Route::post('/laporan/auditcustomer/cetak',['as'=>'laporan.auditcustomercetak',' Route::get('/laporanscantebusbarcode',['as'=>'laporanscantebusbarcode','uses'=>'KhazanahController@LaporanTebusBarcode'])->middleware('auth','khazanah'); +//stokauditkhas +Route::get('laporan/stokauditkhas',['as'=>'laporan.stokauditkhas','uses'=>'KhazanahController@laporanStokAuditKhas'])->middleware('auth','khazanah'); +Route::get('laporan/stokauditkhas/cetak',['as'=>'stokaudit.laporancetakkhas','uses'=>'KhazanahController@cetakLaporanStokAuditKhas'])->middleware('auth','khazanah'); +Route::post('laporan/stokauditkhas/cetakexport',['as'=>'stokaudit.exportlaporancetakkhas','uses'=>'KhazanahController@cetakExportLaporanStokAuditKhas'])->middleware('auth','khazanah'); + //Resit Ansurans Route::get('/resit/{id}',['as'=>'resit.ansuran','uses'=>'GadaianController@resit'])->middleware('auth','teller'); Route::get('/resitansurans/{id}',['as'=>'resit.ansurans','uses'=>'GadaianController@resitansurans'])->middleware('auth','teller'); From bbef0ce40ddddde1930d88a61fde359adacc4f6f Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Mon, 20 Nov 2023 14:50:07 +0800 Subject: [PATCH 2/4] add function rekod blast --- app/Http/Controllers/KhazanahController.php | 37 +- .../khazanah/laporan/rekodblast.blade.php | 260 ++++++++++++++ .../khazanah/laporan/stokauditkhas.blade.php | 126 ++++++- resources/views/pdf/pdf_rekodblast.blade.php | 326 ++++++++++++++++++ .../views/pdf/pdf_stokauditkhas.blade.php | 12 +- .../print/laporan_stokauditkhas.blade.php | 9 - routes/web.php | 2 + 7 files changed, 749 insertions(+), 23 deletions(-) create mode 100644 resources/views/khazanah/laporan/rekodblast.blade.php create mode 100644 resources/views/pdf/pdf_rekodblast.blade.php diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 6011318..8873a38 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -4182,7 +4182,6 @@ class KhazanahController extends Controller $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - $stokaudit = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/gadai/cawangan/'. $auth_user['cawangan'])->json(); return view('khazanah.laporan.stokauditkhas',compact('cawangan_info','api_url')); } @@ -4274,4 +4273,40 @@ class KhazanahController extends Controller // dd($gadai); } + public function rekodblast(Request $request){ + $auth_user = Auth::user(); + $api_url = config('api.url'); + + + if($request->type == 'pdf') + { + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json(); + return view('pdf.pdf_rekodblast', compact('cawangan_info','api_url','rekodblast')); + } + else{ + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json(); + return view('khazanah.laporan.rekodblast',compact('cawangan_info','api_url','rekodblast')); + } + } + + public function rekodblastexport(Request $request){ + $auth_user = Auth::user(); + $api_url = config('api.url'); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + if($request->type == 'pdf') + { + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json(); + return view('pdf.pdf_rekodblast', compact('cawangan_info','api_url','rekodblast','cawangan_detail','tarikh_cetak')); + } + } + } diff --git a/resources/views/khazanah/laporan/rekodblast.blade.php b/resources/views/khazanah/laporan/rekodblast.blade.php new file mode 100644 index 0000000..900daa8 --- /dev/null +++ b/resources/views/khazanah/laporan/rekodblast.blade.php @@ -0,0 +1,260 @@ +@extends('layouts.app') + + + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @elseif ($message = Session::get('failed')) +
+

{{ $message }}

+
+ @endif + +
+ +
+ @csrf + + + + + + + + + + + + + + @php + $counter = 1; + $totalpinjaman = 0; + @endphp + + @foreach ($rekodblast['rekod'] as $index => $item) + @php + if ($item['listsag'][0]['hargajualan'] == null) { + $totalpinjaman += $item['listsag'][0]['pinjaman']; + } else { + $totalpinjaman += $item['listsag'][0]['bakipjm']; + } + @endphp + + + + + + + + + + + @php $counter++; @endphp + @endforeach +
BilNamaNo. KPNo. TelefonNorujukanTempohTarikhMasa
{{ $counter }}{{ $item['info']['nama'] ?? '-' }}{{ $item['nokp'] }}{{ $item['info']['telefon'] ?? '-' }}@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ $item1['tempoh']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('d-m-Y', strtotime($item1['created_at']))}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('h:i:s', strtotime($item1['created_at']))}}
@endforeach
+
+
+ + + +
+
+
+
+
+ + + + +@endsection + diff --git a/resources/views/khazanah/laporan/stokauditkhas.blade.php b/resources/views/khazanah/laporan/stokauditkhas.blade.php index fda0e8f..541a35f 100644 --- a/resources/views/khazanah/laporan/stokauditkhas.blade.php +++ b/resources/views/khazanah/laporan/stokauditkhas.blade.php @@ -59,6 +59,38 @@ + + @section('content')
@@ -91,7 +123,7 @@
-
+
@csrf
@@ -108,27 +140,39 @@ Hingga Tempoh
- +


-
- + {{--
--}} + {{-- --}} {{-- --}} + {{--
--}} + +
+
+
+
+ +
+ +
@@ -147,5 +191,73 @@ }); + + + @endsection diff --git a/resources/views/pdf/pdf_rekodblast.blade.php b/resources/views/pdf/pdf_rekodblast.blade.php new file mode 100644 index 0000000..0e0fd57 --- /dev/null +++ b/resources/views/pdf/pdf_rekodblast.blade.php @@ -0,0 +1,326 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Laporan Blast Whatsapp 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; + @endphp + + @foreach ($rekodblast['rekod'] as $index => $item) + @php + if ($item['listsag'][0]['hargajualan'] == null) { + $totalpinjaman += $item['listsag'][0]['pinjaman']; + } else { + $totalpinjaman += $item['listsag'][0]['bakipjm']; + } + @endphp + + + + + + + + + + + @php $counter++; @endphp + @endforeach +
BilNamaNo. KPNo. TelefonNorujukanTempohTarikhMasa
{{ $counter }}{{ $item['info']['nama'] ?? '-' }}{{ $item['nokp'] }}{{ $item['info']['telefon'] ?? '-' }}@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ $item1['tempoh']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('d-m-Y', strtotime($item1['created_at']))}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('h:i:s', strtotime($item1['created_at']))}}
@endforeach
+ + + + + + + + diff --git a/resources/views/pdf/pdf_stokauditkhas.blade.php b/resources/views/pdf/pdf_stokauditkhas.blade.php index 1284c53..09bdbaa 100644 --- a/resources/views/pdf/pdf_stokauditkhas.blade.php +++ b/resources/views/pdf/pdf_stokauditkhas.blade.php @@ -11,7 +11,7 @@ #sim td {padding:3px 5px 3px 5px; padding-right:10px;}, #sim th { border: 0px solid; padding: 1px; - text-align: left; + /* text-align: left; */ } @@ -69,7 +69,7 @@ } th{ - text-align: center; + /* text-align: center; */ padding: 16px; } @@ -157,7 +157,7 @@ #header th { padding-top: 12px; padding-bottom: 12px; - text-align: left; + /* text-align: left; */ padding: 4px; color: black; } @@ -189,7 +189,7 @@ border-collapse: collapse; padding-top: 12px; padding-bottom: 12px; - text-align: left; + /* text-align: left; */ padding: 4px; color: black; } @@ -253,8 +253,8 @@ - - + + - {{-- --}} - {{-- --}} - {{-- --}} @php $counter = 1; @@ -320,10 +317,7 @@ - {{-- --}} - {{-- --}} - {{-- --}} @php $counter++; @endphp @endforeach @@ -333,10 +327,7 @@ - {{-- - --}} - {{-- --}}
Laporan Stok Audit Laporan Stok Audit Khas Tempoh : {{$daritempoh}} hingga tempoh : {{$hinggatempoh}} Tarikh Cetak: @php diff --git a/resources/views/print/laporan_stokauditkhas.blade.php b/resources/views/print/laporan_stokauditkhas.blade.php index f8c389d..4a129d8 100644 --- a/resources/views/print/laporan_stokauditkhas.blade.php +++ b/resources/views/print/laporan_stokauditkhas.blade.php @@ -283,10 +283,7 @@ Nilai Marhun (RM) Pembiayaan Asal (RM) Baki Pembiayaan (RM)Kadar UpahTempoh Belum BayarKeuntungan Belum Bayar (RM)Lanjutan@foreach($item['listsag'] as $item1){{ number_format($item1['nilaimarhun'], 2)}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['pinjaman'], 2)}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['bakipjm'], 2)}}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['kadarupah']}}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tempoh'] - $item1['tempohbayar'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ number_format($item1['tunggakan'], 2) }}
@endforeach
@foreach($item['listsag'] as $item1){{ $item1['lelong_tawarruq']}}
@endforeach
{{ number_format($stokaudit['totalnilaimarhun'], 2) }} {{ number_format($stokaudit['totalpinjaman'], 2) }} {{ number_format($stokaudit['totalbakipjm'], 2) }}{{ number_format($stokaudit['totaltunggakan'], 2) }}
diff --git a/routes/web.php b/routes/web.php index cdc1cfd..e4ceac5 100644 --- a/routes/web.php +++ b/routes/web.php @@ -283,6 +283,8 @@ Route::get('/laporanscantebusbarcode',['as'=>'laporanscantebusbarcode','uses'=>' Route::get('laporan/stokauditkhas',['as'=>'laporan.stokauditkhas','uses'=>'KhazanahController@laporanStokAuditKhas'])->middleware('auth','khazanah'); Route::get('laporan/stokauditkhas/cetak',['as'=>'stokaudit.laporancetakkhas','uses'=>'KhazanahController@cetakLaporanStokAuditKhas'])->middleware('auth','khazanah'); Route::post('laporan/stokauditkhas/cetakexport',['as'=>'stokaudit.exportlaporancetakkhas','uses'=>'KhazanahController@cetakExportLaporanStokAuditKhas'])->middleware('auth','khazanah'); +Route::get('laporan/rekodblast',['as'=>'stokaudit.rekodblast','uses'=>'KhazanahController@rekodblast'])->middleware('auth','khazanah'); +Route::post('laporan/rekodblastexport',['as'=>'stokaudit.rekodblastexport','uses'=>'KhazanahController@rekodblastexport'])->middleware('auth','khazanah'); //Resit Ansurans Route::get('/resit/{id}',['as'=>'resit.ansuran','uses'=>'GadaianController@resit'])->middleware('auth','teller'); From 6209bd340f56a255e44f4b475c1282565356916e Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Tue, 21 Nov 2023 16:15:29 +0800 Subject: [PATCH 3/4] tambah filter jika null --- resources/views/print/laporan_stokauditkhas.blade.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/views/print/laporan_stokauditkhas.blade.php b/resources/views/print/laporan_stokauditkhas.blade.php index 4a129d8..80921b1 100644 --- a/resources/views/print/laporan_stokauditkhas.blade.php +++ b/resources/views/print/laporan_stokauditkhas.blade.php @@ -402,7 +402,7 @@ className: 'btn btn-outline-info pl-4 pr-4 btn-sm export', target: "_blank", titleAttr: 'Blast Whatsapp', - text: 'WHATSAPP', + text: 'WHATSAPP & SMS', action: function ( e, dt, node, config ) { $('#typedonwload').val('whatsapp'); $("#exportpdf").submit(); From 2aa4afe22bb94d7e4a66af652bc4e779a0412b9c Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Wed, 22 Nov 2023 15:10:37 +0800 Subject: [PATCH 4/4] tambah status berjaya dalam wasap dan sms --- app/Http/Controllers/KhazanahController.php | 42 ++- .../views/khazanah/laporan/index.blade.php | 2 +- .../khazanah/laporan/rekodblast.blade.php | 18 +- .../khazanah/laporan/rekodblastsms.blade.php | 268 ++++++++++++++ .../khazanah/laporan/stokauditkhas.blade.php | 9 +- resources/views/pdf/pdf_rekodblast.blade.php | 14 + .../views/pdf/pdf_rekodblastsms.blade.php | 334 ++++++++++++++++++ routes/web.php | 2 + 8 files changed, 672 insertions(+), 17 deletions(-) create mode 100644 resources/views/khazanah/laporan/rekodblastsms.blade.php create mode 100644 resources/views/pdf/pdf_rekodblastsms.blade.php diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 8873a38..f99c567 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -4278,17 +4278,9 @@ class KhazanahController extends Controller $api_url = config('api.url'); - if($request->type == 'pdf') - { - $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - $rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json(); - return view('pdf.pdf_rekodblast', compact('cawangan_info','api_url','rekodblast')); - } - else{ - $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); - $rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json(); - return view('khazanah.laporan.rekodblast',compact('cawangan_info','api_url','rekodblast')); - } + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $rekodblast = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblast/'. $auth_user['cawangan'])->json(); + return view('khazanah.laporan.rekodblast',compact('cawangan_info','api_url','rekodblast')); } public function rekodblastexport(Request $request){ @@ -4309,4 +4301,32 @@ class KhazanahController extends Controller } } + public function rekodblastsms(Request $request){ + $auth_user = Auth::user(); + $api_url = config('api.url'); + + + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $rekodblastsms = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblastsms/'. $auth_user['cawangan'])->json(); + return view('khazanah.laporan.rekodblastsms',compact('cawangan_info','api_url','rekodblastsms')); + } + + public function rekodblastsmsexport(Request $request){ + $auth_user = Auth::user(); + $api_url = config('api.url'); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + + $cawangan=Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + if($request->type == 'pdf') + { + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + $rekodblastsms = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/api/rekodblastsms/'. $auth_user['cawangan'])->json(); + return view('pdf.pdf_rekodblastsms', compact('cawangan_info','api_url','rekodblastsms','cawangan_detail','tarikh_cetak')); + } + } + } diff --git a/resources/views/khazanah/laporan/index.blade.php b/resources/views/khazanah/laporan/index.blade.php index b24cf1c..608a0d5 100644 --- a/resources/views/khazanah/laporan/index.blade.php +++ b/resources/views/khazanah/laporan/index.blade.php @@ -83,7 +83,7 @@ Serah Marhun Tebus
diff --git a/resources/views/khazanah/laporan/rekodblast.blade.php b/resources/views/khazanah/laporan/rekodblast.blade.php index 900daa8..9a0e561 100644 --- a/resources/views/khazanah/laporan/rekodblast.blade.php +++ b/resources/views/khazanah/laporan/rekodblast.blade.php @@ -100,8 +100,8 @@ @@ -138,6 +138,7 @@ Tempoh Tarikh Masa + Status @php $counter = 1; @@ -161,6 +162,19 @@ @foreach($item['rekodblast'] as $item1){{ $item1['tempoh']}}
@endforeach @foreach($item['rekodblast'] as $item1){{ date('d-m-Y', strtotime($item1['created_at']))}}
@endforeach @foreach($item['rekodblast'] as $item1){{ date('h:i:s', strtotime($item1['created_at']))}}
@endforeach + @foreach($item['rekodblast'] as $item1) + @php + $response = $item1['status']; + $status = collect(json_decode($response)); + + @endphp + @if($status['status'] == "success") + Berjaya + @else + Tidak Berjaya + @endif + +
@endforeach @php $counter++; @endphp @endforeach diff --git a/resources/views/khazanah/laporan/rekodblastsms.blade.php b/resources/views/khazanah/laporan/rekodblastsms.blade.php new file mode 100644 index 0000000..57e3ef9 --- /dev/null +++ b/resources/views/khazanah/laporan/rekodblastsms.blade.php @@ -0,0 +1,268 @@ +@extends('layouts.app') + + + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @elseif ($message = Session::get('failed')) +
+

{{ $message }}

+
+ @endif + +
+ +
+ @csrf + + + + + + + + + + + + + + + @php + $counter = 1; + $totalpinjaman = 0; + @endphp + + @foreach ($rekodblastsms['rekod'] as $index => $item) + @php + if ($item['listsag'][0]['hargajualan'] == null) { + $totalpinjaman += $item['listsag'][0]['pinjaman']; + } else { + $totalpinjaman += $item['listsag'][0]['bakipjm']; + } + @endphp + + + + + + + + + + + + @php $counter++; @endphp + @endforeach +
BilNamaNo. KPNo. TelefonNorujukanTempohTarikhMasaStatus
{{ $counter }}{{ $item['info']['nama'] ?? '-' }}{{ $item['nokp'] }}{{ $item['info']['telefon'] ?? '-' }}@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ $item1['tempoh']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('d-m-Y', strtotime($item1['created_at']))}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('h:i:s', strtotime($item1['created_at']))}}
@endforeach
@foreach($item['rekodblast'] as $item1) + @if($item1['status'] > 0) + Berjaya + @else + Tidak Berjaya + @endif +
@endforeach
+
+
+ + + +
+
+
+
+
+ + + + +@endsection + diff --git a/resources/views/khazanah/laporan/stokauditkhas.blade.php b/resources/views/khazanah/laporan/stokauditkhas.blade.php index 541a35f..25e8e52 100644 --- a/resources/views/khazanah/laporan/stokauditkhas.blade.php +++ b/resources/views/khazanah/laporan/stokauditkhas.blade.php @@ -159,10 +159,13 @@
- diff --git a/resources/views/pdf/pdf_rekodblast.blade.php b/resources/views/pdf/pdf_rekodblast.blade.php index 0e0fd57..8beb3f3 100644 --- a/resources/views/pdf/pdf_rekodblast.blade.php +++ b/resources/views/pdf/pdf_rekodblast.blade.php @@ -278,6 +278,7 @@ Tempoh Tarikh Masa + Status @php $counter = 1; @@ -301,6 +302,19 @@ @foreach($item['rekodblast'] as $item1){{ $item1['tempoh']}}
@endforeach @foreach($item['rekodblast'] as $item1){{ date('d-m-Y', strtotime($item1['created_at']))}}
@endforeach @foreach($item['rekodblast'] as $item1){{ date('h:i:s', strtotime($item1['created_at']))}}
@endforeach + @foreach($item['rekodblast'] as $item1) + @php + $response = $item1['status']; + $status = collect(json_decode($response)); + + @endphp + @if($status['status'] == "success") + Berjaya + @else + Tidak Berjaya + @endif + +
@endforeach @php $counter++; @endphp @endforeach diff --git a/resources/views/pdf/pdf_rekodblastsms.blade.php b/resources/views/pdf/pdf_rekodblastsms.blade.php new file mode 100644 index 0000000..8cf0d49 --- /dev/null +++ b/resources/views/pdf/pdf_rekodblastsms.blade.php @@ -0,0 +1,334 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + +
Laporan Blast SMS 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; + @endphp + + @foreach ($rekodblastsms['rekod'] as $index => $item) + @php + if ($item['listsag'][0]['hargajualan'] == null) { + $totalpinjaman += $item['listsag'][0]['pinjaman']; + } else { + $totalpinjaman += $item['listsag'][0]['bakipjm']; + } + @endphp + + + + + + + + + + + + @php $counter++; @endphp + @endforeach +
BilNamaNo. KPNo. TelefonNorujukanTempohTarikhMasaStatus
{{ $counter }}{{ $item['info']['nama'] ?? '-' }}{{ $item['nokp'] }}{{ $item['info']['telefon'] ?? '-' }}@foreach($item['listsag'] as $item1){{ $item1['norujukan']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ $item1['tempoh']}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('d-m-Y', strtotime($item1['created_at']))}}
@endforeach
@foreach($item['rekodblast'] as $item1){{ date('h:i:s', strtotime($item1['created_at']))}}
@endforeach
@foreach($item['rekodblast'] as $item1) + @if($item1['status'] > 0) + Berjaya + @else + Tidak Berjaya + @endif +
@endforeach
+ + + + + + + + diff --git a/routes/web.php b/routes/web.php index e4ceac5..bbc8224 100644 --- a/routes/web.php +++ b/routes/web.php @@ -285,6 +285,8 @@ Route::get('laporan/stokauditkhas/cetak',['as'=>'stokaudit.laporancetakkhas','us Route::post('laporan/stokauditkhas/cetakexport',['as'=>'stokaudit.exportlaporancetakkhas','uses'=>'KhazanahController@cetakExportLaporanStokAuditKhas'])->middleware('auth','khazanah'); Route::get('laporan/rekodblast',['as'=>'stokaudit.rekodblast','uses'=>'KhazanahController@rekodblast'])->middleware('auth','khazanah'); Route::post('laporan/rekodblastexport',['as'=>'stokaudit.rekodblastexport','uses'=>'KhazanahController@rekodblastexport'])->middleware('auth','khazanah'); +Route::get('laporan/rekodblastsms',['as'=>'stokaudit.rekodblastsms','uses'=>'KhazanahController@rekodblastsms'])->middleware('auth','khazanah'); +Route::post('laporan/rekodblastsmsexport',['as'=>'stokaudit.rekodblastsmsexport','uses'=>'KhazanahController@rekodblastsmsexport'])->middleware('auth','khazanah'); //Resit Ansurans Route::get('/resit/{id}',['as'=>'resit.ansuran','uses'=>'GadaianController@resit'])->middleware('auth','teller');