Merge branch 'apiaku' into 'master'

fix kelulusan

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