@extends('layouts.default') @section('title', trans('reports.standard.title.standardreports', ['type' => trans('reports.standard.customerbalancesummary')])) @section('new_button') {{-- // --}} @endsection @section('content')
{!! Form::open(['url'=>'/reports/standard/customer-balance-summary']) !!} @include('accounts.reports.standard.date-filter-view') {!! Form::close() !!}

ASAS {{ trans('reports.standard.customerbalancesummary') }}

{{ Tree($items) }} @php $gtotal = 0; function Tree($elements, $prefix = 10) { global $gtotal; foreach ($elements as $k=> $element) { $total_amount = 0; $paid_amount = 0; if( count($element['invoices_total']) > 0){ $invoice_amount = ($element['invoices_total'])[0]['total_amount']; $paid_amount = isset(($element['payments_total'])[0])?($element['payments_total'])[0]['paid_amount']:0; $total_amount = $invoice_amount - $paid_amount ; $gtotal = $gtotal + $total_amount ; } @endphp @if (isset($element['children'])) @php Tree($element['children'], $prefix+20 ); @endphp @endif @if($element['parent_id'] == NULL) @php $gtotal = 0; @endphp @endif @php } } @endphp
@sortablelink('name', trans('general.name')) @sortablelink('blance', trans_choice('general.balance',2))
{{ $element['name'] }} @money((($total_amount != '')?$total_amount:0), $element['currency_code'], true)
Total {{ $element['name'] }} @money((($gtotal != '')?$gtotal:0), $element['currency_code'], true)
@include('accounts.reports.standard.filter') @include('includes.datepicker') @endsection