Biggest problem was that almost well-formed transactions missing a currency
element wouldn't import correctly because the FindCommonCurrencies function
only used the old currency values, ignoring the commodity values in the
splits' accounts. A new function, xaccFindCommonCurrencies(), looks at those
first and then calls xaccFindOldCommonCurrencies only if it fails. That
addresses the cause of the import failure reported in 632166 and a big chunk
of the warning messages complained about in 632346.
A secondary problem, also addressed in this change, was that the last block
in xaccTransScrubCurrencyFromSplits always replaced the "amount" with the
"value". This is the right thing to do if the commodity for the split account
is a currency, but if it isn't, the replacement should be reversed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19744 57a11ea4-9604-0410-9ed3-97b8803252fd
Accounts with security elements would only use the security to update the
commodity if there wasn't a commodity; however, the files in the tests had
accounts which had a security and a commodity, where the commodity was a
currency. That's wrong. so now if the commodity is a currency, the security
will overwrite it.
Added the account name and element name to the log message to assist in
troubleshooting, should that be needed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19743 57a11ea4-9604-0410-9ed3-97b8803252fd
* dbi_conn_error_flag is deprecated, replace with dbi_conn_error
(Thanks, Christian).
* Switch from OS-determined HOST_NAME_MAX to locally defined
GNC_HOSTNAME_MAX so that the field is always 255 regardless of what
OS creates it.
* Use G_OS_WIN32 instead of naked WIN32
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19740 57a11ea4-9604-0410-9ed3-97b8803252fd
* Accounting Period: reorder options so the dates are on top
* Business: reorder options to clarify which options are general and which apply to invoices or bills only
* Business: remove obscure "Number of lines" option
* Register defaults: remove obscure "Number of lines" option
* General: remove "Show splash screen" option
While removing the "Number of lines" options, I have also removed most of the code that used this option. The number of lines was used to calculate the default window size in various places in the code. The code now simply uses sensible defaults for that.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19733 57a11ea4-9604-0410-9ed3-97b8803252fd
This patch changes the default rounding behaviour in GnuCash from
"Round to nearest even" to "Round away to infinity". See the bugreport
for more details on these different rounding methods.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19695 57a11ea4-9604-0410-9ed3-97b8803252fd
Replaces the pointer arithmetics with string functions and regexes where possible
to avoid typical pointer pitfalls.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19694 57a11ea4-9604-0410-9ed3-97b8803252fd
deletes an existing transaction. Log replay should now do exactly one xaccTransBeginEdit/xaccTransCommitEdit
call per logged transaction.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19689 57a11ea4-9604-0410-9ed3-97b8803252fd
Save as would make a new session the "current session" and attempt to
save it. If it failed, the new session (with an invalid database)
would remain the current session -- and would be marked clean. An
XML-only file-save-as dialog would be presented with no instructions
about what was going on.
With this change, if the "save as" fails, the old session is restored,
still marked unsaved. This should be much less confusing to users and
more likely to avoid data loss.
Yes, there's some duplicated code now, because do_save_as doesn't call
save. That's because save did some extra things that do_save_as
doesn't need and it didn't allow do_save_as to properly correct the
session. This could be refactored into some tiny functions, but that
seems a bit excessive to me.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19687 57a11ea4-9604-0410-9ed3-97b8803252fd
This caused the numbers in the "SX from txn" to appear as "220/100" ratios,
which we do not want.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19659 57a11ea4-9604-0410-9ed3-97b8803252fd
This was already the case in the standard file selector. This change makes the
two selection methods more consistent.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19658 57a11ea4-9604-0410-9ed3-97b8803252fd
Keep the old function names as convenience wrappers around the new function.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19657 57a11ea4-9604-0410-9ed3-97b8803252fd
Needed to remove an unimplemented function from <gnc-numeric.h>
header.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19653 57a11ea4-9604-0410-9ed3-97b8803252fd
With the original configuration, whatever script was found first on the path was used.
When testing development versions, this caused the also installed stable version to
be used as it happened to appear first on the path.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19651 57a11ea4-9604-0410-9ed3-97b8803252fd
The former should be found on (DY)LD_LIBRARY_PATH, the latter on
GNC_MODULE_PATH. These paths shouldn't overlap as that needlessly
confuses things.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19648 57a11ea4-9604-0410-9ed3-97b8803252fd
If slots table does not include gdate field, it will be added and all current slots will have a NULL value.
Tested on sqlite3 and mysql. Tested using the example gnucash file referenced from the bug report. When saved from XML -> sqlite3 -> XML, some timestamps changed their timezone because of a change of timezone (I'm in North America). I guess this is OK.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19647 57a11ea4-9604-0410-9ed3-97b8803252fd