<style type="text/css">
    td{padding: 5px !important;}
</style>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'financial_cash_flow_title_top'); ?></h2>
        <ol class="breadcrumb">
            <li>
                <a class="url-elem" href="<?php echo url('/dashboard'); ?>"><?= print_lang($app_lang,'home'); ?></a>
            </li>
            <li>
                <a class="url-elem" href="<?php echo url('/reports'); ?>"><?= print_lang($app_lang,'reports'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'financial_cash_flow_title'); ?></strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
        
    </div>
</div>


<?php

$opening_total_cash_ins = [];
$month_1_total_cash_ins = [];
$month_2_total_cash_ins = [];
$month_3_total_cash_ins = [];
$month_4_total_cash_ins = [];
$month_5_total_cash_ins = [];
$month_6_total_cash_ins = [];
$month_7_total_cash_ins = [];
$month_8_total_cash_ins = [];
$month_9_total_cash_ins = [];
$month_10_total_cash_ins = [];
$month_11_total_cash_ins = [];
$month_12_total_cash_ins = [];

$opening_total_cash_out = [];
$month_1_total_cash_out = [];
$month_2_total_cash_out = [];
$month_3_total_cash_out = [];
$month_4_total_cash_out = [];
$month_5_total_cash_out = [];
$month_6_total_cash_out = [];
$month_7_total_cash_out = [];
$month_8_total_cash_out = [];
$month_9_total_cash_out = [];
$month_10_total_cash_out = [];
$month_11_total_cash_out = [];
$month_12_total_cash_out = [];

$opening_sales_amount = isset($monthly_sales['opening_amount']) ? array_sum($monthly_sales['opening_amount']) : 0;
$month_1_sales_amount = isset($monthly_sales['month_1_amount']) ? array_sum($monthly_sales['month_1_amount']) : 0;
$month_2_sales_amount = isset($monthly_sales['month_2_amount']) ? array_sum($monthly_sales['month_2_amount']) : 0;
$month_3_sales_amount = isset($monthly_sales['month_3_amount']) ? array_sum($monthly_sales['month_3_amount']) : 0;
$month_4_sales_amount = isset($monthly_sales['month_4_amount']) ? array_sum($monthly_sales['month_4_amount']) : 0;
$month_5_sales_amount = isset($monthly_sales['month_5_amount']) ? array_sum($monthly_sales['month_5_amount']) : 0;
$month_6_sales_amount = isset($monthly_sales['month_6_amount']) ? array_sum($monthly_sales['month_6_amount']) : 0;
$month_7_sales_amount = isset($monthly_sales['month_7_amount']) ? array_sum($monthly_sales['month_7_amount']) : 0;
$month_8_sales_amount = isset($monthly_sales['month_8_amount']) ? array_sum($monthly_sales['month_8_amount']) : 0;
$month_9_sales_amount = isset($monthly_sales['month_9_amount']) ? array_sum($monthly_sales['month_9_amount']) : 0;
$month_10_sales_amount = isset($monthly_sales['month_10_amount']) ? array_sum($monthly_sales['month_10_amount']) : 0;
$month_11_sales_amount = isset($monthly_sales['month_11_amount']) ? array_sum($monthly_sales['month_11_amount']) : 0;
$month_12_sales_amount = isset($monthly_sales['month_12_amount']) ? array_sum($monthly_sales['month_12_amount']) : 0;


$opening_lots_sales_amount = isset($monthly_lots_sales['opening_amount']) ? array_sum($monthly_lots_sales['opening_amount']) : 0;
$month_1_lots_sales_amount = isset($monthly_lots_sales['month_1_amount']) ? array_sum($monthly_lots_sales['month_1_amount']) : 0;
$month_2_lots_sales_amount = isset($monthly_lots_sales['month_2_amount']) ? array_sum($monthly_lots_sales['month_2_amount']) : 0;
$month_3_lots_sales_amount = isset($monthly_lots_sales['month_3_amount']) ? array_sum($monthly_lots_sales['month_3_amount']) : 0;
$month_4_lots_sales_amount = isset($monthly_lots_sales['month_4_amount']) ? array_sum($monthly_lots_sales['month_4_amount']) : 0;
$month_5_lots_sales_amount = isset($monthly_lots_sales['month_5_amount']) ? array_sum($monthly_lots_sales['month_5_amount']) : 0;
$month_6_lots_sales_amount = isset($monthly_lots_sales['month_6_amount']) ? array_sum($monthly_lots_sales['month_6_amount']) : 0;
$month_7_lots_sales_amount = isset($monthly_lots_sales['month_7_amount']) ? array_sum($monthly_lots_sales['month_7_amount']) : 0;
$month_8_lots_sales_amount = isset($monthly_lots_sales['month_8_amount']) ? array_sum($monthly_lots_sales['month_8_amount']) : 0;
$month_9_lots_sales_amount = isset($monthly_lots_sales['month_9_amount']) ? array_sum($monthly_lots_sales['month_9_amount']) : 0;
$month_10_lots_sales_amount = isset($monthly_lots_sales['month_10_amount']) ? array_sum($monthly_lots_sales['month_10_amount']) : 0;
$month_11_lots_sales_amount = isset($monthly_lots_sales['month_11_amount']) ? array_sum($monthly_lots_sales['month_11_amount']) : 0;
$month_12_lots_sales_amount = isset($monthly_lots_sales['month_12_amount']) ? array_sum($monthly_lots_sales['month_12_amount']) : 0;

$opening_cars_sales_amount = isset($monthly_cars_sales['opening_amount']) ? array_sum($monthly_cars_sales['opening_amount']) : 0;
$month_1_cars_sales_amount = isset($monthly_cars_sales['month_1_amount']) ? array_sum($monthly_cars_sales['month_1_amount']) : 0;
$month_2_cars_sales_amount = isset($monthly_cars_sales['month_2_amount']) ? array_sum($monthly_cars_sales['month_2_amount']) : 0;
$month_3_cars_sales_amount = isset($monthly_cars_sales['month_3_amount']) ? array_sum($monthly_cars_sales['month_3_amount']) : 0;
$month_4_cars_sales_amount = isset($monthly_cars_sales['month_4_amount']) ? array_sum($monthly_cars_sales['month_4_amount']) : 0;
$month_5_cars_sales_amount = isset($monthly_cars_sales['month_5_amount']) ? array_sum($monthly_cars_sales['month_5_amount']) : 0;
$month_6_cars_sales_amount = isset($monthly_cars_sales['month_6_amount']) ? array_sum($monthly_cars_sales['month_6_amount']) : 0;
$month_7_cars_sales_amount = isset($monthly_cars_sales['month_7_amount']) ? array_sum($monthly_cars_sales['month_7_amount']) : 0;
$month_8_cars_sales_amount = isset($monthly_cars_sales['month_8_amount']) ? array_sum($monthly_cars_sales['month_8_amount']) : 0;
$month_9_cars_sales_amount = isset($monthly_cars_sales['month_9_amount']) ? array_sum($monthly_cars_sales['month_9_amount']) : 0;
$month_10_cars_sales_amount = isset($monthly_cars_sales['month_10_amount']) ? array_sum($monthly_cars_sales['month_10_amount']) : 0;
$month_11_cars_sales_amount = isset($monthly_cars_sales['month_11_amount']) ? array_sum($monthly_cars_sales['month_11_amount']) : 0;
$month_12_cars_sales_amount = isset($monthly_cars_sales['month_12_amount']) ? array_sum($monthly_cars_sales['month_12_amount']) : 0;


$opening_total_cash_sales_calculated = $opening_sales_amount + $opening_lots_sales_amount + $opening_cars_sales_amount;
$month_1_total_cash_sales_calculated = $month_1_sales_amount + $month_1_lots_sales_amount + $month_1_cars_sales_amount;
$month_2_total_cash_sales_calculated = $month_2_sales_amount + $month_2_lots_sales_amount + $month_2_cars_sales_amount;
$month_3_total_cash_sales_calculated = $month_3_sales_amount + $month_3_lots_sales_amount + $month_3_cars_sales_amount;
$month_4_total_cash_sales_calculated = $month_4_sales_amount + $month_4_lots_sales_amount + $month_4_cars_sales_amount;
$month_5_total_cash_sales_calculated = $month_5_sales_amount + $month_5_lots_sales_amount + $month_5_cars_sales_amount;
$month_6_total_cash_sales_calculated = $month_6_sales_amount + $month_6_lots_sales_amount + $month_6_cars_sales_amount;
$month_7_total_cash_sales_calculated = $month_7_sales_amount + $month_7_lots_sales_amount + $month_7_cars_sales_amount;
$month_8_total_cash_sales_calculated = $month_8_sales_amount + $month_8_lots_sales_amount + $month_8_cars_sales_amount;
$month_9_total_cash_sales_calculated = $month_9_sales_amount + $month_9_lots_sales_amount + $month_9_cars_sales_amount;
$month_10_total_cash_sales_calculated = $month_10_sales_amount + $month_10_lots_sales_amount + $month_10_cars_sales_amount;
$month_11_total_cash_sales_calculated = $month_11_sales_amount + $month_11_lots_sales_amount + $month_11_cars_sales_amount;
$month_12_total_cash_sales_calculated = $month_12_sales_amount + $month_12_lots_sales_amount + $month_12_cars_sales_amount;

$opening_total_cash_ins[] = $opening_total_cash_sales_calculated;
$month_1_total_cash_ins[] = $month_1_total_cash_sales_calculated;
$month_2_total_cash_ins[] = $month_2_total_cash_sales_calculated;
$month_3_total_cash_ins[] = $month_3_total_cash_sales_calculated;
$month_4_total_cash_ins[] = $month_4_total_cash_sales_calculated;
$month_5_total_cash_ins[] = $month_5_total_cash_sales_calculated;
$month_6_total_cash_ins[] = $month_6_total_cash_sales_calculated;
$month_7_total_cash_ins[] = $month_7_total_cash_sales_calculated;
$month_8_total_cash_ins[] = $month_8_total_cash_sales_calculated;
$month_9_total_cash_ins[] = $month_9_total_cash_sales_calculated;
$month_10_total_cash_ins[] = $month_10_total_cash_sales_calculated;
$month_11_total_cash_ins[] = $month_11_total_cash_sales_calculated;
$month_12_total_cash_ins[] = $month_12_total_cash_sales_calculated;


$opening_services_income_amount = isset($monthly_services_income['opening_amount']) ? array_sum($monthly_services_income['opening_amount']) : 0;
$month_1_services_income_amount = isset($monthly_services_income['month_1_amount']) ? array_sum($monthly_services_income['month_1_amount']) : 0;
$month_2_services_income_amount = isset($monthly_services_income['month_2_amount']) ? array_sum($monthly_services_income['month_2_amount']) : 0;
$month_3_services_income_amount = isset($monthly_services_income['month_3_amount']) ? array_sum($monthly_services_income['month_3_amount']) : 0;
$month_4_services_income_amount = isset($monthly_services_income['month_4_amount']) ? array_sum($monthly_services_income['month_4_amount']) : 0;
$month_5_services_income_amount = isset($monthly_services_income['month_5_amount']) ? array_sum($monthly_services_income['month_5_amount']) : 0;
$month_6_services_income_amount = isset($monthly_services_income['month_6_amount']) ? array_sum($monthly_services_income['month_6_amount']) : 0;
$month_7_services_income_amount = isset($monthly_services_income['month_7_amount']) ? array_sum($monthly_services_income['month_7_amount']) : 0;
$month_8_services_income_amount = isset($monthly_services_income['month_8_amount']) ? array_sum($monthly_services_income['month_8_amount']) : 0;
$month_9_services_income_amount = isset($monthly_services_income['month_9_amount']) ? array_sum($monthly_services_income['month_9_amount']) : 0;
$month_10_services_income_amount = isset($monthly_services_income['month_10_amount']) ? array_sum($monthly_services_income['month_10_amount']) : 0;
$month_11_services_income_amount = isset($monthly_services_income['month_11_amount']) ? array_sum($monthly_services_income['month_11_amount']) : 0;
$month_12_services_income_amount = isset($monthly_services_income['month_12_amount']) ? array_sum($monthly_services_income['month_12_amount']) : 0;

$opening_total_cash_ins[] = $opening_services_income_amount;
$month_1_total_cash_ins[] = $month_1_services_income_amount;
$month_2_total_cash_ins[] = $month_2_services_income_amount;
$month_3_total_cash_ins[] = $month_3_services_income_amount;
$month_4_total_cash_ins[] = $month_4_services_income_amount;
$month_5_total_cash_ins[] = $month_5_services_income_amount;
$month_6_total_cash_ins[] = $month_6_services_income_amount;
$month_7_total_cash_ins[] = $month_7_services_income_amount;
$month_8_total_cash_ins[] = $month_8_services_income_amount;
$month_9_total_cash_ins[] = $month_9_services_income_amount;
$month_10_total_cash_ins[] = $month_10_services_income_amount;
$month_11_total_cash_ins[] = $month_11_services_income_amount;
$month_12_total_cash_ins[] = $month_12_services_income_amount;

$opening_accounts_received_amount = isset($monthly_accounts_received['opening_amount']) ? array_sum($monthly_accounts_received['opening_amount']) : 0;
$month_1_accounts_received_amount = isset($monthly_accounts_received['month_1_amount']) ? array_sum($monthly_accounts_received['month_1_amount']) : 0;
$month_2_accounts_received_amount = isset($monthly_accounts_received['month_2_amount']) ? array_sum($monthly_accounts_received['month_2_amount']) : 0;
$month_3_accounts_received_amount = isset($monthly_accounts_received['month_3_amount']) ? array_sum($monthly_accounts_received['month_3_amount']) : 0;
$month_4_accounts_received_amount = isset($monthly_accounts_received['month_4_amount']) ? array_sum($monthly_accounts_received['month_4_amount']) : 0;
$month_5_accounts_received_amount = isset($monthly_accounts_received['month_5_amount']) ? array_sum($monthly_accounts_received['month_5_amount']) : 0;
$month_6_accounts_received_amount = isset($monthly_accounts_received['month_6_amount']) ? array_sum($monthly_accounts_received['month_6_amount']) : 0;
$month_7_accounts_received_amount = isset($monthly_accounts_received['month_7_amount']) ? array_sum($monthly_accounts_received['month_7_amount']) : 0;
$month_8_accounts_received_amount = isset($monthly_accounts_received['month_8_amount']) ? array_sum($monthly_accounts_received['month_8_amount']) : 0;
$month_9_accounts_received_amount = isset($monthly_accounts_received['month_9_amount']) ? array_sum($monthly_accounts_received['month_9_amount']) : 0;
$month_10_accounts_received_amount = isset($monthly_accounts_received['month_10_amount']) ? array_sum($monthly_accounts_received['month_10_amount']) : 0;
$month_11_accounts_received_amount = isset($monthly_accounts_received['month_11_amount']) ? array_sum($monthly_accounts_received['month_11_amount']) : 0;
$month_12_accounts_received_amount = isset($monthly_accounts_received['month_12_amount']) ? array_sum($monthly_accounts_received['month_12_amount']) : 0;

$opening_total_cash_ins[] = $opening_accounts_received_amount;
$month_1_total_cash_ins[] = $month_1_accounts_received_amount;
$month_2_total_cash_ins[] = $month_2_accounts_received_amount;
$month_3_total_cash_ins[] = $month_3_accounts_received_amount;
$month_4_total_cash_ins[] = $month_4_accounts_received_amount;
$month_5_total_cash_ins[] = $month_5_accounts_received_amount;
$month_6_total_cash_ins[] = $month_6_accounts_received_amount;
$month_7_total_cash_ins[] = $month_7_accounts_received_amount;
$month_8_total_cash_ins[] = $month_8_accounts_received_amount;
$month_9_total_cash_ins[] = $month_9_accounts_received_amount;
$month_10_total_cash_ins[] = $month_10_accounts_received_amount;
$month_11_total_cash_ins[] = $month_11_accounts_received_amount;
$month_12_total_cash_ins[] = $month_12_accounts_received_amount;

$opening_capital_amount = isset($monthly_capital['opening_amount']) ? array_sum($monthly_capital['opening_amount']) : 0;
$month_1_capital_amount = isset($monthly_capital['month_1_amount']) ? array_sum($monthly_capital['month_1_amount']) : 0;
$month_2_capital_amount = isset($monthly_capital['month_2_amount']) ? array_sum($monthly_capital['month_2_amount']) : 0;
$month_3_capital_amount = isset($monthly_capital['month_3_amount']) ? array_sum($monthly_capital['month_3_amount']) : 0;
$month_4_capital_amount = isset($monthly_capital['month_4_amount']) ? array_sum($monthly_capital['month_4_amount']) : 0;
$month_5_capital_amount = isset($monthly_capital['month_5_amount']) ? array_sum($monthly_capital['month_5_amount']) : 0;
$month_6_capital_amount = isset($monthly_capital['month_6_amount']) ? array_sum($monthly_capital['month_6_amount']) : 0;
$month_7_capital_amount = isset($monthly_capital['month_7_amount']) ? array_sum($monthly_capital['month_7_amount']) : 0;
$month_8_capital_amount = isset($monthly_capital['month_8_amount']) ? array_sum($monthly_capital['month_8_amount']) : 0;
$month_9_capital_amount = isset($monthly_capital['month_9_amount']) ? array_sum($monthly_capital['month_9_amount']) : 0;
$month_10_capital_amount = isset($monthly_capital['month_10_amount']) ? array_sum($monthly_capital['month_10_amount']) : 0;
$month_11_capital_amount = isset($monthly_capital['month_11_amount']) ? array_sum($monthly_capital['month_11_amount']) : 0;
$month_12_capital_amount = isset($monthly_capital['month_12_amount']) ? array_sum($monthly_capital['month_12_amount']) : 0;

$opening_total_cash_ins[] = $opening_capital_amount;
$month_1_total_cash_ins[] = $month_1_capital_amount;
$month_2_total_cash_ins[] = $month_2_capital_amount;
$month_3_total_cash_ins[] = $month_3_capital_amount;
$month_4_total_cash_ins[] = $month_4_capital_amount;
$month_5_total_cash_ins[] = $month_5_capital_amount;
$month_6_total_cash_ins[] = $month_6_capital_amount;
$month_7_total_cash_ins[] = $month_7_capital_amount;
$month_8_total_cash_ins[] = $month_8_capital_amount;
$month_9_total_cash_ins[] = $month_9_capital_amount;
$month_10_total_cash_ins[] = $month_10_capital_amount;
$month_11_total_cash_ins[] = $month_11_capital_amount;
$month_12_total_cash_ins[] = $month_12_capital_amount;

$opening_extra_income_amount = isset($monthly_extra_income['opening_amount']) ? array_sum($monthly_extra_income['opening_amount']) : 0;
$month_1_extra_income_amount = isset($monthly_extra_income['month_1_amount']) ? array_sum($monthly_extra_income['month_1_amount']) : 0;
$month_2_extra_income_amount = isset($monthly_extra_income['month_2_amount']) ? array_sum($monthly_extra_income['month_2_amount']) : 0;
$month_3_extra_income_amount = isset($monthly_extra_income['month_3_amount']) ? array_sum($monthly_extra_income['month_3_amount']) : 0;
$month_4_extra_income_amount = isset($monthly_extra_income['month_4_amount']) ? array_sum($monthly_extra_income['month_4_amount']) : 0;
$month_5_extra_income_amount = isset($monthly_extra_income['month_5_amount']) ? array_sum($monthly_extra_income['month_5_amount']) : 0;
$month_6_extra_income_amount = isset($monthly_extra_income['month_6_amount']) ? array_sum($monthly_extra_income['month_6_amount']) : 0;
$month_7_extra_income_amount = isset($monthly_extra_income['month_7_amount']) ? array_sum($monthly_extra_income['month_7_amount']) : 0;
$month_8_extra_income_amount = isset($monthly_extra_income['month_8_amount']) ? array_sum($monthly_extra_income['month_8_amount']) : 0;
$month_9_extra_income_amount = isset($monthly_extra_income['month_9_amount']) ? array_sum($monthly_extra_income['month_9_amount']) : 0;
$month_10_extra_income_amount = isset($monthly_extra_income['month_10_amount']) ? array_sum($monthly_extra_income['month_10_amount']) : 0;
$month_11_extra_income_amount = isset($monthly_extra_income['month_11_amount']) ? array_sum($monthly_extra_income['month_11_amount']) : 0;
$month_12_extra_income_amount = isset($monthly_extra_income['month_12_amount']) ? array_sum($monthly_extra_income['month_12_amount']) : 0;

$opening_total_cash_ins[] = $opening_extra_income_amount;
$month_1_total_cash_ins[] = $month_1_extra_income_amount;
$month_2_total_cash_ins[] = $month_2_extra_income_amount;
$month_3_total_cash_ins[] = $month_3_extra_income_amount;
$month_4_total_cash_ins[] = $month_4_extra_income_amount;
$month_5_total_cash_ins[] = $month_5_extra_income_amount;
$month_6_total_cash_ins[] = $month_6_extra_income_amount;
$month_7_total_cash_ins[] = $month_7_extra_income_amount;
$month_8_total_cash_ins[] = $month_8_extra_income_amount;
$month_9_total_cash_ins[] = $month_9_extra_income_amount;
$month_10_total_cash_ins[] = $month_10_extra_income_amount;
$month_11_total_cash_ins[] = $month_11_extra_income_amount;
$month_12_total_cash_ins[] = $month_12_extra_income_amount;



$opening_accounts_paid_amount = isset($monthly_accounts_paid['opening_amount']) ? array_sum($monthly_accounts_paid['opening_amount']) : 0;
$month_1_accounts_paid_amount = isset($monthly_accounts_paid['month_1_amount']) ? array_sum($monthly_accounts_paid['month_1_amount']) : 0;
$month_2_accounts_paid_amount = isset($monthly_accounts_paid['month_2_amount']) ? array_sum($monthly_accounts_paid['month_2_amount']) : 0;
$month_3_accounts_paid_amount = isset($monthly_accounts_paid['month_3_amount']) ? array_sum($monthly_accounts_paid['month_3_amount']) : 0;
$month_4_accounts_paid_amount = isset($monthly_accounts_paid['month_4_amount']) ? array_sum($monthly_accounts_paid['month_4_amount']) : 0;
$month_5_accounts_paid_amount = isset($monthly_accounts_paid['month_5_amount']) ? array_sum($monthly_accounts_paid['month_5_amount']) : 0;
$month_6_accounts_paid_amount = isset($monthly_accounts_paid['month_6_amount']) ? array_sum($monthly_accounts_paid['month_6_amount']) : 0;
$month_7_accounts_paid_amount = isset($monthly_accounts_paid['month_7_amount']) ? array_sum($monthly_accounts_paid['month_7_amount']) : 0;
$month_8_accounts_paid_amount = isset($monthly_accounts_paid['month_8_amount']) ? array_sum($monthly_accounts_paid['month_8_amount']) : 0;
$month_9_accounts_paid_amount = isset($monthly_accounts_paid['month_9_amount']) ? array_sum($monthly_accounts_paid['month_9_amount']) : 0;
$month_10_accounts_paid_amount = isset($monthly_accounts_paid['month_10_amount']) ? array_sum($monthly_accounts_paid['month_10_amount']) : 0;
$month_11_accounts_paid_amount = isset($monthly_accounts_paid['month_11_amount']) ? array_sum($monthly_accounts_paid['month_11_amount']) : 0;
$month_12_accounts_paid_amount = isset($monthly_accounts_paid['month_12_amount']) ? array_sum($monthly_accounts_paid['month_12_amount']) : 0;

$opening_total_cash_out[] = $opening_accounts_paid_amount;
$month_1_total_cash_out[] = $month_1_accounts_paid_amount;
$month_2_total_cash_out[] = $month_2_accounts_paid_amount;
$month_3_total_cash_out[] = $month_3_accounts_paid_amount;
$month_4_total_cash_out[] = $month_4_accounts_paid_amount;
$month_5_total_cash_out[] = $month_5_accounts_paid_amount;
$month_6_total_cash_out[] = $month_6_accounts_paid_amount;
$month_7_total_cash_out[] = $month_7_accounts_paid_amount;
$month_8_total_cash_out[] = $month_8_accounts_paid_amount;
$month_9_total_cash_out[] = $month_9_accounts_paid_amount;
$month_10_total_cash_out[] = $month_10_accounts_paid_amount;
$month_11_total_cash_out[] = $month_11_accounts_paid_amount;
$month_12_total_cash_out[] = $month_12_accounts_paid_amount;

$opening_purchases_amount = isset($monthly_purchases['opening_amount']) ? array_sum($monthly_purchases['opening_amount']) : 0;
$month_1_purchases_amount = isset($monthly_purchases['month_1_amount']) ? array_sum($monthly_purchases['month_1_amount']) : 0;
$month_2_purchases_amount = isset($monthly_purchases['month_2_amount']) ? array_sum($monthly_purchases['month_2_amount']) : 0;
$month_3_purchases_amount = isset($monthly_purchases['month_3_amount']) ? array_sum($monthly_purchases['month_3_amount']) : 0;
$month_4_purchases_amount = isset($monthly_purchases['month_4_amount']) ? array_sum($monthly_purchases['month_4_amount']) : 0;
$month_5_purchases_amount = isset($monthly_purchases['month_5_amount']) ? array_sum($monthly_purchases['month_5_amount']) : 0;
$month_6_purchases_amount = isset($monthly_purchases['month_6_amount']) ? array_sum($monthly_purchases['month_6_amount']) : 0;
$month_7_purchases_amount = isset($monthly_purchases['month_7_amount']) ? array_sum($monthly_purchases['month_7_amount']) : 0;
$month_8_purchases_amount = isset($monthly_purchases['month_8_amount']) ? array_sum($monthly_purchases['month_8_amount']) : 0;
$month_9_purchases_amount = isset($monthly_purchases['month_9_amount']) ? array_sum($monthly_purchases['month_9_amount']) : 0;
$month_10_purchases_amount = isset($monthly_purchases['month_10_amount']) ? array_sum($monthly_purchases['month_10_amount']) : 0;
$month_11_purchases_amount = isset($monthly_purchases['month_11_amount']) ? array_sum($monthly_purchases['month_11_amount']) : 0;
$month_12_purchases_amount = isset($monthly_purchases['month_12_amount']) ? array_sum($monthly_purchases['month_12_amount']) : 0;

$opening_total_cash_out[] = $opening_purchases_amount;
$month_1_total_cash_out[] = $month_1_purchases_amount;
$month_2_total_cash_out[] = $month_2_purchases_amount;
$month_3_total_cash_out[] = $month_3_purchases_amount;
$month_4_total_cash_out[] = $month_4_purchases_amount;
$month_5_total_cash_out[] = $month_5_purchases_amount;
$month_6_total_cash_out[] = $month_6_purchases_amount;
$month_7_total_cash_out[] = $month_7_purchases_amount;
$month_8_total_cash_out[] = $month_8_purchases_amount;
$month_9_total_cash_out[] = $month_9_purchases_amount;
$month_10_total_cash_out[] = $month_10_purchases_amount;
$month_11_total_cash_out[] = $month_11_purchases_amount;
$month_12_total_cash_out[] = $month_12_purchases_amount;


$opening_payslips_amount = isset($monthly_payslips['opening_amount']) ? array_sum($monthly_payslips['opening_amount']) : 0;
$month_1_payslips_amount = isset($monthly_payslips['month_1_amount']) ? array_sum($monthly_payslips['month_1_amount']) : 0;
$month_2_payslips_amount = isset($monthly_payslips['month_2_amount']) ? array_sum($monthly_payslips['month_2_amount']) : 0;
$month_3_payslips_amount = isset($monthly_payslips['month_3_amount']) ? array_sum($monthly_payslips['month_3_amount']) : 0;
$month_4_payslips_amount = isset($monthly_payslips['month_4_amount']) ? array_sum($monthly_payslips['month_4_amount']) : 0;
$month_5_payslips_amount = isset($monthly_payslips['month_5_amount']) ? array_sum($monthly_payslips['month_5_amount']) : 0;
$month_6_payslips_amount = isset($monthly_payslips['month_6_amount']) ? array_sum($monthly_payslips['month_6_amount']) : 0;
$month_7_payslips_amount = isset($monthly_payslips['month_7_amount']) ? array_sum($monthly_payslips['month_7_amount']) : 0;
$month_8_payslips_amount = isset($monthly_payslips['month_8_amount']) ? array_sum($monthly_payslips['month_8_amount']) : 0;
$month_9_payslips_amount = isset($monthly_payslips['month_9_amount']) ? array_sum($monthly_payslips['month_9_amount']) : 0;
$month_10_payslips_amount = isset($monthly_payslips['month_10_amount']) ? array_sum($monthly_payslips['month_10_amount']) : 0;
$month_11_payslips_amount = isset($monthly_payslips['month_11_amount']) ? array_sum($monthly_payslips['month_11_amount']) : 0;
$month_12_payslips_amount = isset($monthly_payslips['month_12_amount']) ? array_sum($monthly_payslips['month_12_amount']) : 0;

$opening_advances_amount = isset($monthly_advances['opening_amount']) ? array_sum($monthly_advances['opening_amount']) : 0;
$month_1_advances_amount = isset($monthly_advances['month_1_amount']) ? array_sum($monthly_advances['month_1_amount']) : 0;
$month_2_advances_amount = isset($monthly_advances['month_2_amount']) ? array_sum($monthly_advances['month_2_amount']) : 0;
$month_3_advances_amount = isset($monthly_advances['month_3_amount']) ? array_sum($monthly_advances['month_3_amount']) : 0;
$month_4_advances_amount = isset($monthly_advances['month_4_amount']) ? array_sum($monthly_advances['month_4_amount']) : 0;
$month_5_advances_amount = isset($monthly_advances['month_5_amount']) ? array_sum($monthly_advances['month_5_amount']) : 0;
$month_6_advances_amount = isset($monthly_advances['month_6_amount']) ? array_sum($monthly_advances['month_6_amount']) : 0;
$month_7_advances_amount = isset($monthly_advances['month_7_amount']) ? array_sum($monthly_advances['month_7_amount']) : 0;
$month_8_advances_amount = isset($monthly_advances['month_8_amount']) ? array_sum($monthly_advances['month_8_amount']) : 0;
$month_9_advances_amount = isset($monthly_advances['month_9_amount']) ? array_sum($monthly_advances['month_9_amount']) : 0;
$month_10_advances_amount = isset($monthly_advances['month_10_amount']) ? array_sum($monthly_advances['month_10_amount']) : 0;
$month_11_advances_amount = isset($monthly_advances['month_11_amount']) ? array_sum($monthly_advances['month_11_amount']) : 0;
$month_12_advances_amount = isset($monthly_advances['month_12_amount']) ? array_sum($monthly_advances['month_12_amount']) : 0;

$opening_total_salaries_calculated = $opening_payslips_amount + $opening_advances_amount;
$month_1_total_salaries_calculated = $month_1_payslips_amount + $month_1_advances_amount;
$month_2_total_salaries_calculated = $month_2_payslips_amount + $month_2_advances_amount;
$month_3_total_salaries_calculated = $month_3_payslips_amount + $month_3_advances_amount;
$month_4_total_salaries_calculated = $month_4_payslips_amount + $month_4_advances_amount;
$month_5_total_salaries_calculated = $month_5_payslips_amount + $month_5_advances_amount;
$month_6_total_salaries_calculated = $month_6_payslips_amount + $month_6_advances_amount;
$month_7_total_salaries_calculated = $month_7_payslips_amount + $month_7_advances_amount;
$month_8_total_salaries_calculated = $month_8_payslips_amount + $month_8_advances_amount;
$month_9_total_salaries_calculated = $month_9_payslips_amount + $month_9_advances_amount;
$month_10_total_salaries_calculated = $month_10_payslips_amount + $month_10_advances_amount;
$month_11_total_salaries_calculated = $month_11_payslips_amount + $month_11_advances_amount;
$month_12_total_salaries_calculated = $month_12_payslips_amount + $month_12_advances_amount;

$opening_total_cash_out[] = $opening_total_salaries_calculated;
$month_1_total_cash_out[] = $month_1_total_salaries_calculated;
$month_2_total_cash_out[] = $month_2_total_salaries_calculated;
$month_3_total_cash_out[] = $month_3_total_salaries_calculated;
$month_4_total_cash_out[] = $month_4_total_salaries_calculated;
$month_5_total_cash_out[] = $month_5_total_salaries_calculated;
$month_6_total_cash_out[] = $month_6_total_salaries_calculated;
$month_7_total_cash_out[] = $month_7_total_salaries_calculated;
$month_8_total_cash_out[] = $month_8_total_salaries_calculated;
$month_9_total_cash_out[] = $month_9_total_salaries_calculated;
$month_10_total_cash_out[] = $month_10_total_salaries_calculated;
$month_11_total_cash_out[] = $month_11_total_salaries_calculated;
$month_12_total_cash_out[] = $month_12_total_salaries_calculated;

// $opening_total_cash_out[] = isset($opening_expenses['opening_amount']) ? array_sum($opening_expenses['opening_amount']) : 0;
// $opening_total_cash_out[] = isset($opening_assets['opening_amount']) ? array_sum($opening_assets['opening_amount']) : 0;

$opening_expenses_amount = isset($monthly_expenses['opening_amount']) ? array_sum($monthly_expenses['opening_amount']) : 0;
$month_1_expenses_amount = isset($monthly_expenses['month_1_amount']) ? array_sum($monthly_expenses['month_1_amount']) : 0;
$month_2_expenses_amount = isset($monthly_expenses['month_2_amount']) ? array_sum($monthly_expenses['month_2_amount']) : 0;
$month_3_expenses_amount = isset($monthly_expenses['month_3_amount']) ? array_sum($monthly_expenses['month_3_amount']) : 0;
$month_4_expenses_amount = isset($monthly_expenses['month_4_amount']) ? array_sum($monthly_expenses['month_4_amount']) : 0;
$month_5_expenses_amount = isset($monthly_expenses['month_5_amount']) ? array_sum($monthly_expenses['month_5_amount']) : 0;
$month_6_expenses_amount = isset($monthly_expenses['month_6_amount']) ? array_sum($monthly_expenses['month_6_amount']) : 0;
$month_7_expenses_amount = isset($monthly_expenses['month_7_amount']) ? array_sum($monthly_expenses['month_7_amount']) : 0;
$month_8_expenses_amount = isset($monthly_expenses['month_8_amount']) ? array_sum($monthly_expenses['month_8_amount']) : 0;
$month_9_expenses_amount = isset($monthly_expenses['month_9_amount']) ? array_sum($monthly_expenses['month_9_amount']) : 0;
$month_10_expenses_amount = isset($monthly_expenses['month_10_amount']) ? array_sum($monthly_expenses['month_10_amount']) : 0;
$month_11_expenses_amount = isset($monthly_expenses['month_11_amount']) ? array_sum($monthly_expenses['month_11_amount']) : 0;
$month_12_expenses_amount = isset($monthly_expenses['month_12_amount']) ? array_sum($monthly_expenses['month_12_amount']) : 0;

$opening_total_cash_out[] = $opening_expenses_amount;
$month_1_total_cash_out[] = $month_1_expenses_amount;
$month_2_total_cash_out[] = $month_2_expenses_amount;
$month_3_total_cash_out[] = $month_3_expenses_amount;
$month_4_total_cash_out[] = $month_4_expenses_amount;
$month_5_total_cash_out[] = $month_5_expenses_amount;
$month_6_total_cash_out[] = $month_6_expenses_amount;
$month_7_total_cash_out[] = $month_7_expenses_amount;
$month_8_total_cash_out[] = $month_8_expenses_amount;
$month_9_total_cash_out[] = $month_9_expenses_amount;
$month_10_total_cash_out[] = $month_10_expenses_amount;
$month_11_total_cash_out[] = $month_11_expenses_amount;
$month_12_total_cash_out[] = $month_12_expenses_amount;

$opening_assets_amount = isset($monthly_assets['opening_amount']) ? array_sum($monthly_assets['opening_amount']) : 0;
$month_1_assets_amount = isset($monthly_assets['month_1_amount']) ? array_sum($monthly_assets['month_1_amount']) : 0;
$month_2_assets_amount = isset($monthly_assets['month_2_amount']) ? array_sum($monthly_assets['month_2_amount']) : 0;
$month_3_assets_amount = isset($monthly_assets['month_3_amount']) ? array_sum($monthly_assets['month_3_amount']) : 0;
$month_4_assets_amount = isset($monthly_assets['month_4_amount']) ? array_sum($monthly_assets['month_4_amount']) : 0;
$month_5_assets_amount = isset($monthly_assets['month_5_amount']) ? array_sum($monthly_assets['month_5_amount']) : 0;
$month_6_assets_amount = isset($monthly_assets['month_6_amount']) ? array_sum($monthly_assets['month_6_amount']) : 0;
$month_7_assets_amount = isset($monthly_assets['month_7_amount']) ? array_sum($monthly_assets['month_7_amount']) : 0;
$month_8_assets_amount = isset($monthly_assets['month_8_amount']) ? array_sum($monthly_assets['month_8_amount']) : 0;
$month_9_assets_amount = isset($monthly_assets['month_9_amount']) ? array_sum($monthly_assets['month_9_amount']) : 0;
$month_10_assets_amount = isset($monthly_assets['month_10_amount']) ? array_sum($monthly_assets['month_10_amount']) : 0;
$month_11_assets_amount = isset($monthly_assets['month_11_amount']) ? array_sum($monthly_assets['month_11_amount']) : 0;
$month_12_assets_amount = isset($monthly_assets['month_12_amount']) ? array_sum($monthly_assets['month_12_amount']) : 0;

$opening_total_cash_out[] = $opening_assets_amount;
$month_1_total_cash_out[] = $month_1_assets_amount;
$month_2_total_cash_out[] = $month_2_assets_amount;
$month_3_total_cash_out[] = $month_3_assets_amount;
$month_4_total_cash_out[] = $month_4_assets_amount;
$month_5_total_cash_out[] = $month_5_assets_amount;
$month_6_total_cash_out[] = $month_6_assets_amount;
$month_7_total_cash_out[] = $month_7_assets_amount;
$month_8_total_cash_out[] = $month_8_assets_amount;
$month_9_total_cash_out[] = $month_9_assets_amount;
$month_10_total_cash_out[] = $month_10_assets_amount;
$month_11_total_cash_out[] = $month_11_assets_amount;
$month_12_total_cash_out[] = $month_12_assets_amount;

$opening_net_cash_flow = array_sum($opening_total_cash_ins) - array_sum($opening_total_cash_out);
$opening_month_1_net_cash_flow = array_sum($month_1_total_cash_ins) - array_sum($month_1_total_cash_out);
$opening_month_2_net_cash_flow = array_sum($month_2_total_cash_ins) - array_sum($month_2_total_cash_out);
$opening_month_3_net_cash_flow = array_sum($month_3_total_cash_ins) - array_sum($month_3_total_cash_out);
$opening_month_4_net_cash_flow = array_sum($month_4_total_cash_ins) - array_sum($month_4_total_cash_out);
$opening_month_5_net_cash_flow = array_sum($month_5_total_cash_ins) - array_sum($month_5_total_cash_out);
$opening_month_6_net_cash_flow = array_sum($month_6_total_cash_ins) - array_sum($month_6_total_cash_out);
$opening_month_7_net_cash_flow = array_sum($month_7_total_cash_ins) - array_sum($month_7_total_cash_out);
$opening_month_8_net_cash_flow = array_sum($month_8_total_cash_ins) - array_sum($month_8_total_cash_out);
$opening_month_9_net_cash_flow = array_sum($month_9_total_cash_ins) - array_sum($month_9_total_cash_out);
$opening_month_10_net_cash_flow = array_sum($month_10_total_cash_ins) - array_sum($month_10_total_cash_out);
$opening_month_11_net_cash_flow = array_sum($month_11_total_cash_ins) - array_sum($month_11_total_cash_out);
$opening_month_12_net_cash_flow = array_sum($month_12_total_cash_ins) - array_sum($month_12_total_cash_out);

?>


<div class="wrapper wrapper-content animated fadeInRight">

    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins" style="margin-bottom: 10px;">
                <div class="ibox-content">                   
                    <form id="financial-cash-flow-search-form" action="<?= url('/cash-flow'); ?>">
                    <div class="row">
                        <div class="col-md-10">
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <div class="input-group date">
                                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                            <select class="form-control chosen-select" name="currency">
                                                <option value="" selected="">-- <?= print_lang($app_lang,'select_currency'); ?> --</option>
                                                <?php foreach($currencies as $row){ ?>
                                                    <option value="<?= $row['uid']; ?>" <?php if($search_currency == $row['uid']){ echo 'selected="selected"'; } ?>><?= $row['name']; ?> (<?= $row['symbol']; ?>)</option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-4">
                                    <div class="form-group">
                                        <div class="input-group date">
                                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                            <select class="form-control chosen-select" name="year">
                                                <option value="" selected="">-- <?= print_lang($app_lang,'select'); ?> --</option>
                                                <?php foreach(get_last_20_years_data() as $key => $row){ ?>
                                                    <option value="<?= $key; ?>" <?php if($search_year == $key){ echo 'selected="selected"'; } ?>><?= $row; ?></option>
                                                <?php } ?>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-2 text-right">
                            <button class="btn btn-w-m btn-primary custom-font-btn-search" type="submit"><?= print_lang($app_lang,'search'); ?></button>
                        </div>
                    </div>
                    </form>

                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">

                    <div class="table-responsive">
                        <table class="table" style="width: 100%;">
                            <thead>
                                <tr>
                                    <th colspan="13" class="text-center" style="border: 1px solid #000 !important; background: #2b9c1b !important; font-size: 18px; font-style: italic; text-decoration: underline; color: #fff !important; font-size: 18px !important; vertical-align: middle;"><?= print_lang($app_lang,'financial_cash_flow_title'); ?></th>
                                </tr>
                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_jan'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_Feb'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_march'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_april'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_may'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_june'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_july'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_august'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_sep'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_oct'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_nov'); ?></td>
                                    <td style="border: 1px solid #000 !important; font-style: italic; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_months_dec'); ?></td>
                                </tr>
                            </thead>
                            <tbody>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_opening_balance'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_1_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_2_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_3_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_4_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_5_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_6_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_7_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_8_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_9_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_10_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_11_net_cash_flow); ?></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_cash_in'); ?></td>
                                    <td colspan="12" style="border: 1px solid #000 !important; background: #ebe8e8; color: #000;"></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_cash_sales'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_total_cash_sales_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_total_cash_sales_calculated); ?></td>
                                </tr>
                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_services_income'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_services_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_services_income_amount); ?></td>
                                </tr>
                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_accounts_received'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_accounts_received_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_accounts_received_amount); ?></td>
                                </tr>
                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_owners_equity'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_capital_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_capital_amount); ?></td>
                                </tr>
                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_other_income'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_extra_income_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_extra_income_amount); ?></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_total_cash_in'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_1_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_2_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_3_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_4_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_5_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_6_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_7_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_8_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_9_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_10_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_11_total_cash_ins)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_12_total_cash_ins)); ?></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_cash_out'); ?></td>
                                    <td colspan="12" style="border: 1px solid #000 !important; background: #ebe8e8; color: #000;"></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_loan_payments'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_accounts_paid_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_accounts_paid_amount); ?></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_purchases'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_purchases_amount); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_purchases_amount); ?></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= print_lang($app_lang,'financial_cash_flow_thead_salaries'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_1_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_2_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_3_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_4_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_5_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_6_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_7_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_8_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_9_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_10_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_11_total_salaries_calculated); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($month_12_total_salaries_calculated); ?></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_expenses'); ?></td>
                                    <td colspan="12" style="border: 1px solid #000 !important; background: #ebe8e8; color: #000;"></td>
                                </tr>

                                <?php
                                    if(!empty($monthly_expenses_types)){
                                        foreach($monthly_expenses_types as $row){ ?>
                                        <tr>
                                            <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= $row['name']; ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_1_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_2_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_3_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_4_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_5_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_6_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_7_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_8_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_9_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_10_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_11_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_12_amount'])); ?></td>
                                        </tr>
                                <?php }} ?>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_assets'); ?></td>
                                    <td colspan="12" style="border: 1px solid #000 !important; background: #ebe8e8; color: #000;"></td>
                                </tr>

                                <?php
                                    if(!empty($monthly_assets_types)){
                                        foreach($monthly_assets_types as $row){ ?>
                                        <tr>
                                            <td style="border: 1px solid #000 !important; background: #2b9c1b; font-size: 15px; color: #fff;"><?= $row['name']; ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_1_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_2_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_3_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_4_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_5_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_6_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_7_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_8_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_9_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_10_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_11_amount'])); ?></td>
                                            <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($row['month_12_amount'])); ?></td>
                                        </tr>
                                <?php }} ?>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_total_cash_out'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_1_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_2_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_3_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_4_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_5_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_6_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_7_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_8_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_9_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_10_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_11_total_cash_out)); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format(array_sum($month_12_total_cash_out)); ?></td>
                                </tr>

                                <tr>
                                    <td style="border: 1px solid #000 !important; background: #ebe8e8; font-size: 15px; color: #000;"><?= print_lang($app_lang,'financial_cash_flow_thead_net_cash_flow'); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_1_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_2_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_3_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_4_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_5_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_6_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_7_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_8_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_9_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_10_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_11_net_cash_flow); ?></td>
                                    <td style="border: 1px solid #000 !important; color: #000;"><?= $requested_currency_data['symbol'].' '.amount_number_format($opening_month_12_net_cash_flow); ?></td>
                                </tr>

                            </tbody>
                        </table>
                    </div>

                </div>
            </div>
        </div>
    </div>

</div>