Files
portal-api/resources/views/pdf/invoice.blade.php

48 lines
1.4 KiB
PHP

@php
$companyLogo = $companyLogo ?? setting('setting.logo') ?? '';
$companyName = $companyName ?? 'CÔNG TY CỔ PHẦN GIẢI PHÁP CÔNG NGHỆ THẾ GIỚI SỐ';
$companyAddress = $companyAddress ?? 'Số 128/38 đường Tân Hương, Phường Phú Thọ Hòa, Thành phố Hồ Chí Minh, Việt Nam';
$companyTaxCode = $companyTaxCode ?? '0318443116';
$cfg = array_merge([
'show_logo' => true,
'show_company_info' => true,
'show_customer_info' => true,
'show_items_table' => true,
'show_summary' => true,
'footer_text' => '',
'footer_note' => '',
], $cfg ?? []);
$invoiceDate = $invoice->vat_issued_at ?? $invoice->created_at ?? now();
$taxBase = ($invoice->total ?? 0) - ($invoice->tax ?? 0);
$taxRate = ($taxBase > 0 && ($invoice->tax ?? 0) > 0) ? round($invoice->tax / $taxBase * 100) : 0;
@endphp
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<title>Hóa đơn #{{ $invoice->invoice_number }}</title>
@include('pdf.invoice.styles')
</head>
<body>
<div class="invoice">
@include('pdf.invoice.header')
<hr class="divider">
@include('pdf.invoice.seller')
<hr class="divider">
@include('pdf.invoice.buyer')
@include('pdf.invoice.items')
@include('pdf.invoice.signature')
@include('pdf.invoice.footer')
</div>
</body>
</html>