@extends('layouts.app') @section('content')
| # | Bill ID | Bill Amount | Cash | Card | Status | User | Customer | Sale Time | |
|---|---|---|---|---|---|---|---|---|---|
| {{ $row_count }} |
@php
$returnCount = $invoice->returns->count();
$returnTotal = $invoice->returns->reduce(function($carry, $ret){
return $carry + ((float) ($ret->qty ?? 0) * (float) ($ret->price ?? 0));
}, 0);
@endphp
|
{{ $invoice->invoice_number }} {{ $invoice->location->name ?? 'N/A' }} @if($returnCount > 0) Return: -{{ number_format($returnTotal,2) }}
@endif
|
{{ number_format($net_amount, 2) }} | {{ number_format(min($net_amount, $pay_cash), 2) }} | {{ number_format(min($net_amount - min($net_amount, $pay_cash), $pay_card), 2) }} | @php $showTransition = ($applied_later > 0.0001) && (isset($previous_status)) && ($previous_status !== $status); @endphp @if($showTransition) {{ ucfirst($previous_status) }} » @endif @if($status == 'paid') Paid @elseif($status == 'partial') Partial @elseif($status == 'due') Due @endif @if($returnCount > 0) @endif | {{ $invoice->user->name ?? 'N/A' }} | @if($invoice->customer) {{ $invoice->customer->name }} @elseif(empty($invoice->customer_id)) Walk-in Customer @else Unknown @endif | {{ $invoice->posted_at ? $invoice->posted_at->format('Y-m-d h:i A') : 'N/A' }} |
| Total Amount | {{ number_format($total_amount, 2) }} | - | - | {{ number_format($total_credit, 2) }} | |||||