From fe64f5aeeeb771de7d60fcc605652380d08d2b7c Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Thu, 31 Jul 2003 02:01:41 +0000 Subject: [PATCH] * src/business/business-core/gncInvoice.c: set the date-entered on invoice transactions to "now" instead of the post date. This lets us know when an invoice was actually posted, or a payment was actually made. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@8980 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 5 +++++ src/business/business-core/gncInvoice.c | 9 ++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 172f69dbe1..4e1c33b8e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,11 @@ to the various columns displayed in the report currency. Partial fix for #118695. + * src/business/business-core/gncInvoice.c: set the date-entered on + invoice transactions to "now" instead of the post date. This + lets us know when an invoice was actually posted, or a payment + was actually made. + Support "gain/loss" balancing splits on stocks: * src/engine/Transaction.c: fix xaccSplitGetPrice() to return '0' if 'amount' is zero but 'value' is non-zero diff --git a/src/business/business-core/gncInvoice.c b/src/business/business-core/gncInvoice.c index 4c92ba0998..1e807055c5 100644 --- a/src/business/business-core/gncInvoice.c +++ b/src/business/business-core/gncInvoice.c @@ -756,8 +756,8 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, xaccTransSetCurrency (txn, invoice->currency); /* Entered and Posted at date */ + xaccTransSetDateEnteredSecs (txn, time(NULL)); if (post_date) { - xaccTransSetDateEnteredTS (txn, post_date); xaccTransSetDatePostedTS (txn, post_date); gncInvoiceSetDatePosted (invoice, *post_date); } @@ -941,10 +941,9 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc, xaccTransSetCurrency (t2, invoice->currency); /* Entered and Posted at date */ - if (post_date) { - xaccTransSetDateEnteredTS (t2, post_date); + xaccTransSetDateEnteredSecs (t2, time(NULL)); + if (post_date) xaccTransSetDatePostedTS (t2, post_date); - } /* Balance out this lot */ split = xaccMallocSplit (invoice->book); @@ -1110,7 +1109,7 @@ gncOwnerApplyPayment (GncOwner *owner, Account *posted_acc, Account *xfer_acc, xaccTransSetDescription (txn, name ? name : ""); xaccTransSetNum (txn, num); xaccTransSetCurrency (txn, commodity); - xaccTransSetDateEnteredTS (txn, &date); + xaccTransSetDateEnteredSecs (txn, time(NULL)); xaccTransSetDatePostedTS (txn, &date); xaccTransSetTxnType (txn, TXN_TYPE_PAYMENT);