@if (setUserLang() == 'ar')
{{ __('messages.Total') }} {{ $chartOfAcc->code }} - {{ $chartOfAcc->arabic_name }}
@else
{{ __('messages.Total') }} {{ $chartOfAcc->code }} - {{ $chartOfAcc->name }}
@endif
|
{{ $final_open_debit[$chartOfAcc['id']] }}
@php
$opening_debit = 0;
$opening_debit = $final_open_debit[$chartOfAcc['id']];
$opening_total_debit += $opening_debit;
@endphp
|
{{ $final_open_credit[$chartOfAcc['id']] }}
@php
$opening_credit = 0;
$opening_credit = $final_open_credit[$chartOfAcc['id']];
$opening_total_credit += $opening_credit;
@endphp
|
{{ $final_debit[$chartOfAcc['id']] }}
@php
$final_debit[$chartOfAcc['id']];
$total_debit = $final_debit[$chartOfAcc['id']];
$mov_total_debit += $total_debit;
@endphp
|
{{ $final_credit[$chartOfAcc['id']] }}
@php
$final_credit[$chartOfAcc['id']];
$total_credit = $final_credit[$chartOfAcc['id']];
$mov_total_credit += $total_credit;
@endphp
|
{{ $final_net_movement_debit[$chartOfAcc['id']] }}
@php
$net_movement_debit = 0;
$net_movement_debit = $final_net_movement_debit[$chartOfAcc['id']];
$net_mov_total_debit += $final_net_movement_debit[$chartOfAcc['id']];
@endphp
|
{{ $final_net_movement_credit[$chartOfAcc['id']] }}
@php
$net_movement_credit = 0;
$net_movement_credit = $final_net_movement_credit[$chartOfAcc['id']];
$net_mov_total_credit += $final_net_movement_credit[$chartOfAcc['id']];
@endphp
|
@php
$closing_debit = 0;
$closing_credit = 0;
Log::channel('test_log')->info(
"-Opening debit -> {$opening_total_debit} __Opening credit__ {$opening_total_credit}",
);
if ($opening_debit != 0) {
if ($net_movement_debit != 0) {
$closing_debit = $opening_debit + $net_movement_debit;
} else {
if ($opening_debit > $net_movement_credit) {
$closing_debit = $opening_debit - $net_movement_credit;
} else {
$closing_credit = $net_movement_credit - $opening_debit;
}
}
} else {
if ($net_movement_credit != 0) {
$closing_credit = $opening_credit + $net_movement_credit;
} else {
if ($opening_credit > $net_movement_debit) {
$closing_credit = $opening_credit - $net_movement_debit;
} else {
$closing_debit = $net_movement_debit - $opening_credit;
}
}
}
@endphp
{{ $closing_debit }}
@php
$closing_total_debit += $closing_debit;
@endphp
|
{{ $closing_credit }}
@php
$Closing_total_credit += $closing_credit;
@endphp
|
@endif
@endforeach
{{ __('messages.total') }}
|
{{ $opening_total_debit }}
|
{{ $opening_total_credit }}
|
{{ $mov_total_debit }}
|
{{ $mov_total_credit }}
|
{{ $net_mov_total_debit }}
|
{{ $net_mov_total_credit }}
|
{{ $closing_total_debit }}
|
{{ $Closing_total_credit }}
|