@php /** * ONE BILLING RECORD FOR THE WHOLE RELATIONSHIP. * * A restaurant owner does not think about which table a charge landed in — they think "what have I * paid this platform". Plan terms and sponsored placements are both money paid to the platform, they * are numbered from one invoice sequence, and they now read as one list. What each row IS stays * visible in its own column, so the two are never confused for one another. * * The campaigns themselves are untouched by this: a placement is still listed, managed and measured * on the sponsored ads page. It is the BILL that lives here. * * @var array $history rows from Invoice::historyForRestaurant() * @var array $pager */ $history = $history ?? []; // One venue needs no column; two or more cannot be read without one. $multiBranch = count(array_unique(array_column($history, 'branch'))) > 1; $cols = $multiBranch ? 7 : 6; @endphp
| {{ t_raw('common.date') }} | @php /* WHICH VENUE THE CHARGE WAS FOR. The record covers every branch this owner runs, and a plan term looks identical from one branch to the next, so without this column the list cannot be read. Rendered only where there is more than one venue: a single-restaurant owner would be told the same name on every line. */ @endphp @if ($multiBranch){{ t_raw('vendor.branches.col_branch') }} | @endif{{ t_raw('vendor.billing.col_charged_for') }} | {{ t_raw('common.period') }} | {{ t_raw('common.amount') }} | {{ t_raw('vendor.billing.col_method') }} | {{ t_raw('common.actions') }} |
|---|---|---|---|---|---|---|
| {!! fmt_day($row['date']) !!} | @if ($multiBranch){{ (string) ($row['branch'] ?? '') }} | @endif@php /* What was bought, and which kind of thing it was. A plan keeps its own tag; a placement says so in words, because the two are charged on different terms and a reader must never have to guess. */ @endphp @if ($row['kind'] === 'plan') {!! $row['title'] !== '' ? plan_tag((string) $row['slug'], (string) $row['title']) : dash() !!} @else {{ t_raw('vendor.billing.kind_placement') }} {{ $row['title'] }} @endif | @if (!empty($row['starts_at'])) {!! fmt_day($row['starts_at']) !!} – {!! !empty($row['ends_at']) ? fmt_day($row['ends_at']) : t('vendor.billing.never_lifetime') !!} @else {!! dash() !!} @endif | {{ money($row['amount']) }} | @php $m = (string) $row['method']; $ico = $m !== '' ? payment_method_icon($m) : ''; echo $ico !== '' ? $ico : ($m !== '' ? status_label('payment_method', $m) : dash()); @endphp | @php /* The invoice is offered where one exists. A term paid before invoice numbering has none, and the charge is still shown — the payment is the record, the document is only its receipt. */ @endphp @partial('row-actions', ['inline' => 1, 'actions' => [ $row['invoice_no'] !== null ? [ 'label' => t_raw('vendor.billing.view_invoice'), 'icon' => 'fa-file-invoice', 'href' => (string) $row['href'], 'primary' => true, ] : null, ]]) |