From ad267682d727da166d4c27dfe2142f7e8d7791cd Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Mon, 25 Mar 2019 16:11:37 +0800 Subject: [PATCH] [transaction] fix transaction other-account display Previously the 'Transfer from/to' column would render "Split Transaction" for single-split. This commit hides transfer. --- gnucash/report/standard-reports/transaction.scm | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gnucash/report/standard-reports/transaction.scm b/gnucash/report/standard-reports/transaction.scm index 930bc999e1..d1b3b94fa9 100644 --- a/gnucash/report/standard-reports/transaction.scm +++ b/gnucash/report/standard-reports/transaction.scm @@ -1157,14 +1157,18 @@ be excluded from periodic reporting.") (column-uses? 'account-name) (column-uses? 'account-full-name))))) - (add-if (or (column-uses? 'other-account-name) (column-uses? 'other-account-code)) + (add-if (or (column-uses? 'other-account-name) + (column-uses? 'other-account-code)) (vector (_ "Transfer from/to") (lambda (split transaction-row?) - (define other-account (xaccSplitGetAccount (xaccSplitGetOtherSplit split))) - (account-namestring other-account - (column-uses? 'other-account-code) - (column-uses? 'other-account-name) - (column-uses? 'other-account-full-name))))) + (and (< 1 (xaccTransCountSplits + (xaccSplitGetParent split))) + (account-namestring + (xaccSplitGetAccount + (xaccSplitGetOtherSplit split)) + (column-uses? 'other-account-code) + (column-uses? 'other-account-name) + (column-uses? 'other-account-full-name)))))) (add-if (column-uses? 'shares) (vector (_ "Shares")