@foreach($childs as $child)
@if (count($child->childs) > 0)
|
{{ $child->code . " " . $child->name}}
|
{{ get_total_acc_all_childs($child->id) }}
|
@include('invoice/acc/reports.manageChild',['childs' => $child->childs])
@else
|
{{ $child->code . " " . $child->name}}
|
{{-- if it is credit --}}
@if ($child->origin == 0)
@php
$new_acc_balance = $child->entry_items->sum('credit') - $child->entry_items->sum('debit');
@endphp
@else
@php
$new_acc_balance = $child->entry_items->sum('debit') - $child->entry_items->sum('credit');
@endphp
@endif
{{ $new_acc_balance }}
|
@endif
@endforeach