function print_tax_report()
{
- global $path_to_root, $trans_dir, $Hooks, $systypes_array;
+ global $path_to_root, $trans_dir, $systypes_array;
$from = $_POST['PARAM_0'];
$to = $_POST['PARAM_1'];
$summaryOnly = $_POST['PARAM_2'];
$comments = $_POST['PARAM_3'];
+ $destination = $_POST['PARAM_4'];
- include_once($path_to_root . "/reporting/includes/pdf_report.inc");
+ if ($destination)
+ include_once($path_to_root . "/reporting/includes/excel_report.inc");
+ else
+ include_once($path_to_root . "/reporting/includes/pdf_report.inc");
$dec = user_price_dec();
$rep->Info($params, $cols, $headers, $aligns);
if (!$summaryOnly)
{
- $rep->Header();
+ $rep->NewPage();
}
$totalnet = 0.0;
if ($rep->row < $rep->bottomMargin + $rep->lineHeight)
{
$rep->Line($rep->row - 2);
- $rep->Header();
+ $rep->NewPage();
}
}
- if (in_array($trans['trans_type'], array(ST_BANKDEPOSIT,ST_SALESINVOICE,ST_CUSTCREDIT))) {
+ if ($trans['trans_type']==ST_JOURNAL && $trans['amount']<0) {
+ $taxes[$trans['tax_type_id']]['taxout'] -= $trans['amount'];
+ $taxes[$trans['tax_type_id']]['out'] -= $trans['net_amount'];
+ }
+ elseif (in_array($trans['trans_type'], array(ST_BANKDEPOSIT,ST_SALESINVOICE,ST_CUSTCREDIT))) {
$taxes[$trans['tax_type_id']]['taxout'] += $trans['amount'];
$taxes[$trans['tax_type_id']]['out'] += $trans['net_amount'];
} else {
$aligns2 = array('left', 'right', 'right', 'right', 'right', 'right', 'right');
- for ($i = 0; $i < count($cols2); $i++)
- $rep->cols[$i] = $rep->leftMargin + $cols2[$i];
+ $rep->Info($params, $cols2, $headers2, $aligns2);
+
+ //for ($i = 0; $i < count($cols2); $i++)
+ // $rep->cols[$i] = $rep->leftMargin + $cols2[$i];
$rep->headers = $headers2;
$rep->aligns = $aligns2;
- $rep->Header();
+ $rep->NewPage();
$taxtotal = 0;
foreach( $taxes as $id=>$sum)
$rep->Font();
$rep->NewLine();
- if (method_exists($Hooks, 'TaxFunction'))
- {
- $Hooks->TaxFunction();
- }
+ hook_tax_report_done();
$rep->End();
}