fixing table pinjaman

This commit is contained in:
KhatamNugraha
2024-04-05 15:47:48 +07:00
parent 9f8b6f6d5f
commit ece4805fc5
3 changed files with 209 additions and 138 deletions

View File

@ -13,42 +13,6 @@
}
/** Define the header rules **/
/* header {
position: fixed;
top: 0cm;
left: 0cm;
right: 0cm;
height: 6.5cm;
}
/** Define the footer rules **/
/* footer {
position: fixed;
bottom: 0cm;
left: 0cm;
right: 0cm;
}, */
/* table {
width: 100%;
border-collapse: collapse;
border: 1px solid #ddd;
}
th, td {
border: 1px solid #ddd;
padding: 3px;
font-size: 12px;
}
th {
background-color: #f2f2f2;
font-weight: bold;
}
tr:nth-child(even) {
background-color: #f2f2f2;
} */
.text-center{
text-align: center;
@ -75,7 +39,7 @@
border-collapse: collapse;
}
.no-border-table,
.no-border-table,
.no-border-table th,
.no-border-table td,
.no-border-table tr {
@ -95,20 +59,47 @@
text-align: center;
position: fixed;
margin-top: 1cm;
}
.header {
top: 0px;
position: fixed;
top: -60px;
left: 0px;
right: 0px;
height: 50px;
font-size: 20px !important;
background-color: #000;
color: white;
text-align: center;
line-height: 35px;
}
/* Hide header on first page */
body:nth-child(1) .header {
display: none;
}
.footer {
top: 23cm;
}
.pagenum:before {
content: counter(page);
}
.flyleaf {
page-break-after: always;
}
</style>
</head>
<body>
<div class="header">
testtt
</div>
<ul class="no-bullets">
<li>Nomor &nbsp; : {{$data['infoSuratOld']['no_surat']}}</li>
<li>Tanggal : {{ $data['today'] }}</li>
@ -145,7 +136,7 @@
</tr>
</thead>
<tbody>
@if (count($data['DataAccounts'])>0)
@if (count($data['DataAccounts'])>0 )
@php $i=1
@endphp
@foreach ($data['DataAccounts'] as $val)
@ -153,7 +144,6 @@
<td class="text-center space1">{{ $i++ }}</td>
<td class="text-left space1">{{ $val['SHORT_NAME'] }}</td>
<td class=" text-center space1"></td>
{{-- <td class=" text-center space1">{{ $val['OPENING_DATE'] }}</td> --}}
<td class=" text-center space1">{{ $val['CURRENCY'] }}</td>
<td class=" text-right space1">{{ $val['WORKING_BALANCE'] }}</td>
<td class="text-center space1 ">{{ $val['TERM'] }}</td>
@ -165,7 +155,7 @@
@endforeach
@else
<tr class="">
<td class="space1" colspan="9" style="text-align: center;">Tidak Ada Data Yang Ditampilkan</td>
<td class="space1" colspan="9" style="text-align: center;">NIHIL</td>
</tr>
@endif
<!-- Add more rows here if needed -->
@ -191,32 +181,61 @@
</tr>
</thead>
<tbody>
@if (count($data['DataPinjaman'])>0)
@php $i=1;
$saldo = '';
@endphp
@foreach ($data['DataPinjaman'] as $key1 => $pinjaman)
<tr class="space1">
<td class="text-center space1">{{ $i++ }}</td>
<td class="space1">{{ $pinjaman['PRODUCT'] }}</td>
<td class="text-center space1 "></td>
{{-- <td class="text-center space1 ">{{$pinjaman['START_DATE']}}</td> --}}
<td class="text-center space1">{{ $pinjaman['CURRENCY'] }}</td>
<td class="text-right space1">{{$pinjaman['WORKING_BALANCE']}}</td>
<td class="text-center space1">{{ $pinjaman['TERM'] }} BLN</td>
<td class="text-center space1">{{ $pinjaman['FIXED_RATE'] }} %</td>
<td class="text-center space1">{{ $pinjaman['MATURITY_DATE'] }}</td>
<td class="text-center space1">{{ $pinjaman['ACCOUNT_NUMBER'] }}</td>
</tr>
@endforeach
@if (count($data['DataPinjaman'])>0 OR count($data['DataRK'])>0)
@if (count($data['DataPinjaman'])>0)
@php $i=1;
$saldo = '';
@endphp
@foreach ($data['DataPinjaman'] as $key1 => $pinjaman)
<tr class="space1">
<td class="text-center space1">{{ $i++ }}</td>
<td class="space1">{{ $pinjaman['PRODUCT'] }}</td>
<td class="text-center space1 "></td>
<td class="text-center space1">{{ $pinjaman['CURRENCY'] }}</td>
<td class="text-right space1">{{$pinjaman['WORKING_BALANCE']}}</td>
<td class="text-center space1">{{ $pinjaman['TERM'] }} BLN</td>
<td class="text-center space1">{{ $pinjaman['FIXED_RATE'] }} %</td>
<td class="text-center space1">{{ $pinjaman['MATURITY_DATE'] }}</td>
<td class="text-center space1">{{ $pinjaman['ACCOUNT_NUMBER'] }}</td>
</tr>
@endforeach
@endif
@if (count($data['DataRK']) > 0)
@php
$no = 0;
if (count( $data['DataPinjaman']) > 0) {
$no = count($data['DataPinjaman']) + 1 ;
}else{
$no = 1 ;
}
@endphp
@foreach ($data['DataRK'] as $rk => $dtRK)
<tr class="space1">
<td class="text-center space1">{{ $i++ }}</td>
<td class="space1">{{ $dtRK['SHORT_NAME'] }}</td>
<td class="text-center space1 "></td>
<td class="text-center space1">{{ $dtRK['CURRENCY'] }}</td>
<td class="text-right space1">{{$dtRK['WORKING_BALANCE']}}</td>
<td class="text-center space1"></td>
<td class="text-center space1"></td>
<td class="text-center space1"></td>
<td class="text-center space1">{{ $dtRK['ACCOUNT_NUMBER'] }}</td>
</tr>
@endforeach
@endif
@else
<tr class="space1">
<td class="space1" colspan="9" style="text-align: center;">Tidak Ada Data Pinjaman Yang Ditampilkan</td>
<td class="space1" colspan="9" style="text-align: center;">NIHIL</td>
</tr>
@endif
</tbody>
</table><br>
<ul class="no-bullets" style="page-break-inside: avoid;">
<li>FASILITAS LAIN YANG DITERIMA OLEH NASABAH</li>
<li>POSISI : {{ $data['batchDate'] }} </li>
@ -237,73 +256,73 @@
</thead>
<tbody>
@if (count($data['DataLimit']) > 0 OR count($data['DataFasilitas']) > 0 )
@if (count($data['DataLimit']) > 0)
@php $i=1 @endphp
@foreach ($data['DataLimit'] as $limit)
@php
$approvalDate = \Carbon\Carbon::parse($limit->APPROVAL_DATE);
$expiryDate = \Carbon\Carbon::parse($limit->EXPIRY_DATE);
$term = $expiryDate->diffInMonths($approvalDate);
$limitPecent = intval($limit->LIMIT_PERCENTAGE) / 100 ;
$noRek = explode(']', $limit->ACCOUNT);
//conver term
@endphp
<tr class="space1">
@if (count($data['DataLimit']) > 0)
@php $i=1 @endphp
@foreach ($data['DataLimit'] as $limit)
@php
$approvalDate = \Carbon\Carbon::parse($limit->APPROVAL_DATE);
$expiryDate = \Carbon\Carbon::parse($limit->EXPIRY_DATE);
$term = $expiryDate->diffInMonths($approvalDate);
$limitPecent = intval($limit->LIMIT_PERCENTAGE) / 100 ;
$noRek = explode(']', $limit->ACCOUNT);
//conver term
@endphp
<tr class="space1">
<td class="text-center space1">{{ $i++ }}</td>
<td class="space1">{{ $limit->SHORT_NAME }}</td>
<td class="text-center space1"></td>
{{-- <td class="text-center space1">{{ $approvalDate->format('d-m-Y') }}</td> --}}
<td class="text-center space1">{{ $limit->LIMIT_CURRENCY }}</td>
<td class="space1 text-right">
{{ ($limit->AVAIL_AMT != 0.00) ? number_format($limit->AVAIL_AMT,2,',','.') : 'NIHIL'}}</td>
<td class="text-center space1">{{ $term }} BLN </td>
<td class="text-center space1">{{ $limitPecent }} %</td>
<td class="text-center space1">{{ $expiryDate->format('d-m-Y')}}</td>
<td class="text-center space1">
@if(count($noRek) > 1)
<ul class="no-bullets">
@foreach ($noRek as $item)
<li style=" font-family: Times New Roman,Times, sans-serif;font-size:12px">{{$item}}</li>
@endforeach
</ul>
@else
{{ $limit->ACCOUNT}}
@endif
</td>
</tr>
@endforeach
@endif
<td class="text-center space1">{{ $i++ }}</td>
<td class="space1">{{ $limit->SHORT_NAME }}</td>
<td class="text-center space1"></td>
{{-- <td class="text-center space1">{{ $approvalDate->format('d-m-Y') }}</td> --}}
<td class="text-center space1">{{ $limit->LIMIT_CURRENCY }}</td>
<td class="space1 text-right">
{{ ($limit->AVAIL_AMT != 0.00) ? number_format($limit->AVAIL_AMT,2,',','.') : 'NIHIL'}}</td>
<td class="text-center space1">{{ $term }} BLN </td>
<td class="text-center space1">{{ $limitPecent }} %</td>
<td class="text-center space1">{{ $expiryDate->format('d-m-Y')}}</td>
<td class="text-center space1">
@if(count($noRek) > 1)
<ul class="no-bullets">
@foreach ($noRek as $item)
<li style=" font-family: Times New Roman,Times, sans-serif;font-size:12px">{{$item}}</li>
@endforeach
</ul>
@else
{{ $limit->ACCOUNT}}
@endif
</td>
</tr>
@endforeach
@endif
@if (count($data['DataFasilitas']) > 0)
@php
$no = 0;
if (count( $data['DataLimit']) > 0) {
$no = count($data['DataLimit']) + 1 ;
}else{
$no = 1 ;
}
@endphp
@if (count($data['DataFasilitas']) > 0)
@php
$no = 0;
if (count( $data['DataLimit']) > 0) {
$no = count($data['DataLimit']) + 1 ;
}else{
$no = 1 ;
}
@endphp
@foreach ($data['DataFasilitas'] as $fasilitas)
<tr class="space1">
<td class="text-center space1">{{ $no++ }}</td>
<td class="space1">{{ $fasilitas['jenis_fasilitas'] }}</td>
<td class="text-center space1"></td>
{{-- <td class="text-center space1">{{ \Carbon\Carbon::parse($fasilitas->start_date)->format('d-m-Y') }}</td> --}}
<td class="text-center space1">{{ $fasilitas['mata_uang'] }}</td>
<td class="space1 text-right"> {{ $fasilitas['saldo']}}</td></td>
<td class="text-center space1 ">{{ $fasilitas['jangka_waktu'] }}</td>
<td class="text-center space1">{{ $fasilitas['fixed_rate'] }} %</td>
<td class="text-center space1">{{ \Carbon\Carbon::parse($fasilitas['due_date'])->format('d-m-Y') }}</td>
<td class="text-center space1">{{ $fasilitas['nomor_rekening'] }}</td>
</tr>
@endforeach
@endif
@foreach ($data['DataFasilitas'] as $fasilitas)
<tr class="space1">
<td class="text-center space1">{{ $no++ }}</td>
<td class="space1">{{ $fasilitas['jenis_fasilitas'] }}</td>
<td class="text-center space1"></td>
{{-- <td class="text-center space1">{{ \Carbon\Carbon::parse($fasilitas->start_date)->format('d-m-Y') }}</td> --}}
<td class="text-center space1">{{ $fasilitas['mata_uang'] }}</td>
<td class="space1 text-right"> {{ $fasilitas['saldo']}}</td></td>
<td class="text-center space1 ">{{ $fasilitas['jangka_waktu'] }}</td>
<td class="text-center space1">{{ $fasilitas['fixed_rate'] }} %</td>
<td class="text-center space1">{{ \Carbon\Carbon::parse($fasilitas['due_date'])->format('d-m-Y') }}</td>
<td class="text-center space1">{{ $fasilitas['nomor_rekening'] }}</td>
</tr>
@endforeach
@endif
@else
<tr class="space1">
<td class="space1" colspan="9" style="text-align: center;">Tidak Ada Fasilitas </td>
</tr>
<tr class="space1">
<td class="space1" colspan="9" style="text-align: center;">NIHIL</td>
</tr>
@endif
</tbody>
</table><br>