{{-- Print Header --}}
{{ __('Bill To') }} : {{ $sale->party->name ?? 'Guest' }}
{{ __('Mobile') }} : {{ $sale->party->phone ?? 'Guest' }}
{{ __('Address') }} : {{ $sale->party->address ?? '' }}
@if (!empty($sale->business->vat_name)) @endif
{{ __('Sells By') }} : {{ $sale->user->role != 'staff' ? 'Admin' : $sale->user->name }}
{{ __('Invoice') }} : {{ $sale->invoiceNumber ?? '' }}
{{ __('Date') }} : {{ formatted_date($sale->saleDate ?? '') }}
{{ $sale->business->vat_name ?? '' }} : {{ $sale->business->vat_no ?? '' }}
@if (!$sale_returns->isEmpty()) {{-- Sales --}}
@php $subtotal = 0; @endphp @foreach ($sale->details as $detail) @php $productTotal = ($detail->price ?? 0) * ($detail->quantities ?? 0); $subtotal += $productTotal; @endphp @endforeach
{{ __('SL') }} {{ __('Item') }} {{ __('Quantity') }} {{ __('Unit Price') }} {{ __('Total Price') }}
{{ $loop->iteration }} {{ ($detail->product->productName ?? '') . (!empty($detail->stock->batch_no) ? ' (' . $detail->stock->batch_no . ')' : '') }} {{ $detail->quantities ?? '' }} {{ currency_format($detail->price ?? 0, currency: business_currency()) }} {{ currency_format($productTotal, currency: business_currency()) }}
{{ __('Subtotal') }} : {{ currency_format($subtotal, currency: business_currency()) }}
{{ __('Vat') }} : {{ currency_format($sale->vat_amount, currency: business_currency()) }}
{{ __('Shipping Charge') }} : {{ currency_format($sale->shipping_charge, currency: business_currency()) }}
{{ __('Discount') }} @if ($sale->discount_type == 'percent') ({{ $sale->discount_percent }}%) @endif : {{ currency_format($sale->discountAmount + $total_discount, currency: business_currency()) }}
{{ __('Total Amount') }} : {{ currency_format($subtotal + $sale->vat_amount - ($sale->discountAmount + $total_discount) + $sale->shipping_charge + $sale->rounding_amount, currency: business_currency()) }}
{{ __('Rounding(+/-)') }} : {{ currency_format(abs($sale->rounding_amount), currency: business_currency()) }}
{{ __('Total Payable') }} : {{ currency_format($subtotal + $sale->vat_amount - ($sale->discountAmount + $total_discount) + $sale->shipping_charge, currency: business_currency()) }}
{{-- Sale Return --}}
@php $total_return_amount = 0; @endphp @foreach ($sale_returns as $key => $return) @foreach ($return->details as $detail) @php $total_return_amount += $detail->return_amount ?? 0; @endphp @endforeach @endforeach
{{ __('SL') }} {{ __('Date') }} {{ __('Returned Item') }} {{ __('Quantity') }} {{ __('Total Amount') }}
{{ $loop->iteration }} {{ formatted_date($return->return_date) }} {{ $detail->saleDetail->product->productName ?? '' }} {{ $detail->saleDetail?->stock?->batch_no ? '(' . $detail->saleDetail?->stock?->batch_no . ')' : '' }} {{ $detail->return_qty ?? 0 }} {{ currency_format($detail->return_amount ?? 0, currency: business_currency()) }}

{{ amountInWords($total_return_amount) }}

@if(!empty($sale->meta['note'])) @endif
{{ __('Total Return Amount') }} : {{ currency_format($total_return_amount, currency: business_currency()) }}
{{ __('Payable Amount') }} : {{ currency_format($sale->totalAmount, currency: business_currency()) }}
{{ __('Paid Amount') }} : {{ currency_format($sale->paidAmount, currency: business_currency()) }}
{{ __('Due') }} : {{ currency_format($sale->dueAmount, currency: business_currency()) }}
@else {{-- Sales --}}
@php $subtotal = 0; @endphp @foreach ($sale->details as $detail) @php $productTotal = ($detail->price ?? 0) * ($detail->quantities ?? 0); $subtotal += $productTotal; @endphp @endforeach
{{ __('SL') }} {{ __('Item') }} {{ __('Quantity') }} {{ __('Unit Price') }} {{ __('Total Price') }}
{{ $loop->iteration }} {{ ($detail->product->productName ?? '') . (!empty($detail->stock?->batch_no) ? ' (' . $detail->stock?->batch_no . ')' : '') }} {{ $detail->quantities ?? '' }} {{ currency_format($detail->price ?? 0, currency: business_currency()) }} {{ currency_format($productTotal, currency: business_currency()) }}

{{ amountInWords($subtotal) }}

@if(!empty($sale->meta['note'])) @endif
@if($sale->change_amount > 0) @else @endif
{{ __('Subtotal') }} : {{ currency_format($subtotal, currency: business_currency()) }}
{{ __('Vat') }} : {{ currency_format($sale->vat_amount, currency: business_currency()) }}
{{ __('Shipping Charge') }} : {{ currency_format($sale->shipping_charge, currency: business_currency()) }}
{{ __('Discount') }} @if ($sale->discount_type == 'percent') ({{ $sale->discount_percent }}%) @endif : {{ currency_format($sale->discountAmount, currency: business_currency()) }}
{{ __('Total Amount') }} : {{ currency_format($sale->actual_total_amount, currency: business_currency()) }}
{{ __('Rounding(+/-)') }} : {{ currency_format(abs($sale->rounding_amount), currency: business_currency()) }}
{{ __('Payable Amount') }} : {{ currency_format($sale->totalAmount, currency: business_currency()) }}
{{ __('Receive Amount') }} : {{ currency_format($sale->paidAmount + $sale->change_amount, currency: business_currency()) }}
{{ __('Change Amount') }} : {{ currency_format($sale->change_amount, currency: business_currency()) }}
{{ __('Due') }} : {{ currency_format($sale->dueAmount, currency: business_currency()) }}
@endif