From 00fd4c16465a9df3fdb56b076698cfb262a1a3b8 Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Thu, 24 Aug 2023 17:06:50 +0800 Subject: [PATCH] update marhun permata --- app/Http/Controllers/ReportAllController.php | 44 ++++++ .../Controllers/ReportCawanganController.php | 43 ++++++ .../laporan/marhunpermatabycaw.blade.php | 5 +- .../laporan/marhunpermatabycawangan.blade.php | 2 +- .../marhunpermatabycawanganT.blade.php | 102 +++++++++++++ .../marhunpermatabycawanganbybatch.blade.php | 2 +- .../marhunpermatabycawanganbybatchT.blade.php | 135 ++++++++++++++++++ routes/web.php | 4 + 8 files changed, 334 insertions(+), 3 deletions(-) create mode 100644 resources/views/laporan/marhunpermatabycawanganT.blade.php create mode 100644 resources/views/laporan/marhunpermatabycawanganbybatchT.blade.php diff --git a/app/Http/Controllers/ReportAllController.php b/app/Http/Controllers/ReportAllController.php index 1f334748..9a202ad2 100644 --- a/app/Http/Controllers/ReportAllController.php +++ b/app/Http/Controllers/ReportAllController.php @@ -786,6 +786,7 @@ class ReportAllController extends Controller $datalelong = Http::get(config('app.api_url'). 'get/listbatchlelong/'. $kodcaw ,[ 'kodcaw' => $kodcaw, ])->json(); + // dd($datalelong); $data = [ 'kodcaw'=>$kodcaw, 'caw_name'=>$cawangan->caw_name, @@ -928,6 +929,49 @@ class ReportAllController extends Controller } + Public function marhunpermatabycawdetailT($cawid){ + $senarai = []; + $cawangan = Cawangan::where('id','=',$cawid)->first(); + $cawanganDetail = $cawangan->caw_name; + $kodcaw = $cawangan->caw_code; + $cawid = $cawangan->id; + $datalelong = Http::get(config('app.api_url'). 'get/listbatchlelongT/'. $kodcaw ,[ + 'kodcaw' => $kodcaw, + ])->json(); + $data = [ + 'kodcaw'=>$kodcaw, + 'caw_name'=>$cawangan->caw_name, + 'lelong' => $datalelong ? $datalelong : '', + ]; + array_push($senarai,$data); + // dd($bycaw_all); + return view('laporan.marhunpermatabycawanganT',compact('senarai','cawanganDetail','cawid')); + } + + Public function marhunpermatabycawdetailbatchT($kodcaw,$batchno){ + $senarai = []; + $cawangan = Cawangan::where('caw_code','=',$kodcaw)->first(); + $cawanganDetail = $cawangan->caw_name; + + // $kodcaw = $cawangan->caw_code; + $datalelong = Http::get(config('app.api_url'). 'get/listlelongbybatchT/'.$kodcaw.'/'.$batchno ,[ + 'kodcaw' => $kodcaw, + 'batchno' => $batchno, + ])->json(); + // dd($datalelong); + $data = [ + 'kodcaw'=>$kodcaw, + 'batchno'=>$batchno, + 'caw_name'=>$cawangan->caw_name, + 'lelong' => $datalelong ? $datalelong : '', + ]; + array_push($senarai,$data); + // dd($senarai); + return view('laporan.marhunpermatabycawanganbybatchT',compact('senarai','cawanganDetail')); + + + } + diff --git a/app/Http/Controllers/ReportCawanganController.php b/app/Http/Controllers/ReportCawanganController.php index 44b94f1a..6f3bda83 100644 --- a/app/Http/Controllers/ReportCawanganController.php +++ b/app/Http/Controllers/ReportCawanganController.php @@ -1105,6 +1105,49 @@ class ReportCawanganController extends Controller } + Public function marhunpermatabycawdetailT($cawid){ + $senarai = []; + $cawangan = Cawangan::where('id','=',$cawid)->first(); + $cawanganDetail = $cawangan->caw_name; + $kodcaw = $cawangan->caw_code; + $cawid = $cawangan->id; + $datalelong = Http::get(config('app.api_url'). 'get/listbatchlelongT/'. $kodcaw ,[ + 'kodcaw' => $kodcaw, + ])->json(); + $data = [ + 'kodcaw'=>$kodcaw, + 'caw_name'=>$cawangan->caw_name, + 'lelong' => $datalelong ? $datalelong : '', + ]; + array_push($senarai,$data); + // dd($bycaw_all); + return view('laporan.marhunpermatabycawangan',compact('senarai','cawanganDetail','cawid')); + } + + Public function marhunpermatabycawdetailbatchT($kodcaw,$batchno){ + $senarai = []; + $cawangan = Cawangan::where('caw_code','=',$kodcaw)->first(); + $cawanganDetail = $cawangan->caw_name; + + // $kodcaw = $cawangan->caw_code; + $datalelong = Http::get(config('app.api_url'). 'get/listlelongbybatchT/'.$kodcaw.'/'.$batchno ,[ + 'kodcaw' => $kodcaw, + 'batchno' => $batchno, + ])->json(); + // dd($datalelong); + $data = [ + 'kodcaw'=>$kodcaw, + 'batchno'=>$batchno, + 'caw_name'=>$cawangan->caw_name, + 'lelong' => $datalelong ? $datalelong : '', + ]; + array_push($senarai,$data); + // dd($senarai); + return view('laporan.marhunpermatabycawanganbybatchT',compact('senarai','cawanganDetail')); + + + } + diff --git a/resources/views/laporan/marhunpermatabycaw.blade.php b/resources/views/laporan/marhunpermatabycaw.blade.php index 761fea2a..edc6bcfd 100644 --- a/resources/views/laporan/marhunpermatabycaw.blade.php +++ b/resources/views/laporan/marhunpermatabycaw.blade.php @@ -27,8 +27,9 @@ Bil Cawangan - Senarai Mengikut Batch + Senarai Sebelum Tawarruq Mengikut Batch Keseluruhan Sebelum Tawarruq + Senarai Selepas Tawarruq Mengikut Batch Keseluruhan Selepas Tawarruq @@ -43,6 +44,7 @@ + @endhasrole @@ -53,6 +55,7 @@ + @endhasrole diff --git a/resources/views/laporan/marhunpermatabycawangan.blade.php b/resources/views/laporan/marhunpermatabycawangan.blade.php index cd424f7f..4a596dd3 100644 --- a/resources/views/laporan/marhunpermatabycawangan.blade.php +++ b/resources/views/laporan/marhunpermatabycawangan.blade.php @@ -11,7 +11,7 @@
- Marhun Permata: {{$cawanganDetail}} + Marhun Permata Sebelum Tawarruq: {{$cawanganDetail}}
diff --git a/resources/views/laporan/marhunpermatabycawanganT.blade.php b/resources/views/laporan/marhunpermatabycawanganT.blade.php new file mode 100644 index 00000000..43d5f886 --- /dev/null +++ b/resources/views/laporan/marhunpermatabycawanganT.blade.php @@ -0,0 +1,102 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
+
+ + + +
+ Marhun Permata Selepas Tawarruq: {{$cawanganDetail}} +
+
+ + +
+
+ + @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif +
+ + + + + + + + + + {{-- --}} + + + + + {{-- {{dd($senarai[0]['lelong'])}} --}} + @foreach ($senarai[0]['lelong'] as $bid) + {{-- {{dd($bid['t_lelong'])}} --}} + {{-- {{dd($bid['lelong_info']['id'])}} --}} + + + + + @hasrole('operasi') + + @endhasrole + @hasrole('pengurus-cawangan') + + @endhasrole + {{-- --}} + + @endforeach + + +
BilTarikh LelongBatch LelongBil.SuratSenaraiJenis
{{$loop->iteration}} + @foreach ($bid['t_lelong'] as $index=>$tlelong) + @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tlelong[0]['t_lelong'] ); + $t_lelong = $myDateTime->format('d-m-Y'); + echo($t_lelong); + @endphp + @endforeach + {{ $bid['batchno']}}{{ $bid['total_lelong']}}
+
+
+ +
+
+ + +@endsection diff --git a/resources/views/laporan/marhunpermatabycawanganbybatch.blade.php b/resources/views/laporan/marhunpermatabycawanganbybatch.blade.php index 2e21ce59..cbd310c1 100644 --- a/resources/views/laporan/marhunpermatabycawanganbybatch.blade.php +++ b/resources/views/laporan/marhunpermatabycawanganbybatch.blade.php @@ -11,7 +11,7 @@
- Marhun Permata: {{$cawanganDetail}}
+ Marhun Permata Sebelum Tawarruq: {{$cawanganDetail}}
BatchNo: {{$senarai[0]['batchno']}}
diff --git a/resources/views/laporan/marhunpermatabycawanganbybatchT.blade.php b/resources/views/laporan/marhunpermatabycawanganbybatchT.blade.php new file mode 100644 index 00000000..f920de2d --- /dev/null +++ b/resources/views/laporan/marhunpermatabycawanganbybatchT.blade.php @@ -0,0 +1,135 @@ +@extends('layouts.app') + +@section('content') +
+
+
+
+
+
+ + + +
+ Marhun Permata Selepas Tawarruq: {{$cawanganDetail}}
+ BatchNo: {{$senarai[0]['batchno']}} +
+
+ + +
+
+ + @if ($message = Session::get('success')) +
+

{{ $message }}

+
+ @endif +
+ + + + + + + + + + + + + + + + + + {{-- {{dd($senarai[0]['lelong'])}} --}} + @foreach ($senarai[0]['lelong'] as $index=>$bid) + {{-- {{ \Carbon\Carbon::createFromFormat('created_at', 'd-m-Y')->toDateTimeString() }} --}} + @php + $today = date('Y-m-d'); + $get_start_date = new DateTime($today); // New date object + $get_end_date = date('Y-m-d',strtotime($bid['t_lelong'])); + $end_date = new DateTime($get_end_date); // New date object + $months = $end_date->diff($get_start_date); + $months1 = $months->format('%y Tahun %m Bulan %d Hari'); + + @endphp + + + + + + + + + + + + + @endforeach + + +
BilNo.RujukanNo.KPKuantitiTarikh Pembiayaan/Tarikh GadaianTarikh LelongBaki Lelong(RM)Rugi Lelong(RM)Tempoh Simpanan Batu Permata Selepas LelongMarhun
{{$loop->iteration}} + {{ $bid['norujukan']}}{{ $bid['nokp']}}{{ $bid['kuantiti']}} @php + $myDateTime = DateTime::createFromFormat('Y-m-d', $bid['t_gadai'] ); + $t_gadai = $myDateTime->format('d-m-Y'); + echo($t_gadai); + @endphp@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $bid['t_lelong'] ); + $t_lelong = $myDateTime->format('d-m-Y'); + echo($t_lelong); + @endphp@php if($bid['baki'] > 0){ + $bakilelong = $bid['baki']; + echo($bakilelong);} + elseif($bid['baki'] < 0){ + $bakilelong = ''; + echo($bakilelong);} + @endphp + @php if($bid['baki'] > 0){ + $bakilelong = ''; + echo($bakilelong);} + elseif($bid['baki'] < 0){ + $bakilelong = $bid['baki']; + echo($bakilelong);} + @endphp + {{$months1}} + + @foreach ($bid['listmarhun'] as $index1=>$bid2) + {{$loop->iteration.'. '.$bid2['marhun'].':'.$bid2['nota']}}
+ @endforeach + +
+
+
+ +
+
+ + +@endsection diff --git a/routes/web.php b/routes/web.php index 040a3c89..b9bea651 100644 --- a/routes/web.php +++ b/routes/web.php @@ -626,6 +626,8 @@ Route::get('/marhunpermatabycawdetail/{cawid}',['as'=>'reportcaw.marhunpermataby Route::get('/marhunpermatabycawdetailbatch/{kodcaw}/{batchno}',['as'=>'reportcaw.marhunpermatabycawdetailbatch','uses'=>'ReportCawanganController@marhunpermatabycawdetailbatch']); Route::get('/marhunpermatabycawdetailall/{cawid}',['as'=>'reportcaw.marhunpermatabycawdetailall','uses'=>'ReportCawanganController@marhunpermatabycawdetailall']); Route::post('/marhunpermatabycawdetailallpdf/{cawid}',['as'=>'reportcaw.marhunpermatabycawdetailallpdf','uses'=>'ReportCawanganController@marhunpermatabycawdetailallpdf']); +Route::get('/marhunpermatabycawdetailT/{cawid}',['as'=>'reportcaw.marhunpermatabycawdetailT','uses'=>'ReportCawanganController@marhunpermatabycawdetailT']); +Route::get('/marhunpermatabycawdetailbatchT/{kodcaw}/{batchno}',['as'=>'reportcaw.marhunpermatabycawdetailbatchT','uses'=>'ReportCawanganController@marhunpermatabycawdetailbatchT']); Route::get('/marhunpermatabycawdetailallT/{cawid}',['as'=>'reportcaw.marhunpermatabycawdetailallT','uses'=>'ReportCawanganController@marhunpermatabycawdetailallT']); Route::post('/marhunpermatabycawdetailallpdfT/{cawid}',['as'=>'reportcaw.marhunpermatabycawdetailallpdfT','uses'=>'ReportCawanganController@marhunpermatabycawdetailallpdfT']); @@ -703,6 +705,8 @@ Route::group(['middleware' => ['permission:reportbycaw'],'prefix'=>'reportbycaw' Route::get('/marhunpermatabycawdetailbatch/{kodcaw}/{batchno}',['as'=>'reportbycaw.marhunpermatabycawdetailbatch','uses'=>'ReportAllController@marhunpermatabycawdetailbatch']); Route::get('/marhunpermatabycawdetailall/{cawid}',['as'=>'reportbycaw.marhunpermatabycawdetailall','uses'=>'ReportAllController@marhunpermatabycawdetailall']); Route::post('/marhunpermatabycawdetailallpdf/{cawid}',['as'=>'reportbycaw.marhunpermatabycawdetailallpdf','uses'=>'ReportAllController@marhunpermatabycawdetailallpdf']); + Route::get('/marhunpermatabycawdetailT/{cawid}',['as'=>'reportbycaw.marhunpermatabycawdetailT','uses'=>'ReportAllController@marhunpermatabycawdetailT']); + Route::get('/marhunpermatabycawdetailbatchT/{kodcaw}/{batchno}',['as'=>'reportbycaw.marhunpermatabycawdetailbatchT','uses'=>'ReportAllController@marhunpermatabycawdetailbatchT']); Route::get('/marhunpermatabycawdetailallT/{cawid}',['as'=>'reportbycaw.marhunpermatabycawdetailallT','uses'=>'ReportAllController@marhunpermatabycawdetailallT']); Route::post('/marhunpermatabycawdetailallpdfT/{cawid}',['as'=>'reportbycaw.marhunpermatabycawdetailallpdfT','uses'=>'ReportAllController@marhunpermatabycawdetailallpdfT']); });