From d6159e12f3ec97a6a924c99456d35b6bff98cffa Mon Sep 17 00:00:00 2001 From: Nur Izzati Zulkifli Date: Wed, 24 Jan 2024 14:45:25 +0800 Subject: [PATCH] update surat notis peirngatan dan info pelanggan --- app/Http/Controllers/CallCenterController.php | 78 +++++- .../suratnotisperingatankeduafasa1.blade.php | 250 ++++++++++++++++++ .../suratnotisperingatankeduafasa2.blade.php | 247 +++++++++++++++++ resources/views/callcenter/v1/info.blade.php | 30 +-- resources/views/callcenter/v2/info.blade.php | 36 +-- routes/web.php | 2 +- 6 files changed, 591 insertions(+), 52 deletions(-) create mode 100644 resources/views/callcenter/suratnotisperingatankeduafasa1.blade.php create mode 100644 resources/views/callcenter/suratnotisperingatankeduafasa2.blade.php diff --git a/app/Http/Controllers/CallCenterController.php b/app/Http/Controllers/CallCenterController.php index 1c88657..5d2294b 100644 --- a/app/Http/Controllers/CallCenterController.php +++ b/app/Http/Controllers/CallCenterController.php @@ -527,20 +527,28 @@ class CallCenterController extends Controller { $datanotiskedua = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/getdatanotiskedua/'. $kodcaw.'/'.$notisid. '/' . 'fasa1')->json(); $fasa = 'fasa1'; + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $kodcaw)->json(); + $cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$kodcaw)->json(); + $cawangan_detail=$cawangan[0]; + + // return view('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','tarikh_cetak')); + // dd($datanotiskedua); + $pdf=PDF::loadView('callcenter.suratnotisperingatankeduafasa1', compact('cawangan_info','api_url','cawangan_detail','datanotiskedua','fasa','tarikh_cetak'))->setPaper('A4','potrait'); + return $pdf->download('notisperingatankedua_'.$tarikh_cetak.'_'.$fasa.'.pdf'); }else{ // dd(false); $datanotiskedua = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url'). '/arcc/getdatanotiskedua/'. $kodcaw.'/'.$notisid. '/' . 'fasa2')->json(); $fasa = 'fasa2'; + $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $kodcaw)->json(); + $cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$kodcaw)->json(); + $cawangan_detail=$cawangan[0]; + + // return view('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','tarikh_cetak')); // dd($datanotiskedua); + $pdf=PDF::loadView('callcenter.suratnotisperingatankeduafasa2', compact('cawangan_info','api_url','cawangan_detail','datanotiskedua','fasa','tarikh_cetak'))->setPaper('A4','potrait'); + return $pdf->download('notisperingatankedua_'.$tarikh_cetak.'_'.$fasa.'.pdf'); } - $cawangan_info = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/cawangan/'. $kodcaw)->json(); - $cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url').'/api/cawangan/detail/'.$kodcaw)->json(); - $cawangan_detail=$cawangan[0]; - - // return view('print.notislelong', compact('cawangan_info','notislelong','api_url','cawangan_detail','lelong','tarikh_cetak')); - // dd($datanotiskedua); - $pdf=PDF::loadView('callcenter.suratnotisperingatankedua', compact('cawangan_info','api_url','cawangan_detail','datanotiskedua','fasa','tarikh_cetak'))->setPaper('A4','potrait'); - return $pdf->download('notisperingatankedua_'.$tarikh_cetak.'_'.$fasa.'.pdf'); + } elseif($request->type == 'pdflist') @@ -817,4 +825,58 @@ class CallCenterController extends Controller } return view('callcenter.bycawdetailnotisjbg2',compact('cawangan_info','bycawnotisjbg','kodcaw','notisid','api_url')); } + + public function history(Request $request) + { + $auth_user = Auth::user(); + + $gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $request->norujukan)->json(); + + if(sizeof($gadai) > 0) + { + $history = $gadai[0][0]['historygadaian']; + $dahtebus = $gadai[0][0]['sttebus']; + $norujukan = $gadai[0][0]['norujukan']; + + } + + $count = 0; + $arrayhist = []; + + while($history != "0" && $history != '' || $dahtebus == 'T') + { + if($history != "0" && $history != '') + { + $gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $history)->json(); + $tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/listpenebusanhistory/'. $gadai[0][0]['kodcaw'],[ + "norujukan" => $history + ])->json(); + + if(sizeof($gadai) > 0) + { + if($history == $gadai[0][0]['historygadaian']) + $history = 0; + else{ + array_push($arrayhist,["tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0),"hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''), "pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"norujukan" => $history,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]); + $history = $gadai[0][0]['historygadaian']; + } + } + + $count++; + + } + else{ + $gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/gadai/norujukan/'. $norujukan)->json(); + $tebus = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.url') . '/api/listpenebusanhistory/'. $gadai[0][0]['kodcaw'],[ + "norujukan" => $norujukan + ])->json(); + + + array_push($arrayhist,["tagbaru" => ((isset($gadai[0][0]['tagbaru'])) ? $gadai[0][0]['tagbaru'] : 0), "hargajualan" => ((isset($gadai[0][0]['hargajualan'])) ? $gadai[0][0]['hargajualan'] : ''),"pinjaman" => ((isset($tebus[0])) ? $tebus[0]['pinjaman'] : 0),"norujukan" => $norujukan,"jenistebus" => ((isset($tebus[0])) ? $tebus[0]['jenistebus'] : 0),"jbg" => ((isset($tebus[0])) ? $tebus[0]['jbg'] : 0),"t_tebus" => ((isset($tebus[0])) ? $tebus[0]['t_tebus'] : 0)]); + break; + } + } + + return response()->json($arrayhist,200); + } } diff --git a/resources/views/callcenter/suratnotisperingatankeduafasa1.blade.php b/resources/views/callcenter/suratnotisperingatankeduafasa1.blade.php new file mode 100644 index 0000000..6b3b240 --- /dev/null +++ b/resources/views/callcenter/suratnotisperingatankeduafasa1.blade.php @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + @foreach($datanotiskedua as $index=>$lel) + {{-- {{dd($notis['nama']['alamat1'])}} --}} + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TARIKH CETAK + :@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $datez = $myDateTime->format('d-m-Y'); + //echo($datez); + $fmt = datefmt_create( + 'ms_MY', + IntlDateFormatter::LONG, + IntlDateFormatter::NONE, + 'Asia/Kuala_Lumpur', + IntlDateFormatter::GREGORIAN + ); + $cal = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + + echo '' . strtoupper($fmt->format($cal)); + @endphp +

KEPADA:{{ $lel['nama'] }} +
{{ strtoupper($lel['alamat']) }}
+ {{ ' ' . $lel['poskod'] . ' ' . strtoupper($lel['daerah']) . ' ' . strtoupper($lel['negeri'])}}
+ + +

Tuan/Puan,

+

NOTIS PEMBERITAHUAN

+

Dengan hormatnya dimaklumkan, akaun pembiayaan tuan/puan akan cukup tempoh 6 bulan.

+ + + + + + + + + + + + + + + + + + + + + + +
No Akuan Pembiayaan:{{$lel['norujukan']}}
Jumlah Pembiayaan:RM{{number_format($lel['pinjaman'], 2, '.', ',')}}
Jumlah Kutipan:RM{{number_format($lel['keuntungan'], 2, '.', ',')}}
Tarikh Matang:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $lel['tmatang']); + $datez = $myDateTime->format('d-m-Y'); + echo($datez); + @endphp
+ +

Oleh yang demikian, tuan/puan atau wakil boleh membuat bayaran tersebut secepat mungkin. Pihak Ar-Rahn ada menyediakan kemudahan e-bayaran melalui arrahnPay untuk + memudahkan bayaran anda di https://pay.arrahn.com.my.

+ +

Jika pihak tuan/puan memerlukan sebarang pertanyaan, sila hubungi kakitangan cawangan kami yang sentiasa sedia membantu.
+ Sekian, terima kasih.

+ +

Nota:

+ Sila abaikan notis ini sekiranya pihak tuan/puan telah membuat urusan diatas. + +

Notis ini adalah cetakan komputer dan tiada tandatangan diperlukan.

+ +
+
+ @endforeach \ No newline at end of file diff --git a/resources/views/callcenter/suratnotisperingatankeduafasa2.blade.php b/resources/views/callcenter/suratnotisperingatankeduafasa2.blade.php new file mode 100644 index 0000000..93532ac --- /dev/null +++ b/resources/views/callcenter/suratnotisperingatankeduafasa2.blade.php @@ -0,0 +1,247 @@ + + + + + + + + + + + + + + @foreach($datanotiskedua as $index=>$lel) + {{-- {{dd($notis['nama']['alamat1'])}} --}} + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TARIKH CETAK + :@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + $datez = $myDateTime->format('d-m-Y'); + //echo($datez); + $fmt = datefmt_create( + 'ms_MY', + IntlDateFormatter::LONG, + IntlDateFormatter::NONE, + 'Asia/Kuala_Lumpur', + IntlDateFormatter::GREGORIAN + ); + $cal = DateTime::createFromFormat('Y-m-d', $tarikh_cetak); + + echo '' . strtoupper($fmt->format($cal)); + @endphp +

KEPADA:{{ $lel['nama'] }} +
{{ strtoupper($lel['alamat']) }}
+ {{ ' ' . $lel['poskod'] . ' ' . strtoupper($lel['daerah']) . ' ' . strtoupper($lel['negeri'])}}
+ + +

Tuan/Puan,

+

NOTIS PEMBERITAHUAN

+

Dengan hormatnya dimaklumkan, akaun pembiayaan tuan/puan akan cukup tempoh 12 bulan.

+ + + + + + + + + + + + + + + + + + + + + + +
No Akuan Pembiayaan:{{$lel['norujukan']}}
Jumlah Pembiayaan:RM{{number_format($lel['pinjaman'], 2, '.', ',')}}
Jumlah Kutipan:RM{{number_format($lel['keuntungan'], 2, '.', ',')}}
Tarikh Tamat Kontrak:@php + $myDateTime = DateTime::createFromFormat('Y-m-d', $lel['tmatang1']); + $datez = $myDateTime->format('d-m-Y'); + echo($datez); + @endphp
+ +

Oleh yang demikian, tuan/puan atau wakil boleh membuat bayaran tersebut secepat mungkin. Jika pihak tuan/puan memerlukan sebarang pertanyaan, sila hubungi kakitangan cawangan kami yang sentiasa sedia membantu.
+ Sekian, terima kasih.

+ +

Nota:

+ Sila abaikan notis ini sekiranya pihak tuan/puan telah membuat urusan diatas. + +

Notis ini adalah cetakan komputer dan tiada tandatangan diperlukan.

+ +
+
+ @endforeach \ No newline at end of file diff --git a/resources/views/callcenter/v1/info.blade.php b/resources/views/callcenter/v1/info.blade.php index b483019..bc1a66d 100644 --- a/resources/views/callcenter/v1/info.blade.php +++ b/resources/views/callcenter/v1/info.blade.php @@ -205,6 +205,7 @@ Jum Tuntut/Bayar Keuntungan Caj Lelong + Dituntut Oleh @@ -802,23 +803,13 @@ var urlroute = '{{ route("lelongan", ":id") }}'; urlroute = urlroute.replace(':id', gadai_detail["norujukan"]); - var tuntutan = 'Pelanggan'; - - $.ajax({ - method:"GET", - async:false, - url: api_url + "/api/check/customer/", - data:{ - "norujukan" : gadai_detail['norujukan'], - "kodcaw" : kodcaw - }, - success: function(response){ - if(response[0].teller == 'DM') - { - tuntutan = 'WTD'; - } - } - }); + var tuntutan = ''; + if(gadai_detail['datatuntut']['teller'] == 'DM') + { + tuntutan = 'WTD'; + }else{ + tuntutan = 'Pelanggan'; + } if(gadai_detail['trkhtuntut'] == null){ tablelelong.row.add([ @@ -837,7 +828,7 @@ }else{ tablelelong.row.add([ counter, - '' + gadai_detail['norujukan'] + '', + gadai_detail['norujukan'], gadai_detail['t_lelong'], gadai_detail['trkhtuntut'], 'RM '+ formatter.format(gadai_detail['pinjaman']), @@ -845,8 +836,7 @@ 'RM '+formatter.format(gadai_detail['baki']), 'RM '+formatter.format(gadai_detail['bakiupah']), 'RM '+formatter.format(gadai_detail['cajlelong']), - tuntutan, - '' + tuntutan ]).draw(); } } diff --git a/resources/views/callcenter/v2/info.blade.php b/resources/views/callcenter/v2/info.blade.php index 29a9907..707cca7 100644 --- a/resources/views/callcenter/v2/info.blade.php +++ b/resources/views/callcenter/v2/info.blade.php @@ -236,8 +236,8 @@ Jum Tuntut/Bayar Keuntungan Caj Lelong - Status Tuntutan - Cetak + Dituntut Oleh + {{-- Cetak --}} @@ -837,28 +837,18 @@ var urlroute = '{{ route("lelongan", ":id") }}'; urlroute = urlroute.replace(':id', gadai_detail["norujukan"]); - var tuntutan = 'Pelanggan'; - - $.ajax({ - method:"GET", - async:false, - url: api_url + "/api/check/customer/", - data:{ - "norujukan" : gadai_detail['norujukan'], - "kodcaw" : kodcaw - }, - success: function(response){ - if(response[0].teller == 'DM') - { - tuntutan = 'WTD'; - } - } - }); + var tuntutan = ''; + if(gadai_detail['datatuntut']['teller'] == 'DM') + { + tuntutan = 'WTD'; + }else{ + tuntutan = 'Pelanggan'; + } if(gadai_detail['trkhtuntut'] == null){ tablelelong.row.add([ counter, - '' + gadai_detail['norujukan'] + '', + gadai_detail['norujukan'], gadai_detail['t_lelong'], gadai_detail['trkhtuntut'], 'RM '+ formatter.format(gadai_detail['pinjaman']), @@ -867,12 +857,12 @@ 'RM '+formatter.format(gadai_detail['bakiupah']), 'RM '+formatter.format(gadai_detail['cajlelong']), '', - '' + ]).draw(); }else{ tablelelong.row.add([ counter, - '' + gadai_detail['norujukan'] + '', + gadai_detail['norujukan'], gadai_detail['t_lelong'], gadai_detail['trkhtuntut'], 'RM '+ formatter.format(gadai_detail['pinjaman']), @@ -881,7 +871,7 @@ 'RM '+formatter.format(gadai_detail['bakiupah']), 'RM '+formatter.format(gadai_detail['cajlelong']), tuntutan, - '' + ]).draw(); } } diff --git a/routes/web.php b/routes/web.php index dd2e39b..5183bbb 100644 --- a/routes/web.php +++ b/routes/web.php @@ -419,7 +419,7 @@ Route::post('/blastpertama/{kodcaw}/{notisid}',['as'=>'arcc.blastpertama','uses' Route::get('/arcc/pelanggan',['as'=>'arcc.pelanggan','uses'=>'CallCenterController@pelanggan'])->middleware('auth','callcenter'); Route::get('/arcc/searchpelanggan',['as'=>'arcc.searchpelanggan','uses'=>'CallCenterController@search'])->middleware('auth','callcenter'); Route::get('/arcc/customer_info',['as'=>'arcc.customer_info','uses'=>'CallCenterController@info'])->middleware('auth','callcenter'); -Route::get('/arcc/history',['as'=>'arcc.history','uses'=>'GadaianController@history'])->middleware('auth','callcenter'); +Route::get('/arcc/history',['as'=>'arcc.history','uses'=>'CallCenterController@history'])->middleware('auth','callcenter'); Route::get('/notisperingatankedua',['as'=>'arcc.notisperingatankedua','uses'=>'CallCenterController@notisperingatankedua'])->middleware('auth','callcenter'); Route::get('/rekodnotisperingatankedua',['as'=>'arcc.rekodnotisperingatankedua','uses'=>'CallCenterController@rekodnotisperingatankedua'])->middleware('auth','callcenter'); Route::get('/kemaskininotisperingatan/{notisid}',['as'=>'arcc.kemaskininotisperingatan','uses'=>'CallCenterController@kemaskininotisperingatan'])->middleware('auth','callcenter');