senarai marhun
This commit is contained in:
@@ -138,27 +138,7 @@ class MarhunController extends Controller
|
||||
// dd($lelkarat);
|
||||
return view('marhun.marhun',compact('marhun','lelongbid','karatall','emasall','lelkarat'));
|
||||
}
|
||||
|
||||
public function exportmarhundetails(Request $request)
|
||||
{
|
||||
$lelongbid = LelongBid::where('id','=',$request->lelongbid)->first();
|
||||
$marhun = LelongBidMarhun::where('lelongbid_id','=',$request->lelongbid)->get();
|
||||
|
||||
$karatall = JenisKarat::all();
|
||||
$emasall = JenisEmas::all();
|
||||
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.marhundetails',compact('marhun',
|
||||
'lelongbid',
|
||||
'karatall',
|
||||
|
||||
'emasall'))->setPaper('a4', 'landscape');
|
||||
|
||||
return $pdf->download('Senarai Lelong Details.pdf');
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function senarailelongmarhun(Request $request){
|
||||
|
||||
@@ -177,6 +157,58 @@ class MarhunController extends Controller
|
||||
return view('marhun.senarailelongmarhun',compact('senarai'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function exportmarhundetails($lelong_id)
|
||||
{
|
||||
$lelongs= LelongBid::where('lelong_id','=',$lelong_id)->get()->toArray();
|
||||
|
||||
$arraycaw= [];
|
||||
|
||||
$total_berat = 0;
|
||||
$berat = 0;
|
||||
|
||||
$total_harga = 0;
|
||||
$harga = 0;
|
||||
|
||||
$total_nmarhun = 0;
|
||||
$nilai_marhun = 0;
|
||||
|
||||
$total_hargaasas = 0;
|
||||
$hargaasas = 0;
|
||||
|
||||
foreach($lelongs as $index1=>$lelong){
|
||||
|
||||
$marhun= LelongBidMarhun::where('lelongbid_id','=',$lelong['id'])->get();
|
||||
$total_berat = $total_berat + ($marhun->sum('berat'));
|
||||
$total_harga = $total_harga + ($marhun->sum('harga'));
|
||||
$total_nmarhun = $total_nmarhun + ($marhun->sum('n_marhun'));
|
||||
$total_hargaasas = $total_hargaasas + ($marhun->sum('hargaasas'));
|
||||
|
||||
$lelongs[$index1]['detailmarhun']=$marhun;
|
||||
|
||||
}
|
||||
|
||||
array_push($arraycaw,[
|
||||
'berat'=>$berat,
|
||||
'harga'=>$harga,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
'hargaasas'=>$hargaasas
|
||||
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.marhundetails',compact('lelongs','arraycaw','total_nmarhun','total_berat','total_harga','total_hargaasas'
|
||||
))->setPaper('a4', 'potrait');
|
||||
|
||||
return $pdf->download('Senarai Marhun.pdf');
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function sahubahmutu(Request $request)
|
||||
{
|
||||
// dd($request->all());
|
||||
@@ -276,6 +308,7 @@ class MarhunController extends Controller
|
||||
|
||||
return redirect()->route('pengesahan.perubahanmutumarhun')->with('success','Pengesahan Mutu Marhun Berjaya');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -646,6 +646,20 @@ class SimulasiController extends Controller
|
||||
|
||||
}
|
||||
|
||||
array_push($arraycaw,[
|
||||
'cawangan'=>$cawangan->caw_name,
|
||||
't_lelong'=>$simulasi->tarikh_lelong,
|
||||
'bil_marhun'=>sizeof($databid),
|
||||
'berat'=>$berat,
|
||||
'n_marhun'=>$nilai_marhun,
|
||||
'pinjaman'=>$pinjaman,
|
||||
'upah'=>0,
|
||||
'hargaasas'=>$hargaasas,
|
||||
'cajlelong'=>$cajlelong,
|
||||
'rugilelong'=>$rugilelong,
|
||||
'bakilelong'=>$bakilelong,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
$total_marhun = $total_marhun + sizeof($databid);
|
||||
|
||||
Reference in New Issue
Block a user