feat(frontend): add VAT breakdown, print receipt, and VAT indicators
Add print receipt feature to UserBookingModal with full VAT breakdown. Fix VAT rate display (remove double *100). Show VAT breakdown (net + VAT) on booking confirmed page. Add VAT info to EditBookingModal. Show incl. VAT label on BookingFlow total, schedule, and today dashboard. Add VAT note to prices page. Show booking total amount on account page. Improve VAT enable toast in BusinessSettings. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -645,7 +645,7 @@
|
||||
<div class="mt-2 text-xs text-gray-600">
|
||||
<div>Net: £{payment.net_amount?.toFixed(2) || '0.00'}</div>
|
||||
<div>
|
||||
VAT ({(payment.vat_rate || 0) * 100}%): £{payment.vat_amount?.toFixed(
|
||||
VAT ({payment.vat_rate || 0}%): £{payment.vat_amount?.toFixed(
|
||||
2
|
||||
) || '0.00'}
|
||||
</div>
|
||||
|
||||
@@ -230,8 +230,14 @@
|
||||
});
|
||||
|
||||
if (res.ok) {
|
||||
settings = await res.json();
|
||||
toast.success('Business settings updated');
|
||||
const wasVatEnabled = settings?.is_vat_registered;
|
||||
const updated = await res.json() as BusinessSettings;
|
||||
settings = updated;
|
||||
if (!wasVatEnabled && updated.is_vat_registered) {
|
||||
toast.success('VAT enabled — past payments and till sales updated retroactively');
|
||||
} else {
|
||||
toast.success('Business settings updated');
|
||||
}
|
||||
showEditModal = false;
|
||||
} else {
|
||||
const errText = await res.text();
|
||||
|
||||
@@ -583,6 +583,14 @@
|
||||
<span class="mx-1">|</span>
|
||||
<span class="text-gray-500">Inv: {payment.invoice_number}</span>
|
||||
{/if}
|
||||
{#if payment.is_vat_applicable && payment.net_amount != null}
|
||||
<span class="mx-1">|</span>
|
||||
<span class="text-gray-500">Net: £{payment.net_amount.toFixed(2)}</span>
|
||||
<span class="mx-1">|</span>
|
||||
<span class="text-gray-500">
|
||||
VAT ({payment.vat_rate || 0}%): £{payment.vat_amount?.toFixed(2)}
|
||||
</span>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="mt-1 text-xs text-gray-400">
|
||||
{new SvelteDate(payment.created_at).toLocaleDateString('en-GB', {
|
||||
|
||||
Reference in New Issue
Block a user