hapus gadai dan notifikasi baiki
This commit is contained in:
@@ -1095,4 +1095,49 @@ class GadaiController extends Controller
|
||||
|
||||
return response()->json($petibesi_cawangan);
|
||||
}
|
||||
|
||||
|
||||
public function GadaiHapus($kodcaw,$norujukan,Request $request)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->get();
|
||||
|
||||
if($gadai[0]['historygadaian'] != "0")
|
||||
{
|
||||
Gadai::on($cawangan['mysql'])->where('norujukan','=',$gadai[0]['historygadaian'])->update(['sttebus' => '']);
|
||||
|
||||
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||
|
||||
Tebus::on($cawangan['mysql'])->where('norujukan','=',$gadai[0]['historygadaian'])->delete();
|
||||
|
||||
return response('Deleted Successfully', 200);
|
||||
}
|
||||
else
|
||||
{
|
||||
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||
|
||||
return response('Deleted Successfully', 200);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function TebusHapus($kodcaw,$norujukan)
|
||||
{
|
||||
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
|
||||
|
||||
$tebus = Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->get();
|
||||
|
||||
if($tebus[0]['jenistebus'] == 'T')
|
||||
{
|
||||
Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(['sttebus' => '']);
|
||||
|
||||
Tebus::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->delete();
|
||||
|
||||
return response('Deleted Successfully', 200);
|
||||
}
|
||||
else
|
||||
return response('Bukan-Tebus');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ class KelulusanController extends Controller
|
||||
|
||||
$kelulusan=Mohon::on($cawangan['mysql'])
|
||||
->where('TARIKH','=',$harini->toDateString())
|
||||
->where('pelulus','=','')
|
||||
->where('masalulus','=','')
|
||||
->get();
|
||||
|
||||
@@ -36,7 +35,6 @@ class KelulusanController extends Controller
|
||||
$kelulusan=Mohon::on($cawangan['mysql'])
|
||||
->where('TARIKH','=',$harini->toDateString())
|
||||
->where('NORUJUKAN','=',$norujukan)
|
||||
->where('pelulus','<>','')
|
||||
->where('masalulus','<>','')
|
||||
->get();
|
||||
|
||||
|
||||
@@ -236,6 +236,7 @@ class TebusController extends Controller
|
||||
'bakiupah' => $request->bakiupah,
|
||||
'terima' => "*",
|
||||
'kodgl' => "0",
|
||||
'nowakil' => $request->nowakil,
|
||||
'rebate' => $rebet,
|
||||
'marhuntebus' => $request->marhun,
|
||||
'historygadaian' => $request->historygadaian,
|
||||
|
||||
Reference in New Issue
Block a user