X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Frep709.php;h=668021b2fa8adc40c050b2e542ecb5e2ed56b238;hb=a5242af68e65661edb7175412444dce536a7f311;hp=842a7663bba036645499a316720e9d4b2f359732;hpb=871bc1f187ad6e5622a80c7dd8aadc48d8ea70fd;p=fa-stable.git diff --git a/reporting/rep709.php b/reporting/rep709.php index 842a7663..668021b2 100644 --- a/reporting/rep709.php +++ b/reporting/rep709.php @@ -1,13 +1,13 @@ . + See the License here . ***********************************************************************/ $page_security = 2; // ---------------------------------------------------------------- @@ -48,6 +48,7 @@ function getTaxTransactions($from, $to) 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' @@ -144,14 +145,13 @@ function print_tax_report() $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']; } @@ -180,8 +180,8 @@ function print_tax_report() $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(); }