add baki harga jualan in transaction
This commit is contained in:
@@ -151,6 +151,7 @@ class GadaiController extends Controller
|
||||
'kodcaw' => 'online',
|
||||
'duit_masuk' => $request->bayaran,
|
||||
'created_at' => $current,
|
||||
'bakiharga' => $baki_hargajualan,
|
||||
]);
|
||||
|
||||
$transaction_upah = TransaksiKeuntungan::on('mysql7')->create([
|
||||
@@ -199,6 +200,27 @@ class GadaiController extends Controller
|
||||
return response()->json($harga_tebus);
|
||||
}
|
||||
|
||||
public function getGadaianSemasa($kodcaw){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where([['t_gadai','=',$current->toDateString()],['cetak','=',0]])->get();
|
||||
|
||||
return response()->json($gadai);
|
||||
}
|
||||
|
||||
public function getGadaianBelumSerah($kodcaw){
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$current = Carbon::now();
|
||||
$current = new Carbon();
|
||||
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where([['t_gadai','=',$current->toDateString()],['cetak','=',1]])->get();
|
||||
|
||||
return response()->json($gadai);
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
Gadai::findOrFail($id)->delete();
|
||||
|
||||
Reference in New Issue
Block a user