marhun to pdf
export marhun(senarai lelong) to pdf
This commit is contained in:
@@ -102,7 +102,29 @@ class MarhunController extends Controller
|
||||
$emasall = JenisEmas::all();
|
||||
|
||||
return view('marhun.marhun',compact('marhun','lelongbid','karatall','emasall'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function exportmarhundetails(Request $request)
|
||||
{
|
||||
$lelongbid = LelongBid::where('id','=',$request->lelongbid)->first();
|
||||
$marhun = LelongBidMarhun::where('lelongbid_id','=',$request->lelongbid)->get();
|
||||
|
||||
$karatall = JenisKarat::all();
|
||||
$emasall = JenisEmas::all();
|
||||
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.marhundetails',compact('marhun',
|
||||
'lelongbid',
|
||||
'karatall',
|
||||
|
||||
'emasall'))->setPaper('a4', 'landscape');
|
||||
|
||||
return $pdf->download('Senarai Lelong Details.pdf');
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -10,8 +10,10 @@
|
||||
<p>{{ $message }}</p>
|
||||
</div>
|
||||
@endif
|
||||
<form id="exportform" action="" method="POST">
|
||||
<form id="exportform" action="{{route('marhun.exportmarhundetails')}}" method="POST">
|
||||
@csrf
|
||||
<input type="hidden" name="type" value="User">
|
||||
<input type="hidden" name="lelongbid" value="{{ $lelongbid->id }}">
|
||||
<table class="table table-striped table-xl" id="marhun" style="width:100%">
|
||||
<thead class="bg-primary text-white">
|
||||
<tr>
|
||||
@@ -162,7 +164,7 @@
|
||||
},
|
||||
{
|
||||
className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export',
|
||||
titleAttr: 'Export to CSV',
|
||||
titleAttr: 'Export Marhun Details to PDF',
|
||||
text: '<i class="fas fa-download"></i>',
|
||||
action: function ( e, dt, node, config ) {
|
||||
$("#exportform").submit();
|
||||
|
||||
@@ -75,125 +75,64 @@ tr:nth-child(even) {
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2"><u><b>LAPORAN SIMULASI SEMUA CAWANGAN</b></u></td>
|
||||
<td colspan="2"><u><b>SENARAI BARANG LELONG (DETAILS</b></u></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table cellspacing="" cellpadding="5" text-align="left" border="1" height="25" align="left" id="sim">
|
||||
<thead>
|
||||
<br>
|
||||
<tr>
|
||||
<td>Bilangan Lelong: {{$total_marhun}}</td>
|
||||
<td>Nilai Marhun Keseluruhan: RM{{ number_format($total_nmarhun, 2, '.', ',') }}</td>
|
||||
<td>Pembiayaan Keseluruhan: RM{{ number_format($total_pinjaman, 2, '.', ',') }} </td>
|
||||
<td>Keuntungan Keseluruhan:RM{{ number_format($total_upah, 2, '.', ',') }}</td>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<table cellspacing="" cellpadding="5" text-align="left" border="1" height="25" align="left" id="sim">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>Rugi Lelong Keseluruhan: RM{{ number_format($total_rugilelong, 2, '.', ',') }}</td>
|
||||
<td>Baki Lelong Keseluruhan: RM{{ number_format($total_bakilelong, 2, '.', ',') }}</td>
|
||||
<td>Caj Lelong Keseluruhan: RM{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<table cellspacing="0" cellpadding="5" style="float:right;" border="1" width="100%" height="80" align="center" id="sim">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="2%" align="center">No</th>
|
||||
<th width="9%" align="center">Cawangan</th>
|
||||
<th width="6%" align="center">Tarikh Lelong</th>
|
||||
<th width="5%" align="center">Bil Marhun (Paket)</th>
|
||||
<th width="9%" align="center">No Rujukan </th>
|
||||
<th width="6%" align="center">Jenis Marhun</th>
|
||||
<th width="5%" align="center">Karat</th>
|
||||
<th width="5%" align="center">Berat(gm)</th>
|
||||
<th width="9%" align="center">Harga(RM)</th>
|
||||
<th width="9%" align="center">Nilai Marhun(RM)</th>
|
||||
<th width="9%" align="center">Pembiayaan(RM)</th>
|
||||
<th width="9%" align="center">Keuntungan(RM)</th>
|
||||
<th width="9%" align="center">Harga Asas(RM)</th>
|
||||
<th width="9%" align="center">Caj Lelong(RM)</th>
|
||||
<th width="9%" align="center">Baki Lelong(RM)</th>
|
||||
<th width="9%" align="center">Rugi Lelong(RM)</th>
|
||||
<th width="12%" align="center">Nota</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
|
||||
@foreach ($arraycaw as $index=>$caw)
|
||||
<tr>
|
||||
<tbody>
|
||||
|
||||
@foreach ($marhun as $index=>$item)
|
||||
<tr>
|
||||
<td>{{$index+1}}</td>
|
||||
<td>{{ $caw['cawangan'] }}</td>
|
||||
<td>{{ $caw['t_lelong'] }}</td>
|
||||
<td>{{ $caw['bil_marhun'] }}</td>
|
||||
<td>{{ number_format($caw['berat'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['n_marhun'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['pinjaman'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['upah'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['hargaasas'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['cajlelong'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($caw['bakilelong'], 2, '.', ',') }}</td>
|
||||
<td>({{ number_format($caw['rugilelong'], 2, '.', ',') }})</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<td>{{ $lelongbid->norujukan }}</td>
|
||||
<td>{{ $item->marhun }}</td>
|
||||
<td>{{ $item->karat }}</td>
|
||||
<td>{{ $item->berat }}</td>
|
||||
<td>{{ $item->harga }}</td>
|
||||
<td>{{ $item->n_marhun }}</td>
|
||||
<td>{{ $item->hargaasas }}</td>
|
||||
<td>{{ $item->nota }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
|
||||
<@php
|
||||
|
||||
@endphp
|
||||
|
||||
{{--
|
||||
<tr>
|
||||
<td colspan="3" align="left"><strong>Jumlah Keseluruhan</strong></td>
|
||||
<td>{{ $total_marhun }}</td>
|
||||
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_nmarhun, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_upah, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_bakilelong, 2, '.', ',') }}</td>
|
||||
<td>({{ number_format($total_rugilelong, 2, '.', ',') }})</td>
|
||||
</tr>
|
||||
<td></td>
|
||||
<td>{{$total_berat}}</td>
|
||||
<td>{{$total_harga}}</td>
|
||||
<td>{{$total_nilaimarhun}}</td>
|
||||
<td>{{$total_hargaasas}}</td>
|
||||
<td></td>
|
||||
</tr> --}}
|
||||
|
||||
</table>
|
||||
|
||||
|
||||
<br><br><br><br><br><br>
|
||||
|
||||
|
||||
|
||||
<table cellspacing="0" cellpadding="2" style="float:right;" border="1" width="100%" height="80" align="right" id="sim">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center;" colspan="10"><h3><b>JUMLAH BERAT MENGIKUT MUTU (KESELURUHAN)</b></h3></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td colspan="1" align="left"><strong>MUTU </strong></td>
|
||||
<td colspan="1" align="center">24Kgb </td>
|
||||
<td colspan="1" align="center">24K </td>
|
||||
<td colspan="1" align="center">23K </td>
|
||||
<td colspan="1" align="center">22K </td>
|
||||
<td colspan="1" align="center">21K </td>
|
||||
<td colspan="1" align="center">20K </td>
|
||||
<td colspan="1" align="center">18K </td>
|
||||
<td colspan="1" align="center">14K </td>
|
||||
<td colspan="1" align="center">9K </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" align="left"><strong>BERAT(gm)</strong></td>
|
||||
<td colspan="1" align="center">{{$total24Kgb}}</td>
|
||||
<td colspan="1" align="center">{{$total24K}}</td>
|
||||
<td colspan="1" align="center">{{$total23k}}</td>
|
||||
<td colspan="1" align="center">{{$total22K}}</td>
|
||||
<td colspan="1" align="center">{{$total21K}}</td>
|
||||
<td colspan="1" align="center">{{$total20K}}</td>
|
||||
<td colspan="1" align="center">{{$total18Kp}}</td>
|
||||
<td colspan="1" align="center">{{$total14K}}</td>
|
||||
<td colspan="1" align="center">{{$total9K}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</tbody>
|
||||
|
||||
|
||||
@@ -106,5 +106,7 @@ Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinim
|
||||
|
||||
Route::post('/kemaskini',['as'=>'marhun.kemaskini','uses'=>'MarhunController@kemaskini']);
|
||||
Route::get('/semakan',['as'=>'marhun.semakan','uses'=>'MarhunController@semakan']);
|
||||
Route::post('/exportmarhun',['as'=>'marhun.exportmarhundetails','uses'=>'MarhunController@exportmarhundetails']);
|
||||
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user