feat: add legacy PDF generation support and invoice discount fields
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
<a href="{{ route('invoices.pdf', $invoice) }}" target="_blank"
|
||||
class="btn-sakura text-sm px-4 py-2.5 rounded-full border border-pink-200 text-pink-500 hover:bg-pink-50">📥
|
||||
Download PDF</a>
|
||||
<a href="{{ route('invoices.pdf-legacy', $invoice) }}" target="_blank"
|
||||
class="btn-sakura text-sm px-4 py-2.5 rounded-full border border-gray-200 text-gray-500 hover:bg-gray-50">📥
|
||||
PDF (Legacy)</a>
|
||||
<form action="{{ route('invoices.destroy', $invoice) }}" method="POST"
|
||||
onsubmit="return confirm('Delete this invoice?')">
|
||||
@csrf @method('DELETE')
|
||||
@@ -104,6 +107,10 @@
|
||||
<span
|
||||
class="ml-1.5 text-xs bg-gray-100 text-gray-500 px-2 py-0.5 rounded-full font-medium">Non-Taxable</span>
|
||||
@endif
|
||||
@if($invoice->discount_rate > 0 && !$item->is_discountable)
|
||||
<span
|
||||
class="ml-1.5 text-xs bg-pink-50 text-pink-500 px-2 py-0.5 rounded-full font-medium">No Discount</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="py-3 px-4 text-sm text-right text-gray-600">Rp
|
||||
{{ number_format($item->unit_price, 0, ',', '.') }}</td>
|
||||
@@ -120,8 +127,14 @@
|
||||
<div class="w-72 space-y-2 text-sm">
|
||||
<div class="flex justify-between text-gray-500">
|
||||
<span>Subtotal</span><span class="font-medium">Rp
|
||||
{{ number_format($invoice->subtotal, 0, ',', '.') }}</span>
|
||||
{{ number_format($invoice->subtotal + $invoice->discount_amount, 0, ',', '.') }}</span>
|
||||
</div>
|
||||
@if($invoice->discount_amount > 0)
|
||||
<div class="flex justify-between text-pink-500">
|
||||
<span>Discount ({{ $invoice->discount_rate }}%)</span>
|
||||
<span class="font-medium">- Rp {{ number_format($invoice->discount_amount, 0, ',', '.') }}</span>
|
||||
</div>
|
||||
@endif
|
||||
@if($invoice->tax_rate > 0)
|
||||
<div class="flex justify-between text-amber-600">
|
||||
<span>Tax ({{ $invoice->tax_rate }}% — paid by client)</span>
|
||||
|
||||
Reference in New Issue
Block a user