mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Enable kvp fetch for queries. Fix bug restoring transaction iguid.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5698 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
df790e9422
commit
0c42ebaa20
@ -339,6 +339,7 @@ query_cb (PGBackend *be, PGresult *result, int j, gpointer data)
|
|||||||
ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_entered",j));
|
ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_entered",j));
|
||||||
xaccTransSetDateEnteredTS (trans, &ts);
|
xaccTransSetDateEnteredTS (trans, &ts);
|
||||||
xaccTransSetVersion (trans, atoi(DB_GET_VAL("version",j)));
|
xaccTransSetVersion (trans, atoi(DB_GET_VAL("version",j)));
|
||||||
|
trans->idata = atoi(DB_GET_VAL("iguid",j));
|
||||||
|
|
||||||
currency = gnc_string_to_commodity (DB_GET_VAL("currency",j), be->session);
|
currency = gnc_string_to_commodity (DB_GET_VAL("currency",j), be->session);
|
||||||
xaccTransSetCurrency (trans, currency);
|
xaccTransSetCurrency (trans, currency);
|
||||||
@ -384,12 +385,11 @@ pgendFillOutToCheckpoint (PGBackend *be, const char *query_string)
|
|||||||
for (node=xaction_list; node; node=node->next)
|
for (node=xaction_list; node; node=node->next)
|
||||||
{
|
{
|
||||||
Transaction *trans = (Transaction *) node->data;
|
Transaction *trans = (Transaction *) node->data;
|
||||||
GList *engine_splits, *snode;
|
|
||||||
pgendCopySplitsToEngine (be, trans);
|
pgendCopySplitsToEngine (be, trans);
|
||||||
xaccTransCommitEdit (trans);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 1
|
||||||
/* hack alert !! deal with kvp later -- huge sucking sound ! */
|
/* hack alert !! deal with kvp later -- huge sucking sound ! */
|
||||||
/* restore any kvp data associated with the transaction and splits */
|
/* restore any kvp data associated with the transaction and splits */
|
||||||
for (node=xaction_list; node; node=node->next)
|
for (node=xaction_list; node; node=node->next)
|
||||||
@ -397,13 +397,13 @@ pgendFillOutToCheckpoint (PGBackend *be, const char *query_string)
|
|||||||
Transaction *trans = (Transaction *) node->data;
|
Transaction *trans = (Transaction *) node->data;
|
||||||
GList *engine_splits, *snode;
|
GList *engine_splits, *snode;
|
||||||
|
|
||||||
trans->kvp_data = pgendKVPFetch (be, &(trans->guid), trans->kvp_data);
|
trans->kvp_data = pgendKVPFetch (be, trans->idata, trans->kvp_data);
|
||||||
|
|
||||||
engine_splits = xaccTransGetSplitList(trans);
|
engine_splits = xaccTransGetSplitList(trans);
|
||||||
for (snode = engine_splits; snode; snode=snode->next)
|
for (snode = engine_splits; snode; snode=snode->next)
|
||||||
{
|
{
|
||||||
Split *s = snode->data;
|
Split *s = snode->data;
|
||||||
s->kvp_data = pgendKVPFetch (be, &(s->guid), s->kvp_data);
|
s->kvp_data = pgendKVPFetch (be, s->idata, s->kvp_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
xaccTransCommitEdit (trans);
|
xaccTransCommitEdit (trans);
|
||||||
|
Loading…
Reference in New Issue
Block a user