add scanmarhun, senarai terima marhun
This commit is contained in:
@@ -22,6 +22,7 @@ use App\Models\LelKarat_temp;
|
||||
|
||||
use App\Models\Pengesahan;
|
||||
use App\Models\GadaiMarhun;
|
||||
use App\Models\ScanMarhun;
|
||||
use App\Models\TangguhLelong;
|
||||
use Carbon\Carbon;
|
||||
|
||||
@@ -463,6 +464,35 @@ class MarhunController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function senarailelongscan(Request $request){
|
||||
|
||||
$user = Auth::user();
|
||||
$arrayinfo = [];
|
||||
|
||||
$lelong = CawanganLelong::join('lelong','cawangan_lelong.lelong_id','=','lelong.id')
|
||||
->join('cawangan','cawangan_lelong.caw_id', '=', 'cawangan.id')
|
||||
->where('cawangan.caw_code', $user->kodcaw)
|
||||
->where('sts_lelong', 0)
|
||||
->select('lelong_id','tarikh_lelong','cawangan_lelong.masatamat_lelong','harga_emas_asas','jbg','cajlelong','sts_lelong')
|
||||
->get()
|
||||
->toArray();
|
||||
|
||||
foreach($lelong as $info)
|
||||
{
|
||||
|
||||
$detailsinfo = CawanganLelong::join('cawangan','cawangan_lelong.caw_id','=','cawangan.id')
|
||||
->where('lelong_id',$info['lelong_id'])
|
||||
->where('cawangan.caw_code', $user->kodcaw)
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arrayinfo,['info'=>$info, 'detailsinfo'=>$detailsinfo]);
|
||||
|
||||
}
|
||||
|
||||
return view('marhun.senarailelongscan',compact('lelong', 'arrayinfo'));
|
||||
|
||||
}
|
||||
|
||||
public function semak($id, $lelong_id)
|
||||
{
|
||||
//$id => lelongbid_id
|
||||
@@ -1134,8 +1164,87 @@ class MarhunController extends Controller
|
||||
|
||||
}
|
||||
|
||||
public function scanbarcode() {
|
||||
return view('marhun.scanbarcode');
|
||||
public function terimaserahmarhun() {
|
||||
$user = Auth::user();
|
||||
$caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first();
|
||||
|
||||
return view('marhun.terimaserahmarhun');
|
||||
|
||||
}
|
||||
|
||||
public function listScanBarcode($lelong_id)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first();
|
||||
|
||||
$lelongDetail = Lelong::where('id', '=', $lelong_id)->first();
|
||||
$lelongbid = LelongBid::where('lelong_id', '=', $lelong_id)
|
||||
->where('caw_id', '=', $caw->id)
|
||||
->get();
|
||||
|
||||
$senaraiScanKeluar = ScanMarhun::where('lelong_id', '=', $lelong_id)
|
||||
->where('kodcaw', '=', $caw->caw_code)
|
||||
->orderBy('id', 'desc')
|
||||
->get();
|
||||
|
||||
return view('marhun.scanbarcode', compact('lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar'));
|
||||
}
|
||||
|
||||
public function scanKeluarMarhun(Request $request)
|
||||
{
|
||||
|
||||
$user = Auth::user();
|
||||
$caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first();
|
||||
$current = Carbon::now();
|
||||
|
||||
$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();
|
||||
|
||||
$senaraiScanKeluar = ScanMarhun::where('lelong_id', '=', $lelong_id)
|
||||
->where('kodcaw', '=', $caw->caw_code)
|
||||
->orderBy('id', 'desc')
|
||||
->get();
|
||||
|
||||
return view('marhun.scanbarcode', compact('lelong_id', 'lelongDetail', 'lelongbid', 'senaraiScanKeluar'));
|
||||
}
|
||||
|
||||
public function scanMasukMarhun(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first();
|
||||
$current = Carbon::now();
|
||||
|
||||
$lelongbidItem = LelongBid::where('norujukan', '=', $request->norujukan_barcode)->first();
|
||||
$scanMasuk = ScanMarhun::where('');
|
||||
}
|
||||
|
||||
public function senaraiScanKeluar(Request $request)
|
||||
{
|
||||
$user = Auth::user();
|
||||
$caw = Cawangan::where('caw_code', '=', $user->kodcaw)->first();
|
||||
|
||||
$senaraiScanKeluar = ScanMarhun::where('lelong_id', '=', $request->lelong_id)
|
||||
->where('kodcaw', '=', $caw)
|
||||
->get();
|
||||
}
|
||||
|
||||
public function addPhotoMarhun(Request $request)
|
||||
|
||||
Reference in New Issue
Block a user