Files
ladill-woo-manager/resources/views/invoices/templates/_body.blade.php
T
isaaccladandCursor ffe0b9d877
Deploy Ladill Woo Manager / deploy (push) Failing after 2s
Scaffold Ladill Woo Manager for WooCommerce order fulfillment.
Standalone app with SSO shell, WordPress plugin connect flow, webhook ingest,
fulfillment inbox, and plugin activation API — no payment processing.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 22:39:38 +00:00

96 lines
4.8 KiB
PHP

@php
$company = $invoice->company_snapshot ?? [];
$logoUrl = $invoice->logoPath() ? route('woo.public.logo', $invoice->public_token) : null;
$fmt = fn (int $minor) => invoice_money($minor, $invoice->currency);
@endphp
<table class="w-full text-sm">
<thead>
<tr class="border-b border-slate-200 text-left text-xs uppercase tracking-wide text-slate-500">
<th class="py-2 pr-4">Description</th>
<th class="py-2 px-4 text-right">Qty</th>
<th class="py-2 px-4 text-right">Unit</th>
<th class="py-2 pl-4 text-right">Amount</th>
</tr>
</thead>
<tbody class="divide-y divide-slate-100">
@foreach($invoice->lines as $line)
<tr>
<td class="py-3 pr-4 text-slate-800">{{ $line->description }}</td>
<td class="py-3 px-4 text-right text-slate-600">{{ number_format($line->quantity, 2) }}</td>
<td class="py-3 px-4 text-right text-slate-600">{{ $fmt((int) $line->unit_price_minor) }}</td>
<td class="py-3 pl-4 text-right font-medium text-slate-900">{{ $fmt((int) $line->line_total_minor) }}</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-6 flex justify-end">
<dl class="w-full max-w-xs space-y-2 text-sm">
<div class="flex justify-between text-slate-600">
<dt>{{ $invoice->vat_enabled ? 'Taxable value' : 'Subtotal' }}</dt>
<dd>{{ $fmt((int) $invoice->subtotal_minor) }}</dd>
</div>
@if($invoice->vat_enabled && (int) $invoice->tax_minor > 0)
@foreach($invoice->vatBreakdown() as $label => $amount)
<div class="flex justify-between text-slate-500">
<dt>{{ $label }}</dt>
<dd>{{ $fmt((int) $amount) }}</dd>
</div>
@endforeach
<div class="flex justify-between border-t border-slate-100 pt-2 text-slate-600">
<dt>Total tax (20%)</dt>
<dd>{{ $fmt((int) $invoice->tax_minor) }}</dd>
</div>
@elseif((int) $invoice->tax_minor > 0)
<div class="flex justify-between text-slate-600">
<dt>Tax ({{ number_format((float) $invoice->tax_rate, 2) }}%)</dt>
<dd>{{ $fmt((int) $invoice->tax_minor) }}</dd>
</div>
@endif
<div class="flex justify-between border-t border-slate-200 pt-2 text-base font-semibold text-slate-900">
<dt>{{ $invoice->vat_enabled && $invoice->vat_inclusive ? 'Total (tax incl.)' : 'Total' }}</dt>
<dd>{{ $fmt((int) $invoice->total_minor) }}</dd>
</div>
</dl>
</div>
@if($invoice->notes)
<div class="mt-6 rounded-xl bg-slate-50 p-4 text-sm text-slate-600">
<p class="font-medium text-slate-800">Notes</p>
<p class="mt-1 whitespace-pre-line">{{ $invoice->notes }}</p>
</div>
@endif
@if(!empty($showPay) && $invoice->isPayable())
@php $balanceMinor = $invoice->balanceMinor(); $balanceMajor = number_format($balanceMinor / 100, 2, '.', ''); @endphp
<form method="POST" action="{{ route('woo.public.pay', $invoice->public_token) }}" class="mt-8 space-y-3">
@csrf
@if($invoice->amountPaidMinor() > 0)
<p class="text-sm text-slate-600">Paid so far: <span class="font-medium">{{ $fmt((int) $invoice->amountPaidMinor()) }}</span> · Balance due: <span class="font-semibold text-slate-900">{{ $fmt((int) $balanceMinor) }}</span></p>
@endif
<div>
<label class="block text-sm font-medium text-slate-700">Amount to pay ({{ $invoice->currency }})</label>
<input type="number" name="amount" step="0.01" min="0.01" max="{{ $balanceMajor }}" value="{{ $balanceMajor }}"
class="mt-1 w-full max-w-xs rounded-lg border-slate-200 text-sm focus:border-indigo-500 focus:ring-indigo-500">
<p class="mt-1 text-xs text-slate-400">Pay the full balance, or enter less to make a part payment.</p>
</div>
<button type="submit" class="w-full rounded-xl bg-indigo-600 px-6 py-3 text-center text-sm font-semibold text-white hover:bg-indigo-700 sm:w-auto">
Pay now
</button>
<p class="text-xs text-slate-400">Secured by Paystack · Powered by Ladill Pay</p>
</form>
@endif
@if($invoice->status === \App\Models\Invoice::STATUS_PAID)
<div class="mt-6 inline-flex items-center gap-2 rounded-full bg-emerald-50 px-4 py-2 text-sm font-medium text-emerald-700">
<span class="h-2 w-2 rounded-full bg-emerald-500"></span>
Paid
</div>
@elseif($invoice->isPartiallyPaid())
<div class="mt-6 inline-flex items-center gap-2 rounded-full bg-amber-50 px-4 py-2 text-sm font-medium text-amber-700">
<span class="h-2 w-2 rounded-full bg-amber-500"></span>
Partially paid balance {{ $fmt((int) $invoice->balanceMinor()) }}
</div>
@endif