feat(billing): renewals, coupons, VAT numbering, billing cycles and invoice payment tracking
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
ea9a53f742
commit
25f23d541e
@@ -12,7 +12,7 @@
|
||||
'footer_text' => '',
|
||||
'footer_note' => '',
|
||||
], $cfg ?? []);
|
||||
$invoiceDate = $invoice->created_at ?? now();
|
||||
$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
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<div class="buyer-section">
|
||||
<div class="info-row">
|
||||
Họ tên người mua hàng <span class="italic">(Buyer)</span>:
|
||||
{{ $customer?->fullname ?? '' }}
|
||||
{{ $buyer['name'] ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Tên đơn vị <span class="italic">(Company's name)</span>:
|
||||
{{ $customer?->company ?? '' }}
|
||||
{{ $buyer['company'] ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Mã số thuế <span class="italic">(Tax code)</span>: {{ $customer?->identity_number ?? '' }}
|
||||
Mã số thuế <span class="italic">(Tax code)</span>: {{ $buyer['tax_code'] ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
Địa chỉ <span class="italic">(Address)</span>:
|
||||
{{ $customer?->address ?? '' }}
|
||||
{{ $buyer['address'] ?? '' }}
|
||||
</div>
|
||||
|
||||
<div class="info-row">
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<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>
|
||||
<u>{{ rtrim(config('app.frontend_url'), '/') }}/tra-cuu-hoa-don</u>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Mã tra cứu: <strong>{{ $invoice->invoice_number }}</strong>
|
||||
Số hóa đơn tra cứu: <strong>{{ $invoice->invoice_number }}</strong> — Mã tra cứu: <strong>{{ $invoice->lookup_code }}</strong>
|
||||
</p>
|
||||
|
||||
@if($cfg['footer_text'] ?? '')
|
||||
|
||||
@@ -26,12 +26,12 @@
|
||||
<td class="invoice-number">
|
||||
<p>
|
||||
Ký hiệu <span class="italic">(Serial)</span>:
|
||||
<strong>1C26TCP</strong>
|
||||
<strong>{{ $invoice->vat_serial ?: '1C26TCP' }}</strong>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Số <span class="italic">(No.)</span>:
|
||||
<strong>{{ $invoice->invoice_number ?? '<Chưa cấp số>' }}</strong>
|
||||
<strong>{{ $invoice->vat_number ?: $invoice->invoice_number }}</strong>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -38,7 +38,11 @@
|
||||
@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>:
|
||||
@if($invoice->tax > 0)
|
||||
Cộng tiền hàng đã gồm VAT <span class="italic">(Subtotal incl. VAT)</span>:
|
||||
@else
|
||||
Cộng tiền hàng <span class="italic">(Total amount excl. VAT)</span>:
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-right bold">{{ number_format($invoice->sub_total, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@@ -46,12 +50,21 @@
|
||||
@if($invoice->discount_amount > 0)
|
||||
<tr>
|
||||
<td colspan="5" class="summary-label">
|
||||
Giảm giá <span class="italic">(Discount)</span>:
|
||||
Giảm giá <span class="italic">(Discount)</span>{{ $invoice->coupon_code ? ' - '.$invoice->coupon_code : '' }}:
|
||||
</td>
|
||||
<td class="text-right bold">-{{ number_format($invoice->discount_amount, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@if($invoice->tax > 0)
|
||||
<tr>
|
||||
<td colspan="5" class="summary-label">
|
||||
Cộng tiền hàng chưa VAT <span class="italic">(Total amount excl. VAT)</span>:
|
||||
</td>
|
||||
<td class="text-right bold">{{ number_format($invoice->total - $invoice->tax, 0, ',', '.') }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
Thuế suất GTGT <span class="italic">(VAT rate)</span>:
|
||||
|
||||
Reference in New Issue
Block a user