{{__('messages.trialBalance')}}
--}}
Opening Balance | Movement | Net Movement | Closing Balance | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Account | Debit | Credit | Debit | Credit | Debit | Credit | Debit | Credit | |||
@if(setUserLang() == "ar") {{__('messages.Total')}} {{$chartOfAcc->code}} - {{$chartOfAcc->arabic_name}} @else {{__('messages.Total')}} {{$chartOfAcc->code}} - {{$chartOfAcc->name}} @endif | {{ format_balance($final_open_debit[$chartOfAcc['id']]) }} @php $opening_debit = 0; $opening_debit = $final_open_debit[$chartOfAcc['id']]; $opening_total_debit +=$opening_debit; @endphp | {{ format_balance($final_open_credit[$chartOfAcc['id']]) }} @php $opening_credit = 0; $opening_credit = $final_open_credit[$chartOfAcc['id']]; $opening_total_credit += $opening_credit; @endphp | @php format_balance($final_debit[$chartOfAcc['id']]); $total_debit = $final_debit[$chartOfAcc['id']]; $mov_total_debit += $total_debit; @endphp | @php format_balance($final_credit[$chartOfAcc['id']]); $total_credit = $final_credit[$chartOfAcc['id']]; $mov_total_credit += $total_credit; @endphp | {{ format_balance($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 | {{ format_balance($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 | |||
{{__('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}} |