From: Joe Hunt Date: Sat, 7 Apr 2012 14:31:46 +0000 (+0200) Subject: Rerun of /gl/includes/db/gl_db_trans.inc and /reporting/rep709.php. X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=d423b0a5a4f7e82859a1b8e4274da43699d57d0b;p=textcart.git Rerun of /gl/includes/db/gl_db_trans.inc and /reporting/rep709.php. --- diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index 2802c79..0134776 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -443,12 +443,12 @@ function get_tax_summary($from, $to) ." || (trans_type=".ST_JOURNAL ." AND amount<0)" ." || trans_type=".ST_CUSTCREDIT.", amount*ex_rate,0)) payable, - SUM(IF(trans_type=".ST_CUSTCREDIT." || trans_type=".ST_SUPPINVOICE.",-1,1)* + SUM(IF(trans_type=".ST_CUSTCREDIT." || trans_type=".ST_SUPPINVOICE." || trans_type=".ST_JOURNAL.",-1,1)* IF(trans_type=".ST_BANKDEPOSIT." || trans_type=".ST_SALESINVOICE ." || (trans_type=".ST_JOURNAL ." AND amount<0)" ." || trans_type=".ST_CUSTCREDIT.", 0, net_amount*ex_rate)) net_input, - SUM(IF(trans_type=".ST_CUSTCREDIT." || trans_type=".ST_SUPPINVOICE.",-1,1)* + SUM(IF(trans_type=".ST_CUSTCREDIT." || trans_type=".ST_SUPPINVOICE." || trans_type=".ST_JOURNAL.",-1,1)* IF(trans_type=".ST_BANKDEPOSIT." || trans_type=".ST_SALESINVOICE ." || (trans_type=".ST_JOURNAL ." AND amount<0)" ." || trans_type=".ST_CUSTCREDIT.", 0, amount*ex_rate)) collectible, diff --git a/reporting/rep709.php b/reporting/rep709.php index 54b1a90..21646d7 100644 --- a/reporting/rep709.php +++ b/reporting/rep709.php @@ -152,8 +152,12 @@ function print_tax_report() } } 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']; + $taxes[$trans['tax_type_id']]['taxin'] += $trans['amount']; + $taxes[$trans['tax_type_id']]['in'] += $trans['net_amount']; + } + elseif ($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'];