<style type="text/css">
    td,tr,th{border: 1px solid black !important; font-size: 15px !important; font-weight: 700;}
    @media print{
        #dynamic-content-container{background: #fff;}
            .navbar-default.navbar-static-side{display: none !important;}
            #page-wrapper{margin: 0px !important; padding: 0 !important;}
            .row.border-bottom{display: none !important;}
            .footer.fixed{display: none;}
            .ibox-content{padding: 0 !important;}
            #incomes-vs-expenses-search-form{display: none !important;}
            td,tr,th{border: 1px solid black !important; font-size: 15px !important; font-weight: 700;}
            body {
            -webkit-print-color-adjust:exact;
            background: #fff;
            }
    }
</style>
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2><?= print_lang($app_lang,'incomes_expenses_title'); ?></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,'incomes_expenses_breadcrumb'); ?></strong>
            </li>
        </ol>
    </div>
    <div class="col-lg-2">
        
    </div>
</div>


<div class="wrapper wrapper-content animated fadeInRight">
    <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,'incomes_expenses_title'); ?></h2>
                    
                    <form id="incomes-vs-expenses-search-form" action="<?= url('/incomes-vs-expenses'); ?>">
                    <div class="row">
                        <div class="col-md-9">
                            <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">
                                        <?php if($branch_calander == 'persian'){ ?>
                                            <input type="text" class="form-control persian-date" value="<?= $search_from; ?>" name="from" placeholder="<?= print_lang($app_lang,'from'); ?>" readonly="" style="background: #fff;">
                                        <?php }else{ ?>
                                            <input type="date" class="form-control" name="from" value="<?= $search_from; ?>">
                                        <?php } ?>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="form-group">
                                        <?php if($branch_calander == 'persian'){ ?>
                                            <input type="text" class="form-control persian-date" value="<?= $search_to; ?>" name="to" placeholder="<?= print_lang($app_lang,'to'); ?>" readonly="" style="background: #fff;">
                                        <?php }else{ ?>
                                            <input type="date" class="form-control" name="to" value="<?= $search_to; ?>">
                                        <?php } ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3 text-right">
                            <button class="btn btn-w-m btn-primary custom-font-btn-search" type="submit"><?= print_lang($app_lang,'search'); ?></button>
                            <a href="javascript:void(0)" onclick="window.print()" class="btn btn-outline btn-primary dim"><i class="fa fa-print"></i></a>
                        </div>
                    </div>
                    </form>

                    <div class="table-responsive">
                        <table style="width: 100%;" class="table table-bordered">
                            <!-- <tr>
                                <td colspan="2"><strong><?= print_lang($app_lang,'incomes_expenses_incomes_title'); ?></strong></td>
                                <td colspan="2"><strong><?= print_lang($app_lang,'incomes_expenses_expenses_title'); ?></strong></td>
                            </tr> -->
                            <tr>
                                <td style="background: #00b0f0 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_source_incomes'); ?></strong></td>
                                <td style="text-align: center; background: #00b0f0 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_amount'); ?></strong></td>
                                <td style="background: #00b0f0 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_source_expenses'); ?></strong></td>
                                <td style="text-align: center; background: #00b0f0 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_amount'); ?></strong></td>
                            </tr>
                            <tr>
                                <td style="background: #039314 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_services'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['services']; ?></td>
                                <td style="background: #002060 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_general_expenses'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['expenses']; ?></td>
                            </tr>

                            <tr>
                                <td style="background: #039314 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_sales'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['sales']; ?></td>
                                <td style="background: #002060 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_purchases'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['purchases']; ?></td>
                            </tr>

                            <tr>
                                <td style="background: #039314 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_extra_incomes'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['extra_income']; ?></td>
                                <td style="background: #002060 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_salaries'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['salaries']; ?></td>
                            </tr>

                            <tr>
                                <td style="background: #039314 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_jv_received'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['jv_received']; ?></td>
                                <td style="background: #002060 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_sales_return'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['sales_return']; ?></td>
                            </tr>

                            <tr>
                                <td style="background: #039314 !important; color: #fff !important;"></td>
                                <td style="background: #bfbfbf !important; color: #000 !important;"></td>
                                <td style="background: #002060 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_transit'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['transit']; ?></td>
                            </tr>

                            <tr>
                                <td style="background: #039314 !important; color: #fff !important;"></td>
                                <td style="background: #bfbfbf !important; color: #000 !important;"></td>
                                <td style="background: #002060 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_production'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['production']; ?></td>
                            </tr>

                            <tr>
                                <td style="background: #039314 !important; color: #fff !important;"></td>
                                <td style="background: #bfbfbf !important; color: #000 !important;"></td>
                                <td style="background: #002060 !important; color: #fff !important;"><strong style="color: #fff !important;"><?= print_lang($app_lang,'incomes_expenses_jv_payment'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['jv_payment']; ?></td>
                            </tr>

                            <tr>
                                <td style="background: #ffff00 !important; color: #000 !important;"><strong><?= print_lang($app_lang,'incomes_expenses_incomes_jv'); ?></strong></td>
                                <td style="text-align: center; background: #d9d9d9 !important; color: #000 !important;"><?= $currency_show.' '.$pageData['total_income_with_jv']; ?></td>
                                <td style="background: #ffff00 !important; color: #000 !important;"><strong><?= print_lang($app_lang,'incomes_expenses_expenses_jv'); ?></strong></td>
                                <td style="text-align: center; background: #d9d9d9 !important; color: #000 !important;"><?= $currency_show.' '.$pageData['totals_expenses_with_jv']; ?></td>
                            </tr>
                            <tr>
                                <td style="background: #ffc000 !important; color: #000 !important;"><strong><?= print_lang($app_lang,'incomes_expenses_without_incomes_jv'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['total_income_without_jv']; ?></td>
                                <td style="background: #ffc000 !important; color: #000 !important;"><strong><?= print_lang($app_lang,'incomes_expenses_without_expenses_jv'); ?></strong></td>
                                <td style="text-align: center; background: #bfbfbf !important; color: #000 !important;"><?= $currency_show.' '.$pageData['totals_expenses_without_jv']; ?></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="background: #00b0f0 !important; color: #fff !important;"><strong><?= print_lang($app_lang,'incomes_expenses_balance_jv'); ?></strong></td>
                                <td colspan="2" style="<?php if($app_direction == 'rtl'){echo 'text-align: left;';}else{echo 'text-align: right;';}?> background: #92d050 !important; color: #000 !important;"><?= $currency_show.' '.$pageData['net_balance_with_jv']; ?></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="background: #2f75b5 !important; color: #fff !important;"><strong><?= print_lang($app_lang,'incomes_expenses_without_balance_jv'); ?></strong></td>
                                <td colspan="2" style="<?php if($app_direction == 'rtl'){echo 'text-align: left;';}else{echo 'text-align: right;';}?> background: #548235 !important; color: #000 !important;"><?= $currency_show.' '.$pageData['net_balance_without_jv']; ?></td>
                            </tr>
                        </table>
                    </div>

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