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');
|
||||
|
||||
Reference in New Issue
Block a user