gnucash maint: Bug 797482 - Can't edit date when using Edit Payment function

Geert Janssens gjanssens at code.gnucash.org
Fri Dec 27 12:39:04 EST 2019


Updated	 via  https://github.com/Gnucash/gnucash/commit/cd869832 (commit)
	from  https://github.com/Gnucash/gnucash/commit/3be7f993 (commit)



commit cd8698321dd9606daea06293a9631f16c242556a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Fri Dec 27 18:38:55 2019 +0100

    Bug 797482 - Can't edit date when using Edit Payment function

diff --git a/libgnucash/engine/gncOwner.c b/libgnucash/engine/gncOwner.c
index 32d5e0de4..03e938fd9 100644
--- a/libgnucash/engine/gncOwner.c
+++ b/libgnucash/engine/gncOwner.c
@@ -838,8 +838,6 @@ gncOwnerCreatePaymentLotSecs (const GncOwner *owner, Transaction **preset_txn,
         xaccTransSetDescription (txn, name ? name : "");
         /* set per book option */
         xaccTransSetCurrency (txn, commodity);
-        xaccTransSetDateEnteredSecs (txn, gnc_time (NULL));
-        xaccTransSetDatePostedSecs (txn, date);
 
 
         /* The split for the transfer account */
@@ -892,6 +890,10 @@ gncOwnerCreatePaymentLotSecs (const GncOwner *owner, Transaction **preset_txn,
     gnc_set_num_action (txn, NULL, num, _("Payment"));
     xaccTransSetTxnType (txn, TXN_TYPE_PAYMENT);
 
+    /* Set date for transaction */
+    xaccTransSetDateEnteredSecs (txn, gnc_time (NULL));
+    xaccTransSetDatePostedSecs (txn, date);
+
     /* Commit this new transaction */
     xaccTransCommitEdit (txn);
     if (preset_txn)



Summary of changes:
 libgnucash/engine/gncOwner.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list