gnucash maint: Correct txf output to use a minus sign, rather than parenthesis, for debits, without regard to locale settings, as is required by the txf pseudo-standard; was previously incorrectly using parenthesis for negatives in Windows environments, for example.
J. Alex Aycinena
alex.aycinena at code.gnucash.org
Sat Sep 6 19:46:52 EDT 2014
Updated via https://github.com/Gnucash/gnucash/commit/9ea36d7e (commit)
from https://github.com/Gnucash/gnucash/commit/3363a2c5 (commit)
commit 9ea36d7e9685527f55269496695dcda33d6a8892
Author: Alex Aycinena <alex.aycinena at gmail.com>
Date: Sat Sep 6 16:15:34 2014 -0700
Correct txf output to use a minus sign, rather than parenthesis, for debits, without regard to locale settings, as is required by the txf pseudo-standard; was previously incorrectly using parenthesis for negatives in Windows environments, for example.
diff --git a/src/report/locale-specific/us/taxtxf.scm b/src/report/locale-specific/us/taxtxf.scm
index 302d5d2..146c6e8 100644
--- a/src/report/locale-specific/us/taxtxf.scm
+++ b/src/report/locale-specific/us/taxtxf.scm
@@ -521,7 +521,6 @@
(define (render-txf-account account account-value d? date x? x-date
type code copy tax-entity-type sold-desc)
(let* ((print-info (gnc-account-print-info account #f))
- (value (xaccPrintAmount account-value print-info))
(txf? (gnc:account-get-txf account)))
(if (and txf?
(not (gnc-numeric-zero-p account-value)))
@@ -570,10 +569,12 @@
(xaccAccountGetName account)))
(else "")))
- (value (string-append "$" ; reverse signs on dr's & cr's
- (xaccPrintAmount
- (gnc-numeric-neg account-value)
- print-info)))
+ (value (string-append "$" ; in txf output, income is positive; expense negative
+ ; liabilities are positive, assets are negative;
+ ; essentially, just reverse signs on dr's & cr's
+ (sprintf #f "%.2f" (gnc-numeric-to-double
+ (gnc-numeric-neg
+ account-value)))))
)
;; Based on TXF Spec of 6/16/06, V 041, and Quicken 98 output, the
;; fields by format are as follows, for F1040:
Summary of changes:
src/report/locale-specific/us/taxtxf.scm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
More information about the gnucash-changes
mailing list