pdf senarai brg lelongan
This commit is contained in:
@@ -719,18 +719,24 @@ class LelongController extends Controller
|
||||
|
||||
public function senaraibrglelong($lelong_id){
|
||||
|
||||
$lelong_id = $lelong_id;
|
||||
|
||||
|
||||
$brglelong = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get()->toArray();
|
||||
|
||||
|
||||
|
||||
$keuntungan=0;
|
||||
|
||||
foreach($brglelong as $index1=>$upah)
|
||||
{
|
||||
|
||||
$keuntungan = $upah['bakipjm'] - ($upah['bakihargajualan'] - ($upah['upah12'] - $upah['ansakhir'])-(($upah['tempoh']-$upah['tempohbayar'])*$upah['kadarupah']/100*$upah['bakipjm']) );
|
||||
$brglelong[$index1]['keuntungan'] = $keuntungan;
|
||||
}
|
||||
|
||||
|
||||
return view('lelong.senaraibrglelong',compact('brglelong','lelong_id'));
|
||||
|
||||
|
||||
return view('lelong.senaraibrglelong',compact('brglelong','lelong_id','keuntungan'));
|
||||
|
||||
}
|
||||
|
||||
@@ -738,14 +744,34 @@ class LelongController extends Controller
|
||||
|
||||
$lelong_id = $request->lelongid;
|
||||
|
||||
// $nilai_marhun = 0;
|
||||
|
||||
|
||||
$brglelong = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get()->toArray();
|
||||
->get();
|
||||
|
||||
$keuntungan=0;
|
||||
$totharga_asas=0;
|
||||
$totkeuntungan=0;
|
||||
$totnilai_marhun=0;
|
||||
$tot_pinjaman=0;
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.listlelong',compact('brglelong'))
|
||||
foreach($brglelong as $index1=>$upah)
|
||||
{
|
||||
$keuntungan = $upah['bakipjm'] - ($upah['bakihargajualan'] - ($upah['upah12'] - $upah['ansakhir']) - (($upah['tempoh']-$upah['tempohbayar'])*$upah['kadarupah']/100*$upah['bakipjm']) );
|
||||
$brglelong[$index1]['keuntungan'] = $keuntungan;
|
||||
|
||||
}
|
||||
|
||||
$totharga_asas = $totharga_asas + ($upah->sum('hargaasas'));
|
||||
$totkeuntungan = $totkeuntungan + ($brglelong->sum('keuntungan'));
|
||||
$totnilai_marhun = $totnilai_marhun + ($upah->sum('nilaimarhun'));
|
||||
$tot_pinjaman = $tot_pinjaman + ($upah->sum('pinjaman'));
|
||||
|
||||
|
||||
|
||||
|
||||
$pdf = PDF::loadView('pdf.listlelong',compact('brglelong','totharga_asas','totkeuntungan','totnilai_marhun','tot_pinjaman'))
|
||||
->setPaper('a4', 'potrait');
|
||||
|
||||
return $pdf->download('Senarai Lelong.pdf');
|
||||
|
||||
@@ -57,20 +57,20 @@ class NotisController extends Controller
|
||||
|
||||
$lelong_id = $lelong_id;
|
||||
|
||||
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
$senarai = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get()->toArray();
|
||||
|
||||
$bayaran=0;
|
||||
foreach($payment as $index1=>$pay)
|
||||
foreach($senarai as $index1=>$notis)
|
||||
{
|
||||
$bayaran = $pay['hargajualan'] - $pay['bakihargajualan'];
|
||||
$bayaran = $notis['hargajualan'] - $notis['bakihargajualan'];
|
||||
}
|
||||
|
||||
$payment[$index1]['payment'] = $payment;
|
||||
$payment[$index1]['bayaran_keuntungan'] = $bayaran;
|
||||
$senarai[$index1]['payment'] = $senarai;
|
||||
$senarai[$index1]['bayaran_keuntungan'] = $bayaran;
|
||||
|
||||
return view('jananotis.senarainotis',compact('payment','lelong_id','bayaran'));
|
||||
return view('jananotis.senarainotis',compact('senarai','lelong_id','bayaran'));
|
||||
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ class NotisController extends Controller
|
||||
$current = new Carbon();
|
||||
$tarikh_cetak = $current->toDateString();
|
||||
|
||||
$payment = Gadai::join('lelongbid','gadai.norujukan','=','lelongbid.norujukan')
|
||||
$payment = LelongBid::join('gadai','lelongbid.norujukan','=','gadai.norujukan')
|
||||
->join('customer','gadai.nokp','=','customer.kpbaru')
|
||||
->where('lelongbid.lelong_id', $lelong_id)
|
||||
->get()->toArray();
|
||||
|
||||
@@ -667,7 +667,6 @@ class SimulasiController extends Controller
|
||||
]);
|
||||
|
||||
|
||||
|
||||
$total_marhun = $total_marhun + sizeof($databid);
|
||||
$total_berat = $total_berat + $berat;
|
||||
$total_nmarhun = $total_nmarhun + $nilai_marhun;
|
||||
@@ -677,7 +676,7 @@ class SimulasiController extends Controller
|
||||
$total_cazlelong = $total_cazlelong + $cajlelong;
|
||||
$total_rugilelong = $total_rugilelong + $rugilelong;
|
||||
$total_bakilelong = $total_bakilelong + $bakilelong;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($payment as $pay)
|
||||
@foreach($senarai as $notis)
|
||||
<tr>
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td>{{ $pay['norujukan']}}</td>
|
||||
<td>{{ $pay['jbg']}}</td>
|
||||
<td>{{ $pay['nokp']}}</td>
|
||||
<td>{{ $pay['pinjaman']}}</td>
|
||||
<td>{{ $pay['bakiupah']}}</td>
|
||||
<td>{{ $notis['norujukan']}}</td>
|
||||
<td>{{ $notis['jbg']}}</td>
|
||||
<td>{{ $notis['nokp']}}</td>
|
||||
<td>{{ $notis['pinjaman']}}</td>
|
||||
<td>{{ $notis['bakiupah']}}</td>
|
||||
<td>{{ $bayaran}}</td>
|
||||
|
||||
@endforeach
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<th>No</th>
|
||||
<th>No Rujukan</th>
|
||||
<th>Harga Asas</th>
|
||||
<th>Upah</th>
|
||||
<th>Upah Keuntungan</th>
|
||||
<th>JBG</th>
|
||||
<th>Nilai Marhun Asal</th>
|
||||
<th>Pinjaman</th>
|
||||
@@ -35,11 +35,12 @@
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
<td>{{ $brg['norujukan']}}</td>
|
||||
<td>{{$brg['hargaasas']}}</td>
|
||||
<td>{{$brg['upahsimpan']}}</td>
|
||||
<td>{{ $brg['keuntungan'] }}</td>
|
||||
<td>{{ $brg['jbg']}}</td>
|
||||
<td>{{ $brg['nilaimarhun']}}</td>
|
||||
<td>{{ $brg['pinjaman']}}</td>
|
||||
<td>{{ $brg['marhun']}}</td>
|
||||
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
||||
|
||||
@@ -66,8 +66,11 @@
|
||||
</p>
|
||||
<p>
|
||||
No Rujukan: {{$notis['norujukan']}} <br>
|
||||
Kepada:{{ $notis['nama'] }}<br> {{ strtoupper($notis['alamat1']) }} {!! ($notis['alamat2'] === null || $notis['alamat2'] === '') ? '' : '<br>' . strtoupper($notis['alamat2']) !!} <br> {{ ' ' . $notis['poskod'] . ' ' . strtoupper($notis['koddaerah']) . ' ' . strtoupper($notis['kodnegeri'])}}</td>
|
||||
<br>
|
||||
Kepada:{{ $notis['nama'] }}<br> {{ strtoupper($notis['alamat1']) }} {!! ($notis['alamat2'] === null || $notis['alamat2'] === '') ? '' : '<br>'
|
||||
. strtoupper($notis['alamat2']) !!} <br> {{ ' ' . $notis['poskod'] . ' ' . strtoupper($notis['koddaerah']) . ' ' . strtoupper($notis['kodnegeri'])}}</td>
|
||||
|
||||
</p>
|
||||
<p>
|
||||
No Telefon: {{$notis['telefon']}} <br>
|
||||
No K/P: {{$notis['kpbaru']}}
|
||||
</p>
|
||||
|
||||
@@ -105,29 +105,27 @@ tr:nth-child(even) {
|
||||
<td> {{ $loop->iteration }} </td>
|
||||
|
||||
<td>{{ $brg['norujukan'] }}</td>
|
||||
<td>{{ ($brg['norujukan']) }}</td>
|
||||
<td>{{ number_format($brg['hargaasas'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($brg['upahsimpan'], 2, '.', ',') }}</td>
|
||||
|
||||
|
||||
<td>{{ number_format($brg['keuntungan'], 2, '.', ',') }}</td>
|
||||
<td>{{ $brg['jbg'] }}</td>
|
||||
<td>{{ number_format($brg['nilaimarhun'], 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($brg['pinjaman'], 2, '.', ',') }}</td>
|
||||
<td>{{ ($brg['marhun']) }}</td>
|
||||
|
||||
|
||||
@endforeach
|
||||
|
||||
<tr>
|
||||
|
||||
<td colspan="2"><b>JUMLAH KESELURUHAN</b></td>
|
||||
<td>{{ number_format($totharga_asas, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($totkeuntungan, 2, '.', ',') }}</td>
|
||||
<td></td>
|
||||
<td>{{ number_format($totnilai_marhun, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($tot_pinjaman, 2, '.', ',') }}</td>
|
||||
<td></td>
|
||||
|
||||
|
||||
|
||||
{{-- <tr>
|
||||
<td colspan="3" align="left"><strong>Jumlah Keseluruhan</strong></td>
|
||||
<td></td>
|
||||
<td>{{ number_format($total_berat, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_nmarhun, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_pinjaman, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_upah, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_hargaasas, 2, '.', ',') }}</td>
|
||||
<td>{{ number_format($total_cazlelong, 2, '.', ',') }}</td>
|
||||
<td></td> --}}
|
||||
|
||||
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user