{{ $settings['address'] ?? '' }}
{{ $settings['number_1'] ?? '' }}, {{ $settings['number_2'] ?? '' }}
{{ $inv?->cust?->name }}
{{--Shelby Company Limited
--}} {{--Small Heath, B10 0HF, UK
--}}{{ $inv?->cust?->phone }}
{{--peakyFBlinders@gmail.com
--}}| Item | Qty | Price | |
|---|---|---|---|
| from Customer Opening Balance | @else{{ $pr_item->product->name }} | @endif{{ $pr_item?->quantity . ' ' . $pr_item?->measurement?->name }} | $ {{ number_format($pr_item?->quantity * $pr_item?->price, 2) }} | @php $total += $pr_item?->quantity * $pr_item?->price; @endphp
|
Salesperson: {{ $inv->User->name }} Thanks for your business |
@php
// payments in USD (other currency converted back), as Invoice → Pay counts them
$usd = fn ($p, $v) => $p->currency == 2 && $p->exchange_rate ? (float) $v / $p->exchange_rate : (float) $v;
$payments = $inv->pos_payment ?? collect();
$inv_discount = $payments->sum(fn ($p) => $usd($p, $p->discount) + $usd($p, $p->promotion));
$inv_paid = $payments->sum(fn ($p) => $usd($p, $p->amount));
$inv_net = $total - $inv_discount;
$inv_balance = max(0, round($inv_net - $inv_paid, 2));
@endphp
Subtotal: Discount: Total: Paid: Balance: Status: |
${{ number_format($total, 2) }} ${{ number_format($inv_discount, 2) }} ${{ number_format($inv_net, 2) }} ${{ number_format($inv_paid, 2) }} ${{ number_format($inv_balance, 2) }} @if ($inv?->status == 'Pending') {{ $inv?->status }} @elseif ($inv?->status == 'Partial') {{ $inv?->status }} @else {{ $inv?->status }} @endif |