static gnc_numeric gncEntryGetIntDiscountValue (GncEntry *entry, gboolean round, gboolean is_cust_doc) { if (!entry) return gnc_numeric_zero(); gncEntryRecomputeValues (entry); if (round) return (is_cust_doc ? entry->i_disc_value_rounded : gnc_numeric_zero()); else return (is_cust_doc ? entry->i_disc_value : gnc_numeric_zero()); }
static gnc_numeric gncEntryGetIntTaxValue (GncEntry *entry, gboolean round, gboolean is_cust_doc) { if (!entry) return gnc_numeric_zero(); gncEntryRecomputeValues (entry); if (round) return (is_cust_doc ? entry->i_tax_value_rounded : entry->b_tax_value_rounded); else return (is_cust_doc ? entry->i_tax_value : entry->b_tax_value); }
void gncEntryGetValue (GncEntry *entry, gboolean is_inv, gnc_numeric *value, gnc_numeric *discount_value, gnc_numeric *tax_value, GList **tax_values) { if (!entry) return; gncEntryRecomputeValues (entry); if (value) *value = (is_inv ? entry->i_value : entry->b_value); if (discount_value) *discount_value = (is_inv ? entry->i_disc_value : gnc_numeric_zero()); if (tax_value) *tax_value = (is_inv ? entry->i_tax_value : entry->b_tax_value); if (tax_values) *tax_values = (is_inv ? entry->i_tax_values : entry->b_tax_values); }
gnc_numeric gncEntryReturnDiscountValue (GncEntry *entry, gboolean is_inv) { if (!entry) return gnc_numeric_zero(); gncEntryRecomputeValues (entry); return (is_inv ? entry->i_disc_value_rounded : gnc_numeric_zero()); }
AccountValueList * gncEntryReturnTaxValues (GncEntry *entry, gboolean is_inv) { if (!entry) return NULL; gncEntryRecomputeValues (entry); return (is_inv ? entry->i_tax_values : entry->b_tax_values); }
gnc_numeric gncEntryReturnTaxValue (GncEntry *entry, gboolean is_inv) { if (!entry) return gnc_numeric_zero(); gncEntryRecomputeValues (entry); return (is_inv ? entry->i_tax_value_rounded : entry->b_tax_value_rounded); }
/* Careful: the returned list is managed by the entry, and will only be valid for a short time */ 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); }