Files
ladill-woo-manager/resources/views/invoices/pdf.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

125 lines
5.8 KiB
PHP

@php
$c = $invoice->company_snapshot ?? [];
$fmt = fn (int $minor) => invoice_money($minor, $invoice->currency);
$cityCountry = trim(($c['city'] ?? '').', '.($c['country'] ?? ''), ', ');
@endphp
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: DejaVu Sans, sans-serif; color: #1e293b; font-size: 12px; line-height: 1.5; }
.wrap { padding: 8px; }
.head { width: 100%; margin-bottom: 24px; }
.head td { vertical-align: top; }
.logo { max-height: 48px; max-width: 200px; margin-bottom: 8px; }
.company-name { font-size: 18px; font-weight: bold; color: #0f172a; }
.muted { color: #64748b; }
.doc-title { font-size: 22px; font-weight: bold; color: #4f46e5; text-transform: uppercase; letter-spacing: 1px; text-align: right; }
.doc-meta { text-align: right; margin-top: 6px; color: #475569; }
.doc-meta strong { color: #0f172a; }
.section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 4px; }
.billto { margin-bottom: 20px; }
.billto .name { font-weight: bold; color: #0f172a; font-size: 13px; }
table.items { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
table.items th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #64748b; border-bottom: 2px solid #e2e8f0; padding: 8px 6px; }
table.items th.r, table.items td.r { text-align: right; }
table.items td { padding: 8px 6px; border-bottom: 1px solid #f1f5f9; }
.totals { width: 45%; margin-left: 55%; }
.totals td { padding: 4px 6px; }
.totals td.r { text-align: right; }
.totals .grand td { border-top: 2px solid #e2e8f0; font-size: 14px; font-weight: bold; color: #0f172a; padding-top: 8px; }
.levy td { color: #64748b; font-size: 11px; }
.notes { margin-top: 24px; padding: 12px; background: #f8fafc; border-radius: 6px; color: #475569; }
.foot { margin-top: 28px; text-align: center; color: #94a3b8; font-size: 10px; }
.paid { display: inline-block; margin-top: 8px; padding: 4px 10px; background: #ecfdf5; color: #047857; border-radius: 999px; font-weight: bold; font-size: 11px; }
</style>
</head>
<body>
<div class="wrap">
<table class="head">
<tr>
<td style="width: 60%;">
@if($logoData)<img src="{{ $logoData }}" class="logo"><br>@endif
<div class="company-name">{{ $c['company_name'] ?? 'Company' }}</div>
<div class="muted">
@if(!empty($c['address_line1'])){{ $c['address_line1'] }}<br>@endif
@if(!empty($c['address_line2'])){{ $c['address_line2'] }}<br>@endif
@if($cityCountry){{ $cityCountry }}<br>@endif
@if(!empty($c['email'])){{ $c['email'] }}<br>@endif
@if(!empty($c['phone'])){{ $c['phone'] }}@endif
</div>
</td>
<td style="width: 40%;">
<div class="doc-title">Invoice</div>
<div class="doc-meta">
<strong>{{ $invoice->invoice_number }}</strong><br>
Issued: {{ $invoice->issue_date->format('M j, Y') }}<br>
@if($invoice->due_date)Due: {{ $invoice->due_date->format('M j, Y') }}@endif
@if(!empty($c['tax_id']))<br>Tax ID: {{ $c['tax_id'] }}@endif
</div>
</td>
</tr>
</table>
<div class="billto">
<div class="section-label">Bill to</div>
<div class="name">{{ $invoice->client_name }}</div>
@if($invoice->client_email)<div class="muted">{{ $invoice->client_email }}</div>@endif
@if($invoice->client_address)<div class="muted">{!! nl2br(e($invoice->client_address)) !!}</div>@endif
</div>
<table class="items">
<thead>
<tr>
<th>Description</th>
<th class="r">Qty</th>
<th class="r">Unit price</th>
<th class="r">Amount</th>
</tr>
</thead>
<tbody>
@foreach($invoice->lines as $line)
<tr>
<td>{{ $line->description }}</td>
<td class="r">{{ rtrim(rtrim(number_format($line->quantity, 2), '0'), '.') }}</td>
<td class="r">{{ $fmt((int) $line->unit_price_minor) }}</td>
<td class="r">{{ $fmt((int) $line->line_total_minor) }}</td>
</tr>
@endforeach
</tbody>
</table>
<table class="totals">
<tr>
<td>{{ $invoice->vat_enabled ? 'Taxable value' : 'Subtotal' }}</td>
<td class="r">{{ $fmt((int) $invoice->subtotal_minor) }}</td>
</tr>
@if($invoice->vat_enabled && (int) $invoice->tax_minor > 0)
@foreach($invoice->vatBreakdown() as $label => $amount)
<tr class="levy"><td>{{ $label }}</td><td class="r">{{ $fmt((int) $amount) }}</td></tr>
@endforeach
<tr><td>Total tax (20%)</td><td class="r">{{ $fmt((int) $invoice->tax_minor) }}</td></tr>
@elseif((int) $invoice->tax_minor > 0)
<tr><td>Tax</td><td class="r">{{ $fmt((int) $invoice->tax_minor) }}</td></tr>
@endif
<tr class="grand"><td>Total</td><td class="r">{{ $fmt((int) $invoice->total_minor) }}</td></tr>
</table>
@if($invoice->status === \App\Models\Invoice::STATUS_PAID)
<div class="paid">PAID</div>
@endif
@if($invoice->notes)
<div class="notes">
<strong>Notes</strong><br>
{!! nl2br(e($invoice->notes)) !!}
</div>
@endif
<div class="foot">{{ $invoice->invoice_number }} · Powered by Ladill Woo Manager</div>
</div>
</body>
</html>