Work
parent
562e499d12
commit
7e2a22e016
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Invoice;
|
||||
use Spatie\Browsershot\Browsershot;
|
||||
use Spatie\LaravelPdf\Facades\Pdf;
|
||||
|
||||
class InvoiceController extends Controller
|
||||
{
|
||||
public function pdf(int $id)
|
||||
{
|
||||
$invoice = Invoice::find($id);
|
||||
$url = strtolower('invoice-'.$invoice->internal_id.'.pdf');
|
||||
|
||||
Pdf::view('pdf.invoice', ['invoice' => $invoice])
|
||||
->withBrowsershot(function (Browsershot $browsershot) {
|
||||
$browsershot->noSandbox();
|
||||
})
|
||||
->margins(8, 8, 15, 8)
|
||||
->footerView('pdf.invoice-footer', ['invoice' => $invoice])
|
||||
->save($url);
|
||||
|
||||
return redirect($url);
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,10 @@
|
||||
<style>
|
||||
* {
|
||||
font-size: 12px;
|
||||
margin: 10px 5px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<footer>
|
||||
{{$invoice->internal_id}}, page @pageNumber of @totalPages
|
||||
</footer>'
|
@ -0,0 +1,88 @@
|
||||
@extends('layouts.pdf')
|
||||
|
||||
<div class="container-fluid ">
|
||||
<div class="fw-bold">
|
||||
TOP NOTCH EMBROIDERY & DIGITIZING LTD
|
||||
</div>
|
||||
<div>
|
||||
108-618 EAST KENT AVE. SOUTH <br>
|
||||
VANCOUVER BC <br>
|
||||
(604) 871-9991 <br>
|
||||
info@sewtopnotch.com <br>
|
||||
GST# 846025062RT0001 <br>
|
||||
</div>
|
||||
<div class="fs-3">
|
||||
INVOICE
|
||||
</div>
|
||||
<div class="fw-bold">
|
||||
BILL TO
|
||||
</div>
|
||||
<div>
|
||||
{{$invoice->customer->company_name}} <br>
|
||||
{{$invoice->customer->billing_address}} <br>
|
||||
</div>
|
||||
|
||||
{{-- split right--}}
|
||||
<div>
|
||||
<span class="fw-bold">
|
||||
INVOICE#
|
||||
</span>
|
||||
{{$invoice->internal_id}}
|
||||
</div>
|
||||
<div>
|
||||
<span class="fw-bold">
|
||||
DATE
|
||||
</span>
|
||||
{{$invoice->date}}
|
||||
</div>
|
||||
<div>
|
||||
<span class="fw-bold">
|
||||
DUE DATE
|
||||
</span>
|
||||
{{$invoice->due_date}}
|
||||
</div>
|
||||
<div>
|
||||
<span class="fw-bold">
|
||||
TERMS
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>WO#</th>
|
||||
<th>PO#</th>
|
||||
<th>PRODUCT SERVICES</th>
|
||||
<th>QTY</th>
|
||||
<th>RATE</th>
|
||||
<th>AMOUNT</th>
|
||||
</tr>
|
||||
@foreach($invoice->productServices as $service)
|
||||
<tr>
|
||||
<td>
|
||||
{{$service->order->internal_po}}
|
||||
</td>
|
||||
<td>
|
||||
{{$service->order->customer_po}}
|
||||
</td>
|
||||
<td>
|
||||
{{$service->order->order_type->name}} <br>
|
||||
{{$service->service_details}}
|
||||
</td>
|
||||
<td>
|
||||
{{$service->amount}}
|
||||
</td>
|
||||
<td>
|
||||
{{$service->amount_price}}
|
||||
</td>
|
||||
<td>
|
||||
${{$service->price}}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue