Guys iam working with a project Inventory control
i need to take a print out for the purchase order.
i used barryvdh/laravel-dompdf to make it as pdf and then to take printout.
now the print out is fine.
this is my controller
public function printpdf($id)
{
$pur_list_det = PurchaseOrder::where('id', $id)->first();
$orderlists = OrderList::where ('login_user_id',auth()->id())->where('purchase_order_id',$id)->orderBy('updated_at','desc')->get();
// return view('Purchase.manage-order-list')->withPur_list_det($pur_list_det)->withOrderlists($orderlists);
$pdf=PDF::loadView('Purchase.printpdf', [
'pur_list_det' => $pur_list_det,
'orderlists'=>$orderlists,
]);
$pdf->setPaper('A4','portrait');
return $pdf->stream('print.pdf');
}
and this is my printpdf.blade file
<!DOCTYPE html>
<head>
<style>
#design {
font-family: Serif;
border-collapse: collapse;
width: 100%;
}
#design td,
#design th,
#design thead {
border: 1px solid #000;
font-size: 12px;
}
#design1 {
font-family: Serif;
width: 100%;
}
#design1 td,
#design1 th,
#design1 thead {
border: none;
font-size: 12px;
}
</style>
</head>
<body>
<table id="design1">
<tr>
<td><b>Order Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->order_date)->format('d-m-Y') }}</td>
<td><b>Order Time: </b> {{ $pur_list_det->order_time }}</td>
<td><b>Order ID : </b> {{ $pur_list_det->pur_order_num }}</td>
</tr>
<tr>
<td><b>Supplier: </b> {{ $pur_list_det->supplier->sup_name }}</td>
<td><b>Expected Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->expec_date)->format('d-m-Y') }}</td>
<td><b>Expected Time: </b> {{ $pur_list_det->expec_time }}</td>
</tr>
</table>
<caption>
<h3 align="center"><br>ORDER DETAILS</h3>
</caption>
<table id="design">
<thead>
<tr>
<th>S.No</th>
<th>Product</th>
<th>Quantity</th>
</tr>
</thead>
<tbody>
@php ($s_no = 1)
@foreach($orderlists as $orderlist)
<tr>
<td>{{ $s_no }}</td>
<td>{{ $orderlist->product->product_name }}</td>
<td>{{ $orderlist->qty }}</td>
</tr>
@php ($s_no++)
@endforeach
</tbody>
</table>
</body>
</html>
but what my boss is saying is, he need page number for the printout pages.
how to do this??
and also he need the top portion
<table id="design1">
<tr>
<td><b>Order Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->order_date)->format('d-m-Y') }}</td>
<td><b>Order Time: </b> {{ $pur_list_det->order_time }}</td>
<td><b>Order ID : </b> {{ $pur_list_det->pur_order_num }}</td>
</tr>
<tr>
<td><b>Supplier: </b> {{ $pur_list_det->supplier->sup_name }}</td>
<td><b>Expected Date: </b> {{ \Carbon\Carbon::parse( $pur_list_det->expec_date)->format('d-m-Y') }}</td>
<td><b>Expected Time: </b> {{ $pur_list_det->expec_time }}</td>
</tr>
</table>
the above portion in all pages, because this protion contains the order Id, supplier name, order date, order time, expected date, expected time so these portion must be repeated in all pages how to do that
Kindly reply please