update design pdf dan view report
This commit is contained in:
@@ -1337,72 +1337,41 @@ class LelongController extends Controller
|
||||
$bakilelong = 0;
|
||||
$total_cazlelong = 0;
|
||||
// dd($cawid);
|
||||
$marhuns = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong_id','=',$lelongid)->where('caw_id','=',$cawid)
|
||||
->select(
|
||||
'lelongbid.t_lelong',
|
||||
'lelongbid.kodcaw',
|
||||
'cawangan.caw_name',
|
||||
'lelongbid.norujukan',
|
||||
'lelongbid.pinjaman',
|
||||
'lelongbid.berat',
|
||||
'lelongbid.nilaimarhun',
|
||||
'lelongbid.hargaasas',
|
||||
'lelongbid.hargajual',
|
||||
'lelongbid.t_jual',
|
||||
'lelongbid.upahsimpan',
|
||||
'lelongbid.cajlelong',
|
||||
'lelongbid.baki',
|
||||
'lelongbid.bakiupah',
|
||||
'lelongbid.status_jual',
|
||||
'lelongbid.jbg'
|
||||
)
|
||||
->get()->toArray();
|
||||
|
||||
$lelonglel = Lelong::with('cawangan')->find($lelongid);
|
||||
|
||||
$cawanganDetail = $lelonglel->cawangan->find($cawid);
|
||||
|
||||
$marhuns = LelongBid::where('caw_id', '=', $cawid)
|
||||
->where('lelong_id', '=', $lelongid)
|
||||
->get();
|
||||
// dd($marhuns);
|
||||
$arraymarhun = [];
|
||||
foreach ($marhuns as $index1=> $cal) {
|
||||
// dd($cal);
|
||||
$gadai = Gadai::on($cal['kodcaw'])
|
||||
->where('norujukan','=',$cal['norujukan'])
|
||||
->first();
|
||||
// dd($gadai);
|
||||
$customer = Customer::where('kpbaru','=',$gadai['nokp'])
|
||||
->orWhere('kplama','=',$gadai['nokp'])
|
||||
->first();
|
||||
// dd($customer);
|
||||
|
||||
$simulasilel = Lelong::where('id',$lelongid)->get();
|
||||
$sumcajlelong = $cal['hargaasas'] * ($simulasilel[0]['cajlelong']/100);
|
||||
$sumcajlelong = $cal['hargaasas'] * ($lelonglel->cajlelong/100);
|
||||
$totalbaki = $cal['hargaasas'] - $cal['pinjaman'] - $cal['bakiupah'] - bcdiv($sumcajlelong,1,1);
|
||||
$marhuns[$index1]['cajlelong'] = bcdiv($sumcajlelong,1,1);
|
||||
$marhuns[$index1]['baki'] = $totalbaki;
|
||||
|
||||
// $keuntungan = $cal['bakipjm'] - ($cal['bakihargajualan'] - ($cal['upah12'] - $cal['ansakhir'])-(($cal['tempoh']-$cal['tempohbayar'])*$cal['kadarupah']/100*$cal['bakipjm']) );
|
||||
$marhuns[$index1]['keuntungan'] = $keuntungan;
|
||||
$marhuns[$index1]['nama'] = $customer;
|
||||
|
||||
// array_push($arraymarhun,[
|
||||
// 'norujukan' => $cal['norujukan'],
|
||||
// 'tempoh' => $gadai['tempoh'],
|
||||
// 'nama' => $customer['nama'],
|
||||
// 'berat' => $cal['berat'],
|
||||
// 'nilaimarhun' => $cal['nilaimarhun'],
|
||||
// 'hargaasas' => $cal['hargaasas'],
|
||||
// 'hargajual' => $cal['hargajual'],
|
||||
// 't_jual' => $cal['t_jual'],
|
||||
// 'pinjaman' => $cal['pinjaman'],
|
||||
// 'pinjasal' => $gadai['pinjaman'],
|
||||
// 'bakiupah' => $cal['bakiupah'],
|
||||
// 'cajlelong' => $cal['cajlelong'],
|
||||
// 'baki' => $cal['baki'],
|
||||
// 'upah6bulan' => $gadai['bakiupah']
|
||||
// ]);
|
||||
$total_berat = $total_berat + $cal['berat'];
|
||||
$total_pinjaman = $total_pinjaman + $cal['pinjaman'];
|
||||
$total_hargaasas = $total_hargaasas + $cal['hargaasas'];
|
||||
$total_nilaimarhun = $total_nilaimarhun + $cal['nilaimarhun'];
|
||||
$total_bakiupah = $total_bakiupah + $cal['bakiupah'];
|
||||
$total_cazlelong = $total_cazlelong + bcdiv($sumcajlelong,1,1);
|
||||
|
||||
array_push($arraymarhun,[
|
||||
'norujukan' => $cal['norujukan'],
|
||||
'tempoh' => $cal['jbg'],
|
||||
'berat' => $cal['berat'],
|
||||
'nilaimarhun' => $cal['nilaimarhun'],
|
||||
'hargaasas' => $cal['hargaasas'],
|
||||
'pinjaman' => $cal['pinjaman'],
|
||||
'bakiupah' => $cal['bakiupah'],
|
||||
'cajlelong' => $cal['cajlelong'],
|
||||
'baki' => $cal['baki'],
|
||||
]);
|
||||
}
|
||||
|
||||
$arrayinfo = [];
|
||||
@@ -1429,6 +1398,8 @@ class LelongController extends Controller
|
||||
'total_hargaasas',
|
||||
'total_bakiupah',
|
||||
'total_nilaimarhun',
|
||||
'lelonglel',
|
||||
'cawanganDetail',
|
||||
'total_cazlelong'));
|
||||
}
|
||||
|
||||
@@ -3118,6 +3089,11 @@ class LelongController extends Controller
|
||||
$keuntungan = 0;
|
||||
|
||||
$arraylistgadai = 0;
|
||||
|
||||
$lelonglel = Lelong::with('cawangan')->find($lelongid);
|
||||
|
||||
$cawanganDetail = $lelonglel->cawangan->find($cawid);
|
||||
|
||||
$marhun = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong_id','=',$lelongid)
|
||||
->where('caw_id','=',$cawid);
|
||||
@@ -3175,7 +3151,7 @@ class LelongController extends Controller
|
||||
->toArray();
|
||||
array_push($arrayinfo,['laporan' => $laporan,'details' => $details]);
|
||||
}
|
||||
return view('lelong.listsagbycust',compact('marhuns','lelongid','cawid','listsag','ktlhbyr','arrayinfo'));
|
||||
return view('lelong.listsagbycust',compact('lelonglel','cawanganDetail','marhuns','lelongid','cawid','listsag','ktlhbyr','arrayinfo'));
|
||||
}
|
||||
|
||||
public function exportlelong(Request $request)
|
||||
@@ -3757,7 +3733,7 @@ class LelongController extends Controller
|
||||
->where('cawangan_lelong.caw_id', $caw->id)
|
||||
->get()
|
||||
->toArray();
|
||||
array_push($arraydetails,['laporan' => $laporan,'details' => $details]);
|
||||
array_push($arraydetails,['laporan' => $laporan,'details' => $details]);
|
||||
}
|
||||
|
||||
|
||||
@@ -4591,8 +4567,11 @@ class LelongController extends Controller
|
||||
$data = Lelong::where('lelong.id','=',$lelong_id)
|
||||
->first();
|
||||
}
|
||||
$datacaw = Cawangan::where('id','=',$caw->id)
|
||||
->get();
|
||||
|
||||
$pdf = PDF::loadView('pdf.lelreportpc',compact('arraycaw',
|
||||
|
||||
$pdf = PDF::loadView('pdf.lelreportpc',compact('datacaw','arraycaw',
|
||||
'total_marhun',
|
||||
'total_berat',
|
||||
'total_nmarhun',
|
||||
|
||||
@@ -753,8 +753,10 @@ class ReportController extends Controller
|
||||
->toArray();
|
||||
array_push($arrayinfo,['laporan' => $laporan,'details' => $details]);
|
||||
}
|
||||
$datacaw = Cawangan::where('id','=',$cawid)
|
||||
->get();
|
||||
|
||||
$pdf = PDF::loadView('pdf.pdflelongreport',compact('arraymarhun','marhuns','lelongid','cawid','arrayinfo','total_berat',
|
||||
$pdf = PDF::loadView('pdf.pdflelongreport',compact('datacaw','arraymarhun','marhuns','lelongid','cawid','arrayinfo','total_berat',
|
||||
'total_pinjaman',
|
||||
'total_upah',
|
||||
'total_hargaasas',
|
||||
@@ -836,6 +838,7 @@ class ReportController extends Controller
|
||||
$total_bakiupah = 0;
|
||||
$total_nilaimarhun = 0;
|
||||
$keuntungan = 0;
|
||||
$total_cazlelong = 0;
|
||||
$marhuns = LelongBid::join('cawangan', 'lelongbid.caw_id', '=', 'cawangan.id')
|
||||
->where('lelong_id','=',$lelongid)->where('caw_id','=',$cawid)
|
||||
->select(
|
||||
@@ -869,6 +872,11 @@ class ReportController extends Controller
|
||||
->orWhere('kplama','=',$gadai['nokp'])
|
||||
->first();
|
||||
// dd($customer);
|
||||
$simulasilel = Lelong::where('id',$lelongid)->get();
|
||||
$sumcajlelong = $cal['hargaasas'] * ($simulasilel[0]['cajlelong']/100);
|
||||
$totalbaki = $cal['hargaasas'] - $cal['pinjaman'] - $cal['bakiupah'] - bcdiv($sumcajlelong,1,1);
|
||||
$marhuns[$index1]['cajlelong'] = bcdiv($sumcajlelong,1,1);
|
||||
$marhuns[$index1]['baki'] = $totalbaki;
|
||||
|
||||
// $keuntungan = $cal['bakipjm'] - ($cal['bakihargajualan'] - ($cal['upah12'] - $cal['ansakhir'])-(($cal['tempoh']-$cal['tempohbayar'])*$cal['kadarupah']/100*$cal['bakipjm']) );
|
||||
$marhuns[$index1]['keuntungan'] = $keuntungan;
|
||||
@@ -895,6 +903,7 @@ class ReportController extends Controller
|
||||
$total_hargaasas = $total_hargaasas + $cal['hargaasas'];
|
||||
$total_nilaimarhun = $total_nilaimarhun + $cal['nilaimarhun'];
|
||||
$total_bakiupah = $total_bakiupah + $cal['bakiupah'];
|
||||
$total_cazlelong = $total_cazlelong + bcdiv($sumcajlelong,1,1);
|
||||
|
||||
}
|
||||
|
||||
@@ -916,14 +925,17 @@ class ReportController extends Controller
|
||||
->toArray();
|
||||
array_push($arrayinfo,['laporan' => $laporan,'details' => $details]);
|
||||
}
|
||||
$datacaw = Cawangan::where('id','=',$cawid)
|
||||
->get();
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.pdflelongreportpc',compact('arraymarhun','marhuns','lelongid','cawid','arrayinfo','total_berat',
|
||||
$pdf = PDF::loadView('pdf.pdflelongreportpc',compact('datacaw','arraymarhun','marhuns','lelongid','cawid','arrayinfo','total_berat',
|
||||
'total_pinjaman',
|
||||
'total_upah',
|
||||
'total_hargaasas',
|
||||
'total_bakiupah',
|
||||
'total_nilaimarhun'))
|
||||
'total_nilaimarhun',
|
||||
'total_cazlelong'))
|
||||
->setPaper('a4','potrait');
|
||||
|
||||
return $pdf->download('Laporan Lelong Cawangan.pdf');
|
||||
|
||||
@@ -1042,8 +1042,11 @@ class SimulasiController extends Controller
|
||||
$total_berat += $berat;
|
||||
$total_hargaasas += $hargaasas;
|
||||
}
|
||||
$tarikhkemaskini = $simulasi->simkarat[0];
|
||||
$data = $simulasi;
|
||||
|
||||
return view('simulasi.showsimulasi', compact(
|
||||
'tarikhkemaskini',
|
||||
'data',
|
||||
'simkarat',
|
||||
'jeniskarat',
|
||||
@@ -1920,6 +1923,11 @@ class SimulasiController extends Controller
|
||||
{
|
||||
$keuntungan = 0;
|
||||
$arraylistgadai = 0;
|
||||
|
||||
$simulasilel = Simulasi::with('cawangan')->find($simulasi_id);
|
||||
|
||||
$cawanganDetail = $simulasilel->cawangan->find($cawid);
|
||||
|
||||
$marhun = SimulasiBid::join('cawangan', 'simulasibid.caw_id', '=', 'cawangan.id')
|
||||
->where('simulasi_id','=',$simulasi_id)
|
||||
->where('caw_id','=',$cawid);
|
||||
@@ -1958,7 +1966,7 @@ class SimulasiController extends Controller
|
||||
$marhuns[$index1]['listsag'] = $listsag;
|
||||
|
||||
}
|
||||
return view('simulasi.listsagbycust',compact('marhuns','simulasi_id','cawid','ktlhbyr'));
|
||||
return view('simulasi.listsagbycust',compact('simulasilel','cawanganDetail','marhuns','simulasi_id','cawid','ktlhbyr'));
|
||||
}
|
||||
|
||||
public function senaraisimulasiall()
|
||||
|
||||
Reference in New Issue
Block a user