This commit is contained in:
Afiq
2021-01-18 09:10:16 +08:00
4 changed files with 60 additions and 17 deletions
+9 -2
View File
@@ -384,6 +384,10 @@ class GadaiController extends Controller
}
public function gadaiRingkasanTerkumpul($kodcaw,$tarikh){
$current = Carbon::now();
$current = new Carbon();
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$array_terkumpul = [];
@@ -392,13 +396,16 @@ class GadaiController extends Controller
->selectRaw('COUNT(*) AS bilangan, SUM(nilaimarhun) as jumlahmarhun, SUM(pinjaman) as jumlahpinjaman')
->where('t_gadai','<=',$tarikh)
// ->where('sttebus','=','')
// ->whereYear('t_gadai','=',$current->year)
->orderBy('t_gadai','desc')
->get();
$tebus = Gadai::on($cawangan['mysql'])
->selectRaw('COUNT(*) AS bilangan, SUM(nilaimarhun) as jumlahmarhun, SUM(pinjaman) as jumlahpinjaman, SUM(bakiupah) as upahsimpan')
->where('t_gadai','<=',$tarikh)
->where('sttebus','=','T')
// ->whereYear('t_gadai','=',$current->year)
->orderBy('t_gadai','desc')
->get();
@@ -406,6 +413,7 @@ class GadaiController extends Controller
->selectRaw('COUNT(*) AS bilangan, SUM(nilaimarhun) as jumlahmarhun, SUM(pinjaman) as jumlahpinjaman')
->where('t_gadai','<=',$tarikh)
->where('sttebus','=','L')
// ->whereYear('t_gadai','=',$current->year)
->orderBy('t_gadai','desc')
->get();
@@ -1098,8 +1106,7 @@ class GadaiController extends Controller
return response('Deleted Successfully', 200);
}
else
return response('Bukan-Tebus');
return response('Bukan-Tebus', 200);
}
public function senaraiLelong($kodcaw,Request $request){
+43 -14
View File
@@ -21,23 +21,28 @@ class KelulusanController extends Controller
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('masalulus','=','')
->where('pelulus','!=','operasi')
->get();
return response()->json($kelulusan);
}
public function listdahlulus($kodcaw,$norujukan)
public function listdahlulus($kodcaw,$norujukan,Request $request)
{
$harini = Carbon::now();
$harini = new Carbon;
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('norujukan','=',$norujukan)
->where('masalulus','<>','')
->get();
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('norujukan','=',$norujukan)
->where('masalulus','<>','')
->get();
return response()->json($kelulusan);
}
@@ -63,16 +68,38 @@ class KelulusanController extends Controller
$harini = new Carbon;
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$pengesahan = $request->pengesahan;
if($pengesahan == 'khazanah')
{
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('norujukan','=',$norujukan)
->update(array(
'masalulus'=> $harini->toTimeString(),
'pelulus'=> 'khazanah'
));
}
else
{
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('norujukan','=',$norujukan)
->update(array(
'pelulus' => 'operasi'
));
}
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('norujukan','=',$norujukan)
->update(array(
'masalulus'=> $harini->toTimeString()
));
if($request->sahkan === 1)
{
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('norujukan','=',$norujukan)
->update(array(
'pelulus' => 'dahlulus',
'masalulus'=> $harini->toTimeString()
));
}
return response()->json($kelulusan,201);
}
@@ -116,6 +143,7 @@ class KelulusanController extends Controller
'jumpinj' => $request->jumpinjam,
'jenistebus' => $request->jenistebus,
'teller' => $request->teller,
'pelulus' => 'minta',
'peloperasi' => $request->peloperasi
]);
@@ -209,6 +237,7 @@ class KelulusanController extends Controller
$kelulusan=Mohon::on($cawangan['mysql'])
->where('tarikh','=',$harini->toDateString())
->where('masalulus','=','')
->where('pelulus','=','operasi')
->get();
if(sizeof($kelulusan) != 0){
@@ -118,6 +118,10 @@ class MarhunController extends Controller
}
public function getLaporanMarhunTerkumpul($kodcaw,$tarikh){
$current = Carbon::now();
$current = new Carbon();
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$marhun = Marhun::on($cawangan['mysql'])
@@ -125,6 +129,7 @@ class MarhunController extends Controller
->rightJoin('Gadai', 'Gadai.norujukan', '=', 'Marhun.norujukan')
->rightJoin('Customer', 'Customer.kpbaru', '=', 'Gadai.nokp')
->where('Marhun.t_gadai','<=',$tarikh)
->whereYear('Marhun.t_gadai','=',$current->year)
->where('Gadai.sttebus','=','')
->orderBy('Marhun.norujukan')
->get();
+3 -1
View File
@@ -257,6 +257,8 @@ class TebusController extends Controller
{
$rebet = $this->rebet($kodcaw,$norujukan);
}
else
$rebet = 0;
$update_gadai = Gadai::on($cawangan['mysql'])->where('norujukan','=',$norujukan)->update(array(
@@ -382,7 +384,7 @@ class TebusController extends Controller
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$kodcaw)->first();
$wakil = Wakil::on($cawangan['mysql'])
->where('NOWAKIL','=',$nowakil)
->where('nowakil','=',$nowakil)
->get();
return response()->json($wakil,200);