diff --git a/app/Http/Controllers/MarhunController.php b/app/Http/Controllers/MarhunController.php index ac7340fb..1907ba44 100644 --- a/app/Http/Controllers/MarhunController.php +++ b/app/Http/Controllers/MarhunController.php @@ -102,7 +102,29 @@ class MarhunController extends Controller $emasall = JenisEmas::all(); return view('marhun.marhun',compact('marhun','lelongbid','karatall','emasall')); - } + } + + + 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'); + + + } } \ No newline at end of file diff --git a/resources/views/marhun/marhun.blade.php b/resources/views/marhun/marhun.blade.php index 1e948987..a29602d8 100644 --- a/resources/views/marhun/marhun.blade.php +++ b/resources/views/marhun/marhun.blade.php @@ -10,8 +10,10 @@

{{ $message }}

@endif -
+ + @csrf + @@ -162,7 +164,7 @@ }, { className: 'btn btn-outline-secondary pl-4 pr-4 btn-sm export', - titleAttr: 'Export to CSV', + titleAttr: 'Export Marhun Details to PDF', text: '', action: function ( e, dt, node, config ) { $("#exportform").submit(); diff --git a/resources/views/pdf/marhundetails.blade.php b/resources/views/pdf/marhundetails.blade.php index b2074986..b4818cbc 100644 --- a/resources/views/pdf/marhundetails.blade.php +++ b/resources/views/pdf/marhundetails.blade.php @@ -75,125 +75,64 @@ tr:nth-child(even) { - +
LAPORAN SIMULASI SEMUA CAWANGANSENARAI BARANG LELONG (DETAILS
-

- - - -
- - - - - - -
Bilangan Lelong: {{$total_marhun}}Nilai Marhun Keseluruhan: RM{{ number_format($total_nmarhun, 2, '.', ',') }}Pembiayaan Keseluruhan: RM{{ number_format($total_pinjaman, 2, '.', ',') }} Keuntungan Keseluruhan:RM{{ number_format($total_upah, 2, '.', ',') }}
- - - - - - - - - -
Rugi Lelong Keseluruhan: RM{{ number_format($total_rugilelong, 2, '.', ',') }}Baki Lelong Keseluruhan: RM{{ number_format($total_bakilelong, 2, '.', ',') }}Caj Lelong Keseluruhan: RM{{ number_format($total_cazlelong, 2, '.', ',') }}
- - -

- - - + + + + - - - - - + - - @foreach ($arraycaw as $index=>$caw) - + + + @foreach ($marhun as $index=>$item) + - - - - - - - - - - - - - @endforeach - + + + + + + + + + + @endforeach + + + <@php + + @endphp + +{{-- - - - - - - - - - - + + + + + + + --}}
NoCawanganTarikh LelongBil Marhun (Paket)No Rujukan Jenis MarhunKarat Berat(gm)Harga(RM) Nilai Marhun(RM)Pembiayaan(RM)Keuntungan(RM) Harga Asas(RM)Caj Lelong(RM)Baki Lelong(RM)Rugi Lelong(RM)Nota
{{$index+1}}{{ $caw['cawangan'] }}{{ $caw['t_lelong'] }}{{ $caw['bil_marhun'] }}{{ number_format($caw['berat'], 2, '.', ',') }}{{ number_format($caw['n_marhun'], 2, '.', ',') }}{{ number_format($caw['pinjaman'], 2, '.', ',') }}{{ number_format($caw['upah'], 2, '.', ',') }}{{ number_format($caw['hargaasas'], 2, '.', ',') }}{{ number_format($caw['cajlelong'], 2, '.', ',') }}{{ number_format($caw['bakilelong'], 2, '.', ',') }}({{ number_format($caw['rugilelong'], 2, '.', ',') }})
{{ $lelongbid->norujukan }}{{ $item->marhun }}{{ $item->karat }}{{ $item->berat }}{{ $item->harga }}{{ $item->n_marhun }}{{ $item->hargaasas }}{{ $item->nota }}
Jumlah Keseluruhan{{ $total_marhun }}{{ number_format($total_berat, 2, '.', ',') }}{{ number_format($total_nmarhun, 2, '.', ',') }}{{ number_format($total_pinjaman, 2, '.', ',') }}{{ number_format($total_upah, 2, '.', ',') }}{{ number_format($total_hargaasas, 2, '.', ',') }}{{ number_format($total_cazlelong, 2, '.', ',') }}{{ number_format($total_bakilelong, 2, '.', ',') }}({{ number_format($total_rugilelong, 2, '.', ',') }})
{{$total_berat}}{{$total_harga}}{{$total_nilaimarhun}}{{$total_hargaasas}}
-





- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

JUMLAH BERAT MENGIKUT MUTU (KESELURUHAN)

MUTU  24Kgb  24K 23K 22K 21K 20K 18K 14K 9K 
BERAT(gm){{$total24Kgb}}{{$total24K}}{{$total23k}}{{$total22K}}{{$total21K}}{{$total20K}}{{$total18Kp}}{{$total14K}}{{$total9K}}
+ diff --git a/routes/web.php b/routes/web.php index b32a7617..2558ec25 100644 --- a/routes/web.php +++ b/routes/web.php @@ -106,5 +106,7 @@ Route::group(['middleware' => ['permission:semakanmarhun','permission:kemaskinim Route::post('/kemaskini',['as'=>'marhun.kemaskini','uses'=>'MarhunController@kemaskini']); Route::get('/semakan',['as'=>'marhun.semakan','uses'=>'MarhunController@semakan']); + Route::post('/exportmarhun',['as'=>'marhun.exportmarhundetails','uses'=>'MarhunController@exportmarhundetails']); + }); \ No newline at end of file