@extends('layouts.app') @section('title', 'Sale: '.$sale->invoice_no) @section('breadcrumb') @endsection @section('content') {{-- Stats --}}
৳{{ number_format($sale->total_amount, 2) }}
Total
৳{{ number_format($sale->paid_amount, 2) }}
Paid
৳{{ number_format($sale->due_amount, 2) }}
Due
@php $sc=['completed'=>'success','hold'=>'warning','returned'=>'danger','cancelled'=>'secondary','draft'=>'info']; @endphp
{{ ucfirst($sale->status) }}
Status
Sale Items
@foreach($sale->items as $i => $item) @endforeach @if($sale->discount > 0)@endif @if($sale->vat > 0)@endif
#Product / VariantQtyUnit PriceDiscountTotalProfitWarranty
{{ $i+1 }}
{{ $item->productVariant->product->name }}
{{ $item->productVariant->variant_name }}
@if($item->serialNumbers->count())
@foreach($item->serialNumbers as $sn) {{ $sn->serial_no }} @endforeach
@endif
{{ $item->qty }} ৳{{ number_format($item->unit_price, 2) }} {{ $item->discount > 0 ? '৳'.number_format($item->discount, 2) : '—' }} ৳{{ number_format($item->total_price, 2) }} ৳{{ number_format($item->profit, 2) }} {{ $item->warranty_months > 0 ? $item->warranty_months.'m' : '—' }}
Subtotal:৳{{ number_format($sale->subtotal, 2) }}৳{{ number_format($sale->items->sum('profit'), 2) }}
Discount:-৳{{ number_format($sale->discount, 2) }}
VAT:+৳{{ number_format($sale->vat, 2) }}
Grand Total:৳{{ number_format($sale->total_amount, 2) }}
Payment History
@if($sale->payments->isEmpty())

No payments

@else @foreach($sale->payments as $pmt) @endforeach
DateAmountMethodAccount
{{ $pmt->payment_date->format('d M Y') }} ৳{{ number_format($pmt->amount, 2) }} {{ ucfirst(str_replace('_',' ',$pmt->payment_method)) }} {{ $pmt->account->name }}
@endif
Customer
@if($sale->customer)
{{ $sale->customer->name }}
@if($sale->customer->phone)
{{ $sale->customer->phone }}
@endif @if($sale->customer->email)
{{ $sale->customer->email }}
@endif @if($sale->customer->current_due > 0)
Due: ৳{{ number_format($sale->customer->current_due, 2) }}
@endif @else Walk-in Customer @endif
@if($sale->due_amount > 0 && $sale->customer) @can_permission('payments.customer.pay')
Record Payment
@csrf
@endcan_permission @endif
@if($sale->change_amount > 0)@endif @if($sale->notes)@endif
Payment Method{{ ucfirst(str_replace('_',' ',$sale->payment_method)) }}
Sale Type{{ ucfirst($sale->sale_type) }}
Change Given৳{{ number_format($sale->change_amount, 2) }}
Notes{{ $sale->notes }}
{{-- Return Modal --}} @endsection