@foreach ($accountingVouchers as $accountingVoucher)

{{ $company->name }}

No:{{ $accountingVoucher->voucher_number }}

Invoice Date:{{ \Carbon\Carbon::parse($accountingVoucher->voucher_date)->format('d-M-Y') }}

Staff:{{ $accountingVoucher->user?->name ?: '' }}

{{$accountingVoucher->debitLedger->name}}

Address{{ $accountingVoucher->debitLedger->address }}

Mobile:{{ $accountingVoucher->debitLedger->mobile_no }}

@foreach ($accountingVoucher->items as $accountingVoucherItem) @endforeach @if($accountingVoucher->freight != 0) @endif @if( $accountingVoucher->discount != 0) @else @endif @php if($accountingVoucher->previousBalanceDrCr == 'Dr'){ $nettotal = $accountingVoucher->previousBalance + $accountingVoucher->amount; } else if($accountingVoucher->previousBalanceDrCr == 'Cr') { if($accountingVoucher->previousBalance > $accountingVoucher->amount) { $nettotal = $accountingVoucher->previousBalance - $accountingVoucher->amount; } else{ $nettotal = $accountingVoucher->amount - $accountingVoucher->previousBalance; } } else{ $nettotal = $accountingVoucher->previousBalance + $accountingVoucher->amount; } @endphp
Item qty price total
{{ $accountingVoucherItem->stockItem->name }} {{ $accountingVoucherItem->quantity }} {{ (round($accountingVoucherItem->price_inc_tax) - $accountingVoucherItem->price_inc_tax) > 0 ? number_format( $accountingVoucherItem->price_inc_tax,2) : round($accountingVoucherItem->price_inc_tax) }} {{ (round($accountingVoucherItem->total) - $accountingVoucherItem->total) > 0 ? round( $accountingVoucherItem->total):round($accountingVoucherItem->total)}}
Total {{ round($accountingVoucher->items()->sum('total'))}}
Freight {{ $accountingVoucher->freight}}
@if($accountingVoucher->previousBalanceDrCr == 'Dr') Old Balance: @else Advance: @endif{{ $accountingVoucher->previousBalance }} {{ $accountingVoucher->previousBalanceDrCr }}Discount {{ round($accountingVoucher->discount)}}
Net Amount:{{ $nettotal}} Grand Total {{(round($accountingVoucher->amount) - $accountingVoucher->amount ) > 0 ? number_format( $accountingVoucher->amount,2) : round($accountingVoucher->amount) }}
@if($accountingVouchers->last() != $accountingVoucher)
@endif @endforeach