[Account.h] gnc_account_get_earliest_date

Returns posted date of earliest split, or INT64_MAX if the account has
no splits.

This may reflect the opening date of the account.
pull/2168/head
Christopher Lam 3 months ago
parent bab04728f4
commit 334b015c19

@ -5078,6 +5078,14 @@ gnc_account_tree_staged_transaction_traversal (const Account *acc,
return 0;
}
time64
gnc_account_get_earliest_date (const Account* account)
{
g_return_val_if_fail (GNC_IS_ACCOUNT(account), INT64_MAX);
const auto& splits = xaccAccountGetSplits (account);
return splits.empty() ? INT64_MAX : xaccTransGetDate (xaccSplitGetParent (splits.front()));
}
/********************************************************************\
\********************************************************************/

@ -1580,6 +1580,15 @@ typedef enum
int xaccAccountTreeForEachTransaction(Account *acc,
TransactionCallback proc, void *data);
/**
* Returns the date of the earliest split in the account, or INT64_MAX.
*
* @param account The account to retrieve data about.
*
* @return posted_date of first split in the account, or INT64_MAX
*/
time64 gnc_account_get_earliest_date (const Account* account);
/* Look up an Account in the map non-Baysian
*/
Account* gnc_account_imap_find_account (Account* acc, const char* category,

Loading…
Cancel
Save