gnucash stable: Bug 799602 - Unit Price on Australian Tax Invoice will NOT display...

John Ralls jralls at code.gnucash.org
Tue May 27 15:24:19 EDT 2025


Updated	 via  https://github.com/Gnucash/gnucash/commit/1b4471d4 (commit)
	from  https://github.com/Gnucash/gnucash/commit/03581932 (commit)



commit 1b4471d4e89a9b1a814d05498956c409814ede57
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon May 26 19:51:48 2025 -0700

    Bug 799602 - Unit Price on Australian Tax Invoice will NOT display...
    
    as decimals (Revisited).
    
    The regular invoice report had a similar problem.
    The default price renderer displays two more decimal places than the
    currency's scu, necessitating a change to the invoice tests.

diff --git a/gnucash/report/reports/standard/invoice.scm b/gnucash/report/reports/standard/invoice.scm
index 6036b89112..6d8ae05d7b 100644
--- a/gnucash/report/reports/standard/invoice.scm
+++ b/gnucash/report/reports/standard/invoice.scm
@@ -632,7 +632,7 @@ for styling the invoice. Please see the exported report for the CSS class names.
           (addif (price-col used-columns)
                  (gnc:make-html-table-cell/markup
                   "number-cell"
-                  (gnc:make-gnc-monetary
+                  (gnc:default-price-renderer
                    currency (if cust-doc?
                                 (gncEntryGetInvPrice entry)
                                 (gncEntryGetBillPrice entry)))))
diff --git a/gnucash/report/reports/standard/test/test-invoice.scm b/gnucash/report/reports/standard/test/test-invoice.scm
index ba9451506c..470f425f56 100644
--- a/gnucash/report/reports/standard/test/test-invoice.scm
+++ b/gnucash/report/reports/standard/test/test-invoice.scm
@@ -97,7 +97,7 @@
         '("$6.00" "$6.00" "$6.00" "$6.00")
         (sxml-get-row-col "entries-table" sxml #f -1))
       (test-equal "inv-1 simple entry details are correct"
-        '("entry-1-desc" "entry-1-action" "2.00" "$3.00" "0.00 %" "T" "$0.00" "$6.00")
+        '("entry-1-desc" "entry-1-action" "2.00" "$3.0000" "0.00 %" "T" "$0.00" "$6.00")
         (cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
       (test-equal "inv-1 cust-name is correct"
         '("cust-1-name")
@@ -130,7 +130,7 @@
         '("$6.00" "$6.00" "$6.00" "$6.00")
         (sxml-get-row-col "entries-table" sxml #f -1))
       (test-equal "inv-2 simple entry details are correct"
-        '("entry-inv-2-desc" "entry-inv-2-action" "2.00" "$3.00" "0.00 %" "T" "$0.00" "$6.00")
+        '("entry-inv-2-desc" "entry-inv-2-action" "2.00" "$3.0000" "0.00 %" "T" "$0.00" "$6.00")
         (cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
       (test-equal "inv-2 cust-name is correct"
         '("cust-1-name")
@@ -156,7 +156,7 @@
         '("$6.00" "$6.00" "$6.00" "$6.00")
         (sxml-get-row-col "entries-table" sxml #f -1))
       (test-equal "inv-3 simple entry details are correct"
-        '("entry-inv-3-desc" "entry-inv-3-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
+        '("entry-inv-3-desc" "entry-inv-3-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
         (cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
       (test-equal "inv-3 vend-name is correct"
         '("vend-1-name")
@@ -174,7 +174,7 @@
         '("$6.00" "$6.00" "$6.00" "$6.00")
         (sxml-get-row-col "entries-table" sxml #f -1))
       (test-equal "inv-4 simple entry details are correct"
-        '("entry-inv-4-desc" "entry-inv-4-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
+        '("entry-inv-4-desc" "entry-inv-4-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
         (cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
       (test-equal "inv-4 vend-name is correct"
         '("emp-1-name")
@@ -192,7 +192,7 @@
         '("$6.00" "$6.00" "$6.00" "$6.00")
         (sxml-get-row-col "entries-table" sxml #f -1))
       (test-equal "inv-5 simple entry details are correct"
-        '("entry-5-desc" "entry-5-action" "2.00" "$3.00" "0.00 %" "T" "$0.00" "$6.00")
+        '("entry-5-desc" "entry-5-action" "2.00" "$3.0000" "0.00 %" "T" "$0.00" "$6.00")
         (cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
       (test-equal "inv-5 cust-name is correct"
         '("cust-1-name")
@@ -206,7 +206,7 @@
         '("$6.00" "$6.00" "$6.00" "$6.00")
         (sxml-get-row-col "entries-table" sxml #f -1))
       (test-equal "inv-6 simple entry details are correct"
-        '("entry-inv-6-desc" "entry-inv-6-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
+        '("entry-inv-6-desc" "entry-inv-6-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
         (cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
       (test-equal "inv-6 vend-name is correct"
         '("vend-1-name")
@@ -224,7 +224,7 @@
         '("$6.00" "$6.00" "$6.00" "$6.00")
         (sxml-get-row-col "entries-table" sxml #f -1))
       (test-equal "inv-7 simple entry details are correct"
-        '("entry-inv-7-desc" "entry-inv-7-action" "2.00" "$3.00" "T" "$0.00" "$6.00")
+        '("entry-inv-7-desc" "entry-inv-7-action" "2.00" "$3.0000" "T" "$0.00" "$6.00")
         (cdr (sxml-get-row-col "entries-table" sxml 1 #f)))
       (test-equal "inv-7 vend-name is correct"
         '("emp-1-name")
diff --git a/gnucash/report/reports/support/receipt.eguile.scm b/gnucash/report/reports/support/receipt.eguile.scm
index 4c217d7d7f..b8f850a26a 100644
--- a/gnucash/report/reports/support/receipt.eguile.scm
+++ b/gnucash/report/reports/support/receipt.eguile.scm
@@ -174,8 +174,8 @@
           <td align="left"><?scm:d (qof-print-date (gncEntryGetDate entry)) ?></td>
           <td align="left" ><?scm:d (gncEntryGetDescription entry) ?></td>
           <td align="right"><?scm:d (fmtnumeric qty) ?></td>
-          <td align="right"><?scm:d (format #f "~4,2,,,'0f" (gnc-numeric-to-double each)) ?></td>
-          <td align="right" nowrap><?scm:d (format #f "~4,2,,,'0f" (gnc-numeric-to-double rval)) ?>
+          <td align="right"><?scm:d (gnc:default-price-renderer currency each) ?></td>
+          <td align="right" nowrap><?scm:d (fmtmoney currency rval) ?>
               <?scm (if tax? (begin ?>
                  T
               <?scm ) (begin ?>



Summary of changes:
 gnucash/report/reports/standard/invoice.scm           |  2 +-
 gnucash/report/reports/standard/test/test-invoice.scm | 14 +++++++-------
 gnucash/report/reports/support/receipt.eguile.scm     |  4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)



More information about the gnucash-changes mailing list