Merge branch 'pipiv2' into 'master'

Pipiv2

See merge request online-sistem1/kaunter!115
This commit is contained in:
hafifie rahman
2021-04-22 04:50:51 +00:00
6 changed files with 406 additions and 75 deletions
+12 -4
View File
@@ -2078,7 +2078,7 @@ class KhazanahController extends Controller
} }
public function cetakLaporanStokAudit(Request $request){ public function cetakLaporanStokAudit(Request $request){
// dd($request);
$api_url = config('api.url'); $api_url = config('api.url');
$auth_user = Auth::user(); $auth_user = Auth::user();
$current = Carbon::now(); $current = Carbon::now();
@@ -2090,13 +2090,21 @@ class KhazanahController extends Controller
$split_date = explode('-',$request->datetimepicker1); $split_date = explode('-',$request->datetimepicker1);
$tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0]; $tebus_date = $split_date[2] . '-' . $split_date[1] . '-' . $split_date[0];
} }
// $stokaudit = Http::get(config('api.url'). '/api/gadai/cawangan/'. $auth_user['cawangan']. '/' . $tebus_date)->json();
$stokaudit = Http::get(config('api.url'). '/api/stokaudit/aktif/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
$cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json(); $cawangan=Http::get(config('api.url').'/api/cawangan/detail/'.$auth_user['cawangan'])->json();
$cawangan_detail=$cawangan[0]; $cawangan_detail=$cawangan[0];
if($request->radaktif === 'aktif')
{
$stokaudit = Http::get(config('api.url'). '/api/stokaudit/aktif/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
return view('print.laporan_stokaudit', compact('stokaudit','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
}else{
$stokaudit = Http::get(config('api.url'). '/api/stokaudit/takaktif/'. $auth_user['cawangan'],['tarikh' => $tebus_date])->json();
return view('print.laporan_stokauditbelumaktif', compact('stokaudit','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
}
// dd($gadai); // dd($gadai);
return view('print.laporan_stokaudit', compact('stokaudit','cawangan_detail','tarikh_cetak','tebus_date','api_url'));
} }
public function laporanBatalSuratGadai(){ public function laporanBatalSuratGadai(){
+1 -1
View File
@@ -533,7 +533,7 @@
'RM '+ formatter.format(gadai_detail['bakihargajualan']), 'RM '+ formatter.format(gadai_detail['bakihargajualan']),
'RM '+formatter.format(gadai_detail['bakipjm']), 'RM '+formatter.format(gadai_detail['bakipjm']),
(((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%', (((Number(gadai_detail['pinjaman'])/Number(gadai_detail['nilaimarhun']))*100).toFixed(2)).toLocaleString("en-GB") + '%',
gadai_detail['jbg'], gadai_detail['tempoh'],
'RM '+ formatter.format(upahsemasa) 'RM '+ formatter.format(upahsemasa)
]).draw(); ]).draw();
} }
@@ -1,4 +1,63 @@
@extends('layouts.app') @extends('layouts.app')
<style>
.radiostyle .radio-green {
background-color: #27ae60;
color:white;
box-shadow: 5px 10px #888888;
width:200px;
margin-right:5px;
transition: 0.5s ease;
}
.radiostyle .radio-red {
background-color: #e74c3c;
color:white;
width:200px;
margin-right:5px;
box-shadow: 5px 10px #888888;
transition: 0.5s ease;
}
.radiostyle .radio-yellow {
background-color: #3498db;
color:white;
width:200px;
margin-right:5px;
box-shadow: 5px 10px #888888;
transition: 0.5s ease;
}
.radiostyle .radio-green:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-red:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-yellow:hover {
box-shadow: 5px 5px #888888;
}
.radiostyle .radio-green input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
.radiostyle .radio-yellow input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
.radiostyle .radio-red input[type="radio"]:checked{
box-shadow: 5px 10px #888888;
}
</style>
@section('content') @section('content')
<div class="container"> <div class="container">
@@ -20,45 +79,41 @@
<div class="col-md-10"> <div class="col-md-10">
</div> </div>
</div> </div>
<div class="row">
<div class="col-md-5"> <div class="container">
<form action="{{ route('stokaudit.laporancetak') }}" target="_blank" method="get"> <div class="row">
@csrf <div class="col-md-5 mx-auto">
<div class="input-group mb-3"> <form action="{{ route('stokaudit.laporancetak') }}" target="_blank" method="get">
<div class="input-group-prepend"> @csrf
<span class="input-group-text" id="basic-addon1">Tarikh</span> <div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text" id="basic-addon1">Tarikh</span>
</div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetimepicker1" name="datetimepicker1" aria-describedby="basic-addon1">
<input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak">
</div> </div>
<input type="text" class="form-control" placeholder="Pilih Tarikh" aria-label="Tarikh" id="datetimepicker1" name="datetimepicker1" aria-describedby="basic-addon1">
<input type="submit" class="btn btn-primary ml-md-5" id="submit_button" name="submit_button" value="Cetak"> </div>
</div>
</form>
</div> </div>
</div> <br><br>
<div class="row"> <div class="row">
<div class="col-md-12">
<table class="" id="myTable"> <div class="btn-group-toggle col-md-12 col-sm-12 mb-4 radiostyle" data-toggle="buttons">
<thead> <label class="btn btn-lg radio-yellow">
<tr> <input autocomplete="off" type="radio" name="radaktif" id="option1" value="aktif" autocomplete="off" checked><i
<th>Bil</th> class="fas fa-money-bill-alt fa-2x"></i><br>
<th>No Rujukan</th> <span>Aktif</span>
<th>JBG</th> </label>
<th>No KP</th> <label class="btn btn-lg radio-green">
<th>Marhun</th> <input autocomplete="off" type="radio" name="radaktif" id="option2" value="takaktif" autocomplete="off"><i
<th>Berat</th> class="fas fa-thumbs-up fa-2x"></i><br><span>Tak Aktif</span>
<th>N.M (RM)</th> </label>
<th>Pembiayaan</th> </div>
<th>JT</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="row">
<div class="col-md-12 text-right">
Bilangan Surat : <span id="bilangan_surat">3</span>
Jumlah Pinjaman : <span id="jumlah_pinjaman">RM 3,000.00</span>
</div> </div>
</form>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
+38 -27
View File
@@ -146,21 +146,21 @@
<table id="header"> <table id="header">
<tr> <tr>
<th rowspan="4" style="width:50px"><br><img src="{{ asset('img/ARRAHN1.png') }}" style="width:70px"></img></th> {{-- <th rowspan="4" style="width:50px"><br><img src="{{ asset('img/ARRAHN1.png') }}" style="width:70px"></img></th> --}}
<th colspan="1">KOPERASI PERMODALAN KELANTAN BERHAD</th> {{-- <th colspan="1">KOPERASI PERMODALAN KELANTAN BERHAD</th> --}}
</tr> </tr>
<tr> <tr>
<td>{{ $cawangan_detail['namacaw'] }}</td> <td style="font-size:20px;">{{ $cawangan_detail['namacaw'] }}</td>
<td></td> <td></td>
</tr> </tr>
<tr> {{-- <tr>
<td>{{ $cawangan_detail['alamat1'] }}</td> <td>{{ $cawangan_detail['alamat1'] }}</td>
<td></td> <td></td>
</tr> </tr>
<tr> <tr>
<td>{{ $cawangan_detail['alamat2'].' No Tel : '. $cawangan_detail['notel'].' No Faks : '. $cawangan_detail['nofaks'] }}</td> <td>{{ $cawangan_detail['alamat2'].' No Tel : '. $cawangan_detail['notel'].' No Faks : '. $cawangan_detail['nofaks'] }}</td>
<td></td> <td></td>
</tr> </tr> --}}
</table> </table>
<br> <br>
@@ -169,22 +169,25 @@
<th colspan ="5"><b>LAPORAN GADAIAN</b></th> <th colspan ="5"><b>LAPORAN GADAIAN</b></th>
<th> </th> <th> </th>
<th> </th> <th> </th>
<th><b> Tarikh Cetak:</b> <th>
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp
</th> </th>
<th></th> <th></th>
</tr> </tr>
<tr> <tr>
<td style="width:10px"> <b>TARIKH</b></td> <td><b> Tarikh:</b></td>
<td>@php <td style="text-align:left;"> @php
$myDateTime = DateTime::createFromFormat('Y-m-d', $gadai_date); $myDateTime = DateTime::createFromFormat('Y-m-d', $gadai_date);
$formattedweddingdate = $myDateTime->format('d-m-Y'); $formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate) echo($formattedweddingdate)
@endphp</td> @endphp</td>
</tr>
<tr>
<td style="width:10px"> <b>Tarikh Cetak</b></td>
<td style="text-align:left;">@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp</td>
<td style="width:50px"> <td style="width:50px">
</td> </td>
<td> </td> <td> </td>
@@ -205,7 +208,6 @@
<th>Alamat</th> <th>Alamat</th>
<th>No K/P</th> <th>No K/P</th>
<th>Masa</th> <th>Masa</th>
<th>Marhun</th>
<th>Berat</th> <th>Berat</th>
<th>N Marhun</th> <th>N Marhun</th>
<th>Pembiayaan</th> <th>Pembiayaan</th>
@@ -217,17 +219,20 @@
@if($index > 0) @if($index > 0)
@if($item['teller'] != $gadai[$index - 1]['teller']) @if($item['teller'] != $gadai[$index - 1]['teller'])
<tr> <tr>
<td colspan=10>Teller : {{$item['teller']}}</td> <td colspan=10>Teller : <b>{{ $item['teller'] }}</b></td>
</tr> </tr>
@php $totalpinjamanteller = 0;$totalnmteller = 0;$totalberatteller = 0; @endphp
@endif @endif
@else @else
<tr> <tr>
<td colspan=10>Teller : {{$item['teller']}}</td> <td colspan=10>Teller : <b>{{ $item['teller'] }}</b></td>
</tr> </tr>
@php $totalpinjamanteller = 0;$totalnmteller = 0;$totalberatteller = 0; @endphp
@endif @endif
<tr> <tr>
<td>{{ $counter }}</td> <td>{{ $counter }}</td>
<td colspan=2 style="width:100px">{{$item['norujukan']}}</td> <td style="width:100px">{{$item['norujukan']}}</td>
<td> <td>
@php @php
$customer_detail = Http::get($api_url . '/api/customers/' . $item['nokp'])->json(); $customer_detail = Http::get($api_url . '/api/customers/' . $item['nokp'])->json();
@@ -237,29 +242,35 @@
<td>{{$customer_detail[0]['alamat1']}}</td> <td>{{$customer_detail[0]['alamat1']}}</td>
<td>{{ $item['nokp'] }}</td> <td>{{ $item['nokp'] }}</td>
<td>{{ $item['masa'] }}</td> <td>{{ $item['masa'] }}</td>
<td>{{ $item['marhun'] }}</td>
<td>{{ number_format($item['berat'],2) }}</td> <td>{{ number_format($item['berat'],2) }}</td>
<td>{{ number_format($item['nilaimarhun'],2) }}</td> <td>{{ number_format($item['nilaimarhun'],2) }}</td>
<td>{{ number_format($item['pinjaman'],2) }}</td> <td>{{ number_format($item['pinjaman'],2) }}</td>
<td>{{ $item['percentpinj'] }}</td> <td>{{ $item['percentpinj'] }}</td>
</tr> </tr>
@php $counter++; @endphp @php $counter++; @endphp
@php $totalpinjamanteller += $item['pinjaman'];$totalnmteller += $item['nilaimarhun'];$totalberatteller += $item['berat']; @endphp
@if($index+1 < sizeof($gadai)) @if($index+1 < sizeof($gadai))
@if($item['teller'] != $gadai[$index + 1]['teller']) @if($item['teller'] != $gadai[$index + 1]['teller'])
<tr> <tr>
<td colspan=10>{{ $counter-1 }} Jumlah Surat Bagi Teller : {{$item['teller']}}</td> <td colspan="6"><b>{{ $counter-1 }}</b> Jumlah surat bagi teller : <b>{{ $item['teller'] }}</b></td>
<td><b>{{ number_format($totalberatteller,2) }} </b></td>
<td><b>{{ number_format($totalnmteller,2) }} </b></td>
<td><b>{{ number_format($totalpinjamanteller,2) }} </b></td>
</tr> </tr>
@php $counter = 0; @endphp @php $counter = 1; @endphp
@endif @endif
@else @else
<tr> <tr>
<td colspan=10>{{ $counter }} Jumlah Bagi Teller : {{$item['teller']}}</td> <td colspan="6"><b>{{ $counter-1 }}</b> Jumlah surat bagi teller : <b>{{ $item['teller'] }}</b></td>
<td><b>{{ number_format($totalberatteller,2) }} </b></td>
<td><b>{{ number_format($totalnmteller,2) }} </b></td>
<td><b>{{ number_format($totalpinjamanteller,2) }} </b></td>
</tr> </tr>
@endif @endif
@endforeach @endforeach
<tfoot> <tfoot>
<th colspan="9" style="text-align:right;">JUMLAH</th> <th colspan="8" style="text-align:right;font-size:13px;">JUMLAH KESELURUHAN :</th>
<th>{{ number_format($totalpinjaman,2) }}</th> <th style="font-size:13px;">{{ number_format($totalpinjaman,2) }}</th>
<th></th> <th></th>
</tfoot> </tfoot>
</table> </table>
@@ -213,22 +213,22 @@
<th>N Marhun</th> <th>N Marhun</th>
<th>Jenis Tebus</th> <th>Jenis Tebus</th>
</tr> </tr>
@php $counter = 0; $totalpembiayaan = 0;@endphp @php $counter = 1; $totalpembiayaan = 0;@endphp
@foreach($tebus as $index=>$item) @foreach($tebus as $index=>$item)
@if($index > 0) @if($index > 0)
@if($item['teller'] != $tebus[$index - 1]['teller']) @if($item['teller'] != $tebus[$index - 1]['teller'])
<tr> <tr>
<td colspan=12>Teller : {{$item['teller']}}</td> <td colspan=12>Teller : <b>{{ $item['teller'] }}</b></td>
</tr> </tr>
@endif @endif
@else @else
<tr> <tr>
<td colspan=12>Teller : {{$item['teller']}}</td> <td colspan=12>Teller : <b>{{ $item['teller'] }}</b></td>
</tr> </tr>
@endif @endif
<tr> <tr>
<td>{{ $loop->iteration }}</td> <td>{{ $counter }}</td>
<td colspan=2>{{$item['norujukan']}}</td> <td>{{ $item['norujukan'] }}</td>
<td> <td>
@php @php
$gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json(); $gadai_detail = Http::get($api_url . '/api/gadai/norujukan/'. $item['norujukan'])->json();
@@ -258,13 +258,13 @@
@if($index+1 < sizeof($tebus)) @if($index+1 < sizeof($tebus))
@if($item['teller'] != $tebus[$index + 1]['teller']) @if($item['teller'] != $tebus[$index + 1]['teller'])
<tr> <tr>
<td colspan=12>{{ $counter }} Jumlah Bagi Teller : {{$item['teller']}}</td> <td colspan=12><b>{{ $counter-1 }}</b> Jumlah Bagi Teller : <b>{{ $item['teller'] }}</b></td>
</tr> </tr>
@php $counter = 0; @endphp @php $counter = 0; @endphp
@endif @endif
@else @else
<tr> <tr>
<td colspan=12>{{ $counter }} Jumlah Bagi Teller : {{$item['teller']}}</td> <td colspan=12><b>{{ $counter-1 }}</b> Jumlah Bagi Teller : <b>{{ $item['teller'] }}</b></td>
</tr> </tr>
@endif @endif
@endforeach @endforeach
@@ -0,0 +1,257 @@
<style>
#header {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#header td, #customers th {
padding:4px;
font-size:10px;
}
#header tr:nth-child(even){background-color: #ffffff;}
#header tr:hover {background-color: #ddd;}
#header th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding:4px;
color:black;
}
</style>
<style>
#scan {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#scan td, #scan th {
padding: 8px;
font-size:11px;
}
#scan tr:nth-child(even){background-color: #ffffff;}
#scan tr:hover {background-color: #ddd;}
#scan th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding:4px;
color:black;
}
</style>
<style>
#scan {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#scan td, #scan th {
border-collapse: collapse;
padding: 8px;
font-size:11px;
}
#scan tr:nth-child(even){background-color: #ffffff;}
#scan tr:hover {background-color: #ddd;}
#scan th {
border-collapse: collapse;
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding:4px;
color:black;
}
</style>
<style>
#details {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#details td, #details th {
padding: 8px;
font-size:11px;
}
#details tr:nth-child(even){background-color: #ffffff;}
#details tr:hover {background-color: #ddd;}
#details th {
padding-top: 12px;
font-style:bold;
padding-bottom: 12px;
text-align: left;
padding:4px;
color:black;
}
</style>
<style>
#sign {
font-family: Arial, Helvetica, sans-serif;
border-collapse: collapse;
width: 100%;
}
#sign td, #sign th {
padding: 8px;
font-size:11px;
text-align: center;
}
#sign tr:nth-child(even){background-color: #ffffff;}
#sign tr:hover {background-color: #ddd;}
#sign th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
padding:4px;
color:black;
}
</style>
<table id="header">
<tr>
<th rowspan="4" style="width:50px"><br><img src="{{ asset('img/ARRAHN1.png') }}" style="width:70px"></img></th>
<th colspan="1">KOPERASI PERMODALAN KELANTAN BERHAD</th>
</tr>
<tr>
<td>{{ $cawangan_detail['namacaw'] }}</td>
<td></td>
</tr>
<tr>
<td>{{ $cawangan_detail['alamat1'] }}</td>
<td></td>
</tr>
<tr>
<td>{{ $cawangan_detail['alamat2'].' No Tel : '. $cawangan_detail['notel'].' No Faks : '. $cawangan_detail['nofaks'] }}</td>
<td></td>
</tr>
</table>
<br>
<table id="scan">
<tr>
<th colspan ="5"><b>Laporan Stok Audit</b></th>
<th> </th>
<th> </th>
<th><b> Tarikh Cetak:</b>
@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh_cetak);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp
</th>
<th></th>
</tr>
<tr>
<td style="width:10px"> <b>TARIKH</b></td>
<td>@php
$myDateTime = DateTime::createFromFormat('Y-m-d', $tebus_date);
$formattedweddingdate = $myDateTime->format('d-m-Y');
echo($formattedweddingdate)
@endphp</td>
<td style="width:50px">
</td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<br>
<table id="details">
<thead>
<th>Bil</th>
<th>Norujukan</th>
<th>JBG</th>
<th>No. KP</th>
<th>Berat</th>
<th>Nilai Marhun (RM)</th>
<th>Pembiayaan</th>
<th>Lanjutan</th>
</thead>
@php $counter = 1; @endphp
@foreach($stokaudit['rekod'] as $index=>$item)
<tr>
<td>{{ $counter }}</td>
<td>{{$item['norujukan']}}</td>
<td>{{ $item['jbg'] }}</td>
<td>{{$item['nokp']}}</td>
<td>{{ number_format($item['berat'],2) }}</td>
<td>{{ number_format($item['nilaimarhun'],2) }}</td>
<td>{{ number_format($item['pinjaman'],2) }}</td>
<td>{{$item['lelong_tawarruq']}}</td>
</tr>
@php $counter++; @endphp
@endforeach
<tfoot>
<th colspan='4'>Jumlah</th>
<th>{{ number_format($stokaudit['totalberat'],2) }}</th>
<th>{{ number_format($stokaudit['totalnilaimarhun'],2) }}</th>
<th>{{ number_format($stokaudit['total'],2) }}</th>
<th></th>
</tfoot>
</table>
<br>
<br>
<table id="sign">
<tr>
<td></td>
<td colspan="2"> .................................................................. </td>
<td> </td>
<td colspan="2">.................................................................. </td>
<td> </td>
</tr>
<tr>
<td></td>
<td colspan="2"><B> DI SEMAK</B> </td>
<td> </td>
<td colspan="2"><B>DI SAHKAN </B></td>
<td> </td>
</tr>
</table>