@extends('master.app') @section('title', 'Customer Invoice') @section('pageCSS') @endsection @section('body')
{{-- Header --}}
Invoice #{{ $bill->invoice_number }}

Invoice Summary

{{ $bill->invoice_date ?? $bill->date ?? '' }} • {{ $bill->customer->name ?? '-' }}
@include('general.valert') {{-- Summary Grid --}}
{{-- Left --}}
Details
{{ $bill->currency->title_en ?? $bill->currency->title ?? '' }}
Customer Name
{{ $bill->customer->name ?? '-' }}
Customer Phone
{{ $bill->customer->phone ?? '-' }}
Customer Address
{{ $bill->customer->address ?? '-' }}
Invoice Number
{{ $bill->invoice_number ?? '-' }}
Received By
{{ $bill->received_by ?? '-' }}
Payment Type
@if ($bill->transaction_id == 1) By Cash @elseif ($bill->transaction_id == 2) By Bank @elseif ($bill->transaction_id == 3) By Sarafi @else Other @endif
{{-- Right --}}
Statement
@php $cur = $bill->currency->title_en ?? $bill->currency->title ?? ''; $grand = (float)($bill->grand_total ?? 0); $disc = (float)($bill->discount ?? 0); $final = (float)($bill->final_amount ?? ($grand - $disc)); $recv = (float)($bill->received ?? 0); $bal = max($final - $recv, 0); @endphp
Grand Total {{ $cur }} {{ number_format($grand, 2) }}
Discount {{ $cur }} {{ number_format($disc, 2) }}
Total {{ $cur }} {{ number_format($final, 2) }}
Received {{ $cur }} {{ number_format($recv, 2) }}
Balance {{ $cur }} {{ number_format($bal, 2) }}
Totals are calculated safely (Balance never negative).
{{-- Items --}}
Items
{{ $bill_items->count() }} items
@if($bill->type_id==1) @endif @forelse ($bill_items as $row) @if($bill->type_id==1) @endif @empty @endforelse
# CatSub/Cat WeightUnit QTY Price Total
{{ $loop->iteration }} {{ $row->category->title_en ?? $row->category->title_ps ?? '-' }}{{ $row->sub_category->title_en ?? $row->sub_category->title_ps ?? '-' }} {{ $row->weight->title_en ?? $row->weight->title_ps ?? '-' }}{{ $row->unit->title_en ?? $row->unit->title_ps ?? '-' }} {{ $row->qty ?? 0 }} {{ $cur }} {{ number_format((float)($row->sale_price ?? 0), 2) }} {{ $cur }} {{ number_format((float)($row->total ?? 0), 2) }}
No items found
@include('sale.bills.bill-modal') @endsection @section('pageJs') @endsection