tambah surat wakil dlm arrahnpay
This commit is contained in:
@@ -5,6 +5,10 @@ namespace App\Http\Controllers;
|
||||
use App\Http\Requests\ProfileRequest;
|
||||
use App\Http\Requests\PasswordRequest;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Http\Request;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
||||
class ProfileController extends Controller
|
||||
{
|
||||
@@ -52,4 +56,92 @@ class ProfileController extends Controller
|
||||
|
||||
return back()->withPasswordStatus(__('Password successfully updated.'));
|
||||
}
|
||||
|
||||
public function printSuratWakil($kodcaw, $norujukan)
|
||||
{
|
||||
$api_url = config('api.urlujrah');
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$t_cetak = $current->toDateString();
|
||||
|
||||
$tarikh_cetak = date('d-m-Y');
|
||||
$check_norujukan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/checksurat/' . $kodcaw . '/' . $norujukan)->json();
|
||||
if ($check_norujukan == $norujukan) {
|
||||
|
||||
//get details gadai && detail customer
|
||||
|
||||
$update_wakil = Http::withOptions(['verify' => config('app.api_verify')])->put(config('api.urlujrah') . '/api/updatewakil/' . $kodcaw . '/' . $norujukan)->json();
|
||||
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/gadai/norujukan/' . $norujukan)->json();
|
||||
$gadai_details = $gadai[0][0];
|
||||
|
||||
$noic = $gadai_details['nokp'];
|
||||
$customer_detail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/customers/' . $noic)->json();
|
||||
|
||||
$cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/cawangan/detail/' . $kodcaw)->json();
|
||||
|
||||
$cawangan_detail = $cawangan[0];
|
||||
|
||||
$nosiri = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/nosiri/wakil/' . $kodcaw . '/' . $norujukan)->json();
|
||||
|
||||
// $pdf=PDF::loadView('print.surat_wakil', compact('customer_detail','current','auth_user','api_url','cawangan_detail'))
|
||||
// ->setPaper('A4','potrait');
|
||||
// return $pdf->download('notislelong_'.'.pdf');
|
||||
// dd($gadai_details);
|
||||
|
||||
|
||||
return view('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri'));
|
||||
} else {
|
||||
|
||||
// insert into wakil_surat
|
||||
|
||||
$current_year = substr($current->year, 2, 2);
|
||||
$current_month = sprintf("%02d", $current->month);
|
||||
$current_day = sprintf("%02d", $current->day);
|
||||
|
||||
|
||||
$surat_wakil = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/wakil/' . $kodcaw . '/' . $t_cetak)->json();
|
||||
if ($surat_wakil) {
|
||||
$new_suratid = $surat_wakil['nosiri'] + 1;
|
||||
} else {
|
||||
$new_suratid = 1;
|
||||
}
|
||||
|
||||
|
||||
$new_surat = sprintf("%04d", $new_suratid);
|
||||
|
||||
$no_surat = 'WK' . $current_year . $current_month . $current_day . '-' . $new_surat;
|
||||
Session::put('norujukan', $norujukan);
|
||||
Session::put('no_surat', $no_surat);
|
||||
Session::put('page_reload', true);
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->post(config('api.urlujrah') . '/api/wakil/' . $kodcaw, [
|
||||
'nosiri' => $new_suratid,
|
||||
'no_surat' => $no_surat,
|
||||
'norujukan' => $norujukan,
|
||||
't_cetak' => $t_cetak,
|
||||
|
||||
]);
|
||||
|
||||
//get details gadai && detail customer
|
||||
|
||||
$gadai = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/gadai/norujukan/' . $norujukan)->json();
|
||||
$gadai_details = $gadai[0][0];
|
||||
|
||||
$noic = $gadai_details['nokp'];
|
||||
$customer_detail = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/customers/' . $noic)->json();
|
||||
|
||||
$cawangan = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/cawangan/detail/' . $kodcaw)->json();
|
||||
|
||||
$cawangan_detail = $cawangan[0];
|
||||
|
||||
$nosiri = Http::withOptions(['verify' => config('app.api_verify')])->get(config('api.urlujrah') . '/api/nosiri/wakil/' . $kodcaw . '/' . $norujukan)->json();
|
||||
|
||||
|
||||
// $pdf=PDF::loadView('print.surat_wakil', compact('customer_detail','current','auth_user','api_url','cawangan_detail'))
|
||||
// ->setPaper('A4','potrait');
|
||||
// return $pdf->download('notislelong_'.'.pdf');
|
||||
|
||||
return view('print.surat_wakil', compact('customer_detail', 'current', 'kodcaw', 'api_url', 'cawangan_detail', 'tarikh_cetak', 'gadai_details', 'noic', 'nosiri'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
return [
|
||||
'url' => env('API_URL')
|
||||
'url' => env('API_URL'),
|
||||
'urlujrah' => env('API_UJRAH_URL')
|
||||
];
|
||||
@@ -234,4 +234,6 @@ return [
|
||||
|
||||
'api_verify' => env('API_VERIFY',true),
|
||||
|
||||
'api_ujrah_url' => env('API_UJRAH_URL', 'http://localhost'),
|
||||
|
||||
];
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<th>T Akhir</th>
|
||||
<th>Keuntungan</th>
|
||||
<th class="hide-xs">Cawangan</th>
|
||||
<th class="hide-xs">Surat Wakil</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="list">
|
||||
@@ -27,6 +28,8 @@
|
||||
<td>{{ $data->tarikh_akhir }}</td>
|
||||
<td>{{ $data->upah_tawarruq_formatted }}</td>
|
||||
<td class="hide-xs">{{ $data->cawangan_name }}</td>
|
||||
<td><a href="{{ route('cust.print.suratwakil',[$data->kodcaw, $data->norujukan]) }}" target='_blank' class="float-center btn"><i class='fas fa-print'></i></a></td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
window.print
|
||||
// window.onfocus=function(){ window.close();}
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.grid-container {
|
||||
display: grid;
|
||||
grid: 75px / 33% 33% 33%;
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
#header_surat1 {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#header_surat1 p {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
#header_surat2 {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
text-align: center;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#header_surat2 p {
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.flex-justify-center-items-center {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#nosiri {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#title p {
|
||||
height: 40px;
|
||||
width: 700px;
|
||||
font-size: 13px;
|
||||
vertical-align: text-top;
|
||||
text-align: center;
|
||||
border: 1px solid black;
|
||||
}
|
||||
|
||||
#details {
|
||||
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#details th td {
|
||||
|
||||
text-wrap: nowrap;
|
||||
|
||||
}
|
||||
|
||||
#note {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#note p {
|
||||
margin: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<body>
|
||||
|
||||
<div class="grid-container" style="margin-bottom: 10px">
|
||||
<div id="header_surat1">
|
||||
<p style="text-wrap:nowrap">KOPERASI PERMODALAN KELANTAN BERHAD (D-5-0228)</p>
|
||||
<p>{{ $cawangan_detail['namacaw'] }}</p>
|
||||
<p style="text-wrap:nowrap">{{ $cawangan_detail['alamat1'] }}</p>
|
||||
<p>{{ $cawangan_detail['alamat2'] }}</p>
|
||||
<p>{{ $cawangan_detail['notel'] }}</p>
|
||||
</div>
|
||||
<div id="header_surat2" style="margin-left:20px">
|
||||
<div class="flex-justify-center-items-center" style="height: 60px">
|
||||
<img src="{{ asset('img/kopkb.png') }}" style="width:65px; margin:0 5px" alt="User Image" class="center">
|
||||
<img src="{{ asset('img/ARRAHN1.png') }}" style="width:50px; margin:0 5px" alt="User Image" class="center">
|
||||
</div>
|
||||
</div>
|
||||
<div id="nosiri" style="text-align:right">
|
||||
<b><div class="arial-sans-serif f-10">Tarikh Cetak: {{$tarikh_cetak}}</div>
|
||||
<br>
|
||||
<div class="arial-sans-serif f-10">No Siri: {{$nosiri}}</div></b>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="title">
|
||||
<p><b>SURAT PELANTIKAN WAKIL<BR>TUJUAN PENYELESAIAN PEMBIAYAAN DI AR-RAHN</b></p>
|
||||
</div>
|
||||
|
||||
<table id="details">
|
||||
<tr>
|
||||
<th>Nama Pelanggan</th>
|
||||
<td colspan="3">: {{$customer_detail['nama']}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>No Surat Akuan Gadai</th>
|
||||
<td>: {{$gadai_details['norujukan']}}</td>
|
||||
<th>Nilai Marhun</th>
|
||||
<td>: RM{{number_format($gadai_details['nilaimarhun'],2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>No MyKad / Passport</th>
|
||||
<td>: {{$noic}}</td>
|
||||
<th>Nilai Pembiayaan</th>
|
||||
<td>: RM{{number_format($gadai_details['pinjaman'],2)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>No Telefon</th>
|
||||
<td>: {{$customer_detail['telefon']}}</td>
|
||||
<th>Baki Pembiayaan</th>
|
||||
<td>: RM{{number_format($gadai_details['bakipjm'],2)}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td></td>
|
||||
<th>Harga Jualan</th>
|
||||
<td>: RM{{number_format($gadai_details['hargajualan'],2)}}</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<table id="details" style="margin-top:20px;">
|
||||
<tr>
|
||||
<td colspan="2">Saya seperti nama di atas, ingin memaklumkan kepada Ar-Rahn Koperasi Permodalan Kelantan Berhad
|
||||
bagi Cawangan {{ $cawangan_detail['namacaw'] }}, bahawa saya tidak dapat hadir untuk melakukan transaksi:
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Penyelesaian Penuh
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
Penyelesaian Penuh dan Permohonan Pembiayaan Baru
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="details" style="margin-top:20px;">
|
||||
<tr>
|
||||
<td colspan="2">1. Saya melantik nama dibawah sebagai wakil bagi pihak saya untuk
|
||||
transaksi sebagaimana di atas. Maklumat wakil adalah seperti berikut:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">2. Saya mengaku tidak akan membuat apa-apa Tuntutan @ Ganti Rugi atas kebarangkalian @
|
||||
kerugian yang berlaku disebabkan perlantikan wakil bagi apa-apa transaksi sebagai wakil saya.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<table id="details" style="margin-top:20px;">
|
||||
<tr>
|
||||
<th style="width: 180px">Nama</td>
|
||||
<td>:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 180px">No. Kad Pengenalan</td>
|
||||
<td>:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 180px">No. Telefon</td>
|
||||
<td>:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th style="width: 180px">Hubungan</td>
|
||||
<td>:</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table id="details" style="margin-top:20px;">
|
||||
<tr>
|
||||
<td colspan="2">2. Saya mengaku tidak akan membuat apa-apa <b>TUNTUTAN @ GANTI RUGI</b> atas kebarangkalian @
|
||||
kerugian yang berlaku disebabkan perlantikan wakil bagi menyelesaikan pembiayaan saya.</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
|
||||
<table id="details" style="margin-top:20px;" id="keuntungan">
|
||||
<tr>
|
||||
<th colspan="2">Tandatangan Pelanggan</th>
|
||||
<th colspan="2">Tandatangan Wakil</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" colspan="2" style="padding:4px; width:33%; height:50px;">_________________________________</td>
|
||||
<td rowspan="2" colspan="2" style="padding:4px; width:33%; height:50px;">_________________________________</td>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
<tr></tr>
|
||||
<tr>
|
||||
<td style="width: 40px">Nama</td>
|
||||
<td>: {{$customer_detail['nama']}}</td>
|
||||
<td>Nama</td>
|
||||
<td>: </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40px">Tarikh</td>
|
||||
<td>:</td>
|
||||
<td style="width: 30px">Tarikh</td>
|
||||
<td>:</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<table id="details" style="margin-top:20px;" id="keuntungan">
|
||||
<tr>
|
||||
<th colspan="2">Tandatangan Pengurus Cawangan</th>
|
||||
<th colspan="2"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="2" colspan="2" style="padding:4px; width:33%; height:50px;">_________________________________</td>
|
||||
<td rowspan="2" colspan="2" style="padding:4px; width:33%; height:50px;"></td>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
<tr></tr>
|
||||
<tr>
|
||||
<td style="width: 40px">Nama</td>
|
||||
<td>:</td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 40px">Tarikh</td>
|
||||
<td>:</td>
|
||||
<td style="width: 30px"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
|
||||
<div id="note"><b>
|
||||
<p>*Penting:</p>
|
||||
<p> a) Sila lampirkan bersama:</p>
|
||||
<p> i. Salinan kad pengenalan diri pelanggan dan kad pengenalan diri wakil yang dilantik.
|
||||
</p>
|
||||
<p> ii. SAG asal pelanggan</p>
|
||||
<p> b) Pastikan tandatangan pelanggan adalah sama dengan tandatangan di Surat Akuan Gadai.</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -249,6 +249,7 @@ Route::group(['middleware' => 'auth','verified'], function () {
|
||||
Route::get('/resit', 'App\Http\Controllers\BayaranController@ResitBayaran')->name('action.resit');
|
||||
Route::get('profile', ['as' => 'profile.edit', 'uses' => 'App\Http\Controllers\ProfileController@edit']);
|
||||
Route::put('profile', ['as' => 'profile.update', 'uses' => 'App\Http\Controllers\ProfileController@update']);
|
||||
Route::get('/cust/print.suratwakil/{kodcaw}/{norujukan}',['as'=>'cust.print.suratwakil','uses'=>'App\Http\Controllers\ProfileController@printSuratWakil']);
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user