Had to partly revert r23045 when it comes to the PostedDate of book-closing txns.

The book-closing txn currently assume that their
posted-date is the end date plus 12 hours, so that the closing txn can
be distinguished from normal txns of the last day. This is the only
case within GnuCash where the PostedDate is a different time-of-day
that what the GDate normally says as a normalized date.

We better change this sometime in the future so that the PostedDate
doesn't silently contain this hidden extra meaning...

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@23047 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2013-06-13 07:32:23 +00:00
parent bae4862575
commit 91b8b3c14d

View File

@ -102,7 +102,14 @@ find_or_create_txn(struct CloseAccountsCB* cacb, gnc_commodity* cmdty)
txn->txn = xaccMallocTransaction(cacb->cbw->book); txn->txn = xaccMallocTransaction(cacb->cbw->book);
xaccTransBeginEdit(txn->txn); xaccTransBeginEdit(txn->txn);
xaccTransSetDateEnteredSecs(txn->txn, gnc_time (NULL)); xaccTransSetDateEnteredSecs(txn->txn, gnc_time (NULL));
xaccTransSetDatePostedSecsNormalized(txn->txn, cacb->cbw->close_date);
/* Watch out: The book-closing txn currently assume that their
posted-date is the end date plus 12 hours, so that the closing txn can
be distinguished from normal txns of the last day. This is the only
case within GnuCash where the PostedDate is a different time-of-day
that what the GDate normally says as a normalized date. */
xaccTransSetDatePostedSecs(txn->txn, cacb->cbw->close_date);
xaccTransSetDescription(txn->txn, cacb->cbw->desc); xaccTransSetDescription(txn->txn, cacb->cbw->desc);
xaccTransSetCurrency(txn->txn, cmdty); xaccTransSetCurrency(txn->txn, cmdty);
xaccTransSetIsClosingTxn(txn->txn, TRUE); xaccTransSetIsClosingTxn(txn->txn, TRUE);