@extends('layouts.master')
@section('css')
@endsection
@section('title')
General Budget
@stop
@section('page-header')
@endsection
@section('content')
@php
$currentDate = \Carbon\Carbon::now()->addHours(3)->format("Y-m-d H:i:s");
// مجموعات الحسابات
$fixedAssets = App\Models\financial_accounts::where('parent_account_number', 74)->get();
$currentAssets = App\Models\financial_accounts::where('parent_account_number',75)->get();
$liabilities = App\Models\financial_accounts::where('account_type', 2)->where('parent_account_number',NULL)->get();
$equity = App\Models\financial_accounts::where('account_type', 5)->where('parent_account_number',NULL)->get();
function calculateTotals($accounts) {
$debit = $accounts->sum('debtor_current');
$credit = $accounts->sum('creditor_current');
return ['debit' => $debit, 'credit' => $credit, 'balance' => $debit - $credit];
}
@endphp