<?php

require_once "../../../class/Utils.php";
require_once "../../../class/DBWork.php";
require_once "../../../class_tax/DBTaxWork.php";
require_once "../../../class/SessionManager.php";
require_once './PHPExcel.php';
$tWork = new DBTaxWork(true);
try {
    $tWork->createWork($_POST, true);
    $res = $tWork->selectExcelDownloadData();
    $comp = $tWork->selectExcelDownloadDataAsCompany($_POST['co_id']);
} catch (Exception $e) {
    $tWork->destoryWork();
    $err = $e->getMessage();
    Util::serverLog($e);
    var_dump($err);
    exit;
}
$_downloadFilename = $_POST['downFileName'];
$tot_supply = 0;
$tot_tax = 0;
$tot_total = 0;
for ($i = 0; $i < count($res); $i++) {
    $obj = $res[$i];
    $tot_supply = $tot_supply + $obj['atax_supply_price'];
    $tot_tax = $tot_tax + $obj['atax_tax'];
}
$tot_total = $tot_tax + $tot_supply;
//Excel Start
try {