@php $formatMoney = function ($amount, $symbol = '$') { return $symbol . number_format((float) $amount, 2); }; $pagesToShow = []; if ($totalPages <= 5) { for ($i = 1; $i <= $totalPages; $i++) { $pagesToShow[] = $i; } } elseif ($currentPage <= 3) { $pagesToShow = [1, 2, 3, 4, 5]; } elseif ($currentPage >= $totalPages - 2) { for ($i = $totalPages - 4; $i <= $totalPages; $i++) { $pagesToShow[] = $i; } } else { for ($i = $currentPage - 2; $i <= $currentPage + 2; $i++) { $pagesToShow[] = $i; } } $formGrandTotal = (float) collect($lineItems)->sum(fn ($item) => (float) ($item['line_total'] ?? 0)); @endphp
{{ __('purchases.manage_your_purchase_orders_suppliers_and_inventory') }}
| # | {{ __('purchases.po_number') }} | {{ __('common.supplier') }} | {{ __('common.date') }} | {{ __('common.item') }} | {{ __('common.unit') }} | {{ __('purchases.qty') }} | {{ __('common.price') }} | {{ __('purchases.discount') }} | {{ __('purchases.tax') }} | {{ __('purchases.transport') }} | {{ __('common.other') }} | {{ __('purchases.line_total') }} | {{ __('purchases.grand_total') }} | {{ __('common.paid') }} | {{ __('purchases.due') }} | {{ __('common.status') }} | {{ __('common.actions') }} |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{ $serial }} | {{ $purchase->purchase_no }} | {{ $purchase->supplier_name ?: '—' }} | {{ $purchaseDate }} | {{ __('common.no_records') }} | {{ number_format((float) $purchase->grand_total, 2) }} | {{ number_format((float) $purchase->paid_amount, 2) }} | {{ number_format((float) $purchase->due_amount, 2) }} | {{ $statusLabel }} | |||||||||
| {{ $itemIdx === 0 ? $serial : '' }} | {{ $itemIdx === 0 ? $purchase->purchase_no : '' }} | {{ $itemIdx === 0 ? ($purchase->supplier_name ?: '—') : '' }} | {{ $itemIdx === 0 ? $purchaseDate : '' }} | {{ $item->item_name ?: 'Item' }} | {{ $item->unit_name ?: '—' }} | {{ number_format((float) $item->quantity, 3) }} | {{ number_format((float) $item->unit_price, 2) }} | {{ number_format((float) $item->discount, 2) }} | {{ number_format((float) $item->tax, 2) }} | {{ number_format((float) $item->transport_cost, 2) }} | {{ number_format((float) $item->other_cost, 2) }} | {{ number_format((float) $item->line_total, 2) }} | {{ $itemIdx === 0 ? number_format((float) $purchase->grand_total, 2) : '' }} | {{ $itemIdx === 0 ? number_format((float) $purchase->paid_amount, 2) : '' }} | {{ $itemIdx === 0 ? number_format((float) $purchase->due_amount, 2) : '' }} | @if ($itemIdx === 0) {{ $statusLabel }} @endif | @if ($itemIdx === 0) @endif |
| {{ __('common.no_records') }} | |||||||||||||||||