update simulasi cajlelong dan baki lelong
This commit is contained in:
@@ -678,6 +678,8 @@ class ReportController extends Controller
|
||||
$total_rugilelong = 0;
|
||||
$total_baki = 0;
|
||||
|
||||
$simulasilel = Simulasi::with('cawangan')->find($simulasi_id);
|
||||
|
||||
$marhuns = SimulasiBid::join('cawangan', 'simulasibid.caw_id', '=', 'cawangan.id')
|
||||
// ->join('gadai','simulasibid.norujukan','=','gadai.norujukan')
|
||||
->where('simulasi_id','=',$simulasi_id)
|
||||
@@ -721,6 +723,12 @@ class ReportController extends Controller
|
||||
// dd($customer);
|
||||
|
||||
// $keuntungan = $cal['bakipjm'] - ($cal['bakihargajualan'] - ($cal['upah12'] - $cal['ansakhir'])-(($cal['tempoh']-$cal['tempohbayar'])*$cal['kadarupah']/100*$cal['bakipjm']) );
|
||||
$sumcajlelong = $cal['hargaasas'] * ($simulasilel->cajlelong/100);
|
||||
$cajlelongnew = round($sumcajlelong,1,1);
|
||||
$baki = $cal['hargaasas'] - $cal['pinjaman'] - $cal['bakiupah'] - $cajlelongnew;
|
||||
$marhuns[$index1]['cajlelong'] = $cal['cajlelong'];
|
||||
$marhuns[$index1]['baki'] = $baki;
|
||||
|
||||
$marhuns[$index1]['keuntungan'] = $keuntungan;
|
||||
$marhuns[$index1]['nama'] = $customer;
|
||||
|
||||
@@ -735,8 +743,8 @@ class ReportController extends Controller
|
||||
'hargaasas' => $cal['hargaasas'],
|
||||
'pinjaman' => $cal['pinjaman'],
|
||||
'bakiupah' => $cal['bakiupah'],
|
||||
'cajlelong' => $cal['cajlelong'],
|
||||
'baki' => $cal['baki'],
|
||||
'cajlelong' => $cajlelongnew,
|
||||
'baki' => $baki,
|
||||
]);
|
||||
|
||||
if($cal['baki'] > 0)
|
||||
@@ -753,8 +761,8 @@ class ReportController extends Controller
|
||||
$total_hargaasas = $total_hargaasas + $cal['hargaasas'];
|
||||
$total_nilaimarhun = $total_nilaimarhun + $cal['nilaimarhun'];
|
||||
$total_bakiupah = $total_bakiupah + $cal['bakiupah'];
|
||||
$total_cajlelong = $total_cajlelong + $cal['cajlelong'];
|
||||
$total_baki = $total_baki + $cal['baki'];
|
||||
$total_cajlelong = $total_cajlelong + $cajlelongnew;
|
||||
$total_baki = $total_baki + $baki;
|
||||
|
||||
$datacaw = Cawangan::where('id','=',$cawid)
|
||||
->get();
|
||||
|
||||
Reference in New Issue
Block a user