void gncEntrySetDescription (GncEntry *entry, const char *desc) { if (!entry || !desc) return; SET_STR (entry, entry->desc, desc); mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetAction (GncEntry *entry, const char *action) { if (!entry || !action) return; SET_STR (entry, entry->action, action); mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetNotes (GncEntry *entry, const char *notes) { if (!entry || !notes) return; SET_STR (entry, entry->notes, notes); mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillPayment (GncEntry *entry, GncEntryPaymentType type) { if (!entry) return; if (entry->b_payment == type) return; gncEntryBeginEdit (entry); entry->b_payment = type; mark_entry (entry); gncEntryCommitEdit (entry); }
/* called from gncInvoice when we're added to the Invoice */ void gncEntrySetInvoice (GncEntry *entry, GncInvoice *invoice) { if (!entry) return; if (entry->invoice == invoice) return; gncEntryBeginEdit (entry); entry->invoice = invoice; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetDateEntered (GncEntry *entry, Timespec date) { if (!entry) return; if (timespec_equal (&entry->date_entered, &date)) return; gncEntryBeginEdit (entry); entry->date_entered = date; mark_entry (entry); gncEntryCommitEdit (entry); }
/* called from gncInvoice when we're added to the Invoice/Bill */ void gncEntrySetBill (GncEntry *entry, GncInvoice *bill) { if (!entry) return; if (entry->bill == bill) return; gncEntryBeginEdit (entry); entry->bill = bill; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillAccount (GncEntry *entry, Account *acc) { if (!entry) return; if (entry->b_account == acc) return; gncEntryBeginEdit (entry); entry->b_account = acc; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillPrice (GncEntry *entry, gnc_numeric price) { if (!entry) return; if (gnc_numeric_eq (entry->b_price, price)) return; gncEntryBeginEdit (entry); entry->b_price = price; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillable (GncEntry *entry, gboolean billable) { if (!entry) return; if (entry->billable == billable) return; gncEntryBeginEdit (entry); entry->billable = billable; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillTaxIncluded (GncEntry *entry, gboolean taxincluded) { if (!entry) return; if (entry->b_taxincluded == taxincluded) return; gncEntryBeginEdit (entry); entry->b_taxincluded = taxincluded; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetInvDiscount (GncEntry *entry, gnc_numeric discount) { if (!entry) return; if (gnc_numeric_eq (entry->i_discount, discount)) return; gncEntryBeginEdit (entry); entry->i_discount = discount; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillTo (GncEntry *entry, GncOwner *billto) { if (!entry || !billto) return; if (gncOwnerEqual (&entry->billto, billto)) return; gncEntryBeginEdit (entry); gncOwnerCopy (billto, &entry->billto); mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetQuantity (GncEntry *entry, gnc_numeric quantity) { if (!entry) return; if (gnc_numeric_eq (entry->quantity, quantity)) return; gncEntryBeginEdit (entry); entry->quantity = quantity; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillTaxable (GncEntry *entry, gboolean taxable) { if (!entry) return; if (entry->b_taxable == taxable) return; gncEntryBeginEdit (entry); entry->b_taxable = taxable; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetDocQuantity (GncEntry *entry, gnc_numeric quantity, gboolean is_cn) { if (!entry) return; if (gnc_numeric_eq (entry->quantity, quantity)) return; gncEntryBeginEdit (entry); entry->quantity = (is_cn ? gnc_numeric_neg (quantity) : quantity); entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
/* Called from gncOrder when we're added to the Order */ void gncEntrySetOrder (GncEntry *entry, GncOrder *order) { if (!entry) return; if (entry->order == order) return; gncEntryBeginEdit (entry); entry->order = order; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetInvDiscountType (GncEntry *entry, GncAmountType type) { if (!entry) return; if (entry->i_disc_type == type) return; gncEntryBeginEdit (entry); entry->i_disc_type = type; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetInvDiscountHow (GncEntry *entry, GncDiscountHow how) { if (!entry) return; if (entry->i_disc_how == how) return; gncEntryBeginEdit (entry); entry->i_disc_how = how; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void qofEntrySetInvDiscHow (GncEntry *entry, const char *type) { GncDiscountHow how; if (!entry) return; gncEntryBeginEdit (entry); gncEntryDiscountStringToHow(type, &how); if (entry->i_disc_how == how) return; entry->i_disc_how = how; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntryCopy (const GncEntry *src, GncEntry *dest, gboolean add_entry) { if (!src || !dest) return; gncEntryBeginEdit (dest); dest->date = src->date; dest->date_entered = src->date_entered; /* ??? */ gncEntrySetDescription (dest, src->desc); gncEntrySetAction (dest, src->action); gncEntrySetNotes (dest, src->notes); dest->quantity = src->quantity; dest->i_account = src->i_account; dest->i_price = src->i_price; dest->i_taxable = src->i_taxable; dest->i_taxincluded = src->i_taxincluded; dest->i_discount = src->i_discount; dest->i_disc_type = src->i_disc_type; dest->i_disc_how = src->i_disc_how; /* vendor bill data */ dest->b_account = src->b_account; dest->b_price = src->b_price; dest->b_taxable = src->b_taxable; dest->b_taxincluded = src->b_taxincluded; dest->billable = src->billable; dest->billto = src->billto; if (src->i_tax_table) gncEntrySetInvTaxTable (dest, src->i_tax_table); if (src->b_tax_table) gncEntrySetBillTaxTable (dest, src->b_tax_table); if (add_entry) { if (src->order) gncOrderAddEntry (src->order, dest); if (src->invoice) gncInvoiceAddEntry (src->invoice, dest); if (src->bill) gncBillAddEntry (src->bill, dest); } dest->values_dirty = TRUE; mark_entry (dest); gncEntryCommitEdit (dest); }
void qofEntrySetInvDiscType (GncEntry *entry, const char *type_string) { GncAmountType type; if (!entry) return; gncAmountStringToType(type_string, &type); if (entry->i_disc_type == type) return; gncEntryBeginEdit (entry); entry->i_disc_type = type; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
void gncEntrySetBillTaxTable (GncEntry *entry, GncTaxTable *table) { if (!entry) return; if (entry->b_tax_table == table) return; gncEntryBeginEdit (entry); if (entry->b_tax_table) gncTaxTableDecRef (entry->b_tax_table); if (table) gncTaxTableIncRef (table); entry->b_tax_table = table; entry->values_dirty = TRUE; mark_entry (entry); gncEntryCommitEdit (entry); }
bfd_boolean _bfd_elf_gc_mark_fdes (struct bfd_link_info *info, asection *sec, asection *eh_frame, elf_gc_mark_hook_fn gc_mark_hook, struct elf_reloc_cookie *cookie) { struct eh_cie_fde *fde, *cie; for (fde = elf_fde_list (sec); fde; fde = fde->u.fde.next_for_section) { if (!mark_entry (info, eh_frame, fde, gc_mark_hook, cookie)) return FALSE; /* At this stage, all cie_inf fields point to local CIEs, so we can use the same cookie to refer to them. */ cie = fde->u.fde.cie_inf; if (!cie->u.cie.gc_mark) { cie->u.cie.gc_mark = 1; if (!mark_entry (info, eh_frame, cie, gc_mark_hook, cookie)) return FALSE; } } return TRUE; }
/* Called from gncOrder when we're added to the Order */ void gncEntrySetOrder (GncEntry *entry, GncOrder *order) { if (!entry) return; if (entry->order == order) return; gncEntryBeginEdit (entry); entry->order = order; mark_entry (entry); gncEntryCommitEdit (entry); /* Generate an event modifying the Order's end-owner */ #if 0 qof_event_gen (gncOwnerGetEndGUID (gncOrderGetOwner (order)), QOF_EVENT_MODIFY, NULL); #endif }
void gncEntrySetDate (GncEntry *entry, Timespec date) { gboolean first_date = FALSE; Timespec zero_time = { 0, 0 }; if (!entry) return; if (timespec_equal (&entry->date, &date)) return; if (timespec_equal (&entry->date, &zero_time)) first_date = TRUE; gncEntryBeginEdit (entry); entry->date = date; mark_entry (entry); gncEntryCommitEdit (entry); /* Don't re-sort the first time we set the date on this entry */ if (!first_date) { if (entry->invoice) gncInvoiceSortEntries(entry->invoice); if (entry->bill) gncInvoiceSortEntries(entry->bill); } }
static void gncEntryRecomputeValues (GncEntry *entry) { int denom; /* See if either tax table changed since we last computed values */ if (entry->i_tax_table) { Timespec modtime = gncTaxTableLastModified (entry->i_tax_table); if (timespec_cmp (&entry->i_taxtable_modtime, &modtime)) { entry->values_dirty = TRUE; entry->i_taxtable_modtime = modtime; } } if (entry->b_tax_table) { Timespec modtime = gncTaxTableLastModified (entry->b_tax_table); if (timespec_cmp (&entry->b_taxtable_modtime, &modtime)) { entry->values_dirty = TRUE; entry->b_taxtable_modtime = modtime; } } if (!entry->values_dirty) return; /* Clear the last-computed tax values */ if (entry->i_tax_values) { gncAccountValueDestroy (entry->i_tax_values); entry->i_tax_values = NULL; } if (entry->b_tax_values) { gncAccountValueDestroy (entry->b_tax_values); entry->b_tax_values = NULL; } /* Determine the commodity denominator */ denom = get_entry_commodity_denom (entry); gncEntryBeginEdit (entry); /* Compute the invoice values */ gncEntryComputeValue (entry->quantity, entry->i_price, (entry->i_taxable ? entry->i_tax_table : NULL), entry->i_taxincluded, entry->i_discount, entry->i_disc_type, entry->i_disc_how, denom, &(entry->i_value), &(entry->i_disc_value), &(entry->i_tax_values)); /* Compute the bill values */ gncEntryComputeValue (entry->quantity, entry->b_price, (entry->b_taxable ? entry->b_tax_table : NULL), entry->b_taxincluded, gnc_numeric_zero(), GNC_AMT_TYPE_VALUE, GNC_DISC_PRETAX, denom, &(entry->b_value), NULL, &(entry->b_tax_values)); entry->i_value_rounded = gnc_numeric_convert (entry->i_value, denom, GNC_HOW_RND_ROUND_HALF_UP); entry->i_disc_value_rounded = gnc_numeric_convert (entry->i_disc_value, denom, GNC_HOW_RND_ROUND_HALF_UP); entry->i_tax_value = gncAccountValueTotal (entry->i_tax_values); entry->i_tax_value_rounded = gnc_numeric_convert (entry->i_tax_value, denom, GNC_HOW_RND_ROUND_HALF_UP); entry->b_value_rounded = gnc_numeric_convert (entry->b_value, denom, GNC_HOW_RND_ROUND_HALF_UP); entry->b_tax_value = gncAccountValueTotal (entry->b_tax_values); entry->b_tax_value_rounded = gnc_numeric_convert (entry->b_tax_value, denom, GNC_HOW_RND_ROUND_HALF_UP); entry->values_dirty = FALSE; mark_entry (entry); gncEntryCommitEdit (entry); }