gnucash stable: Bug 798844 - "Assign as Payment" does nothing in 4.14 & 5.0

Geert Janssens gjanssens at code.gnucash.org
Tue Apr 25 11:51:30 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/7e07c504 (commit)
	from  https://github.com/Gnucash/gnucash/commit/6a68872a (commit)



commit 7e07c50485d2891aadc0457822e6a1e1257d6c0f
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Apr 25 17:50:47 2023 +0200

    Bug 798844 - "Assign as Payment" does nothing in 4.14 & 5.0

diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index 1e62e2dcb5..b1d048ff51 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -1821,7 +1821,14 @@ PaymentWindow * gnc_ui_payment_new_with_txn (GtkWindow* parent, GncOwner *owner,
         gnc_ui_payment_window_set_date(pw, &txn_date);
     }
 
-    gnc_ui_payment_window_set_amount(pw, xaccSplitConvertAmount (payment_split, post_acct));
+    gnc_numeric amount = xaccSplitGetAmount (payment_split);
+    /* Note: at this point post account selected in newly created payment dialog
+     * may differ from what we got from select_txn_lots above.
+     * Use the dialog's post account commodity to optionally convert the amount
+     * to to display to the user */
+    if (pw->post_acct)
+        amount = xaccSplitConvertAmount (payment_split, pw->post_acct);
+    gnc_ui_payment_window_set_amount(pw, amount);
     if (payment_split)
         gnc_ui_payment_window_set_xferaccount(pw, xaccSplitGetAccount(payment_split));
     return pw;



Summary of changes:
 gnucash/gnome/dialog-payment.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list