@extends('layouts.app') @section('title', __('accounting::lang.accounting')) @section('content') @include('accounting::layouts.nav')
@component('components.widget', ['class' => 'box-primary', 'title' => __('accounting::lang.chart_of_account_overview')])
@foreach($account_types as $k => $v) @php $bal = 0; foreach($coa_overview as $overview) { if($overview->account_primary_type==$k && !empty($overview->balance)) { $bal = (float)$overview->balance; } } @endphp @endforeach
@lang('accounting::lang.account_type') @lang('accounting::lang.current_balance')
{{$v['label']}} {{-- Suffix CR/DR as per value --}} @if($bal < 0) {{ (in_array($v['label'], ['Asset', 'Expenses']) ? ' (CR)' : ' (DR)') }} @endif @format_currency(abs($bal))
{!! $coa_overview_chart->container() !!}
@endcomponent
@foreach($all_charts as $key => $chart)
@component('components.widget', ['class' => 'box-primary', 'title' => __('accounting::lang.' . $key)]) {!! $chart->container() !!} @endcomponent
@endforeach
@stop @section('javascript') {!! $coa_overview_chart->script() !!} @foreach($all_charts as $key => $chart) {!! $chart->script() !!} @endforeach @stop