add total amaunt at laporan simulasi
This commit is contained in:
@@ -592,6 +592,14 @@ class ReportController extends Controller
|
||||
Public function simulasireport ($simulasi_id, $cawid){
|
||||
|
||||
$keuntungan = 0;
|
||||
$total_berat = 0;
|
||||
$total_pinjaman = 0;
|
||||
$total_hargaasas = 0;
|
||||
$total_nilaimarhun = 0;
|
||||
$total_bakiupah = 0;
|
||||
$total_cajlelong = 0;
|
||||
$total_bakilelong = 0;
|
||||
$total_rugilelong = 0;
|
||||
|
||||
$marhuns = SimulasiBid::join('cawangan', 'simulasibid.caw_id', '=', 'cawangan.id')
|
||||
// ->join('gadai','simulasibid.norujukan','=','gadai.norujukan')
|
||||
@@ -638,6 +646,8 @@ class ReportController extends Controller
|
||||
// $keuntungan = $cal['bakipjm'] - ($cal['bakihargajualan'] - ($cal['upah12'] - $cal['ansakhir'])-(($cal['tempoh']-$cal['tempohbayar'])*$cal['kadarupah']/100*$cal['bakipjm']) );
|
||||
$marhuns[$index1]['keuntungan'] = $keuntungan;
|
||||
$marhuns[$index1]['nama'] = $customer;
|
||||
|
||||
|
||||
|
||||
array_push($arraymarhun,[
|
||||
'norujukan' => $cal['norujukan'],
|
||||
@@ -652,13 +662,27 @@ class ReportController extends Controller
|
||||
'baki' => $cal['baki'],
|
||||
]);
|
||||
|
||||
if($cal['baki'] > 0)
|
||||
{
|
||||
$total_bakilelong = $total_bakilelong + $cal['baki'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$total_rugilelong = $total_rugilelong - $cal['baki'];
|
||||
}
|
||||
|
||||
$total_berat = $total_berat + $cal['berat'];
|
||||
$total_pinjaman = $total_pinjaman + $cal['pinjaman'];
|
||||
$total_hargaasas = $total_hargaasas + $cal['hargaasas'];
|
||||
$total_nilaimarhun = $total_nilaimarhun + $cal['nilaimarhun'];
|
||||
$total_bakiupah = $total_bakiupah + $cal['bakiupah'];
|
||||
$total_cajlelong = $total_cajlelong + $cal['cajlelong'];
|
||||
|
||||
$datacaw = Cawangan::where('id','=',$cawid)
|
||||
|
||||
->get();
|
||||
}
|
||||
|
||||
$pdf = PDF::loadView('pdf.pdfsimulasireport',compact('arraymarhun','marhuns','simulasi_id','cawid','keuntungan','datacaw'))
|
||||
$pdf = PDF::loadView('pdf.pdfsimulasireport',compact('arraymarhun','marhuns','simulasi_id','cawid','keuntungan','datacaw','total_berat','total_pinjaman','total_hargaasas','total_nilaimarhun','total_bakiupah','total_cajlelong','total_bakilelong','total_rugilelong'))
|
||||
->setPaper('a4','potrait');
|
||||
|
||||
return $pdf->download('Laporan Simulasi Cawangan.pdf');
|
||||
|
||||
@@ -118,7 +118,7 @@ tr:nth-child(even) {
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Nama Pelanggan</th>
|
||||
<!-- <th>Nama Pelanggan</th> -->
|
||||
<th>Tempoh</th>
|
||||
<th>Berat (gm)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
@@ -135,7 +135,7 @@ tr:nth-child(even) {
|
||||
<tr>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>{{ $marhun['norujukan']}}</td>
|
||||
<td>{{ $marhun['nama']}}</td>
|
||||
<!-- <td>{{ $marhun['nama']}}</td> -->
|
||||
<td>{{ number_format($marhun['tempoh'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['berat'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['nilaimarhun'], 2, '.', ',') }}</td>
|
||||
@@ -164,13 +164,17 @@ tr:nth-child(even) {
|
||||
|
||||
|
||||
|
||||
{{-- <tr>
|
||||
<tr>
|
||||
<td colspan="3" align="left"><strong>Jumlah Keseluruhan</strong></td>
|
||||
<td><strong>{{ number_format($total_berat, 2, '.', ',') }}</strong></td>
|
||||
<td><strong>{{ number_format($total_nilaimarhun, 2, '.', ',') }}</strong></td>
|
||||
<td><strong>{{ number_format($total_hargaasas, 2, '.', ',') }}</strong></td>
|
||||
<td><strong>{{ number_format($total_hargalelong, 2, '.', ',') }}</strong></td>
|
||||
<td></td>
|
||||
</tr> --}}
|
||||
<td><strong>{{ number_format($total_pinjaman, 2, '.', ',') }}</strong></td>
|
||||
<td><strong>{{ number_format($total_bakiupah, 2, '.', ',') }}</strong></td>
|
||||
<td><strong>{{ number_format($total_cajlelong, 2, '.', ',') }}</strong></td>
|
||||
<td><strong>({{ number_format($total_rugilelong, 2, '.', ',') }})</strong></td>
|
||||
<td><strong>{{ number_format($total_bakilelong, 2, '.', ',') }}</strong></td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Nama Pelanggan</th>
|
||||
<!-- <th>Nama Pelanggan</th> -->
|
||||
<th>Tempoh</th>
|
||||
<th>Berat (gm)</th>
|
||||
<th>Nilai Marhun (RM)</th>
|
||||
@@ -44,7 +44,7 @@
|
||||
<tr>
|
||||
<td>{{$loop->iteration}}</td>
|
||||
<td>{{ $marhun['norujukan']}}</td>
|
||||
<td>{{ $marhun['nama']}}</td>
|
||||
<!-- <td>{{ $marhun['nama']}}</td> -->
|
||||
<td>{{ number_format($marhun['tempoh'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['berat'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($marhun['nilaimarhun'], 2, '.', ',') }}</td>
|
||||
|
||||
Reference in New Issue
Block a user