feat: add legacy PDF generation support and invoice discount fields

This commit is contained in:
I-Fun
2026-04-07 07:49:35 +07:00
parent 737ba24293
commit 0e6726b0a6
13 changed files with 710 additions and 45 deletions

View File

@@ -317,6 +317,10 @@
<span
style="margin-left:6px; font-size:10px; background:#F3F4F6; color:#6B7280; padding:2px 8px; border-radius:10px; font-weight:600;">Non-Taxable</span>
@endif
@if($invoice->discount_rate > 0 && !$item->is_discountable)
<span
style="margin-left:6px; font-size:10px; background:#FDF2F8; color:#EC4899; padding:2px 8px; border-radius:10px; font-weight:600;">No Discount</span>
@endif
</td>
<td class="td-right">Rp {{ number_format($item->unit_price, 0, ',', '.') }}</td>
<td class="td-center">{{ $item->quantity }}</td>
@@ -332,8 +336,14 @@
<table cellpadding="0" cellspacing="0">
<tr>
<td style="color:#6B7280;">Subtotal</td>
<td class="amount">Rp {{ number_format($invoice->subtotal, 0, ',', '.') }}</td>
<td class="amount">Rp {{ number_format($invoice->subtotal + $invoice->discount_amount, 0, ',', '.') }}</td>
</tr>
@if($invoice->discount_amount > 0)
<tr>
<td style="color:#EC4899;">Discount ({{ $invoice->discount_rate }}%)</td>
<td class="amount" style="color:#EC4899;">- Rp {{ number_format($invoice->discount_amount, 0, ',', '.') }}</td>
</tr>
@endif
@if($invoice->tax_rate > 0)
<tr>
<td style="color:#D97706;">Tax ({{ $invoice->tax_rate }}% — paid by client)</td>