@extends(\Auth::user()->role != 10 ? 'layout' : 'layoutfrontdesk') @section('title', 'Account Payable Aging List') @section('css') @endsection @section('content')
@php $filter_date = $_GET['payment_date_filter'] ?? ''; $company_id = $_GET['company_id'] ?? ''; @endphp
  Print   Export
@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 AP 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 AP Aging Detail if($detail == '0'){ //Jika Dari AP 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 AP 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 AP 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') @elseif($view == 'withdetail') @else @endif @endif
# NamePrev Balance Debit Credit Ending Outstanding30 Days 31 - 60 Days 61 - 90 Days OVER 90 DaysTransaction Date Document NoPrev Balance Debit Credit Ending Balance 30 Days 31 - 60 Days 61 - 90 Days OVER 90 Days
@if($header != '0') {{$header}} @else Empty Recipient @endif
{{$no}} @if($key != '0') {{$key}} @else Empty Recipient @endif {{ number_format($prev_balance, 2) }} {{ number_format($debit, 2) }} {{ number_format($credit, 2) }}{{ number_format($outstanding, 2) }} {{ number_format($days30, 2) }} {{ number_format($days60, 2) }} {{ number_format($days90, 2) }} {{ number_format($over90days, 2) }}
Total:{{ number_format($total_prev_balance, 2) }} {{ number_format($total_debit, 2) }} {{ number_format($total_credit, 2) }}{{ number_format($total_outstanding, 2) }} {{ number_format($total_days30, 2) }} {{ number_format($total_days60, 2) }} {{ number_format($total_days90, 2) }} {{ number_format($total_over90days, 2) }}
Statistic Percentage (%): {{number_format(100, 2)}} {{$total_days30 == 0 ? number_format(0, 2) : number_format(($total_days30/$total_outstanding) * 100, 2)}} {{$total_days60 == 0 ? number_format(0, 2) : number_format(($total_days60/$total_outstanding) * 100, 2)}} {{$total_days90 == 0 ? number_format(0, 2) : number_format(($total_days90/$total_outstanding) * 100, 2)}} {{$total_over90days == 0 ? number_format(0, 2) : number_format(($total_over90days/$outstanding) * 100, 2)}}
@if($key != '0') {{$key}} @else Empty Recipient @endif
{{ $no }} @if($aging_list['supplier_name'] != '0') {{ $aging_list['supplier_name'] }} @else Empty Recipient @endif {{ $aging_list['invoice_date'] }} {{ $aging_list['document_no'] }} {{ number_format($prev_balance, 2) }} {{ number_format($debit, 2) }} {{ number_format($credit, 2) }}{{ number_format($ending_balance, 2) }} {{ number_format($days30, 2) }} {{ number_format($days60, 2) }} {{ number_format($days90, 2) }} {{ number_format($over90days, 2)}}
Total:{{ number_format($total_prev_balance, 2) }} {{ number_format($total_debit, 2) }} {{ number_format($total_credit, 2) }}{{ number_format($total_ending_balance, 2) }} {{ number_format($total_days30, 2) }} {{ number_format($total_days60, 2) }} {{ number_format($total_days90, 2) }} {{ number_format($total_over90days, 2) }}
Statistic Percentage (%): {{number_format(100, 2)}} {{$total_days30 == 0 ? number_format(0, 2) : number_format(($total_days30/$total_ending_balance) * 100, 2)}} {{$total_days60 == 0 ? number_format(0, 2) : number_format(($total_days60/$total_ending_balance) * 100, 2)}} {{$total_days90 == 0 ? number_format(0, 2) : number_format(($total_days90/$total_ending_balance) * 100, 2)}} {{$total_over90days == 0 ? number_format(0, 2) : number_format(($total_over90days/$total_ending_balance) * 100, 2)}}
Grand Total {{ number_format($grand_outstanding, 2) }}Grand Total{{ number_format($grand_prev_balance, 2) }} {{ number_format($grand_debit, 2) }} {{ number_format($grand_credit, 2) }}{{ number_format($grand_ending_balance, 2) }}{{number_format($grand_days30, 2)}} {{number_format($grand_days60, 2)}} {{number_format($grand_days90, 2)}} {{number_format($grand_over, 2)}}
Grand Total Percentage {{ number_format(100, 2) }}Grand Total Percentage (%) {{ number_format(100, 2) }}{{$grand_days30 == 0 ? number_format(0, 2) : number_format(($grand_days30 / $grandtotal) * 100, 2)}} {{$grand_days60 == 0 ? number_format(0, 2) : number_format(($grand_days60 / $grandtotal) * 100, 2)}} {{$grand_days90 == 0 ? number_format(0, 2) : number_format(($grand_days90 / $grandtotal) * 100, 2)}} {{$grand_over == 0 ? number_format(0, 2) : number_format(($grand_over / $grandtotal) * 100, 2)}}
Data not available
Data not available
Data not available
@endsection @section('js') @endsection