slm
This commit is contained in:
@@ -33,30 +33,7 @@ class TebusController extends Controller
|
||||
->where('norujukan','=',$norujukan)
|
||||
->first();
|
||||
|
||||
|
||||
$upah_semasa = $this->kiraupahTawarruq($kodcaw,$norujukan);
|
||||
|
||||
$transaction = Transaction::on('mysql7')
|
||||
->where([['norujukan','=',$norujukan],['trans_type','=','A']])
|
||||
->get();
|
||||
|
||||
$transaction_keuntungan = TransaksiKeuntungan::on('mysql7')
|
||||
->where('norujukan','=',$norujukan)
|
||||
->get();
|
||||
|
||||
$totalBayaranKeuntungan = 0;
|
||||
$totalBayaran = 0;
|
||||
|
||||
|
||||
foreach($transaction as $index=>$trans){
|
||||
$totalBayaran += $trans['duit_masuk'];
|
||||
}
|
||||
|
||||
foreach($transaction_keuntungan as $index=>$untung){
|
||||
$totalBayaranKeuntungan += $untung['bayaran_keuntungan'];
|
||||
}
|
||||
|
||||
$rebet = $gadai_data['upah12'] - $totalBayaranKeuntungan - $upah_semasa;
|
||||
$rebet = $this->rebetselepastawarruq($kodcaw,$norujukan);
|
||||
|
||||
$harga_tebus = $gadai_data['bakihargajualan'] - $rebet;
|
||||
|
||||
@@ -72,25 +49,12 @@ class TebusController extends Controller
|
||||
->where('norujukan','=',$norujukan)
|
||||
->first();
|
||||
|
||||
if($gadai_data['tempoh'] > 6){
|
||||
$upahsemasa_raw = $gadai_data['jbg'] * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
|
||||
$upah_semasa_round = number_format($upahsemasa_raw,2);
|
||||
$upah_semasa = (float)substr($upah_semasa_round, 0, -1);
|
||||
}else{
|
||||
if($gadai_data['tempoh'] == 6){
|
||||
if($gadai_data['bakiupah'] != 0){
|
||||
$upah_semasa = $gadai_data['bakiupah'];
|
||||
}else{
|
||||
$upahsemasa_raw = $gadai_data['jbg'] * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
|
||||
$upah_semasa_round = number_format($upahsemasa_raw,2);
|
||||
$upah_semasa = (float)substr($upah_semasa_round, 0, -1);
|
||||
}
|
||||
}else{
|
||||
$upahsemasa_raw = $gadai_data['jbg'] * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
|
||||
$upah_semasa_round = number_format($upahsemasa_raw,2);
|
||||
$upah_semasa = (float)substr($upah_semasa_round, 0, -1);
|
||||
}
|
||||
}
|
||||
$bilang_bln = $gadai_data['tempoh'] - $gadai_data['tempohbayar'];
|
||||
|
||||
$upahsemasa_raw = $bilangan_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['pinjaman']);
|
||||
|
||||
$upah_semasa_round = number_format($upahsemasa_raw,2);
|
||||
$upah_semasa = (float)substr($upah_semasa_round, 0, -1);
|
||||
|
||||
return $upah_semasa;
|
||||
}
|
||||
@@ -112,11 +76,7 @@ class TebusController extends Controller
|
||||
->where('norujukan','=',$norujukan)
|
||||
->first();
|
||||
|
||||
$upahsemasa = $gadai_data['jbg'] * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
|
||||
|
||||
$upah_semasa_round = round($upahsemasa,2);
|
||||
|
||||
$upah_semasa = (float)substr($upah_semasa_round, 0, -1);
|
||||
$upahsemasa = $this->kiraupahTawarruq($kodcaw,$norujukan);
|
||||
|
||||
$array_recno_marhun = $request->array_recno;
|
||||
|
||||
@@ -136,8 +96,6 @@ class TebusController extends Controller
|
||||
|
||||
$totalhargatebus = (float)substr($total_harga_tebus_round, 0, -1);
|
||||
|
||||
// $total_harga_tebus += $upahsemasa;
|
||||
|
||||
return response()->json($totalhargatebus);
|
||||
}
|
||||
|
||||
@@ -251,29 +209,13 @@ class TebusController extends Controller
|
||||
$gadai_data = Gadai::on($cawangan['mysql'])
|
||||
->where('norujukan','=',$norujukan)
|
||||
->first();
|
||||
|
||||
$upahsemasa = $this->kiraupahTawarruq($kodcaw,$norujukan);
|
||||
|
||||
$transaction = Transaction::on('mysql7')
|
||||
->where([['norujukan','=',$norujukan],['trans_type','=','A']])
|
||||
->get();
|
||||
$bln_tebus_awl = 12 - $gadai_data['tempoh'];
|
||||
|
||||
$transaction_keuntungan = TransaksiKeuntungan::on('mysql7')
|
||||
->where('norujukan','=',$norujukan)
|
||||
->get();
|
||||
$rebet_raw = $bln_tebus_awl * (($gadai_data['kadarupah']/100 )* $gadai_data['pinjaman']);
|
||||
|
||||
$totalBayaranKeuntungan = 0;
|
||||
$totalBayaran = 0;
|
||||
|
||||
foreach($transaction as $index=>$trans){
|
||||
$totalBayaran += $trans['duit_masuk'];
|
||||
}
|
||||
|
||||
foreach($transaction_keuntungan as $index=>$untung){
|
||||
$totalBayaranKeuntungan += $untung['bayaran_keuntungan'];
|
||||
}
|
||||
|
||||
$rebet = $gadai_data['upah12'] - $totalBayaranKeuntungan - $upahsemasa;
|
||||
$rebet_round = number_format($upahsemasa_raw,2);
|
||||
$rebet = (float)substr($rebet_round, 0, -1);
|
||||
|
||||
return $rebet;
|
||||
}
|
||||
@@ -347,8 +289,7 @@ class TebusController extends Controller
|
||||
'norujukan' => $norujukan,
|
||||
'bayaran_keuntungan' => $request->bakiupah,
|
||||
'tarikh_bayaran'=> $current,
|
||||
'kodcaw'=> $kodcaw,
|
||||
'keuntungan_sebenar'=>$request->bakiupah
|
||||
'kodcaw'=> $kodcaw
|
||||
]);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user