@extends('layouts.adminapp') @section('content')
@include('PrintHeader.header')

{{__('lng.SummaryReport')}}

@php $TotalDebit=$TotalCredit=$CashInHand=0; @endphp
{{ __('lng.OpeningBalance') }} @if ($OpeningBalance >= 0) @currency($OpeningBalance) DR @else @currency(abs($OpeningBalance)) CR @endif
@if ($Incomes->count())
@foreach ($Incomes as $Income) @php $TotalCredit+=$Income->credited; @endphp @endforeach @php $CashInHand=$TotalCredit; @endphp
{{__('lng.TotalIncome')}}
{{App\Models\AccountGroup::find($Income->GroupID)->title ?? ''}} @currency($Income->credited)
{{__('lng.Total')}} @currency($TotalCredit)
@endif @if ($Assets->count())
@php $AssetTotalDebit=$AssetTotalCredit=0; @endphp @foreach ($Assets as $Asset) @php $AssetTotalCredit+=$Asset->credited; $AssetTotalDebit+=$Asset->debited; @endphp @endforeach
{{__('lng.Assets')}}
{{__('lng.AccountGroup')}} {{__('lng.Debit')}} {{__('lng.Credit')}} {{__('lng.Balance')}}
{{App\Models\AccountGroup::find($Asset->GroupID)->title ?? ''}} @currency($Asset->debited) @currency($Asset->credited) @if ($Asset->credited - $Asset->debited > 0) @currency($Asset->credited - $Asset->debited) {{__('lng.CR')}} @else @currency(abs($Asset->credited - $Asset->debited)) {{__('lng.DR')}} @endif
{{__('lng.Total')}} @currency($AssetTotalDebit) @currency($AssetTotalCredit) @if ($AssetTotalCredit - $AssetTotalDebit > 0) @currency($AssetTotalCredit - $AssetTotalDebit) {{__('lng.CR')}} @php $CashInHand+=$AssetTotalCredit - $AssetTotalDebit; @endphp @else @currency(abs($AssetTotalCredit - $AssetTotalDebit)) {{__('lng.DR')}} @php $CashInHand-=abs($AssetTotalCredit - $AssetTotalDebit); @endphp @endif
@endif @if ($Liabilities->count())
@php $LiabilityTotalCredit=$LiabilityTotalDebit=0; @endphp @foreach ($Liabilities as $Liability) @php $LiabilityTotalCredit+=$Liability->credited; $LiabilityTotalDebit+=$Liability->debited; @endphp @endforeach
{{__('lng.Liabilities')}}
{{__('lng.AccountGroup')}} {{__('lng.Debit')}} {{__('lng.Credit')}} {{__('lng.Balance')}}
{{App\Models\AccountGroup::find($Liability->GroupID)->title ?? ''}} @currency($Liability->debited) @currency($Liability->credited) @if ($Liability->credited - $Liability->debited > 0) @currency($Liability->credited - $Liability->debited) {{__('lng.CR')}} @else @currency(abs($Liability->credited - $Liability->debited)) {{__('lng.DR')}} @endif
{{__('lng.Total')}} @currency($LiabilityTotalDebit) @currency($LiabilityTotalCredit) @if ($LiabilityTotalCredit - $LiabilityTotalDebit > 0) @currency($LiabilityTotalCredit - $LiabilityTotalDebit) {{__('lng.CR')}} @php $CashInHand+=$LiabilityTotalCredit - $LiabilityTotalDebit; @endphp @else @currency(abs($LiabilityTotalCredit - $LiabilityTotalDebit)) {{__('lng.DR')}} @php $CashInHand-=abs($LiabilityTotalCredit - $LiabilityTotalDebit); @endphp @endif
@endif @if ($Expenses->count())
@foreach ($Expenses as $Expense) @php $TotalDebit+=$Expense->debited; @endphp @endforeach @php $CashInHand-=abs($TotalDebit); @endphp
{{__('lng.TotalExpense')}}
{{App\Models\AccountGroup::find($Expense->GroupID)->title ?? ''}} @currency($Expense->debited)
{{__('lng.Total')}} @currency($TotalDebit)
@endif
{{__('lng.CashInHand')}} @if ($OpeningBalance >= 0) @php $CashInHand-=abs($OpeningBalance); @endphp @else @php $CashInHand+=abs($OpeningBalance); @endphp @endif @if ($CashInHand >= 0) @currency($CashInHand) {{__('lng.CR')}} @else @currency(abs($CashInHand)) {{__('lng.DR')}} @endif
@endsection