@php $total_debit = []; $total_credit = []; 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.Accounting Entry details')}} ({{$accountEntry->entry_no}})

@livewire('accounting-entries-train-component',['component_name'=>"add 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
{{__('messages.No.')}}
{{ $accountEntry->entry_no}}
{{__('messages.entry_date')}}
{{ $accountEntry->entry_date}}
{{__('messages.Total Amount')}}
{{ $accountEntry->total_amount}} {{ $accountEntry->Currency->name}}
{{trans_choice('messages.currency',1)}}
{{ ($accountEntry->Currency)?$accountEntry->Currency->name:'-'}}
{{__('messages.is_carried_forward')}}
@if( $accountEntry->is_carried_forward == 1 ) @else @endif
{{__('messages.Accounting Daily Type')}}
{{ ($accountEntry->accountingDailyType)?$accountEntry->accountingDailyType->name : '-'}}
{{__('messages.Updated By')}}
{{ ($accountEntry->last_updated_by_user)?$accountEntry->last_updated_by_user->name:"-"}}
{{__('messages.Created At')}}
{{\Carbon\Carbon::createFromTimeString($accountEntry->created_at)->translatedFormat('M j, Y, g:i a')}}
{{__('messages.Updated At')}}
{{\Carbon\Carbon::createFromTimeString($accountEntry->updated_at)->translatedFormat('M j, Y, g:i a')}}
{{__('messages.comment')}}
{{ $accountEntry->comment}}
{{-- --}} {{-- --}} @forelse ($accountingEntryDetails as $key =>$accountingEntryDetail) {{-- --}} {{-- --}} @empty @endforelse
#

{{__('messages.Debit')}}

{{__('messages.Credit')}}

{{__('messages.cost_center')}}

{{__('messages.Accounting Account')}}

{{__('messages.Updated By')}}

{{__('messages.Created At')}}

{{__('messages.comment')}}

 
{{$loop->iteration}} @if($accountingEntryDetail['type'] == 'debit') {{$accountingEntryDetail['amount']}} @else - @endif @if($accountingEntryDetail['type'] == 'credit') {{$accountingEntryDetail['amount']}} @else - @endif {{\App\Models\CostCenter::find($accountingEntryDetail['cost_center_id'])->name}} {{\App\Models\AccountingAccount::find($accountingEntryDetail['accounting_account_id'])->name}} {{-- {{($accountingEntryDetail->accountingAccount)?$accountingEntryDetail->accountingAccount->name . ' ' . '(' . $accountingEntryDetail->accountingAccount->no . ')':'-'}}--}} {{($accountingEntryDetail->updatedByUser)?$accountingEntryDetail->updatedByUser->name:'-'}} {{\Carbon\Carbon::createFromTimeString($accountingEntryDetail->created_at)->translatedFormat('M j, Y, g:i a')}} {{$accountingEntryDetail['comment']}}
@if(array_key_exists('id',$accountingEntryDetails[$key])) @if( (auth()->user()->can('edit accounting_entry_details') && $accountEntry->is_carried_forward == 0) || ( auth()->user()->can(['edit accounting_entry_details','edit entry_carried_forward']) && $accountEntry->is_carried_forward == 1)) {{$key}} {{__('messages.entry details')}}
edit_type
{{--
edit_cost_center_id @foreach(\App\Models\CostCenter::all() as $cost_center) @endforeach
--}}
edit_accounting_account_id @foreach(\App\Models\AccountingAccount::all() as $accounting_account) @endforeach
edit_comment_detail 2
mt-2
@endif @endif
{{__('messages.Debit')}} : {{array_sum($total_debit)}} {{__('messages.Credit')}} : {{array_sum($total_credit)}} @if($is_balanced) Balanced @else Not Balanced @endif
type
{{--
cost_center_id @foreach(\App\Models\CostCenter::all() as $cost_center) @endforeach
--}}
accounting_account_id @foreach(\App\Models\AccountingAccount::all() as $accounting_account) @endforeach
comment_detail 2
@if($is_balanced) @else {{__('messages.important warning')}} {{__('messages.back_to_edit')}}

{{__('messages.This Entry is unbalanced. Please balance the entry for Saving or deletion')}}

resetEntry({{$accountEntry->id}}) {{__('messages.Reset')}}
@endif