Add feature tests for domain order management
- Implement AdminDomainOrderTest to cover admin functionalities for domain orders including listing, confirming registration, KYC updates, activation, rejection, and refunds. - Implement ClientDomainOrderTest to cover client functionalities for placing domain orders, including validation for balance, duplicate orders, and domain normalization. - Ensure proper handling of domain pricing and service statuses throughout the tests.
This commit is contained in:
@@ -0,0 +1,549 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="vi">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman-Bold.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman-Italic.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman-Bold-Italic.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
@page {
|
||||
size: A4 portrait;
|
||||
margin: 10mm;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
color: #111;
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-size: 10px;
|
||||
font-weight: 400;
|
||||
line-height: 1.45;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
strong,
|
||||
b,
|
||||
th,
|
||||
.bold {
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
em,
|
||||
i,
|
||||
.italic {
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
strong em,
|
||||
strong i,
|
||||
b em,
|
||||
b i,
|
||||
.bold.italic {
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.invoice {
|
||||
min-height: 277mm;
|
||||
padding: 3mm;
|
||||
border: 1px solid #efefe;
|
||||
}
|
||||
|
||||
.header-table,
|
||||
.info-table,
|
||||
.product-table,
|
||||
.signature-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.header-table td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
.invoice-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.invoice-title h1 {
|
||||
margin: 0;
|
||||
font-size: 21px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.invoice-title h2 {
|
||||
margin: 2px 0;
|
||||
font-size: 15px;
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.invoice-title p {
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.invoice-number {
|
||||
width: 190px;
|
||||
padding-left: 15px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.invoice-number p {
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin: 7px 0;
|
||||
border: 0;
|
||||
border-top: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
margin: 0 0 3px;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.seller-section {
|
||||
position: relative;
|
||||
min-height: 120px;
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 15px;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border: 1px solid #555;
|
||||
text-align: center;
|
||||
line-height: 90px;
|
||||
}
|
||||
|
||||
.bank-table {
|
||||
width: 100%;
|
||||
margin: 4px 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.bank-table td {
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.bank-table-label {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
.product-table {
|
||||
margin-top: 6px;
|
||||
table-layout: auto;
|
||||
}
|
||||
|
||||
.product-table th,
|
||||
.product-table td {
|
||||
border: 1px solid #777;
|
||||
}
|
||||
|
||||
.product-table th {
|
||||
padding: 4px;
|
||||
height: 48px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.product-table tbody td {
|
||||
padding: 1px 2px;
|
||||
height: auto;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.product-table th:first-child,
|
||||
.product-table td:first-child {
|
||||
width: 8mm;
|
||||
padding-left: 1px;
|
||||
padding-right: 1px;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.amount-words {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
.signature-table {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.signature-table td {
|
||||
width: 50%;
|
||||
height: 130px;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.signature-title {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.signature-box {
|
||||
width: 260px;
|
||||
margin: 35px auto 0;
|
||||
padding: 8px;
|
||||
color: red;
|
||||
border: 1px solid #65a765;
|
||||
background: #eef8ee;
|
||||
text-align: left;
|
||||
font-weight: 700;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.footer p {
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.product-table-wrapper {
|
||||
position: relative;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.product-table-watermark {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
|
||||
width: 430px;
|
||||
height: auto;
|
||||
|
||||
opacity: 0.3;
|
||||
|
||||
margin-left: -215px;
|
||||
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.product-table {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
margin-top: 0;
|
||||
table-layout: auto;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.product-table th,
|
||||
.product-table td {
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="invoice">
|
||||
<table class="header-table">
|
||||
<tr>
|
||||
<td style="width: 25%">
|
||||
{{-- Thay bằng đường dẫn logo thực tế --}}
|
||||
<img src="{{ public_path('images/image.png') }}" alt="Logo" style="width: 80%; height: auto;">
|
||||
</td>
|
||||
|
||||
<td class="invoice-title">
|
||||
<h1>HÓA ĐƠN GIÁ TRỊ GIA TĂNG</h1>
|
||||
<h2>(VAT INVOICE)</h2>
|
||||
|
||||
<p>
|
||||
Ngày <span class="italic">(Date)</span> 09
|
||||
tháng <span class="italic">(month)</span> 07
|
||||
năm <span class="italic">(year)</span> 2026
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mã CQT <span class="italic">(Code)</span>:
|
||||
</p>
|
||||
</td>
|
||||
|
||||
<td class="invoice-number">
|
||||
<p>
|
||||
Ký hiệu <span class="italic">(Serial)</span>:
|
||||
<strong>1C26TCP</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Số <span class="italic">(No.)</span>:
|
||||
<strong><Chưa cấp số></strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr class="divider">
|
||||
|
||||
<div class="seller-section">
|
||||
<h3 class="company-name">
|
||||
CÔNG TY CỔ PHẦN GIẢI PHÁP CÔNG NGHỆ THẾ GIỚI SỐ
|
||||
</h3>
|
||||
|
||||
<div class="info-row">
|
||||
Mã số thuế <span class="italic">(Tax code)</span>: 0318443116
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Địa chỉ <span class="italic">(Address)</span>:
|
||||
Số 128/38 đường Tân Hương, Phường Phú Thọ Hòa,
|
||||
Thành phố Hồ Chí Minh, Việt Nam
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Tên cửa hàng <span class="italic">(Shop name)</span>:
|
||||
</div>
|
||||
|
||||
<table class="bank-table">
|
||||
<tr>
|
||||
<td class="bank-table-label">
|
||||
Số tài khoản <span class="italic">(Bank account)</span>:
|
||||
</td>
|
||||
<td>
|
||||
7379868 Ngân hàng TMCP Á Châu (ACB) Chi nhánh TP. Hồ Chí Minh
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bank-table-label"></td>
|
||||
<td>
|
||||
797379868 Ngân hàng TMCP Quân Đội (MB) Chi nhánh Phú Nhuận
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="qr-code">
|
||||
<img src="{{ public_path('images/qr-code-tgs.jpg') }}" alt="QR Code" style="width: 100%; height: auto;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
|
||||
<div class="buyer-section">
|
||||
<div class="info-row">
|
||||
Họ tên người mua hàng <span class="italic">(Buyer)</span>:
|
||||
PHẠM GIA BẢO
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Tên đơn vị <span class="italic">(Company's name)</span>:
|
||||
CÔNG TY TNHH MỘT THÀNH VIÊN CÔNG NGHỆ DEVRO
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Mã số thuế <span class="italic">(Tax code)</span>: 079203005707
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Địa chỉ <span class="italic">(Address)</span>:
|
||||
194/19/12 Chiến Lược, Phường Bình Trị Đông, Thành Phố Hồ Chí Minh
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Hình thức thanh toán <span class="italic">(Payment method)</span>:
|
||||
TM/CK
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-table-wrapper">
|
||||
<img src="{{ public_path('images/image.png') }}" alt="Watermark" class="product-table-watermark">
|
||||
<table class="product-table">
|
||||
<colgroup>
|
||||
<col style="width: 8mm">
|
||||
<col>
|
||||
<col style="width: 13%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 14%">
|
||||
<col style="width: 16%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>STT<br><span class="italic">(No)</span></th>
|
||||
<th>
|
||||
Tên hàng hóa, dịch vụ<br>
|
||||
<span class="italic">(Name of goods and services)</span>
|
||||
</th>
|
||||
<th>Đơn vị tính<br><span class="italic">(Unit)</span></th>
|
||||
<th>Số lượng<br><span class="italic">(Quantity)</span></th>
|
||||
<th>Đơn giá<br><span class="italic">(Unit price)</span></th>
|
||||
<th>Thành tiền<br><span class="italic">(Amount)</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="text-center">1</td>
|
||||
<td>Phí đăng ký và duy trì tên miền quốc tế .COM</td>
|
||||
<td class="text-center">Năm</td>
|
||||
<td class="text-right">2,00</td>
|
||||
<td class="text-right">340.000,00</td>
|
||||
<td class="text-right">680.000</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="5" class="summary-label">
|
||||
Cộng tiền hàng <span class="italic">(Total amount excl. VAT)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">680.000</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Thuế suất GTGT <span class="italic">(VAT rate)</span>:
|
||||
</td>
|
||||
<td class="text-center bold">10%</td>
|
||||
<td colspan="2" class="summary-label">
|
||||
Tiền thuế GTGT <span class="italic">(VAT amount)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">68.000</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="5" class="summary-label">
|
||||
Tổng tiền thanh toán <span class="italic">(Total amount)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">748.000</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="6" class="amount-words">
|
||||
Số tiền viết bằng chữ
|
||||
<span class="italic">(Total amount in words)</span>:
|
||||
<strong><em>Bảy trăm bốn mươi tám nghìn đồng chẵn.</em></strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="signature-table">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="signature-title">
|
||||
Người mua hàng <span class="italic">(Buyer)</span>
|
||||
</div>
|
||||
|
||||
<div class="italic">
|
||||
(Chữ ký số nếu có)<br>
|
||||
(Digital signature if any)
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="signature-title">
|
||||
Người bán hàng <span class="italic">(Seller)</span>
|
||||
</div>
|
||||
|
||||
<div class="italic">
|
||||
(Chữ ký điện tử, Chữ ký số)<br>
|
||||
(E-signature, Digital signature)
|
||||
</div>
|
||||
|
||||
<div class="signature-box">
|
||||
Signature Valid<br>
|
||||
<em>Ký bởi (Signed By):</em><br>
|
||||
<em>Ký ngày (Signing Date):</em>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="footer">
|
||||
<p>
|
||||
Tra cứu tại Website <span class="italic">(Search in website)</span>:
|
||||
<u>https://www.portal.tgs.com.vn/tra-cuu</u>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
(Cần kiểm tra, đối chiếu khi lập, giao, nhận hóa đơn)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Phát hành bởi phần mềm Thế Giới Số Invoice
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,317 +1,599 @@
|
||||
@php
|
||||
$companyLogo = $companyLogo ?? '';
|
||||
$companyName = $companyName ?? '';
|
||||
$companyAddress = $companyAddress ?? '';
|
||||
$companyPhone = $companyPhone ?? '';
|
||||
$companyEmail = $companyEmail ?? '';
|
||||
$companyTaxCode = $companyTaxCode ?? '';
|
||||
$brandColor = $brandColor ?? '#1a56db';
|
||||
$cfg = array_merge([
|
||||
'accent_color' => $brandColor,
|
||||
'show_logo' => true,
|
||||
'show_company_info' => true,
|
||||
'show_customer_info' => true,
|
||||
'show_order_info' => true,
|
||||
'show_items_table' => true,
|
||||
'show_summary' => true,
|
||||
'show_note' => true,
|
||||
'footer_text' => 'Cảm ơn quý khách đã sử dụng dịch vụ.',
|
||||
'footer_note' => 'Đây là hóa đơn điện tử được tạo tự động, không cần chữ ký số.',
|
||||
], $cfg ?? []);
|
||||
$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->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>
|
||||
<style>
|
||||
@page {
|
||||
size: A4;
|
||||
margin: 17mm 18mm;
|
||||
}
|
||||
<meta charset="UTF-8">
|
||||
<title>Hóa đơn #{{ $invoice->invoice_number }}</title>
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
<style>
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
html, body {
|
||||
width: 100%;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman-Bold.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "DejaVu Sans", "Times New Roman", serif;
|
||||
color: #000;
|
||||
font-size: 11px;
|
||||
line-height: 1.45;
|
||||
background: #fff;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman-Italic.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
.page {
|
||||
width: 100%;
|
||||
}
|
||||
@font-face {
|
||||
font-family: "SVN Times New Roman";
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
src: url("{{ public_path('fonts/time-new-roman/SVN-Times-New-Roman-Bold-Italic.ttf') }}")
|
||||
format("truetype");
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.top-table { width: 100%; border-collapse: collapse; margin-bottom: 7px; table-layout: fixed; }
|
||||
.top-table td { vertical-align: top; }
|
||||
.logo-cell { width: 31mm; }
|
||||
.logo-cell img { width: 29mm; max-height: 15mm; }
|
||||
.title-cell { text-align: center; padding: 0 10px; }
|
||||
.title-cell h1 { font-size: 16px; font-weight: bold; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 2px; }
|
||||
.title-cell h2 { font-size: 11px; font-style: italic; font-weight: normal; margin-bottom: 3px; }
|
||||
.title-cell .date-line { font-size: 11px; }
|
||||
.meta-cell { width: 43mm; font-size: 10px; line-height: 1.45; vertical-align: top; padding-top: 1px; }
|
||||
.meta-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
|
||||
.meta-table td { padding: 2px 0 2px 3px; vertical-align: top; }
|
||||
.meta-table .meta-label { width: 22mm; font-weight: bold; }
|
||||
.meta-table .meta-value { word-wrap: break-word; }
|
||||
@page {
|
||||
size: A4 portrait;
|
||||
margin: 10mm;
|
||||
}
|
||||
|
||||
.divider { border: none; border-top: 1px solid #999; margin: 7px 0; }
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
}
|
||||
|
||||
/* Company */
|
||||
.company-table { width: 100%; border-collapse: collapse; }
|
||||
.company-main { vertical-align: top; padding: 2px 8px 2px 0; }
|
||||
.company-main h3 { font-size: 13px; text-transform: uppercase; font-weight: bold; margin-bottom: 5px; }
|
||||
.company-qr { width: 22mm; vertical-align: top; text-align: right; padding: 2px 0 2px 8px; }
|
||||
.qr-box { width: 20mm; height: 20mm; border: 1px solid #ccc; background: #f9f9f9; }
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.info-line { margin-bottom: 4px; font-size: 11px; line-height: 1.45; }
|
||||
.lbl { font-weight: bold; }
|
||||
body {
|
||||
color: #111;
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-size: 10px;
|
||||
font-weight: 400;
|
||||
line-height: 1.45;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* Buyer */
|
||||
.buyer-section { margin-top: 8px; padding: 1px 0; }
|
||||
.payment-table { width: 100%; border-collapse: collapse; }
|
||||
.payment-table td { vertical-align: top; padding: 2px 8px 2px 0; }
|
||||
strong,
|
||||
b,
|
||||
th,
|
||||
.bold {
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Items table */
|
||||
.items-table { width: 100%; border-collapse: collapse; margin-top: 9px; font-size: 10px; line-height: 1.4; table-layout: fixed; page-break-inside: auto; }
|
||||
.items-table th, .items-table td { border: 1px solid #333; padding: 6px 7px; vertical-align: top; overflow-wrap: break-word; word-wrap: break-word; }
|
||||
.items-table thead th { font-weight: bold; text-align: center; }
|
||||
.items-table tr { page-break-inside: avoid; page-break-after: auto; }
|
||||
.items-table td.center { text-align: center; }
|
||||
.items-table td.right { text-align: right; }
|
||||
.items-table tr.sum td { font-weight: bold; }
|
||||
.items-table tr.total-row td { font-weight: bold; font-size: 11px; background: #fafafa; }
|
||||
em,
|
||||
i,
|
||||
.italic {
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
/* Amount words */
|
||||
.amount-words {
|
||||
border: 1px solid #333; border-top: none;
|
||||
padding: 7px 9px; font-size: 11px; line-height: 1.45;
|
||||
}
|
||||
strong em,
|
||||
strong i,
|
||||
b em,
|
||||
b i,
|
||||
.bold.italic {
|
||||
font-family: "SVN Times New Roman", "DejaVu Serif", serif;
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
/* Signature */
|
||||
.sign-table { width: 100%; border-collapse: collapse; margin-top: 11mm; text-align: center; page-break-inside: avoid; }
|
||||
.sign-table td { vertical-align: top; padding: 0 10px; }
|
||||
.sign-table h4 { font-size: 11px; margin-bottom: 2px; }
|
||||
.sign-table p { font-size: 10px; font-style: italic; color: #555; }
|
||||
.sign-spacer { height: 24px; }
|
||||
.invoice {
|
||||
min-height: 277mm;
|
||||
padding: 3mm;
|
||||
border: 1px solid #efefe;
|
||||
}
|
||||
|
||||
/* Note */
|
||||
.note-box { margin-top: 8px; border-left: 3px solid #e6a817; background: #fefce8; padding: 7px 10px; font-size: 10px; line-height: 1.45; page-break-inside: avoid; }
|
||||
.header-table,
|
||||
.info-table,
|
||||
.product-table,
|
||||
.signature-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.footer { margin-top: 10px; text-align: center; font-size: 10px; line-height: 1.5; color: #444; border-top: 1px solid #ddd; padding-top: 7px; page-break-inside: avoid; }
|
||||
.header-table td {
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.status-paid { color: #065f46; font-weight: bold; }
|
||||
.status-unpaid { color: #991b1b; font-weight: bold; }
|
||||
.status-cancelled { color: #6b7280; font-weight: bold; }
|
||||
.logo {
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
.accent { color: {{ $cfg['accent_color'] ?? '#1a56db' }}; }
|
||||
.items-table thead th { background: {{ $cfg['accent_color'] ?? '#1a56db' }}; color: #fff; }
|
||||
</style>
|
||||
.invoice-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.invoice-title h1 {
|
||||
margin: 0;
|
||||
font-size: 21px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.invoice-title h2 {
|
||||
margin: 2px 0;
|
||||
font-size: 15px;
|
||||
font-style: italic;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.invoice-title p {
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.invoice-number {
|
||||
width: 190px;
|
||||
padding-left: 15px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.invoice-number p {
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.divider {
|
||||
margin: 7px 0;
|
||||
border: 0;
|
||||
border-top: 1px solid #bbb;
|
||||
}
|
||||
|
||||
.company-name {
|
||||
margin: 0 0 3px;
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.seller-section {
|
||||
position: relative;
|
||||
min-height: 120px;
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 15px;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border: 1px solid #555;
|
||||
text-align: center;
|
||||
line-height: 90px;
|
||||
}
|
||||
|
||||
.bank-table {
|
||||
width: 100%;
|
||||
margin: 4px 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.bank-table td {
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.bank-table-label {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
.product-table {
|
||||
margin-top: 6px;
|
||||
table-layout: auto;
|
||||
}
|
||||
|
||||
.product-table th,
|
||||
.product-table td {
|
||||
border: 1px solid #777;
|
||||
}
|
||||
|
||||
.product-table th {
|
||||
padding: 4px;
|
||||
height: 48px;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.product-table tbody td {
|
||||
padding: 1px 2px;
|
||||
height: auto;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.product-table th:first-child,
|
||||
.product-table td:first-child {
|
||||
width: 8mm;
|
||||
padding-left: 1px;
|
||||
padding-right: 1px;
|
||||
}
|
||||
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.text-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.italic {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.summary-label {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.amount-words {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
.signature-table {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.signature-table td {
|
||||
width: 50%;
|
||||
height: 130px;
|
||||
text-align: center;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.signature-title {
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.signature-box {
|
||||
width: 260px;
|
||||
margin: 35px auto 0;
|
||||
padding: 8px;
|
||||
color: red;
|
||||
border: 1px solid #65a765;
|
||||
background: #eef8ee;
|
||||
text-align: left;
|
||||
font-weight: 700;
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.footer {
|
||||
text-align: center;
|
||||
font-size: 9px;
|
||||
}
|
||||
|
||||
.footer p {
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.product-table-wrapper {
|
||||
position: relative;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.product-table-watermark {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
|
||||
width: 430px;
|
||||
height: auto;
|
||||
|
||||
opacity: 0.3;
|
||||
|
||||
margin-left: -215px;
|
||||
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.product-table {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
margin-top: 0;
|
||||
table-layout: auto;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.product-table th,
|
||||
.product-table td {
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page">
|
||||
|
||||
{{-- ══ HEADER ══ --}}
|
||||
<table class="top-table">
|
||||
<tr>
|
||||
<td class="logo-cell">
|
||||
@if(($cfg['show_logo'] ?? true) && $companyLogo)
|
||||
<img src="{{ $companyLogo }}" alt="{{ $companyName }}"/>
|
||||
@endif
|
||||
</td>
|
||||
<td class="title-cell">
|
||||
<h1>HÓA ĐƠN ĐẶT HÀNG</h1>
|
||||
<h2>(INVOICE ORDER)</h2>
|
||||
<div class="date-line">
|
||||
Ngày <strong>{{ $invoice->created_at?->format('d') ?? '—' }}</strong>
|
||||
tháng <strong>{{ $invoice->created_at?->format('m') ?? '—' }}</strong>
|
||||
năm <strong>{{ $invoice->created_at?->format('Y') ?? '—' }}</strong>
|
||||
</div>
|
||||
</td>
|
||||
<td class="meta-cell">
|
||||
<table class="meta-table">
|
||||
<body>
|
||||
<div class="invoice">
|
||||
<table class="header-table">
|
||||
<tr>
|
||||
<td class="meta-label">Mã hóa đơn:</td>
|
||||
<td class="meta-value">{{ $invoice->invoice_number }}</td>
|
||||
</tr>
|
||||
@if($order)
|
||||
<tr>
|
||||
<td class="meta-label">Mã đơn hàng:</td>
|
||||
<td class="meta-value">{{ $order->order_num }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr>
|
||||
<td class="meta-label">Hạn thanh toán:</td>
|
||||
<td class="meta-value">{{ $invoice->due_date ? \Carbon\Carbon::parse($invoice->due_date)->format('d/m/Y') : '—' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="meta-label">Trạng thái:</td>
|
||||
<td class="meta-value">
|
||||
@if($invoice->status == 2)<span class="status-paid">Đã thanh toán</span>
|
||||
@elseif($invoice->status == 1)<span class="status-unpaid">Chưa thanh toán</span>
|
||||
@else<span class="status-cancelled">Đã hủy</span>@endif
|
||||
<td style="width: 25%">
|
||||
@if(($cfg['show_logo'] ?? true) && $companyLogo)
|
||||
<img src="{{ $companyLogo }}" alt="{{ $companyName }}" style="width: 80%; height: auto;">
|
||||
@else
|
||||
<img src="{{ public_path('images/image.png') }}" alt="{{ $companyName }}" style="width: 80%; height: auto;">
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="invoice-title">
|
||||
<h1>HÓA ĐƠN GIÁ TRỊ GIA TĂNG</h1>
|
||||
<h2>(VAT INVOICE)</h2>
|
||||
|
||||
<p>
|
||||
Ngày <span class="italic">(Date)</span> {{ $invoiceDate?->format('d') ?? '' }}
|
||||
tháng <span class="italic">(month)</span> {{ $invoiceDate?->format('m') ?? '' }}
|
||||
năm <span class="italic">(year)</span> {{ $invoiceDate?->format('Y') ?? '' }}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mã CQT <span class="italic">(Code)</span>:
|
||||
</p>
|
||||
</td>
|
||||
|
||||
<td class="invoice-number">
|
||||
<p>
|
||||
Ký hiệu <span class="italic">(Serial)</span>:
|
||||
<strong>1C26TCP</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Số <span class="italic">(No.)</span>:
|
||||
<strong>{{ $invoice->invoice_number ?? '<Chưa cấp số>' }}</strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<hr class="divider"/>
|
||||
|
||||
{{-- ══ COMPANY ══ --}}
|
||||
@if($cfg['show_company_info'] ?? true)
|
||||
<table class="company-table">
|
||||
<tr>
|
||||
<td class="company-main">
|
||||
<h3>{{ $companyName }}</h3>
|
||||
@if($companyTaxCode)
|
||||
<div class="info-line"><span class="lbl">Mã số thuế (Tax code):</span> {{ $companyTaxCode }}</div>
|
||||
@endif
|
||||
@if($companyAddress)
|
||||
<div class="info-line"><span class="lbl">Địa chỉ (Address):</span> {{ $companyAddress }}</div>
|
||||
@endif
|
||||
@if($companyPhone)
|
||||
<div class="info-line"><span class="lbl">Điện thoại (Tel):</span> {{ $companyPhone }}</div>
|
||||
@endif
|
||||
@if($companyEmail)
|
||||
<div class="info-line"><span class="lbl">Email:</span> {{ $companyEmail }}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="company-qr"><div class="qr-box"></div></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr class="divider"/>
|
||||
@endif
|
||||
|
||||
{{-- ══ BUYER ══ --}}
|
||||
@if($cfg['show_customer_info'] ?? true)
|
||||
<div class="buyer-section">
|
||||
<div class="info-line">
|
||||
<span class="lbl">Họ tên người mua hàng (Buyer):</span> {{ $customer?->fullname ?? '—' }}
|
||||
</div>
|
||||
@if($customer?->company)
|
||||
<div class="info-line"><span class="lbl">Tên đơn vị:</span> {{ $customer->company }}</div>
|
||||
@endif
|
||||
@if($customer?->identity_number)
|
||||
<div class="info-line"><span class="lbl">MST / CMND:</span> {{ $customer->identity_number }}</div>
|
||||
@endif
|
||||
@if($customer?->address)
|
||||
<div class="info-line"><span class="lbl">Địa chỉ (Address):</span> {{ $customer->address }}</div>
|
||||
@endif
|
||||
<table class="payment-table">
|
||||
<tr>
|
||||
<td style="width:55%">
|
||||
<div class="info-line">
|
||||
<span class="lbl">Hình thức thanh toán:</span>
|
||||
{{ $invoice->payment_method ? strtoupper($invoice->payment_method) : 'TM/CK' }}
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="info-line"><span class="lbl">Email:</span> {{ $customer?->email ?? '—' }}</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- ══ ITEMS TABLE ══ --}}
|
||||
@if($cfg['show_items_table'] ?? true)
|
||||
<table class="items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:9mm">STT</th>
|
||||
<th>Tên hàng hóa, dịch vụ</th>
|
||||
<th style="width:19mm">Đơn vị tính</th>
|
||||
<th style="width:17mm">Số lượng</th>
|
||||
<th style="width:27mm">Đơn giá (đ)</th>
|
||||
<th style="width:29mm">Thành tiền (đ)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($invoiceItems as $i => $item)
|
||||
<tr>
|
||||
<td class="center">{{ $i + 1 }}</td>
|
||||
<td>{{ $item->description ?? ($item->product?->name ?? 'Dịch vụ') }}</td>
|
||||
<td class="center">{{ ($item->months && $item->months > 0) ? 'Tháng' : 'Lần' }}</td>
|
||||
<td class="center">{{ number_format($item->quantity ?? 1, 2, ',', '.') }}</td>
|
||||
<td class="right">{{ number_format($item->unit_price, 0, ',', '.') }}</td>
|
||||
<td class="right">{{ number_format($item->total_price, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<hr class="divider">
|
||||
|
||||
@if($cfg['show_summary'] ?? true)
|
||||
{{-- Sub-total --}}
|
||||
<tr class="sum">
|
||||
<td colspan="5" class="right">Cộng tiền hàng (Total amount excl. VAT)</td>
|
||||
<td class="right">{{ number_format($invoice->sub_total, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@if($invoice->discount_amount > 0)
|
||||
<tr class="sum">
|
||||
<td colspan="5" class="right">Giảm giá (Discount)</td>
|
||||
<td class="right">-{{ number_format($invoice->discount_amount, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@php $taxRate = ($invoice->total > 0 && $invoice->tax > 0) ? round($invoice->tax / ($invoice->total - $invoice->tax) * 100) : 0; @endphp
|
||||
<tr class="sum">
|
||||
<td colspan="3">Thuế suất GTGT (VAT rate): {{ $taxRate > 0 ? $taxRate.'%' : 'Không áp dụng' }}</td>
|
||||
<td colspan="2" class="right">Tiền thuế GTGT (VAT amount)</td>
|
||||
<td class="right">{{ number_format($invoice->tax, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
<tr class="sum total-row">
|
||||
<td colspan="5" class="right">Tổng tiền thanh toán (Total amount)</td>
|
||||
<td class="right">{{ number_format($invoice->total, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="seller-section">
|
||||
<h3 class="company-name">
|
||||
{{ $companyName }}
|
||||
</h3>
|
||||
|
||||
<div class="amount-words">
|
||||
<strong>Số tiền viết bằng chữ (Total amount in words):</strong>
|
||||
{{ \App\Helpers\NumberToWords::convert((int) $invoice->total) }}.
|
||||
</div>
|
||||
@endif
|
||||
<div class="info-row">
|
||||
Mã số thuế <span class="italic">(Tax code)</span>: {{ $companyTaxCode }}
|
||||
</div>
|
||||
|
||||
{{-- ══ NOTE ══ --}}
|
||||
@if(($cfg['show_note'] ?? true) && $invoice->note)
|
||||
<div class="note-box"><strong>Ghi chú:</strong> {{ $invoice->note }}</div>
|
||||
@endif
|
||||
<div class="info-row">
|
||||
Địa chỉ <span class="italic">(Address)</span>:
|
||||
{{ $companyAddress }}
|
||||
</div>
|
||||
|
||||
{{-- ══ SIGNATURE ══ --}}
|
||||
<table class="sign-table">
|
||||
<tr>
|
||||
<td>
|
||||
<h4>Người mua hàng<br/><em style="font-size:11px">(Buyer's signature)</em></h4>
|
||||
<p>Ký, ghi rõ họ tên</p>
|
||||
<div class="sign-spacer"></div>
|
||||
<p>{{ $customer?->fullname ?? '' }}</p>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<h4>Người bán hàng<br/><em style="font-size:11px">(Seller's signature)</em></h4>
|
||||
<p>Ký, đóng dấu, ghi rõ họ tên</p>
|
||||
<div class="sign-spacer"></div>
|
||||
<p>{{ $companyName }}</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="info-row">
|
||||
Tên cửa hàng <span class="italic">(Shop name)</span>:
|
||||
</div>
|
||||
|
||||
{{-- ══ FOOTER ══ --}}
|
||||
<div class="footer">
|
||||
@if($cfg['footer_text'] ?? ''){{ $cfg['footer_text'] }}<br/>@endif
|
||||
@if($cfg['footer_note'] ?? ''){{ $cfg['footer_note'] }}<br/>@endif
|
||||
Mã tra cứu: <strong>{{ $invoice->invoice_number }}</strong>
|
||||
</div>
|
||||
<table class="bank-table">
|
||||
<tr>
|
||||
<td class="bank-table-label">
|
||||
Số tài khoản <span class="italic">(Bank account)</span>:
|
||||
</td>
|
||||
<td>
|
||||
7379868 Ngân hàng TMCP Á Châu (ACB) Chi nhánh TP. Hồ Chí Minh
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bank-table-label"></td>
|
||||
<td>
|
||||
797379868 Ngân hàng TMCP Quân Đội (MB) Chi nhánh Phú Nhuận
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="qr-code">
|
||||
<img src="{{ public_path('images/qr-code-tgs.jpg') }}" alt="QR Code" style="width: 100%; height: auto;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="divider">
|
||||
|
||||
<div class="buyer-section">
|
||||
<div class="info-row">
|
||||
Họ tên người mua hàng <span class="italic">(Buyer)</span>:
|
||||
{{ $customer?->fullname ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Tên đơn vị <span class="italic">(Company's name)</span>:
|
||||
{{ $customer?->company ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Mã số thuế <span class="italic">(Tax code)</span>: {{ $customer?->identity_number ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Địa chỉ <span class="italic">(Address)</span>:
|
||||
{{ $customer?->address ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Hình thức thanh toán <span class="italic">(Payment method)</span>:
|
||||
{{ $invoice->payment_method ? strtoupper($invoice->payment_method) : 'TM/CK' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="product-table-wrapper">
|
||||
<img src="{{ public_path('images/image.png') }}" alt="Watermark" class="product-table-watermark">
|
||||
<table class="product-table">
|
||||
<colgroup>
|
||||
<col style="width: 8mm">
|
||||
<col>
|
||||
<col style="width: 13%">
|
||||
<col style="width: 10%">
|
||||
<col style="width: 14%">
|
||||
<col style="width: 16%">
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>STT<br><span class="italic">(No)</span></th>
|
||||
<th>
|
||||
Tên hàng hóa, dịch vụ<br>
|
||||
<span class="italic">(Name of goods and services)</span>
|
||||
</th>
|
||||
<th>Đơn vị tính<br><span class="italic">(Unit)</span></th>
|
||||
<th>Số lượng<br><span class="italic">(Quantity)</span></th>
|
||||
<th>Đơn giá<br><span class="italic">(Unit price)</span></th>
|
||||
<th>Thành tiền<br><span class="italic">(Amount)</span></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach($invoiceItems as $i => $item)
|
||||
<tr>
|
||||
<td class="text-center">{{ $i + 1 }}</td>
|
||||
<td>{{ $item->description ?? ($item->product?->name ?? 'Dịch vụ') }}</td>
|
||||
<td class="text-center">{{ ($item->months && $item->months > 0) ? 'Tháng' : 'Lần' }}</td>
|
||||
<td class="text-right">{{ number_format($item->quantity ?? 1, 2, ',', '.') }}</td>
|
||||
<td class="text-right">{{ number_format($item->unit_price, 0, ',', '.') }}</td>
|
||||
<td class="text-right">{{ number_format($item->total_price, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
@if($cfg['show_summary'] ?? true)
|
||||
<tr>
|
||||
<td colspan="5" class="summary-label">
|
||||
Cộng tiền hàng <span class="italic">(Total amount excl. VAT)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">{{ number_format($invoice->sub_total, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
|
||||
@if($invoice->discount_amount > 0)
|
||||
<tr>
|
||||
<td colspan="5" class="summary-label">
|
||||
Giảm giá <span class="italic">(Discount)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">-{{ number_format($invoice->discount_amount, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Thuế suất GTGT <span class="italic">(VAT rate)</span>:
|
||||
</td>
|
||||
<td class="text-center bold">{{ $taxRate > 0 ? $taxRate . '%' : 'Không áp dụng' }}</td>
|
||||
<td colspan="2" class="summary-label">
|
||||
Tiền thuế GTGT <span class="italic">(VAT amount)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">{{ number_format($invoice->tax, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="5" class="summary-label">
|
||||
Tổng tiền thanh toán <span class="italic">(Total amount)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">{{ number_format($invoice->total, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td colspan="6" class="amount-words">
|
||||
Số tiền viết bằng chữ
|
||||
<span class="italic">(Total amount in words)</span>:
|
||||
<strong><em>{{ \App\Helpers\NumberToWords::convert((int) $invoice->total) }}.</em></strong>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="signature-table">
|
||||
<tr>
|
||||
<td>
|
||||
<div class="signature-title">
|
||||
Người mua hàng <span class="italic">(Buyer)</span>
|
||||
</div>
|
||||
|
||||
<div class="italic">
|
||||
(Chữ ký số nếu có)<br>
|
||||
(Digital signature if any)
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 65px;">
|
||||
{{ $customer?->fullname ?? '' }}
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="signature-title">
|
||||
Người bán hàng <span class="italic">(Seller)</span>
|
||||
</div>
|
||||
|
||||
<div class="italic">
|
||||
(Chữ ký điện tử, Chữ ký số)<br>
|
||||
(E-signature, Digital signature)
|
||||
</div>
|
||||
|
||||
<div class="signature-box">
|
||||
Signature Valid<br>
|
||||
<em>Ký bởi (Signed By): {{ $companyName }}</em><br>
|
||||
<em>Ký ngày (Signing Date):</em>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="footer">
|
||||
<p>
|
||||
Tra cứu tại Website <span class="italic">(Search in website)</span>:
|
||||
<u>https://www.portal.tgs.com.vn/tra-cuu</u>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mã tra cứu: <strong>{{ $invoice->invoice_number }}</strong>
|
||||
</p>
|
||||
|
||||
@if($cfg['footer_text'] ?? '')
|
||||
<p>{{ $cfg['footer_text'] }}</p>
|
||||
@endif
|
||||
|
||||
@if($cfg['footer_note'] ?? '')
|
||||
<p>{{ $cfg['footer_note'] }}</p>
|
||||
@endif
|
||||
|
||||
<p>
|
||||
(Cần kiểm tra, đối chiếu khi lập, giao, nhận hóa đơn)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Phát hành bởi phần mềm Thế Giới Số Invoice
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
@php
|
||||
$brandColor = $brandColor ?? '#1a56db';
|
||||
$companyLogo = $companyLogo ?? setting('setting.logo') ?? '';
|
||||
|
||||
$frontendLabels = [
|
||||
'nextjs' => 'Next.js',
|
||||
@@ -27,14 +28,29 @@ $fmt = fn ($n) => number_format((float) $n, 0, ',', '.');
|
||||
<style>
|
||||
@page { size: A4; margin: 16mm 18mm; }
|
||||
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
font-family: "DejaVu Serif", "Times New Roman", serif;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: "DejaVu Sans", "Times New Roman", serif;
|
||||
color: #1f2937;
|
||||
font-size: 11px;
|
||||
line-height: 1.5;
|
||||
color: #111;
|
||||
font-size: 10px;
|
||||
line-height: 1.45;
|
||||
background: #fff;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.quote-page {
|
||||
min-height: 277mm;
|
||||
padding: 3mm;
|
||||
border: 1px solid #efefe;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
@@ -47,18 +63,57 @@ body {
|
||||
.meta-cell { width: 52mm; font-size: 10px; text-align: right; }
|
||||
|
||||
.doc-title { text-align: center; margin: 10px 0 2px; }
|
||||
.doc-title h1 { font-size: 20px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px; color: {{ $brandColor }}; }
|
||||
.doc-title h1 { font-size: 21px; font-weight: bold; text-transform: uppercase; letter-spacing: 0; color: #111; }
|
||||
.doc-title .sub { font-size: 11px; font-style: italic; color: #6b7280; }
|
||||
|
||||
.divider { border: none; border-top: 2px solid {{ $brandColor }}; margin: 8px 0 10px; }
|
||||
.divider { border: none; border-top: 1px solid #bbb; margin: 8px 0 10px; }
|
||||
|
||||
.seller-section {
|
||||
position: relative;
|
||||
min-height: 120px;
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.seller-section .company-name {
|
||||
margin: 0 0 3px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.bank-table {
|
||||
width: 100%;
|
||||
margin: 4px 0;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.bank-table td {
|
||||
padding: 0;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.bank-table-label {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
.qr-code {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
right: 15px;
|
||||
width: 90px;
|
||||
height: 90px;
|
||||
border: 1px solid #555;
|
||||
text-align: center;
|
||||
line-height: 90px;
|
||||
}
|
||||
|
||||
/* Section */
|
||||
.section { margin-bottom: 10px; }
|
||||
.section-title {
|
||||
font-size: 12px; font-weight: bold; text-transform: uppercase;
|
||||
color: {{ $brandColor }}; border-bottom: 1px solid #e5e7eb;
|
||||
padding-bottom: 3px; margin-bottom: 6px;
|
||||
}
|
||||
.section-title { font-size: 12px; font-weight: bold; text-transform: uppercase; color: #111; border-bottom: 1px solid #e5e7eb; padding-bottom: 3px; margin-bottom: 6px; }
|
||||
|
||||
.info-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
|
||||
.info-table td { padding: 2px 8px 2px 0; vertical-align: top; }
|
||||
@@ -68,23 +123,42 @@ body {
|
||||
.two-col > tbody > tr > td { width: 50%; vertical-align: top; padding-right: 10px; }
|
||||
|
||||
/* Items table */
|
||||
.items-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 10px; table-layout: fixed; }
|
||||
.items-table th, .items-table td { border: 1px solid #d1d5db; padding: 6px 7px; vertical-align: top; overflow-wrap: break-word; }
|
||||
.items-table thead th { background: {{ $brandColor }}; color: #fff; font-weight: bold; text-align: center; }
|
||||
.items-table-wrapper {
|
||||
position: relative;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.items-table-watermark {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 50%;
|
||||
width: 430px;
|
||||
height: auto;
|
||||
opacity: 0.3;
|
||||
margin-left: -215px;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.items-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 10px; table-layout: auto; }
|
||||
.items-table th, .items-table td { border: 1px solid #777; vertical-align: top; overflow-wrap: break-word; }
|
||||
.items-table th { padding: 4px; height: 38px; text-align: center; vertical-align: middle; }
|
||||
.items-table td { padding: 1px 2px; line-height: 1.2; }
|
||||
.items-table thead th { background: transparent; color: #111; font-weight: bold; text-align: center; }
|
||||
.items-table tr { page-break-inside: avoid; }
|
||||
.items-table td.center { text-align: center; }
|
||||
.items-table td.right { text-align: right; }
|
||||
.items-table td.summary-label { text-align: right; font-weight: bold; }
|
||||
.items-table td.summary-value { text-align: right; font-weight: bold; }
|
||||
.items-table tr.total td { font-size: 12px; font-weight: bold; }
|
||||
.items-table .item-desc { color: #6b7280; font-size: 9px; }
|
||||
.items-table { position: relative; z-index: 1; }
|
||||
|
||||
/* Summary */
|
||||
.summary-table { width: 62mm; border-collapse: collapse; margin-top: 6px; margin-left: auto; font-size: 11px; }
|
||||
.summary-table td { padding: 3px 6px; }
|
||||
.summary-table .lbl { text-align: left; color: #374151; }
|
||||
.summary-table .val { text-align: right; }
|
||||
.summary-table tr.total td {
|
||||
font-weight: bold; font-size: 13px; color: {{ $brandColor }};
|
||||
border-top: 1.5px solid {{ $brandColor }};
|
||||
}
|
||||
.summary-table tr.total td { font-weight: bold; font-size: 13px; color: #111; border-top: 1px solid #777; }
|
||||
|
||||
.note-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 3px; padding: 7px 9px; margin-top: 6px; }
|
||||
|
||||
@@ -101,17 +175,15 @@ ul.ref-list { margin: 2px 0 0 14px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="quote-page">
|
||||
<table class="top-table">
|
||||
<tr>
|
||||
@if ($companyLogo)
|
||||
<td class="logo-cell"><img src="{{ $companyLogo }}" alt="logo"/></td>
|
||||
@endif
|
||||
<td class="logo-cell">
|
||||
<img src="{{ $companyLogo ?: public_path('images/image.png') }}" alt="logo"/>
|
||||
</td>
|
||||
<td class="company-cell">
|
||||
<div class="company-name">{{ $companyName }}</div>
|
||||
@if ($companyAddress)<div>Địa chỉ: {{ $companyAddress }}</div>@endif
|
||||
@if ($companyPhone)<div>Điện thoại: {{ $companyPhone }}</div>@endif
|
||||
@if ($companyEmail)<div>Email: {{ $companyEmail }}</div>@endif
|
||||
@if ($companyTaxCode)<div>MST: {{ $companyTaxCode }}</div>@endif
|
||||
<h1>BÁO GIÁ WEBSITE</h1>
|
||||
|
||||
</td>
|
||||
<td class="meta-cell">
|
||||
<div><strong>Số báo giá:</strong> {{ $quote->quote_number }}</div>
|
||||
@@ -123,9 +195,41 @@ ul.ref-list { margin: 2px 0 0 14px; }
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="doc-title">
|
||||
<h1>Báo giá thiết kế website</h1>
|
||||
<div class="sub">Kính gửi Quý khách hàng</div>
|
||||
<hr class="divider"/>
|
||||
|
||||
<div class="seller-section">
|
||||
<h3 class="company-name">{{ $companyName }}</h3>
|
||||
|
||||
@if ($companyTaxCode)
|
||||
<div class="info-row">Mã số thuế <span style="font-style: italic">(Tax code)</span>: {{ $companyTaxCode }}</div>
|
||||
@endif
|
||||
|
||||
@if ($companyAddress)
|
||||
<div class="info-row">Địa chỉ <span style="font-style: italic">(Address)</span>: {{ $companyAddress }}</div>
|
||||
@endif
|
||||
|
||||
@if ($companyPhone)
|
||||
<div class="info-row">Điện thoại <span style="font-style: italic">(Tel)</span>: {{ $companyPhone }}</div>
|
||||
@endif
|
||||
|
||||
@if ($companyEmail)
|
||||
<div class="info-row">Email: {{ $companyEmail }}</div>
|
||||
@endif
|
||||
|
||||
<table class="bank-table">
|
||||
<tr>
|
||||
<td class="bank-table-label">Số tài khoản <span style="font-style: italic">(Bank account)</span>:</td>
|
||||
<td>7379868 Ngân hàng TMCP Á Châu (ACB) Chi nhánh TP. Hồ Chí Minh</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bank-table-label"></td>
|
||||
<td>797379868 Ngân hàng TMCP Quân Đội (MB) Chi nhánh Phú Nhuận</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="qr-code">
|
||||
<img src="{{ public_path('images/qr-code-tgs.jpg') }}" alt="QR Code" style="width: 100%; height: auto;">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="divider"/>
|
||||
@@ -182,11 +286,9 @@ ul.ref-list { margin: 2px 0 0 14px; }
|
||||
<tr>
|
||||
<td class="lbl">Website mẫu:</td>
|
||||
<td>
|
||||
<ul class="ref-list">
|
||||
@foreach ($referenceWebsites as $ref)
|
||||
<li>{{ $ref }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@foreach ($referenceWebsites as $ref)
|
||||
{{ $ref }}<br/>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@@ -195,10 +297,12 @@ ul.ref-list { margin: 2px 0 0 14px; }
|
||||
|
||||
<div class="section">
|
||||
<div class="section-title">Chi tiết báo giá</div>
|
||||
<div class="items-table-wrapper">
|
||||
<img src="{{ public_path('images/image.png') }}" alt="Watermark" class="items-table-watermark">
|
||||
<table class="items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 8mm;">STT</th>
|
||||
<th style="width: 8mm;">STT<br><span style="font-style: italic">(No)</span></th>
|
||||
<th>Hạng mục</th>
|
||||
<th style="width: 12mm;">SL</th>
|
||||
<th style="width: 26mm;">Đơn giá ({{ $quote->currency }})</th>
|
||||
@@ -220,19 +324,31 @@ ul.ref-list { margin: 2px 0 0 14px; }
|
||||
<td class="right">{{ $fmt(($item['quantity'] ?? 1) * ($item['unit_price'] ?? 0)) }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
<tr>
|
||||
<td colspan="4" class="summary-label">Tạm tính:</td>
|
||||
<td class="summary-value">{{ $fmt($quote->subtotal) }}</td>
|
||||
</tr>
|
||||
@if ($quote->discount > 0)
|
||||
<tr>
|
||||
<td colspan="4" class="summary-label">Giảm giá:</td>
|
||||
<td class="summary-value">-{{ $fmt($quote->discount) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
@if ($quote->vat_percent > 0)
|
||||
<tr>
|
||||
<td colspan="4" class="summary-label">
|
||||
VAT ({{ rtrim(rtrim(number_format($quote->vat_percent, 2, '.', ''), '0'), '.') }}%):
|
||||
</td>
|
||||
<td class="summary-value">{{ $fmt($vatAmount) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
<tr class="total">
|
||||
<td colspan="4" class="summary-label">Tổng cộng:</td>
|
||||
<td class="summary-value">{{ $fmt($quote->total) }} {{ $quote->currency }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="summary-table">
|
||||
<tr><td class="lbl">Tạm tính:</td><td class="val">{{ $fmt($quote->subtotal) }}</td></tr>
|
||||
@if ($quote->discount > 0)
|
||||
<tr><td class="lbl">Giảm giá:</td><td class="val">-{{ $fmt($quote->discount) }}</td></tr>
|
||||
@endif
|
||||
@if ($quote->vat_percent > 0)
|
||||
<tr><td class="lbl">VAT ({{ rtrim(rtrim(number_format($quote->vat_percent, 2, '.', ''), '0'), '.') }}%):</td><td class="val">{{ $fmt($vatAmount) }}</td></tr>
|
||||
@endif
|
||||
<tr class="total"><td class="lbl">Tổng cộng:</td><td class="val">{{ $fmt($quote->total) }} {{ $quote->currency }}</td></tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if ($quote->note)
|
||||
@@ -261,5 +377,6 @@ ul.ref-list { margin: 2px 0 0 14px; }
|
||||
Báo giá có hiệu lực {{ $quote->valid_until ? 'đến ngày ' . $quote->valid_until->format('d/m/Y') : 'trong 30 ngày kể từ ngày lập' }}.
|
||||
Cảm ơn Quý khách đã quan tâm đến dịch vụ thiết kế website của {{ $companyName }}.
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user