<?php $item_settings = get_item_settings(); ?>
<style type="text/css">
    <?php if($app_direction == 'rtl'){ ?>
        .reports-menu-item a{ font-size: 20px !important; }
    <?php }else{ ?>
        .reports-menu-item a{ font-size: 15px !important; }
    <?php } ?>
    .col-md-6{padding: 2px !important;}
    .double-items-sets{margin: 0;}
    .reports-menu-head .reports-menu-item > a{width: 95%;}
</style>

<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'reports'); ?></h2>
        <ol class="breadcrumb">
            <li>
                <a class="url-elem" href="<?php echo url('/dashboard'); ?>"><?= print_lang($app_lang,'home'); ?></a>
            </li>
            <li class="active">
                <strong><?= print_lang($app_lang,'reports'); ?></strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
        
    </div>
</div>


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

                    <h2 class="text-center font-bold" style="margin: 10px 0 20px;"><?= print_lang($app_lang,'reports'); ?></h2>
                    <hr><br>

                    <div class="row">
                        <div class="col-md-3">
                            <div class="reports-menu-head animatedLight">
                                <h2><span><?= print_lang($app_lang,'financial'); ?></span></h2>
                                <div class="row">
                                    <?php if(check_user_access('micro_balance_sheet') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/micro-balance-sheet'); ?>"><?= print_lang($app_lang,'micro_balance_sheet'); ?></a></div>
                                    <?php } ?>
                                    <?php if(check_user_access('chart_of_accounts') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/chart-of-accounts'); ?>"><?= print_lang($app_lang,'financial_chart_of_accounts_menu'); ?></a></div>
                                    <?php } ?>
                                    <?php if(check_user_access('balance_sheet') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/balance-sheet'); ?>"><?= print_lang($app_lang,'financial_balance_sheet_title'); ?></a></div>
                                    <?php } ?>
                                    <?php if(check_user_access('trial_balance') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/trial-balance'); ?>"><?= print_lang($app_lang,'financial_trial_balance_title'); ?></a></div>
                                    <?php } ?>
                                    <?php if(check_user_access('cash_flow') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/cash-flow'); ?>"><?= print_lang($app_lang,'financial_cash_flow_title'); ?></a></div>
                                    <?php } ?>
                                    <?php if(check_user_access('income_statement') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/income-statement'); ?>"><?= print_lang($app_lang,'financial_income_statement_title'); ?></a></div>
                                    <?php } ?>
                                    <?php if(check_user_access('profit_loss') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/profit-and-loss'); ?>"><?= print_lang($app_lang,'profit_and_loss'); ?></a></div>
                                    <?php } ?>
                                    <?php if(check_user_access('balance_summary') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/client-balance-summary'); ?>"><?= print_lang($app_lang,'client_balance_summary'); ?></a></div>
                                    <?php } ?>

                                    <?php if($item_settings['distribution'] == 'enable'){ ?>
                                    <?php if(check_user_access('balance_summary') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/marketers-income-statement'); ?>"><?= print_lang($app_lang,'marketers_balance_summary'); ?></a></div>
                                    <?php }} ?>

                                    <?php if(check_user_access('balance_summary') === TRUE){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/incomes-vs-expenses'); ?>"><?= print_lang($app_lang,'incomes_vs_expenses'); ?></a></div>
                                    <?php } ?>

                                    <?php if($item_settings['distribution'] == 'enable'){ ?>
                                        <div class="col-md-12 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/sales-man-receovery'); ?>"><?= print_lang($app_lang,'mod_sales_man_receovery_rep_menu'); ?></a></div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-9">
                            <div class="row">
                                <div class="col-md-6">
                                    <div class="reports-menu-head animatedLight">
                                        <h2><span><?= print_lang($app_lang,'accounts_reports'); ?></span></h2>
                                        <div class="row double-items-sets">
                                            <?php 
                                            foreach($root_accounts as $row){
                                                $value = $row['uid'];
                                                if(check_user_access($value) === TRUE){
                                            ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/accounts').'?type='.$row['uid'].'&currency=usd'; ?>"><?= ($row['branch'] == 'general') ? print_lang($app_lang,'builtin_account_'.$row['uid']) : $row['name']; ?></a></div>
                                            <?php }} ?>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-6">
                                    <div class="reports-menu-head animatedLight">
                                        <h2><span><?= print_lang($app_lang,'general_reports'); ?></span></h2>
                                        <div class="row double-items-sets">
                                            <?php if(check_user_access('balance_summary_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/balance-summary'); ?>"><?= print_lang($app_lang,'balance_summary'); ?></a></div>
                                            <?php } ?>

                                            <?php if($item_settings['item_stock'] == 'enable'){ ?>

                                                <?php if(check_user_access('inventory_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/inventory'); ?>"><?= print_lang($app_lang,'inventory'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('sale_stock_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sale-stock'); ?>"><?= print_lang($app_lang,'mod_sale_stock_rep_menu'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('sale_stock_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/item-stock'); ?>"><?= print_lang($app_lang,'mod_item_stock_rep_menu'); ?></a></div>
                                                <?php } ?>

                                            <?php } ?>

                                            <?php if($item_settings['expenses'] == 'enable'){ ?>
                                            <?php if(check_user_access('expense_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/expenses').'?currency=usd'; ?>"><?= print_lang($app_lang,'expenses'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['item_stock'] == 'enable'){ ?>

                                                <?php if(check_user_access('raw_warehouse_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/raw-warehouses'); ?>"><?= print_lang($app_lang,'raw_warehouses'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('sales_warehouse_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sales-warehouses'); ?>"><?= print_lang($app_lang,'sale_warehouses'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('items_ledger_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/items-ledger'); ?>"><?= print_lang($app_lang,'items_ledger'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('damage_stock_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/damage-items'); ?>"><?= print_lang($app_lang,'damage_items'); ?></a></div>
                                                <?php } ?>

                                            <?php } ?>


                                            <?php if($item_settings['sale'] == 'enable'){ ?>

                                                <?php if(check_user_access('sales_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sales'); ?>"><?= print_lang($app_lang,'sales'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('sales_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sales-and-return'); ?>"><?= print_lang($app_lang,'sales_and_return_report'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('sales_item_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sales-items'); ?>"><?= print_lang($app_lang,'sales_items'); ?></a></div>
                                                <?php } ?>

                                            <?php } ?>

                                            <?php if($item_settings['purchase'] == 'enable'){ ?>

                                                <?php if(check_user_access('purchase_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/purchases'); ?>"><?= print_lang($app_lang,'purchases'); ?></a></div>
                                                <?php } ?>
                                                <?php if(check_user_access('purchase_item_report') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/purchases-items'); ?>"><?= print_lang($app_lang,'purchases_items'); ?></a></div>
                                                <?php } ?>

                                            <?php } ?>

                                            <?php if($item_settings['production'] == 'enable'){ ?>
                                            <?php if(check_user_access('production_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/production'); ?>"><?= print_lang($app_lang,'production'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['sale'] == 'enable'){ ?>
                                            <?php if(check_user_access('client_item_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/client-items'); ?>"><?= print_lang($app_lang,'client_items'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['purchase'] == 'enable'){ ?>
                                            <?php if(check_user_access('purchase_expense_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/purchase-expenses'); ?>"><?= print_lang($app_lang,'purchase_expenses'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['sale'] == 'enable'){ ?>
                                            <?php if(check_user_access('sale_expense_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sale-expenses'); ?>"><?= print_lang($app_lang,'sales_expenses'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['production'] == 'enable'){ ?>
                                            <?php if(check_user_access('production_expense_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/production-expenses'); ?>"><?= print_lang($app_lang,'production_expenses'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['transferm'] == 'enable'){ ?>
                                            <?php if(check_user_access('warehouse_transfer_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/warehouse-transfer'); ?>"><?= print_lang($app_lang,'warehouse_transfer'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['sale'] == 'enable'){ ?>
                                            <?php if(check_user_access('sale_discount_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sale-discount'); ?>"><?= print_lang($app_lang,'sales_discount'); ?></a></div>
                                            <?php }} ?>


                                            <?php if($item_settings['distribution'] == 'enable'){ ?>
                                            <?php if(check_user_access('sale_discount_report_2') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sale-discount-2'); ?>"><?= print_lang($app_lang,'sales_discount_2'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['purchase'] == 'enable'){ ?>
                                            <?php if(check_user_access('purchase_discount_report') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/purchase-discount'); ?>"><?= print_lang($app_lang,'purchases_discount'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['transferm'] == 'enable'){ ?>

                                                <?php if(check_user_access('transfer_in_discount_1') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/transfer-in-discount-1'); ?>"><?= print_lang($app_lang,'trans_in_discount_1'); ?></a></div>
                                                <?php } ?>

                                                <?php if(check_user_access('transfer_in_discount_2') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/transfer-in-discount-2'); ?>"><?= print_lang($app_lang,'trans_in_discount_2'); ?></a></div>
                                                <?php } ?>

                                                <?php if(check_user_access('transfer_out_discount_1') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/transfer-out-discount-1'); ?>"><?= print_lang($app_lang,'trans_out_discount_1'); ?></a></div>
                                                <?php } ?>

                                                <?php if(check_user_access('transfer_out_discount_2') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/transfer-out-discount-2'); ?>"><?= print_lang($app_lang,'trans_out_discount_2'); ?></a></div>
                                                <?php } ?>

                                            <?php } ?>

                                            <?php if($item_settings['sale'] == 'enable'){ ?>
                                            <?php if(check_user_access('sale_services_report_rights') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sales-service'); ?>"><?= print_lang($app_lang,'sale_service'); ?></a></div>
                                            <?php }} ?>
                                            
                                            <?php if($item_settings['service'] == 'enable'){ ?>

                                                <?php if(check_user_access('services_sales_reports_rights') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/services'); ?>"><?= print_lang($app_lang,'report_services'); ?></a></div>
                                                <?php } ?>

                                                <?php if(check_user_access('services_items_reports_rights') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/services-items'); ?>"><?= print_lang($app_lang,'report_services_item'); ?></a></div>
                                                <?php } ?>

                                            <?php } ?>


                                            <?php if($item_settings['distribution'] == 'enable'){ ?>
                                            <?php if(check_user_access('marketers_report_rights') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/marketers'); ?>"><?= print_lang($app_lang,'report_marketers'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['item_stock'] == 'enable'){ ?>
                                            <?php if(check_user_access('batch_stock_report_rights') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/batch-wise-stock'); ?>"><?= print_lang($app_lang,'batch_wise_stock'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['sale'] == 'enable'){ ?>
                                            <?php if(check_user_access('sale_return_report_rights') === TRUE){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/sales-return'); ?>"><?= print_lang($app_lang,'sales_return_report'); ?></a></div>
                                            <?php }} ?>

                                            <?php if($item_settings['item_stock'] == 'enable'){ ?>
                                                <?php if(check_user_access('near_expiry_report_rights') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/near-expiry-stock'); ?>"><?= print_lang($app_lang,'expiry_report_menu'); ?></a></div>
                                                <?php } ?>

                                                <?php if(check_user_access('expired_report_rights') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/expired-stock'); ?>"><?= print_lang($app_lang,'expired_report_menu'); ?></a></div>
                                                <?php } ?>

                                                <?php if(check_user_access('shortage_report_rights') === TRUE){ ?>
                                                    <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/shortage-stock'); ?>"><?= print_lang($app_lang,'shortage_report_menu'); ?></a></div>
                                                <?php } ?>
                                            <?php } ?>

                                            <?php if($item_settings['bundle_toop'] == 'enable'){ ?>
                                                <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/bundle-toop'); ?>"><?= print_lang($app_lang,'bundle_toop_report_btn_title'); ?></a></div>
                                            <?php } ?>
                                            
                                            <div class="col-md-6 reports-menu-item"><a class="btn btn-primary" href="<?php echo url('/reports/all-bonuses'); ?>"><?= print_lang($app_lang,'mod_all_bonuses_rep_menuu'); ?></a></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

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