When importing the last line of the CSV the gtk_tree_model_get() never happens
and the following compare uses the previous value of new_id, which is now = id,
so the last invoice is never posted.
Set new_id = Null before gtk_tree_model_get() to ensure processing the last line.
If the transaction doesn't have the gdate-posted slot and the random
junk left on the stack where date lives happens to make a valid gdate
then timespec_to_gdate won't be called and a bogus date will be returned.
First step: Change the timestamp to 11:00 UTC instead of midnight local,
adjusting by an hour or two if the local timezone is one near the
International Date Line to keep the date from flipping around.
Scrub all old entries to make current files correct.
Note: This effectively disposes of the distinction of close-book transactions
having a noon instead of midnight timestamp as a way to distinguish them
from regular transactions, but that distinction doesn't seem to be used;
xaccTransIsCloseBook() is used instead.
This slightly changes the semantics of a 'None' default tax table
from 'taxable but no tax details given'
to 'not taxable'.
While not exactly the same the former is a highly unlikely
situation, where the latter is more common and hence makes
more sense. In the rare case a user does want to express
the old semantics this is still possible by explicitly
creating a tax table without any details.
Note this only influences newly entered entries. It has
no influence on existing ones.
There hasn't been a clist to iterate through since 2002, calling
gnc_import_TransInfo_refresh_destacc immediately after
gnc_import_TransInfo_set_destacc(...TRUE) is a no-op, and refresh_model_row
gets called immediately after run_account_picker_dialog_returns.
As a side benefit this might fix bug 757078.
Prevent re-entrance by checking that the static pointers, the second
freeing of which caused the crash. Set said pointers to NULL after
freeing them to make the dialog ready for the next invocation.
Save a default gain/loss account in a book KVP and clean up some other book-currency items.
The changes made are:
app-utils/gnc-ui-util.c & h - define new functions:
gnc_book_get_book_currency_name,
gnc_book_get_default_gain_loss_acct;
reflect changed function names: qof_book_get_book_currency_name,
gnc_valid_policy_name
app-utils/options.scm - reflect changed function name: gnc-valid-policy-name
app-utils/test/test-gnc-ui-util.c - include tests for gnc_book_get_default_gain_loss_acct;
reflect changed function name: gnc_book_get_book_currency_name
engine/policy-p.h - add policy name, description and hint to policy structure
engine/policy.c & h - simplify gnc_get_valid_policy_list & define new functions:
gnc_valid_policy, PolicyGetName, PolicyGetDescription,
PolicyGetHint, xaccGetLIFOPolicy
gnome-utils/dialog-options.c - conform to changes to gnc_get_valid_policy_list
and use new function gnc_cost_policy_select_new
gnome-utils/dialog-utils.c & h - define new function: gnc_cost_policy_select_new
libqof/qof/qofbook.cpp & h - define new property: PROP_OPT_DEFAULT_GAINS_ACCOUNT_GUID
and new function: qof_book_get_default_gain_loss_acct_guid
changed function name: qof_book_get_book_currency_name
libqof/qof/qofbookslots.h - define new option: OPTION_NAME_DEFAULT_GAINS_LOSS_ACCT_GUID
libqof/qof/test/test-qofbook.c - reflect changed function names: qof_book_get_book_currency_name,
gnc_valid_policy_name; add test for qof_book_get_default_gain_loss_acct_guid
Now that there is a subclass of boost::uuids::uuid, that subclass can be
used for GncGUID implementation. This removes the need for the untidy
casts to/from bost::uuids::uuid, and simplifies the logic in many areas.
Although we test libgtest_main, we don't test for libgmock_main. This
shouldn't be necessary since gmock was absorbed by gtest in upstream,
so I'm not planning on working hard to correct this problem robustly.
We'll just check for the source files in the other location where they
might be.