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

This commit is contained in:
Geert Janssens 2023-04-25 17:50:47 +02:00
parent 6a68872a90
commit 7e07c50485

View File

@ -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;