Hide some now internal-only functions from the public GncEntry interface

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21993 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Geert Janssens 2012-02-10 15:33:43 +00:00
parent 6f89b85349
commit 7d6bc3fac8
2 changed files with 9 additions and 20 deletions

View File

@ -1361,7 +1361,9 @@ gncEntryRecomputeValues (GncEntry *entry)
entry->values_dirty = FALSE;
}
gnc_numeric gncEntryGetIntValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
/* The "Int" functions below are for internal use only.
* Outside this file, use the "Doc" or "Bal" variants found below instead. */
static gnc_numeric gncEntryGetIntValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
{
if (!entry) return gnc_numeric_zero();
gncEntryRecomputeValues (entry);
@ -1371,7 +1373,7 @@ gnc_numeric gncEntryGetIntValue (GncEntry *entry, gboolean round, gboolean is_cu
return (is_cust_doc ? entry->i_value : entry->b_value);
}
gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
static gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
{
if (!entry) return gnc_numeric_zero();
gncEntryRecomputeValues (entry);
@ -1382,14 +1384,14 @@ gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is
}
/* Careful: the returned list is managed by the entry, and will only be valid for a short time */
AccountValueList * gncEntryGetIntTaxValues (GncEntry *entry, gboolean is_cust_doc)
static AccountValueList * gncEntryGetIntTaxValues (GncEntry *entry, gboolean is_cust_doc)
{
if (!entry) return NULL;
gncEntryRecomputeValues (entry);
return (is_cust_doc ? entry->i_tax_values : entry->b_tax_values);
}
gnc_numeric gncEntryGetIntDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
static gnc_numeric gncEntryGetIntDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc)
{
if (!entry) return gnc_numeric_zero();
gncEntryRecomputeValues (entry);

View File

@ -214,11 +214,9 @@ void gncEntryCopy (const GncEntry *src, GncEntry *dest);
* - tax value: the amount the government gets
* - discount value: the amount the customer saved
*
* These values can be retrieved in several variants. depending on
* These values can be retrieved in several variants. Depending on
* how they will be used some sign reversals can be applied on
* the values:
* - Int value: the value as stored internally. No sign reversals will
* ever be done on this value
* - Doc value: the value as listed on the document. This is usually
* a positive value, unless the document was a
* negative invoice/bill or negative credit note.
@ -237,25 +235,14 @@ void gncEntryCopy (const GncEntry *src, GncEntry *dest);
* tax values for this entry. This list holds unrounded values only, there's
* no variant with rounded values.
*
* Note that this list may or may not be owned by the entry depending on the
* variant being called. If not owned by the entry, it should be freed with
* gncAccountValueDestroy.
*
* - gncEntryGetIntTaxValues returns a list owned by the entry.
* - gncEntryGetDocTaxValues returns a list NOT owned by the entry. It should be freed by the caller.
* - gncEntryGetBalTaxValues returns a list NOT owned by the entry. It should be freed by the caller.
* Note that this list is not owned by the entry. When no longer needed,
* it should be freed with gncAccountValueDestroy.
*
* Finally, there are rounded and unrounded variants of most of
* these functions.
@{
*/
typedef GList AccountValueList;
gnc_numeric gncEntryGetIntValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
/** Careful: the returned list is managed by the entry, and will only be valid for a short time */
AccountValueList * gncEntryGetIntTaxValues (GncEntry *entry, gboolean is_cust_doc);
gnc_numeric gncEntryGetIntDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc);
gnc_numeric gncEntryGetDocValue (GncEntry *entry, gboolean round, gboolean is_cust_doc, gboolean is_cn);
gnc_numeric gncEntryGetDocTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc, gboolean is_cn);
/** Careful: the returned list is NOT owned by the entry and should be freed by the caller */