97 lines
4.0 KiB
PHP
97 lines
4.0 KiB
PHP
<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">
|
|
@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>
|
|
|
|
@if($invoice->discount_amount > 0)
|
|
<tr>
|
|
<td colspan="5" class="summary-label">
|
|
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>:
|
|
</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>
|