first
This commit is contained in:
@@ -19,6 +19,7 @@ use App\Parameter;
|
||||
use App\Panjar;
|
||||
use App\HargaEmas;
|
||||
use App\Moratorium;
|
||||
use App\Audit;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -62,11 +63,11 @@ class TebusController extends Controller
|
||||
$upahsemasa_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['pinjaman']);
|
||||
|
||||
$upah_semasa_round = number_format($upahsemasa_raw,2);
|
||||
if(strpos($upah_semasa_round,',')){
|
||||
if(strpos($upah_semasa_round,',')){
|
||||
$upah_semasa_round = str_replace(',','',$upah_semasa_round);
|
||||
}
|
||||
$upah_semasa = (float)substr($upah_semasa_round, 0, -1);
|
||||
if(strpos($upah_semasa,',')){
|
||||
if(strpos($upah_semasa,',')){
|
||||
$upah_semasa = str_replace(',','',$upah_semasa);
|
||||
}
|
||||
|
||||
@@ -87,11 +88,11 @@ class TebusController extends Controller
|
||||
$upahrebet_raw = $bilang_bln * (($gadai_data['kadarupah']/100 )* $gadai_data['bakipjm']);
|
||||
|
||||
$upah_rebet_round = number_format($upahrebet_raw,2);
|
||||
if(strpos($upah_rebet_round,',')){
|
||||
if(strpos($upah_rebet_round,',')){
|
||||
$upah_rebet_round = str_replace(',','',$upah_rebet_round);
|
||||
}
|
||||
$upah_rebet = (float)substr($upah_rebet_round, 0, -1);
|
||||
if(strpos($upah_rebet,',')){
|
||||
if(strpos($upah_rebet,',')){
|
||||
$upah_rebet = str_replace(',','',$upah_rebet);
|
||||
}
|
||||
|
||||
@@ -203,7 +204,7 @@ class TebusController extends Controller
|
||||
}
|
||||
$upah_semasa = (float)$upah_semasa - $upahtelahbayar;
|
||||
|
||||
if($upah_semasa <= 0){
|
||||
if($upah_semasa <= 0){
|
||||
$upah_semasa = 0;
|
||||
}
|
||||
|
||||
@@ -243,7 +244,7 @@ class TebusController extends Controller
|
||||
}
|
||||
$upah_semasa = (float)$upah_semasa - $upahtelahbayar;
|
||||
|
||||
if($upah_semasa <= 0){
|
||||
if($upah_semasa <= 0){
|
||||
$upah_semasa = 0;
|
||||
}
|
||||
|
||||
@@ -435,6 +436,22 @@ class TebusController extends Controller
|
||||
'bakiharga' => $baki_hargajualan,
|
||||
]);
|
||||
}
|
||||
|
||||
$audit = new Audit();
|
||||
$audit->users = $request->teller;
|
||||
if($request->jenistebus == 'P'){
|
||||
$audit->actions = "Tambah Pembiayaan";
|
||||
}else if($request->jenistebus == 'S'){
|
||||
$audit->actions = "Tebus Separuh";
|
||||
}else if($request->jenistebus == 'T'){
|
||||
$audit->actions = "Tebus Penuh";
|
||||
}
|
||||
$audit->norujukan = $norujukan;
|
||||
$audit->new_data = $create_tebus;
|
||||
$audit->kodcaw = $kodcaw;
|
||||
$audit->created_at = $current;
|
||||
$audit->updated_at = $current;
|
||||
$audit->save();
|
||||
|
||||
return response()->json($update_gadai, 201);
|
||||
}
|
||||
@@ -527,6 +544,16 @@ class TebusController extends Controller
|
||||
'created_at' => $current,
|
||||
'bakiharga' => 0,
|
||||
]);
|
||||
|
||||
$audit = new Audit();
|
||||
$audit->users = $request->teller;
|
||||
$audit->actions = "Auto Tawarruq";
|
||||
$audit->norujukan = $norujukan;
|
||||
$audit->new_data = $create_tebus;
|
||||
$audit->kodcaw = $kodcaw;
|
||||
$audit->created_at = $current;
|
||||
$audit->updated_at = $current;
|
||||
$audit->save();
|
||||
|
||||
return response()->json($update_gadai, 201);
|
||||
}
|
||||
@@ -1227,7 +1254,7 @@ class TebusController extends Controller
|
||||
->whereNotNull('db2.hargajualan')
|
||||
->sum('bayaran_keuntungan');
|
||||
|
||||
$total = ($ansuran + $bukanansuran);
|
||||
$total = ($ansuran + $bukanansuran);
|
||||
|
||||
return response($total);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user