From 25147a616dcdf0cb540f5c1c1a36d0f27f119abd Mon Sep 17 00:00:00 2001 From: hafifierahman Date: Mon, 18 Oct 2021 11:02:51 +0800 Subject: [PATCH] fix laporan --- app/Http/Controllers/KhazanahController.php | 126 ++++++++ .../khazanah/laporan/audittrail.blade.php | 147 +++++++++ .../khazanah/laporan/hargaemas.blade.php | 147 +++++++++ .../views/khazanah/laporan/index.blade.php | 6 +- .../laporan/senaraipetibesi.blade.php | 147 +++++++++ .../views/print/laporan_audittrail.blade.php | 281 ++++++++++++++++++ .../views/print/laporan_hargaemas.blade.php | 273 +++++++++++++++++ .../print/laporan_senaraipetibesi.blade.php | 281 ++++++++++++++++++ routes/web.php | 6 + 9 files changed, 1411 insertions(+), 3 deletions(-) create mode 100644 resources/views/khazanah/laporan/audittrail.blade.php create mode 100644 resources/views/khazanah/laporan/hargaemas.blade.php create mode 100644 resources/views/khazanah/laporan/senaraipetibesi.blade.php create mode 100644 resources/views/print/laporan_audittrail.blade.php create mode 100644 resources/views/print/laporan_hargaemas.blade.php create mode 100644 resources/views/print/laporan_senaraipetibesi.blade.php diff --git a/app/Http/Controllers/KhazanahController.php b/app/Http/Controllers/KhazanahController.php index 93e4500..9da73c3 100644 --- a/app/Http/Controllers/KhazanahController.php +++ b/app/Http/Controllers/KhazanahController.php @@ -3219,4 +3219,130 @@ class KhazanahController extends Controller return view('print.laporan_denominasi', compact('denominasi','cawangan_detail','tarikh_cetak','date','api_url')); } + public function laporan_senaraipetibesi() + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + + return view('khazanah.laporan.senaraipetibesi', compact('cawangan_info','api_url')); + } + + public function cetaklaporan_senaraipetibesi(Request $request) + { + + $api_url = 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{ + $split_date = explode('-', $request->datemula); + $mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + if($request->datehingga == null){ + $hingga_date = $current->toDateString(); + }else{ + $split_date = explode('-', $request->datehingga); + $hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + $petibesi = Http::get(config('api.url'). '/api/laporanpetibesirange/' . $auth_user['cawangan'],['mula' => $mula_date,'hingga' => $hingga_date])->json(); + + $cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + return view('print.laporan_senaraipetibesi', compact('petibesi','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url')); + } + + public function laporanhargaemas() + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + return view('khazanah.laporan.hargaemas', compact('cawangan_info','api_url')); + } + + public function cetakLaporanhargaemas(Request $request) + { + + $api_url = 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{ + $split_date = explode('-', $request->datemula); + $mula_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + if($request->datehingga == null){ + $hingga_date = $current->toDateString(); + }else{ + $split_date = explode('-', $request->datehingga); + $hingga_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + $petibesi = Http::get(config('api.url'). '/api/harga_emas/laporan/sandaran/',['mula' => $mula_date,'hingga' => $hingga_date])->json(); + + $cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + return view('print.laporan_hargaemas', compact('petibesi','cawangan_detail','tarikh_cetak','mula_date','hingga_date','api_url')); + } + + + public function laporanAuditTrail() + { + $auth_user = Auth::user(); + $api_url = config('api.url'); + + $cawangan_info = Http::get(config('api.url') . '/api/cawangan/'. $auth_user['cawangan'])->json(); + + + return view('khazanah.laporan.audittrail', compact('cawangan_info','api_url')); + } + + public function cetakLaporanAuditTrail(Request $request) + { + + $api_url = config('api.url'); + $auth_user = Auth::user(); + $current = Carbon::now(); + $current = new Carbon(); + $tarikh_cetak = $current->toDateString(); + + if($request->datedenominasi == null){ + $date = $current->toDateString(); + }else{ + $split_date = explode('-', $request->datedenominasi); + $date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; + } + + $denominasi = Http::get(config('api.url'). '/api/DenominasiLaporan/' . $auth_user['cawangan'],['tarikh' => $date])->json(); + + if(!$denominasi) + { + return redirect()->back()->with('errormessage', 'Tiada data pada tarikh tersebut.'); + } + + $cawangan = Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); + $cawangan_detail=$cawangan[0]; + + return view('print.laporan_audittrail', compact('denominasi','cawangan_detail','tarikh_cetak','date','api_url')); + } + + + } diff --git a/resources/views/khazanah/laporan/audittrail.blade.php b/resources/views/khazanah/laporan/audittrail.blade.php new file mode 100644 index 0000000..ab108aa --- /dev/null +++ b/resources/views/khazanah/laporan/audittrail.blade.php @@ -0,0 +1,147 @@ +@extends('layouts.app') + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+ @csrf +
+
+ Mula +
+ +
+ Hingga +
+ + +
+ +
+
+ +
+ +
+
+
+
+
+ +@endsection + diff --git a/resources/views/khazanah/laporan/hargaemas.blade.php b/resources/views/khazanah/laporan/hargaemas.blade.php new file mode 100644 index 0000000..4190d3d --- /dev/null +++ b/resources/views/khazanah/laporan/hargaemas.blade.php @@ -0,0 +1,147 @@ +@extends('layouts.app') + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+ @csrf +
+
+ Mula +
+ +
+ Hingga +
+ + +
+ +
+
+ +
+ +
+
+
+
+
+ +@endsection + diff --git a/resources/views/khazanah/laporan/index.blade.php b/resources/views/khazanah/laporan/index.blade.php index dae0e23..bfef71c 100644 --- a/resources/views/khazanah/laporan/index.blade.php +++ b/resources/views/khazanah/laporan/index.blade.php @@ -39,7 +39,7 @@
{{-- Stok Audit Details --}} - Stok Audit Details + Harga Emas
@@ -59,7 +59,7 @@ Aging Pinjaman
- Aging Pelanggan + Senarai Peti Besi
Lejer Am @@ -83,7 +83,7 @@ Marhun Terkumpul
- Aging Kawalan Stok + Audit Trail
Imbang Duga diff --git a/resources/views/khazanah/laporan/senaraipetibesi.blade.php b/resources/views/khazanah/laporan/senaraipetibesi.blade.php new file mode 100644 index 0000000..5f80a0c --- /dev/null +++ b/resources/views/khazanah/laporan/senaraipetibesi.blade.php @@ -0,0 +1,147 @@ +@extends('layouts.app') + + +@section('content') +
+
+
+
+ + +
+
+
+
+
+
+
+ +
+
+
+
+ @csrf +
+
+ Mula +
+ +
+ Hingga +
+ + +
+ +
+
+ +
+ +
+
+
+
+
+ +@endsection + diff --git a/resources/views/print/laporan_audittrail.blade.php b/resources/views/print/laporan_audittrail.blade.php new file mode 100644 index 0000000..0f84edd --- /dev/null +++ b/resources/views/print/laporan_audittrail.blade.php @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + {{-- --}} + {{-- --}} + + + + + + {{-- + + + + + + + --}} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LAPORAN SENARAI HARGA EMAS
TARIKH CETAK: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp +
MULA:@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
+ +
+ + + + + + + + + + + + + + + + + @php $counter = 1; $totalamaun = 0; $jenis = ''; @endphp + @foreach($petibesi as $index=>$item) + + + + + + + + @php $counter++;@endphp + @endforeach +
BilTarikhTellerPelulusActTransaksiNorujukanPing LamaPinjamanUpahNotaNokpNorujukan Asal
{{ $counter }}{{ $item['t_efektif'] }}{{ $item['m_efektif'] }}{{ $item['karat'] }}{{ number_format($item['harga'],2) }}
+

+{{-- + + + + +
JUMLAH {{ $jenis }}{{ 'RM ' . number_format($totalamaun,2) }}
--}} + +
+


+ + + + + + + + + + + + + + + + + + + +
.................................................................. .................................................................. ..................................................................
Disediakan Disemak Disahkan
+ + + + + + diff --git a/resources/views/print/laporan_hargaemas.blade.php b/resources/views/print/laporan_hargaemas.blade.php new file mode 100644 index 0000000..96b47b4 --- /dev/null +++ b/resources/views/print/laporan_hargaemas.blade.php @@ -0,0 +1,273 @@ + + + + + + + + + + + + + + + + + + + + + + + + + {{-- --}} + {{-- --}} + + + + + + {{-- + + + + + + + --}} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LAPORAN SENARAI HARGA EMAS
TARIKH CETAK: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp +
MULA:@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
+ +
+ + + + + + + + + @php $counter = 1; $totalamaun = 0; $jenis = ''; @endphp + @foreach($petibesi as $index=>$item) + + + + + + + + @php $counter++;@endphp + @endforeach +
BilTarikhMasaMutu/KaratHarga (RM)
{{ $counter }}{{ $item['t_efektif'] }}{{ $item['m_efektif'] }}{{ $item['karat'] }}{{ number_format($item['harga'],2) }}
+

+{{-- + + + + +
JUMLAH {{ $jenis }}{{ 'RM ' . number_format($totalamaun,2) }}
--}} + +
+


+ + + + + + + + + + + + + + + + + + + +
.................................................................. .................................................................. ..................................................................
Disediakan Disemak Disahkan
+ + + + + + diff --git a/resources/views/print/laporan_senaraipetibesi.blade.php b/resources/views/print/laporan_senaraipetibesi.blade.php new file mode 100644 index 0000000..49d7e2f --- /dev/null +++ b/resources/views/print/laporan_senaraipetibesi.blade.php @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + {{-- --}} + {{-- --}} + + + + + + {{-- + + + + + + + --}} + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
LAPORAN SENARAI PETI BESI
TARIKH CETAK: + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $formattedweddingdate = $myDateTime->format('d-m-Y'); + echo($formattedweddingdate); + @endphp +
MULA:@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
+ +
+ + + + + + + + + + + + + @php $counter = 1; $totalamaun = 0; $jenis = ''; @endphp + @foreach($petibesi as $index=>$item) + + + + + + + + + + + + @php $counter++;@endphp + @endforeach +
BilTarikhC/F (RM)Keluar (RM)Masuk (RM)Pendahuluan (RM)Serahan (RM)Panjar (RM)B/F (RM)
{{ $counter }}{{ $item['tarikh'] }}{{ number_format($item['bakiawal'],2) }}{{ number_format($item['keluar'],2) }}{{ number_format($item['masuk'],2) }}{{ number_format($item['pendahuluan'],2) }}{{ number_format($item['serahan'],2) }}{{ number_format($item['totpanjar'],2) }}{{ number_format($item['bakiakhir'],2) }}
+

+{{-- + + + + +
JUMLAH {{ $jenis }}{{ 'RM ' . number_format($totalamaun,2) }}
--}} + +
+


+ + + + + + + + + + + + + + + + + + + +
.................................................................. .................................................................. ..................................................................
Disediakan Disemak Disahkan
+ + + + + + diff --git a/routes/web.php b/routes/web.php index 07e4dc6..cdf8f45 100644 --- a/routes/web.php +++ b/routes/web.php @@ -217,6 +217,12 @@ Route::get('/laporan/pendserahan', [ 'as'=>'laporan.pendserahan', 'uses'=>'Khaza Route::post('/laporan/pendserahan/cetak', ['as'=>'pendserahan.cetaklaporan', 'uses'=>'KhazanahController@cetaklaporan_laporan_pendserahan'])->middleware('auth','khazanah'); Route::get('laporan/denominasi/',['as'=>'laporan.denominasi','uses'=>'KhazanahController@laporanDenominasi'])->middleware('auth','khazanah'); Route::get('laporan/denominasi/cetak',['as'=>'denominasi.laporancetak','uses'=>'KhazanahController@cetakLaporanDenominasi'])->middleware('auth','khazanah'); +Route::get('/laporan/senaraipetibesi', [ 'as'=>'laporan.senaraipetibesi', 'uses'=>'KhazanahController@laporan_senaraipetibesi'])->middleware('auth','khazanah'); +Route::post('/laporan/senaraipetibesi/cetak', ['as'=>'senaraipetibesi.cetaklaporan', 'uses'=>'KhazanahController@cetaklaporan_senaraipetibesi'])->middleware('auth','khazanah'); +Route::get('laporan/hargaemas/',['as'=>'laporan.hargaemas','uses'=>'KhazanahController@laporanhargaemas'])->middleware('auth','khazanah'); +Route::post('laporan/hargaemas/cetak',['as'=>'hargaemas.laporancetak','uses'=>'KhazanahController@cetakLaporanhargaemas'])->middleware('auth','khazanah'); +Route::get('laporan/audittrail/',['as'=>'laporan.audittrail','uses'=>'KhazanahController@laporanAuditTrail'])->middleware('auth','khazanah'); +Route::get('laporan/audittrail/cetak',['as'=>'audittrail.laporancetak','uses'=>'KhazanahController@cetakLaporanAuditTrail'])->middleware('auth','khazanah'); // Route::get('/laporan/agingbulanan', [ 'as'=>'laporan.agingbulanan', 'uses'=>'KhazanahController@laporanAging_Bulanan'])->middleware('auth','khazanah'); // Route::post('/laporan/agingbulanan/cetak', ['as'=>'agingbulan.cetaklaporan', 'uses'=>'KhazanahController@cetaklaporang_Aging'])->middleware('auth','khazanah');