Customer: @if($productSale->customer_type === 'student' && $productSale->student) {{ $productSale->student->student_name_english }} ({{ $productSale->student->admission_roll }}) @else {{ $productSale->customer_name ?? 'Walk-in Customer' }} @endif
Customer Type: {{ ucfirst($productSale->customer_type) }}
Sale Date: {{ optional($productSale->sale_date)->format('d M Y') }}
Sold By: {{ $productSale->soldBy->name ?? 'N/A' }}
@if($productSale->completed_at)Completed At: {{ $productSale->completed_at->format('d M Y H:i') }}
@endifSale Items
| # | Product | Quantity | Unit Price | Total |
|---|---|---|---|---|
| {{ $loop->iteration }} | {{ $item->product->name ?? 'N/A' }} | {{ $item->quantity }} | ৳{{ number_format($item->unit_price, 2) }} | ৳{{ number_format($item->total_price, 2) }} |
| Total Amount: | ৳{{ number_format($productSale->total_amount, 2) }} | |||
| Cost: | ৳{{ number_format($productSale->total_cost, 2) }} | |||
| Profit: | ৳{{ number_format($productSale->profit_amount, 2) }} | |||
Accounting Entries
@if(!$productSale->revenueEntry && !$productSale->cogsEntry)Revenue Entry
Entry No: {{ $productSale->revenueEntry->entry_no }}
Date: {{ $productSale->revenueEntry->entry_date->format('d M Y') }}
| Account | Debit | Credit |
|---|---|---|
| {{ $line->account->name ?? 'N/A' }} | {{ $line->debit > 0 ? '৳'.number_format($line->debit, 2) : '-' }} | {{ $line->credit > 0 ? '৳'.number_format($line->credit, 2) : '-' }} |
COGS Entry
Entry No: {{ $productSale->cogsEntry->entry_no }}
Date: {{ $productSale->cogsEntry->entry_date->format('d M Y') }}
| Account | Debit | Credit |
|---|---|---|
| {{ $line->account->name ?? 'N/A' }} | {{ $line->debit > 0 ? '৳'.number_format($line->debit, 2) : '-' }} | {{ $line->credit > 0 ? '৳'.number_format($line->credit, 2) : '-' }} |
Total Items: {{ $productSale->items->count() }}
Total Quantity: {{ $productSale->items->sum('quantity') }}
Revenue: ৳{{ number_format($productSale->total_amount, 2) }}
Cost: ৳{{ number_format($productSale->total_cost, 2) }}
Profit: ৳{{ number_format($productSale->profit_amount, 2) }}
@if($productSale->total_amount > 0)Profit Margin: {{ number_format(($productSale->profit_amount / $productSale->total_amount) * 100, 2) }}%
@endif