@if (isset($settings['icon']) && is_file('storage/settings/' . $settings['icon'])) @endif {{ $settings['website_name'] ?? '' }}

{{ $settings['address'] ?? '' }}

{{ $settings['number_1'] ?? '' }}, {{ $settings['number_2'] ?? '' }}

INVOICE # {{ $inv?->pos_id }}

Date Issues: {{ \Carbon\Carbon::parse($inv?->date)->format('d M, Y') }}
Date Due: {{ \Carbon\Carbon::parse($inv?->deudate)->format('d M, Y') }}

Invoice To:

{{ $inv?->cust?->name }}

{{--

Shelby Company Limited

--}} {{--

Small Heath, B10 0HF, UK

--}}

{{ $inv?->cust?->phone }}

{{--

peakyFBlinders@gmail.com

--}}
@php $total = 0; @endphp @foreach ($inv->pos_products as $pr_item) @if($pr_item->product->id == 0) @else @endif @php $total += $pr_item?->quantity * $pr_item?->price; @endphp @endforeach
Item Qty Price
from Customer Opening Balance{{ $pr_item->product->name }}{{ $pr_item?->quantity . ' ' . $pr_item?->measurement?->name }} $ {{ number_format($pr_item?->quantity * $pr_item?->price, 2) }}

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