@extends('layout.app') @section('title', 'Bill Details') @section('page-title', 'Bill #' . $bill->bill_number) @section('content')
Bill #{{ $bill->bill_number }}
{{ $bill->date_time }}
Shopkeeper Information

{{ $bill->Shopkeeper->name ?? 'N/A' }}

{{ $bill->shop_name_snapshot ?? 'N/A' }}

Bill Summary

Total Items: {{ $bill->BillItems->count() }}

Total Amount: Rs. {{ number_format($bill->total_amount, 2) }}

Items
@forelse($bill->BillItems as $item) @empty @endforelse
Sr# Item Code Item Name Description Location Unit Per Carton Qty Pieces Qty Cartons Total Qty Price/Unit Total Price
{{ $loop->iteration }} {{ $item->Item->item_code ?? 'N/A' }} {{ $item->Item->name ?? 'N/A' }} {{ $item->Item->description ?? 'N/A' }} {{ $item->Item->location ?? 'N/A' }} {{ $item->Item->unit->name ?? 'N/A' }} {{ $item->pieces_per_carton ?? 0 }} {{ $item->quantity_pieces ?? 0 }} {{ $item->quantity_cartons ?? 0 }} {{ number_format($item->quantity_total, 2) }} Rs. {{ number_format($item->price_at_sale, 2) }} Rs. {{ number_format($item->price_total, 2) }}
No items found in this bill
Total Cartons: {{ $bill->BillItems->sum('quantity_cartons') }}
Total Quantity: {{ number_format($bill->BillItems->sum(function ($item) {return $item->quantity_pieces + $item->quantity_cartons * $item->pieces_per_carton;}),2) }}
Net Amount: Rs. {{ number_format($bill->net_amount, 2) }}
@if ($bill->discount_percent > 0)
Discount ({{ $bill->discount_percent }}%): - Rs. {{ number_format($bill->discount_amount, 2) }}
@elseif($bill->discount_amount > 0)
Discount Amount: - Rs. {{ number_format($bill->discount_amount, 2) }}
@endif
Cash Received: - Rs. {{ number_format($bill->cash_received, 2) }}
@if ($bill->prev_balance > 0)
Previous Balance: + Rs. {{ number_format($bill->prev_balance, 2) }}
@else
@endif
Total Amount (Due): Rs. {{ number_format($bill->total_amount, 2) }}
@endsection