AR Aging List

Report Period: {{$periode}} | Printed on: {{date('l, F d Y')}}
@php $view = isset($_GET['view']) ? $_GET['view'] : ''; //Untuk with previous balance dengan detail $detail = isset($_GET['detail']) ? $_GET['detail'] : ''; @endphp @if(!$view || $detail == '0') @if($detail == '0') @else @endif @else @if($view == 'withpreviousbalance') @else @endif @endif @php $no = 1; if(!$view || $detail == '0'){ $grand_prev_balance = 0; $grand_debit = 0; $grand_credit = 0; $grand_outstanding = 0; } else{ $grand_prev_balance = 0; $grand_debit = 0; $grand_credit = 0; $grand_ending_balance = 0; } $grand_days30 = 0; $grand_days60 = 0; $grand_days90 = 0; $grand_over = 0; @endphp @if(count($aging_lists) > 0) @if(!$view || $detail == '0') @foreach($aging_lists as $header => $details) @php $no = 1; //Jika Dari AR Aging With Detail Summary if($detail == '0'){ $total_prev_balance = 0; $total_debit = 0; $total_credit = 0; } $total_outstanding = 0; $total_days30 = 0; $total_days60 = 0; $total_days90 = 0; $total_over90days = 0; @endphp @foreach($details as $key => $aging_list) @php //Menghitung Breakdown Dari AR Aging Detail if($detail == '0'){ //Jika Dari AR Aging with Previous Balance $prev_balance = array_sum($aging_list['prev_balance']); $debit = array_sum($aging_list['debit']); $credit = array_sum($aging_list['credit']); } $outstanding = array_sum($aging_list['outstanding']); $days30 = array_sum($aging_list['30days']); $days60 = array_sum($aging_list['60days']); $days90 = array_sum($aging_list['90days']); $over90days = array_sum($aging_list['over90days']); //Menghitung Total Dari Record per group if($detail == '0'){ //Jika Dari Ar Aging With previous Balance $total_prev_balance += $prev_balance; $total_debit += $debit; $total_credit += $credit; } $total_outstanding += $outstanding; $total_days30 += $days30; $total_days60 += $days60; $total_days90 += $days90; $total_over90days += $over90days; //Menghitung total keseluruhan if($detail == '0'){ //Jika dari AR Aging With Previous Balance $grand_prev_balance += $prev_balance; $grand_debit += $debit; $grand_credit += $credit; } $grand_outstanding += $outstanding; $grand_days30 += $days30; $grand_days60 += $days60; $grand_days90 += $days90; $grand_over += $over90days; @endphp @if($detail == '0') @endif @php $no++; @endphp @endforeach @if($detail == '0') @endif @if($detail == '0') @endif @endforeach @else @foreach($aging_lists as $key => $details) @php $no = 1; if($view){ $total_prev_balance = 0; $total_debit = 0; $total_credit = 0; } $total_ending_balance = 0; $total_days30 = 0; $total_days60 = 0; $total_days90 = 0; $total_over90days = 0; @endphp @foreach($details as $aging_list) @php if($view == 'withpreviousbalance'){ $prev_balance = $aging_list['prev_balance']; $debit = $aging_list['debit']; $credit = $aging_list['credit']; } $ending_balance = $aging_list['ending_balance']; $days30 = $aging_list['30days']; $days60 = $aging_list['60days']; $days90 = $aging_list['90days']; $over90days = $aging_list['over90days']; if($view == 'withpreviousbalance'){ $total_prev_balance += $prev_balance; $total_debit += $debit; $total_credit += $credit; } $total_ending_balance += $ending_balance; $total_days30 += $days30; $total_days60 += $days60; $total_days90 += $days90; $total_over90days += $over90days; if($view == 'withpreviousbalance'){ $grand_prev_balance += $prev_balance; $grand_debit += $debit; $grand_credit += $credit; } $grand_ending_balance += $ending_balance; $grand_days30 += $days30; $grand_days60 += $days60; $grand_days90 += $days90; $grand_over += $over90days; @endphp @if($view == 'withpreviousbalance') @endif @php $no++; @endphp @endforeach @if($view == 'withpreviousbalance') @endif @if($view == 'withpreviousbalance') @endif @endforeach @endif @if(!$view || $detail == '0') @if($detail == '0') @endif @php $grandtotal = $grand_outstanding; @endphp @else @if($view == 'withpreviousbalance') @endif @php $grandtotal = $grand_ending_balance; @endphp @endif @if(!$view || $detail == '0') @if($detail == '0') @endif @else @if($view == 'withpreviousbalance') @endif @endif @else @if($view == 'withpreviousbalance') @else @endif @endif
# NamePrev Balance Debit Credit Ending Outstanding30 Days 31 - 60 Days 61 - 90 Days OVER 90 DaysTransaction Date BillNoPrev Balance Debit Credit Ending Balance 30 Days 31 - 60 Days 61 - 90 Days OVER 90 Days
{{$header}}
{{$no}} {{$key}}{!! $prev_balance !!} {!! $debit !!} {!! $credit !!}{!! $outstanding !!} {!! $days30 !!} {!! $days60 !!} {!! $days90 !!} {!! $over90days !!}
Total:{!! $total_prev_balance !!} {!! $total_debit !!} {!! $total_credit !!}{!! $total_outstanding !!} {!! $total_days30 !!} {!! $total_days60 !!} {!! $total_days90 !!} {!! $total_over90days !!}
Statistic Percentage (%): {{100}} {{$total_days30 == 0 ? 0 : ($total_days30/$total_outstanding) * 100}} {{$total_days60 == 0 ? 0 : ($total_days60/$total_outstanding) * 100}} {{$total_days90 == 0 ? 0 : ($total_days90/$total_outstanding) * 100}} {{$total_over90days == 0 ? 0 : ($total_over90days/$outstanding) * 100}}
{{$key}}
{{ $no }} {{ $aging_list['customer_name'] }} {{ $aging_list['bill_date'] }} {{ $aging_list['bill_no'] }} {{--
{{ $aging_list['id_bill'] }} --}}
{!! $prev_balance !!} {!! $debit !!} {!! $credit !!}{!! $ending_balance !!} {!! $days30 !!} {!! $days60 !!} {!! $days90 !!} {!! $over90days !!}
Total:{!! $total_prev_balance !!} {!! $total_debit !!} {!! $total_credit !!}{!! $total_ending_balance !!} {!! $total_days30 !!} {!! $total_days60 !!} {!! $total_days90 !!} {!! $total_over90days !!}
Statistic Percentage (%): {{100}} {{$total_days30 == 0 ? 0 : ($total_days30/$total_ending_balance) * 100}} {{$total_days60 == 0 ? 0 : ($total_days60/$total_ending_balance) * 100}} {{$total_days90 == 0 ? 0 : ($total_days90/$total_ending_balance) * 100}} {{$total_over90days == 0 ? 0 : ($total_over90days/$total_ending_balance) * 100}}
Grand Total {!! $grand_outstanding !!}Grand Total{!! $grand_prev_balance !!} {!! $grand_debit !!} {!! $grand_credit !!}{!! $grand_ending_balance !!}{!! $grand_days30 !!} {!! $grand_days60 !!} {!! $grand_days90 !!} {!! $grand_over !!}
Grand Total Percentage {{ 100 }}Grand Total Percentage (%) {{ 100 }}{{$grand_days30 == 0 ? 0 : ($grand_days30 / $grandtotal) * 100}} {{$grand_days60 == 0 ? 0 : ($grand_days60 / $grandtotal) * 100}} {{$grand_days90 == 0 ? 0 : ($grand_days90 / $grandtotal) * 100}} {{$grand_over == 0 ? 0 : ($grand_over / $grandtotal) * 100}}
Data not available
Data not available