<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU Affero General Public License,
- AGPL, as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
$page_security = 2;
// ----------------------------------------------------------------
LEFT JOIN ".TB_PREF."cust_branch as branch ON dtrans.branch_code=branch.branch_code,
".TB_PREF."sys_types stype
WHERE taxrec.trans_type=stype.type_id
+ AND (taxrec.amount != 0 OR taxrec.net_amount != 0)
AND taxrec.trans_type != 13
AND taxrec.tran_date >= '$fromdate'
AND taxrec.tran_date <= '$todate'
$rep->Header();
}
}
- if ($trans['net_amount'] > 0) {
+ if (in_array($trans['trans_type'], array(0,2,10,11))) {
$taxes[$trans['tax_type_id']]['taxout'] += $trans['amount'];
$taxes[$trans['tax_type_id']]['out'] += $trans['net_amount'];
} else {
- $taxes[$trans['tax_type_id']]['taxin'] -= $trans['amount'];
- $taxes[$trans['tax_type_id']]['in'] -= $trans['net_amount'];
+ $taxes[$trans['tax_type_id']]['taxin'] += $trans['amount'];
+ $taxes[$trans['tax_type_id']]['in'] += $trans['net_amount'];
}
-
$totalnet += $trans['net_amount'];
$totaltax += $trans['amount'];
}
$rep->TextCol(2, 3,number_format2($sum['taxout'], $dec));
$rep->TextCol(3, 4, number_format2($sum['in'], $dec));
$rep->TextCol(4, 5,number_format2($sum['taxin'], $dec));
- $rep->TextCol(5, 6, number_format2($sum['taxout']-$sum['taxin'], $dec));
- $taxtotal += $sum['taxout']-$sum['taxin'];
+ $rep->TextCol(5, 6, number_format2($sum['taxout']+$sum['taxin'], $dec));
+ $taxtotal += $sum['taxout']+$sum['taxin'];
$rep->NewLine();
}