function tangguh lelong

add function tangguhlelong, migrate table tangguhlelong
This commit is contained in:
nishaMuhd
2022-10-10 16:28:52 +08:00
parent 56583e4510
commit 664151e866
19 changed files with 2041 additions and 92 deletions
+23 -5
View File
@@ -486,9 +486,9 @@ class MarhunController extends Controller
$lelongBidMarhun->n_marhun = $request->berat_emas * $lelongBidMarhun->harga;
$lelongBidMarhun->update();
// $existingPengesahan = Pengesahan::where('lelongbidmarhun_id', '=', $request->idmarhun)
// ->first()
// ->delete();
$existingPengesahan = Pengesahan::where('lelongbidmarhun_id', '=', $request->idmarhun)
->first();
//->delete();
}
// if ($perluPengesahan == true) {
@@ -1595,8 +1595,26 @@ class MarhunController extends Controller
$user = Auth::user();
$current = Carbon::now();
$checkExisting = ScanSemak::where('norujukan', '=', $request->norujukan_barcode)
->whereNull('scan_masuk')
$lelongbidItem = LelongBid::where('norujukan', '=', $request->norujukan_barcode)->first();
$scanKeluar = new ScanMarhun;
$scanKeluar->kodcaw = $lelongbidItem['kodcaw'];
$scanKeluar->lelong_id = $lelongbidItem['lelong_id'];
$scanKeluar->lelongbid_id = $lelongbidItem['id'];
$scanKeluar->norujukan = $lelongbidItem['norujukan'];
$scanKeluar->user_id = $user['id'];
$scanKeluar->tarikh_scankeluar = $current->toDateString();
$scanKeluar->masa_scankeluar = $current->toTimeString();
$scanKeluar->tag_scankeluar = 1;
// $scanKeluar->masa_scanmasuk = $current->toTimeString(); //dummy data
// $scanKeluar->tarikh_scanmasuk = $current->toDateString(); //dummy data
// $scanKeluar->masa = $current->toTimeString(); //dummy data
$scanKeluar->save();
$lelong_id = $lelongbidItem['lelong_id'];
$lelongDetail = Lelong::where('id', '=', $lelong_id)->first();
$lelongbid = LelongBid::where('lelong_id', '=', $lelong_id)
->where('caw_id', '=', $caw->id)
->get();
if ($checkExisting->isEmpty()) {