updated untuk push 28-9-2022

This commit is contained in:
hafifierahman
2022-09-28 02:43:40 +08:00
parent 9f81fcdac6
commit 6045853f52
6 changed files with 162 additions and 15 deletions
@@ -42,6 +42,7 @@ use App\StokAudit9;
use App\StokAudit10;
use App\StokAudit11;
use App\StokAudit12;
use App\AuditCustomer;
use DB;
use Carbon\Carbon;
@@ -2849,4 +2850,99 @@ class AdminPageController extends Controller
return response()->json($arrayall,200);
}
public function Laporan_SerahPetiBesiGadai(Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$current = Carbon::now();
$current = new Carbon();
$gadai = Gadai::on($cawangan['mysql'])
->where([
['t_gadai','>=',$request->mula],['t_gadai','<=',$request->hingga],
['cetak','=',1],['tagserah','=',1]])
->orderBy('teller')
->orderBy('semakbarcode')
->get();
return response()->json($gadai);
}
public function Laporan_SerahMarhunTebus(Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$current = Carbon::now();
$current = new Carbon();
$gadai = Tebus::on($cawangan['mysql'])
->where([
['t_tebus','>=',$request->mula],['t_tebus','<=',$request->hingga]])
->orderBy('teller')
->orderBy('tagterima')
->get();
return response()->json($gadai);
}
public function laporanAuditCustomer(Request $request){
$audit_customer = AuditCustomer::on('mysql7')
->where('kodcaw', $request->kodcaw)
->whereDate('created_at','>=', $request->mula)
->whereDate('created_at','<=', $request->hingga)
->get()
->toArray();
$array_audit_old = array();
$array_audit_new = array();
$array_changes_audit = array();
foreach($audit_customer as $index1=>$audit)
{
array_push($array_audit_old,json_decode($audit['old_data'], true));
array_push($array_audit_new,json_decode($audit['new_data'], true));
}
foreach($array_audit_old as $index=>$old)
{
$test_old = array_diff($old[0],$array_audit_new[$index][0]);
$test_new = array_diff($array_audit_new[$index][0],$old[0]);
if(sizeof($test_old) != 0)
{
array_push($array_changes_audit,['old' => $test_old,'new' => $test_new,'username' => $audit_customer[$index]['username'],'customer_name' => $audit_customer[$index]['customer_name'],'nokp' => $audit_customer[$index]['customer_nokp'],'tarikhmasa' => $audit_customer[$index]['created_at']]);
}
}
return response()->json($array_changes_audit);
}
public function ListBarcodeScannedOperasi(Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$current = Carbon::now();
$gadai = Gadai::on($cawangan['mysql'])
->where([
['sttebus','=',''],
['semakbarcode','<>','Lulus'],
])
->paginate(5);
return response()->json($gadai,200);
}
public function ListBarcodeScannedOperasi_Update(Request $request){
$cawangan = Cawangan::on('mysql7')->where('kodcaw','=',$request->kodcaw)->first();
$current = Carbon::now();
$gadai = Gadai::on($cawangan['mysql'])
->where('norujukan',$request->norujukan)
->update(['semakbarcode'=>'Lulus']);
return response()->json($gadai);
}
}