tweaks; add wrappers for lot title, lot notes

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9392 57a11ea4-9604-0410-9ed3-97b8803252fd
zzzoldfeatures/cashutil
Linas Vepstas 23 years ago
parent 6b09a496ba
commit 929bca04c5

@ -145,6 +145,7 @@ xaccAccountFindEarliestOpenLot (Account *acc, gnc_numeric sign)
{
struct early_lot_s es;
ENTER (" sign=%lld/%lld", sign.num, sign.denom);
es.lot = NULL;
es.ts.tv_sec = 10000000LL * ((long long) LONG_MAX);
es.ts.tv_nsec = 0;
@ -153,6 +154,7 @@ xaccAccountFindEarliestOpenLot (Account *acc, gnc_numeric sign)
else es.numeric_pred = gnc_numeric_positive_p;
xaccAccountForEachLot (acc, earliest_helper, &es);
LEAVE ("found lot=%p %s", es.lot, gnc_lot_get_title (es.lot));
return es.lot;
}

@ -186,6 +186,37 @@ gint gnc_lot_count_splits (GNCLot *lot)
return g_list_length (lot->splits);
}
/* ============================================================== */
/* Hmm, we should probably inline these. */
const char *
gnc_lot_get_title (GNCLot *lot)
{
if (!lot) return NULL;
return kvp_frame_get_string (lot->kvp_data, "/title");
}
const char *
gnc_lot_get_notes (GNCLot *lot)
{
if (!lot) return NULL;
return kvp_frame_get_string (lot->kvp_data, "/notes");
}
void
gnc_lot_set_title (GNCLot *lot, const char *str)
{
if (!lot) return;
return kvp_frame_set_str (lot->kvp_data, "/title", str);
}
void
gnc_lot_set_notes (GNCLot *lot, const char *str)
{
if (!lot) return;
return kvp_frame_set_str (lot->kvp_data, "/notes", str);
}
/* ============================================================= */
gnc_numeric

@ -103,8 +103,14 @@ Split * gnc_lot_get_earliest_split (GNCLot *lot);
*/
Split * gnc_lot_get_latest_split (GNCLot *lot);
/** Get and set the account title, or the account notes. */
const char * gnc_lot_get_title (GNCLot *);
const char * gnc_lot_get_notes (GNCLot *);
void gnc_lot_set_title (GNCLot *, const char *);
void gnc_lot_set_notes (GNCLot *, const char *);
/** Every lot has a place to hang kvp data. This routine returns that
* place.
* place.
* */
KvpFrame * gnc_lot_get_slots (GNCLot *);

Loading…
Cancel
Save