@php $total_debit = []; $total_credit = []; $accountingEntryDetails = $accountEntry->accountingEntryDetails; foreach ($accountingEntryDetails as $key =>$accountingEntryDetail){ if ($accountingEntryDetail['type'] == 'debit'){ array_push($total_debit,$accountingEntryDetail['amount']); } elseif($accountingEntryDetail['type'] == 'credit'){ array_push($total_credit,$accountingEntryDetail['amount']); } } if (array_sum($total_credit) != 0 && array_sum($total_debit) != 0){ $is_balanced = array_sum($total_credit) == array_sum($total_debit); }else{ $is_balanced = false; } @endphp

{{__('messages.new accounting_entries')}}

@livewire('accounting-entries-train-component',['component_name'=>"edit accounting_entries",'entry' => $accountEntry,'entry_id' => $accountEntry->id ,'is_balanced' => $is_balanced])
@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif
currency_id @foreach(\App\Models\Currency::all() as $currency) @endforeach
accounting_daily_type_id @foreach(\App\Models\AccountingDailyType::all() as $type) @endforeach
comment 4