@if(!empty($for_pdf)) @endif

{{$contact->business->name}}
@if(!empty($location)) {!! $location->location_address !!} @else {!! $contact->business->business_address !!} @endif

@lang('lang_v1.to')

{{$contact->name}}
{!! $contact->contact_address !!} @if(!empty($contact->email))
@lang('business.email'): {{$contact->email}} @endif
@lang('contact.mobile'): {{$contact->mobile}} @if(!empty($contact->tax_number))
@lang('contact.tax_no'): {{$contact->tax_number}} @endif

{{__('lang_v1.statement')}}
@lang('lang_v1.date')
{{$ledger_details['start_date']}} @lang('lang_v1.to') {{$ledger_details['end_date']}}
@php $amount_due = 0; $current_due = 0; $due_1_30_days = 0; $due_30_60_days = 0; $due_60_90_days = 0; $due_over_90_days = 0; @endphp @if(!empty($for_pdf))
@endif @foreach($ledger_details['ledger'] as $data) @php if(empty($data['total_due'])) { continue; } if($data['payment_status'] != 'paid' && !empty($data['due_date'])) { if (!empty($data['transaction_type']) && $data['transaction_type'] == 'ledger_discount') { $data['total_due'] = -1 * $data['total_due']; } $amount_due += $data['total_due']; $days_diff = $data['due_date']->diffInDays(); if($days_diff == 0){ $current_due += $data['total_due']; } elseif ($days_diff > 0 && $days_diff <= 30) { $due_1_30_days += $data['total_due']; } elseif ($days_diff > 30 && $days_diff <= 60) { $due_30_60_days += $data['total_due']; } elseif ($days_diff > 60 && $days_diff <= 90) { $due_60_90_days += $data['total_due']; } elseif ($days_diff > 90) { $due_over_90_days += $data['total_due']; } } @endphp iteration % 2 == 0) class="odd" @endif style="border:hidden;"> @endforeach @if(count($ledger_details['ledger']) < 5) @endif
@lang('lang_v1.date') @lang('lang_v1.transaction') @lang('sale.amount') @lang('lang_v1.balance')
{{@format_datetime($data['date'])}} @if($loop->index == 0) {{$data['type']}} @endif {{$data['ref_no']}} @if(!empty($data['due_date']) && $data['payment_status'] != 'paid')
@lang('lang_v1.due') {{@format_date($data['due_date'])}} @endif
@format_currency($data['final_total']) @format_currency($data['total_due'])
 
 
 
 
 
 
 
@lang('lang_v1.current') {{strtoupper(__('lang_v1.1_30_days_past_due'))}} {{strtoupper(__('lang_v1.30_60_days_past_due'))}} {{strtoupper(__('lang_v1.60_90_days_past_due'))}} {{strtoupper(__('lang_v1.over_90_days_past_due'))}} {{strtoupper(__('lang_v1.amount_due'))}}
@format_currency($current_due) @format_currency($due_1_30_days) @format_currency($due_30_60_days) @format_currency($due_60_90_days) @format_currency($due_over_90_days) @format_currency($amount_due)