@extends('layouts.pdf') @php $is_official = request()->is_official; $show_official_tag = !empty($is_official) && $is_official != 'combine'; $show_official = ($is_official == 'official' || $is_official == 'separate' || $is_official == 'combine' || empty($is_official)); $show_unofficial = ($is_official == 'unofficial' || $is_official == 'separate'); $is_summary = request()->report_type =='summary'; $summary_sub_grp_ids = request()->custom_summary_subgroup_ids ?? []; @endphp @section('title') {{ $extra['module_name'] }} @endsection @section('content') @php $head_name = array(); @endphp
@include('admin.partials.header', ['extra' => $extra]) @if($show_official) @endif @if($show_unofficial) @endif @php $net_profit = 0; @endphp @foreach ($data as $key => $group) {{-- Type --}} {{-- Expense, Revenue --}} @php $firstLevelTotal = 0; $secondLevelTotal = 0; $thirdLevelTotal = 0; @endphp @foreach ($group as $groupKey =>$groupValue) {{-- Group --}} @foreach ($groupValue as $subGroupKey => $subGroupValue) {{-- Sub Group --}} @php $code = reset($subGroupValue); $group_code = $code['group_code']; $sub_group_code = $code['type_code']; $subgroup_id = $code['subgroup_id']; $summary_group = $is_summary || in_array($subgroup_id,$summary_sub_grp_ids); $sub_total_text = "$subGroupKey ".__('lang.sub_total'); if($summary_group){ $sub_total_text = "$group_code.$sub_group_code $subGroupKey"; } $sub_total_text = strtoupper($sub_total_text); @endphp @foreach ($subGroupValue as $transactionsKey => $transactionsValue) {{-- Transactions --}} @php $category = $transactionsValue['category_name']; $dr = $transactionsValue['dr']; $cr = $transactionsValue['cr']; $dr_unofficial = $transactionsValue['dr_unofficial']; $cr_unofficial = $transactionsValue['cr_unofficial']; if(empty($is_official) || $is_official=='combine'){ $dr = $dr + $dr_unofficial; $cr = $cr + $cr_unofficial; } $amount = $dr - $cr; $amount_unofficial = $dr_unofficial - $cr_unofficial; $firstLevelTotal += $amount; $secondLevelTotal += $amount; $thirdLevelTotal += $amount; $firstLevelTotal_unofficial += $amount_unofficial; $secondLevelTotal_unofficial += $amount_unofficial; $thirdLevelTotal_unofficial += $amount_unofficial; if(strtoupper($category) == 'ASSETS'){ $total_assets += $amount; $total_assets_unofficial += $amount_unofficial; }else if(strtoupper($category) == 'LIABILITIES' || strtoupper($category) == 'EQUITY'){ $total_liabilities += $amount; $total_liabilities_unofficial += $amount_unofficial; } $hide_head = $transactionsValue['head_check'] == 1; @endphp @if(!$hide_head && !$summary_group) @if($show_official) @endif @if($show_unofficial) @endif @endif @endforeach {{-- End Transactions --}} @if($show_official) @endif @if($show_unofficial) @endif @php $secondLevelTotal = 0; $secondLevelTotal_unofficial = 0; @endphp @endforeach {{-- End Sub Group --}} @endforeach {{-- End Group --}} @if($show_official) @endif @if($show_unofficial) @endif @php $thirdLevelTotal = 0; $thirdLevelTotal_unofficial = 0; @endphp @endforeach {{-- End Type --}} @if($show_official) @endif @if($show_unofficial) @endif
{{__('lang.code')}} {{__('lang.head')}}{{__('lang.amount')}} @if($show_official_tag) {{__('lang.official')}} @endif {{$transaction->systemSettingCurrency()}}{{__('lang.amount')}} {{__('lang.unofficial')}} {{$transaction->systemSettingCurrency()}}
{{ strtoupper($key) }}
{{ strtoupper($groupKey) }}
{{$subGroupKey}}
{{$transactionsKey}} {{$transactionsValue['name']}} {{ $transaction->isNegative($amount) }} {{ $transaction->isNegative($amount_unofficial) }}
{{ $sub_total_text }}{{ $transaction->isNegative($secondLevelTotal ) }}{{ $transaction->isNegative($secondLevelTotal_unofficial ) }}
{{ strtoupper($key) }} {{__('lang.total')}}{{ $transaction->isNegative($thirdLevelTotal ) }}{{ $transaction->isNegative($thirdLevelTotal_unofficial ) }}
 
{{__('lang.assets_total')}} : {{$transaction->isNegative(abs($total_assets)) }}
{{__('lang.liabities_equity_total')}} : {{$transaction->isNegative(abs($total_liabilities)) }}
{{__('lang.assets_total')}} {{__('lang.unofficial')}} : {{$transaction->isNegative(abs($total_assets_unofficial)) }}
{{__('lang.liabities_equity_total')}} {{__('lang.unofficial')}} : {{$transaction->isNegative(abs($total_liabilities_unofficial)) }}

@stop