Those two functions were merged into one, qof_instance_get_guid(), in
r15773, but they returned different values if the parameter was NULL.
Some code depends on the return value being guid_null(), or maybe even
NULL, so revert the changes entity->instance, where the entity is not
guaranteed to be non-NULL.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16212 57a11ea4-9604-0410-9ed3-97b8803252fd
single pair of fields attached to the QofInstance object.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16041 57a11ea4-9604-0410-9ed3-97b8803252fd
thus the running account balances. Fixes#386074.
BP
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15989 57a11ea4-9604-0410-9ed3-97b8803252fd
- Merge QofEntity into QofInstance
- Derive QofInstance from GObject
- Convert all QofInstance-derived objects to use GObject framework
- renamed qof_instance_init() to qof_instance_init_data()
- removed qof_instance_release() because it's no longer needed
Merge from branches/gobject-engine-dev-warlord (r15827)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15846 57a11ea4-9604-0410-9ed3-97b8803252fd
xaccSplitOrder. Add a new xaccSplitOrderDateOnly function.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15838 57a11ea4-9604-0410-9ed3-97b8803252fd
migrate each object's "free()" function to a combination of
dispose() and finalize().
(and yes, "make check" still passes all its tests)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gobject-engine-dev-warlord@15827 57a11ea4-9604-0410-9ed3-97b8803252fd
off the environment variable GNC_AUTO_SCRUB_LOTS instead of commenting
it out of the code. This make it easier for developers to test/users
to try lot scrubbing.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15791 57a11ea4-9604-0410-9ed3-97b8803252fd
point directly to their parent and have a simple GList of children.
(The old method was alternating data structures in the form Account,
AccountGroup, Account, AccountGroup, etc.)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15647 57a11ea4-9604-0410-9ed3-97b8803252fd
Override the Transaction Number to sort numerically.
* lib/libqof/qof/qofclass.h:
* lib/libqof/qof/qofquery.c:
* lib/libqof/qof/qofquerycore-p.h:
* lib/libqof/qof/qofquerycore.[ch]:
- Publish the QofCompareFunc prototype.
- Add a new QofParam param_compfcn parameter
- Change QofQuery to use the param_compfcn over the
default type compare function.
- create (and publish) a qof API to compare strings
as numbers: qof_string_number_compare_func()
* src/engine/Transaction.c:
Assign TRANS_NUM to use qof_string_numer_compare_func()
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14903 57a11ea4-9604-0410-9ed3-97b8803252fd
This new type is like QOF_TYPE_STRING but it sorts numerically
(first) and then sorts alphanumerically (by the tail of the
number). Added the QOF Type, the gnome-search support, and
modified TRANS_NUM to use the new type.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14892 57a11ea4-9604-0410-9ed3-97b8803252fd
This includes the now semi-functional postgres backend.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14198 57a11ea4-9604-0410-9ed3-97b8803252fd
dirtying the book implicitly without setting any time of first change.
Instead, make sure that committed Splits dirty their parent Transaction.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13958 57a11ea4-9604-0410-9ed3-97b8803252fd
cap-gains.c to Transaction.c.
Fix a logic error where "split->gains |= ~GAINS_STATUS_ADIRTY" was supposed
to be "split->gains &= ~GAINS_STATUS_ADIRTY".
Disable the loop-restart code in xaccTransScrubGainsDate() because I think
the state changes inside the loop will never cause a previously-skipped
Split to be not skipped during another pass.
Incidental:
make both xaccTransFindSplitByAccount() arguments 'const'
Internalize Begin/Commit edit block into xaccTransScrubSplits()
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13921 57a11ea4-9604-0410-9ed3-97b8803252fd
Add new function xaccTransGetReversedBy() to find the reversing transaction
if there is one.
This also ensures that the KVP changes are inside a Begin/Commit block.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13916 57a11ea4-9604-0410-9ed3-97b8803252fd
splits when computing capital gain's instead of just the opening lot.
Scrub lots when scrubbing everything else. Some MacOs X fixes.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13872 57a11ea4-9604-0410-9ed3-97b8803252fd
This is what I actually intended in r13130, but we want the stuff that
xaccTransCommitEdit provides over-and-above what qof_commit_edit provides.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13830 57a11ea4-9604-0410-9ed3-97b8803252fd
string. Mark it 'const' to prevent callers from trying to free it.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13786 57a11ea4-9604-0410-9ed3-97b8803252fd
* src/engine/Transaction.c:
* src/engine/test/test-date.c:
* src/backend/file/test/test-dom-converters1.c:
Fix 64-bit compile: Use G_GUINT64_FORMAT instead of %llu or lld
for Timespec seconds.
* src/app-utils/gnc-ui-util.c:
Fix 64-bit compile issues:
- Use QOF_SCANF_LLD instead of GNC_SCANF_LLD.
- Use QOF_SCANF_LLD and G_GINT64_FORMAT properly.
- replace %lld with G_GINT64_FORMAT
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13780 57a11ea4-9604-0410-9ed3-97b8803252fd
Enable emission of some new Split events.
Use xaccSplitRollbackEdit() in implementation of xaccTransRollbackEdit().
Avoid rollback of Splits not owned by the Transaction. This was actually
impossible to encounter, but the algorithm is now correct even for some
cases that aren't permitted by other code.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13766 57a11ea4-9604-0410-9ed3-97b8803252fd
because qof.h includes it for us. Also, this changeset contains
lots of other stuff that has nothing to do with glib.h. Note
that this revision wont build, but I'll fix that shortly.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13763 57a11ea4-9604-0410-9ed3-97b8803252fd
only sort on the date of transactions (not date and time) since
gnucash doesn't allow times to be input. Fixes#127809.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13497 57a11ea4-9604-0410-9ed3-97b8803252fd
index and count reflective of any in-progress edit.
Convert some split iterators from directly using the GList of Splits to
using xaccTransGetSplit().
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13487 57a11ea4-9604-0410-9ed3-97b8803252fd
transaction. This makes it easier to safely iterate over a split list.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13471 57a11ea4-9604-0410-9ed3-97b8803252fd
Pass the *old* parent transaction (since the Split may be moving into
a new transaction) and the old index of the Split in the old Transaction's
list of Splits.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13468 57a11ea4-9604-0410-9ed3-97b8803252fd
Broken out just for clarity.
Note: There's one piece that I didn't change that I think is conceptually
awkward. It has to do with how/when we would discover that another
user has deleted the transaction we're currently editing. I think it makes
more sense to detect and handle this case in xaccTransCommitEdit() instead
of xaccTransRollbackEdit(), because (a) we don't actually have to do the
rollback if we just destroy the trans, (b) some rollbacks are not backend-
induced, but rather voluntary, (c) we need a generalized mechanism
anyway for detecting and handling deleted transactions even when
we're not editing them.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13461 57a11ea4-9604-0410-9ed3-97b8803252fd
edit-blocks should work, and why.
Converts the very important xaccTransCommitEdit function to use the
qof_commit_edit_part2() function instead of something that is 90%
similar.
Transactions have a Split list that keeps track of Splits during the edit.
During edits, this list only grows and never shrinks. Splits that
have been destroyed or reparented to other transactions remain in
the list, along with pre-edit Splits and newly added Splits. Only after a
successful commit does the Split list drop reparented or destroyed
Splits. A couple out-of-engine users (mainly the register) call
xaccTransGetSplitList() an work from the Transaction's split list,
but they expect to be working with only the Splits that would still be in
the Transaction if the in-progress edit would be committed. So, we
provide the function xaccTransStillHasSplit(t, s) to allow users to query
the in-edit state of the Transaction's Split list.
xaccTransRemoveSplit() and xaccTransInsertSplit() have been replaced by
xaccSplitSetParent().
The new xaccTransCommitEdit tries to take a more conservative approach
to event generation, too. Instead of generating every possible event for
any commit, it should generate only events that indicate a change to an
engine object or relation.
Move some of the financial-constraint-enforcing functions closer to the
relevant data-structures. (from Scrub.c)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13459 57a11ea4-9604-0410-9ed3-97b8803252fd
(default ':') and set it with an accessor function at startup and when
it is changed in the preferences/gconf. Eliminate unnecessary passing
around of the account separator character.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13435 57a11ea4-9604-0410-9ed3-97b8803252fd
Introduce xaccSplitVoid() and xaccSplitUnvoid() to aid the separation.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13363 57a11ea4-9604-0410-9ed3-97b8803252fd