mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Some const correctness improvements in owner and invoice functions
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21411 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e409352c65
commit
012ab52a07
@ -56,7 +56,7 @@ const gchar *owner_version_string = "2.0.0";
|
|||||||
#define owner_id_string "owner:id"
|
#define owner_id_string "owner:id"
|
||||||
|
|
||||||
xmlNodePtr
|
xmlNodePtr
|
||||||
gnc_owner_to_dom_tree (const char *tag, GncOwner *owner)
|
gnc_owner_to_dom_tree (const char *tag, const GncOwner *owner)
|
||||||
{
|
{
|
||||||
xmlNodePtr ret;
|
xmlNodePtr ret;
|
||||||
const char *type_str;
|
const char *type_str;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
gboolean gnc_dom_tree_to_owner (xmlNodePtr node, GncOwner *owner,
|
gboolean gnc_dom_tree_to_owner (xmlNodePtr node, GncOwner *owner,
|
||||||
QofBook *book);
|
QofBook *book);
|
||||||
xmlNodePtr gnc_owner_to_dom_tree (const char *tag, GncOwner *addr);
|
xmlNodePtr gnc_owner_to_dom_tree (const char *tag, const GncOwner *addr);
|
||||||
void gnc_owner_xml_initialize (void);
|
void gnc_owner_xml_initialize (void);
|
||||||
|
|
||||||
#endif /* GNC_OWNER_XML_V2_H */
|
#endif /* GNC_OWNER_XML_V2_H */
|
||||||
|
@ -204,19 +204,12 @@ static void
|
|||||||
gnc_invoice_select_search_set_label(GncISI* isi)
|
gnc_invoice_select_search_set_label(GncISI* isi)
|
||||||
{
|
{
|
||||||
GncOwnerType owner_type;
|
GncOwnerType owner_type;
|
||||||
GncOwner *tmp;
|
|
||||||
char *label;
|
char *label;
|
||||||
|
|
||||||
g_assert(isi);
|
g_assert(isi);
|
||||||
if (!isi->label) return;
|
if (!isi->label) return;
|
||||||
|
|
||||||
tmp = &isi->owner;
|
owner_type = gncOwnerGetType(gncOwnerGetEndOwner(&isi->owner));
|
||||||
owner_type = gncOwnerGetType(tmp);
|
|
||||||
while (owner_type == GNC_OWNER_JOB)
|
|
||||||
{
|
|
||||||
tmp = gncOwnerGetEndOwner(tmp);
|
|
||||||
owner_type = gncOwnerGetType(tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Translators: See comments in dialog-invoice.c:gnc_invoice_search() */
|
/* Translators: See comments in dialog-invoice.c:gnc_invoice_search() */
|
||||||
switch (owner_type)
|
switch (owner_type)
|
||||||
|
@ -1480,7 +1480,7 @@ gnc_invoice_window_refresh_handler (GHashTable *changes, gpointer user_data)
|
|||||||
InvoiceWindow *iw = user_data;
|
InvoiceWindow *iw = user_data;
|
||||||
const EventInfo *info;
|
const EventInfo *info;
|
||||||
GncInvoice *invoice = iw_get_invoice (iw);
|
GncInvoice *invoice = iw_get_invoice (iw);
|
||||||
GncOwner *owner;
|
const GncOwner *owner;
|
||||||
|
|
||||||
/* If there isn't an invoice behind us, close down */
|
/* If there isn't an invoice behind us, close down */
|
||||||
if (!invoice)
|
if (!invoice)
|
||||||
@ -1840,7 +1840,7 @@ find_handler (gpointer find_data, gpointer user_data)
|
|||||||
|
|
||||||
static InvoiceWindow *
|
static InvoiceWindow *
|
||||||
gnc_invoice_new_page (QofBook *bookp, InvoiceDialogType type,
|
gnc_invoice_new_page (QofBook *bookp, InvoiceDialogType type,
|
||||||
GncInvoice *invoice, GncOwner *owner,
|
GncInvoice *invoice, const GncOwner *owner,
|
||||||
GncMainWindow *window)
|
GncMainWindow *window)
|
||||||
{
|
{
|
||||||
InvoiceWindow *iw;
|
InvoiceWindow *iw;
|
||||||
@ -2198,13 +2198,14 @@ gnc_invoice_create_page (InvoiceWindow *iw, gpointer page)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static InvoiceWindow *
|
static InvoiceWindow *
|
||||||
gnc_invoice_window_new_invoice (QofBook *bookp, GncOwner *owner,
|
gnc_invoice_window_new_invoice (QofBook *bookp, const GncOwner *owner,
|
||||||
GncInvoice *invoice)
|
GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
InvoiceWindow *iw;
|
InvoiceWindow *iw;
|
||||||
GladeXML *xml;
|
GladeXML *xml;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
GncOwner *billto;
|
GncOwner *billto;
|
||||||
|
const GncOwner *start_owner;
|
||||||
|
|
||||||
if (invoice)
|
if (invoice)
|
||||||
{
|
{
|
||||||
@ -2236,17 +2237,18 @@ gnc_invoice_window_new_invoice (QofBook *bookp, GncOwner *owner,
|
|||||||
invoice = gncInvoiceCreate (bookp);
|
invoice = gncInvoiceCreate (bookp);
|
||||||
gncInvoiceSetCurrency (invoice, gnc_default_currency ());
|
gncInvoiceSetCurrency (invoice, gnc_default_currency ());
|
||||||
iw->book = bookp;
|
iw->book = bookp;
|
||||||
|
start_owner = owner;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iw->dialog_type = MOD_INVOICE;
|
iw->dialog_type = MOD_INVOICE;
|
||||||
owner = gncInvoiceGetOwner (invoice);
|
start_owner = gncInvoiceGetOwner (invoice);
|
||||||
iw->book = gncInvoiceGetBook (invoice);
|
iw->book = gncInvoiceGetBook (invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save this for later */
|
/* Save this for later */
|
||||||
gncOwnerCopy (gncOwnerGetEndOwner(owner), &(iw->owner));
|
gncOwnerCopy (gncOwnerGetEndOwner(start_owner), &(iw->owner));
|
||||||
gncOwnerInitJob (&(iw->job), gncOwnerGetJob (owner));
|
gncOwnerInitJob (&(iw->job), gncOwnerGetJob (start_owner));
|
||||||
|
|
||||||
billto = gncInvoiceGetBillTo (invoice);
|
billto = gncInvoiceGetBillTo (invoice);
|
||||||
gncOwnerCopy (gncOwnerGetEndOwner (billto), &(iw->proj_cust));
|
gncOwnerCopy (gncOwnerGetEndOwner (billto), &(iw->proj_cust));
|
||||||
@ -2677,15 +2679,8 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
|
|||||||
*/
|
*/
|
||||||
if (owner)
|
if (owner)
|
||||||
{
|
{
|
||||||
GncOwner *tmp = owner;
|
|
||||||
|
|
||||||
/* First, figure out the type of owner here.. */
|
/* First, figure out the type of owner here.. */
|
||||||
owner_type = gncOwnerGetType(owner);
|
owner_type = gncOwnerGetType (gncOwnerGetEndOwner (owner));
|
||||||
while (owner_type == GNC_OWNER_JOB)
|
|
||||||
{
|
|
||||||
tmp = gncOwnerGetEndOwner(tmp);
|
|
||||||
owner_type = gncOwnerGetType(tmp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Then if there's an actual owner add it to the query
|
/* Then if there's an actual owner add it to the query
|
||||||
* and limit the search to this owner
|
* and limit the search to this owner
|
||||||
@ -2771,34 +2766,6 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
|
|||||||
label);
|
label);
|
||||||
}
|
}
|
||||||
|
|
||||||
GNCSearchWindow *
|
|
||||||
gnc_invoice_search_select (gpointer start, gpointer book)
|
|
||||||
{
|
|
||||||
GncInvoice *i = start;
|
|
||||||
GncOwner owner, *ownerp;
|
|
||||||
|
|
||||||
if (!book) return NULL;
|
|
||||||
|
|
||||||
if (i)
|
|
||||||
{
|
|
||||||
ownerp = gncInvoiceGetOwner (i);
|
|
||||||
gncOwnerCopy (ownerp, &owner);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
gncOwnerInitCustomer (&owner, NULL); /* XXX */
|
|
||||||
|
|
||||||
return gnc_invoice_search (start, NULL, book);
|
|
||||||
}
|
|
||||||
|
|
||||||
GNCSearchWindow *
|
|
||||||
gnc_invoice_search_edit (gpointer start, gpointer book)
|
|
||||||
{
|
|
||||||
if (start)
|
|
||||||
gnc_ui_invoice_edit (start);
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
DialogQueryList *
|
DialogQueryList *
|
||||||
gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
|
gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
|
||||||
{
|
{
|
||||||
|
@ -59,15 +59,6 @@ InvoiceWindow * gnc_ui_invoice_duplicate (GncInvoice *invoice);
|
|||||||
/* Search for invoices */
|
/* Search for invoices */
|
||||||
GNCSearchWindow * gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book);
|
GNCSearchWindow * gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book);
|
||||||
|
|
||||||
/*
|
|
||||||
* These callbacks are for use with the gnc_general_search widget
|
|
||||||
*
|
|
||||||
* select() provides a Select Dialog and returns it.
|
|
||||||
* edit() opens the existing invoice for editing and returns NULL.
|
|
||||||
*/
|
|
||||||
GNCSearchWindow * gnc_invoice_search_select (gpointer start, gpointer book);
|
|
||||||
GNCSearchWindow * gnc_invoice_search_edit (gpointer start, gpointer book);
|
|
||||||
|
|
||||||
void gnc_business_call_owner_report (GncOwner *owner, Account *acc);
|
void gnc_business_call_owner_report (GncOwner *owner, Account *acc);
|
||||||
|
|
||||||
void gnc_invoice_window_sort (InvoiceWindow *iw, invoice_sort_type_t sort_code);
|
void gnc_invoice_window_sort (InvoiceWindow *iw, invoice_sort_type_t sort_code);
|
||||||
|
@ -706,7 +706,7 @@ gnc_ui_payment_window_destroy (PaymentWindow *pw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
PaymentWindow *
|
PaymentWindow *
|
||||||
gnc_ui_payment_new_with_invoice (GncOwner *owner, QofBook *book,
|
gnc_ui_payment_new_with_invoice (const GncOwner *owner, QofBook *book,
|
||||||
GncInvoice *invoice)
|
GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
GncOwner owner_def;
|
GncOwner owner_def;
|
||||||
@ -715,15 +715,14 @@ gnc_ui_payment_new_with_invoice (GncOwner *owner, QofBook *book,
|
|||||||
if (owner)
|
if (owner)
|
||||||
{
|
{
|
||||||
/* Figure out the company */
|
/* Figure out the company */
|
||||||
owner = gncOwnerGetEndOwner (owner);
|
gncOwnerCopy (gncOwnerGetEndOwner (owner), &owner_def);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gncOwnerInitCustomer (&owner_def, NULL);
|
gncOwnerInitCustomer (&owner_def, NULL);
|
||||||
owner = &owner_def;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new_payment_window (owner, book, invoice);
|
return new_payment_window (&owner_def, book, invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
PaymentWindow *
|
PaymentWindow *
|
||||||
|
@ -31,7 +31,7 @@ typedef struct _payment_window PaymentWindow;
|
|||||||
|
|
||||||
/* Create a payment window */
|
/* Create a payment window */
|
||||||
PaymentWindow * gnc_ui_payment_new (GncOwner *owner, QofBook *book);
|
PaymentWindow * gnc_ui_payment_new (GncOwner *owner, QofBook *book);
|
||||||
PaymentWindow * gnc_ui_payment_new_with_invoice (GncOwner *owner,
|
PaymentWindow * gnc_ui_payment_new_with_invoice (const GncOwner *owner,
|
||||||
QofBook *book,
|
QofBook *book,
|
||||||
GncInvoice *invoice);
|
GncInvoice *invoice);
|
||||||
PaymentWindow * gnc_ui_payment_new_with_txn (GncOwner *owner, Transaction *txn);
|
PaymentWindow * gnc_ui_payment_new_with_txn (GncOwner *owner, Transaction *txn);
|
||||||
|
@ -141,7 +141,7 @@ gnc_entry_ledger_set_watches (GncEntryLedger *ledger, GList *entries)
|
|||||||
/* For expense vouchers, watch the employee and refresh if it's changed */
|
/* For expense vouchers, watch the employee and refresh if it's changed */
|
||||||
if (ledger->type == GNCENTRY_EXPVOUCHER_ENTRY)
|
if (ledger->type == GNCENTRY_EXPVOUCHER_ENTRY)
|
||||||
{
|
{
|
||||||
GncOwner *owner = gncOwnerGetEndOwner (gncInvoiceGetOwner (ledger->invoice));
|
const GncOwner *owner = gncOwnerGetEndOwner (gncInvoiceGetOwner (ledger->invoice));
|
||||||
GncEmployee *employee = gncOwnerGetEmployee (owner);
|
GncEmployee *employee = gncOwnerGetEmployee (owner);
|
||||||
|
|
||||||
if (employee)
|
if (employee)
|
||||||
|
@ -108,7 +108,7 @@ static void load_discount_how_cells (GncEntryLedger *ledger)
|
|||||||
static void load_payment_type_cells (GncEntryLedger *ledger)
|
static void load_payment_type_cells (GncEntryLedger *ledger)
|
||||||
{
|
{
|
||||||
ComboCell *cell;
|
ComboCell *cell;
|
||||||
GncOwner *owner;
|
const GncOwner *owner;
|
||||||
GncEmployee *employee;
|
GncEmployee *employee;
|
||||||
|
|
||||||
cell = (ComboCell *) gnc_table_layout_get_cell (ledger->table->layout,
|
cell = (ComboCell *) gnc_table_layout_get_cell (ledger->table->layout,
|
||||||
@ -356,7 +356,7 @@ void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list)
|
|||||||
/* The rest of this does not apply to expense vouchers */
|
/* The rest of this does not apply to expense vouchers */
|
||||||
if (ledger->type != GNCENTRY_EXPVOUCHER_ENTRY)
|
if (ledger->type != GNCENTRY_EXPVOUCHER_ENTRY)
|
||||||
{
|
{
|
||||||
GncOwner *owner = gncInvoiceGetOwner (ledger->invoice);
|
const GncOwner *owner = gncInvoiceGetOwner (ledger->invoice);
|
||||||
GncTaxTable *table = NULL;
|
GncTaxTable *table = NULL;
|
||||||
GncTaxIncluded taxincluded_p = GNC_TAXINCLUDED_USEGLOBAL;
|
GncTaxIncluded taxincluded_p = GNC_TAXINCLUDED_USEGLOBAL;
|
||||||
gboolean taxincluded = FALSE;
|
gboolean taxincluded = FALSE;
|
||||||
@ -364,8 +364,7 @@ void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list)
|
|||||||
GNCOptionDB *odb;
|
GNCOptionDB *odb;
|
||||||
|
|
||||||
/* Determine the TaxIncluded and Discount values */
|
/* Determine the TaxIncluded and Discount values */
|
||||||
owner = gncOwnerGetEndOwner (owner);
|
switch (gncOwnerGetType (gncOwnerGetEndOwner (owner)))
|
||||||
switch (gncOwnerGetType (owner))
|
|
||||||
{
|
{
|
||||||
case GNC_OWNER_CUSTOMER:
|
case GNC_OWNER_CUSTOMER:
|
||||||
taxincluded_p = gncCustomerGetTaxIncluded (owner->owner.customer);
|
taxincluded_p = gncCustomerGetTaxIncluded (owner->owner.customer);
|
||||||
|
@ -696,7 +696,7 @@ const char * gncInvoiceGetID (const GncInvoice *invoice)
|
|||||||
return invoice->id;
|
return invoice->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
GncOwner * gncInvoiceGetOwner (GncInvoice *invoice)
|
const GncOwner * gncInvoiceGetOwner (const GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
if (!invoice) return NULL;
|
if (!invoice) return NULL;
|
||||||
return &invoice->owner;
|
return &invoice->owner;
|
||||||
@ -776,7 +776,7 @@ const char * gncInvoiceGetNotes (const GncInvoice *invoice)
|
|||||||
return invoice->notes;
|
return invoice->notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
GncOwnerType gncInvoiceGetOwnerType (GncInvoice *invoice)
|
GncOwnerType gncInvoiceGetOwnerType (const GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
const GncOwner *owner;
|
const GncOwner *owner;
|
||||||
g_return_val_if_fail (invoice, GNC_OWNER_NONE);
|
g_return_val_if_fail (invoice, GNC_OWNER_NONE);
|
||||||
@ -877,7 +877,7 @@ GList * gncInvoiceGetTypeListForOwnerType (GncOwnerType type)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GncInvoiceType gncInvoiceGetType (GncInvoice *invoice)
|
GncInvoiceType gncInvoiceGetType (const GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
if (!invoice) return GNC_INVOICE_UNDEFINED;
|
if (!invoice) return GNC_INVOICE_UNDEFINED;
|
||||||
switch (gncInvoiceGetOwnerType (invoice))
|
switch (gncInvoiceGetOwnerType (invoice))
|
||||||
@ -893,7 +893,7 @@ GncInvoiceType gncInvoiceGetType (GncInvoice *invoice)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char * gncInvoiceGetTypeString (GncInvoice *invoice)
|
const char * gncInvoiceGetTypeString (const GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
GncInvoiceType type = gncInvoiceGetType(invoice);
|
GncInvoiceType type = gncInvoiceGetType(invoice);
|
||||||
switch (type)
|
switch (type)
|
||||||
@ -1154,7 +1154,7 @@ gncInvoiceGetInvoiceFromTxn (const Transaction *txn)
|
|||||||
return gncInvoiceLookup(book, guid);
|
return gncInvoiceLookup(book, guid);
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean gncInvoiceAmountPositive (GncInvoice *invoice)
|
gboolean gncInvoiceAmountPositive (const GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
switch (gncInvoiceGetType (invoice))
|
switch (gncInvoiceGetType (invoice))
|
||||||
{
|
{
|
||||||
@ -1174,7 +1174,7 @@ gboolean gncInvoiceAmountPositive (GncInvoice *invoice)
|
|||||||
|
|
||||||
struct lotmatch
|
struct lotmatch
|
||||||
{
|
{
|
||||||
GncOwner *owner;
|
const GncOwner *owner;
|
||||||
gboolean positive_balance;
|
gboolean positive_balance;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1182,7 +1182,8 @@ static gboolean
|
|||||||
gnc_lot_match_owner_payment (GNCLot *lot, gpointer user_data)
|
gnc_lot_match_owner_payment (GNCLot *lot, gpointer user_data)
|
||||||
{
|
{
|
||||||
struct lotmatch *lm = user_data;
|
struct lotmatch *lm = user_data;
|
||||||
GncOwner owner_def, *owner;
|
GncOwner owner_def;
|
||||||
|
const GncOwner *owner;
|
||||||
gnc_numeric balance = gnc_lot_get_balance (lot);
|
gnc_numeric balance = gnc_lot_get_balance (lot);
|
||||||
|
|
||||||
/* Is this a payment lot */
|
/* Is this a payment lot */
|
||||||
@ -1217,7 +1218,7 @@ Transaction * gncInvoicePostToAccount (GncInvoice *invoice, Account *acc,
|
|||||||
const char *name, *type;
|
const char *name, *type;
|
||||||
char *lot_title;
|
char *lot_title;
|
||||||
Account *ccard_acct = NULL;
|
Account *ccard_acct = NULL;
|
||||||
GncOwner *owner;
|
const GncOwner *owner;
|
||||||
|
|
||||||
if (!invoice || !acc) return NULL;
|
if (!invoice || !acc) return NULL;
|
||||||
|
|
||||||
@ -1964,7 +1965,7 @@ gboolean gncInvoiceRegister (void)
|
|||||||
return qof_object_register (&gncInvoiceDesc);
|
return qof_object_register (&gncInvoiceDesc);
|
||||||
}
|
}
|
||||||
|
|
||||||
gchar *gncInvoiceNextID (QofBook *book, GncOwner *owner)
|
gchar *gncInvoiceNextID (QofBook *book, const GncOwner *owner)
|
||||||
{
|
{
|
||||||
gchar *nextID;
|
gchar *nextID;
|
||||||
switch (gncOwnerGetType(gncOwnerGetEndOwner(owner)))
|
switch (gncOwnerGetType(gncOwnerGetEndOwner(owner)))
|
||||||
|
@ -129,17 +129,17 @@ void gncInvoiceSortEntries (GncInvoice *invoice);
|
|||||||
/** @name Get Functions
|
/** @name Get Functions
|
||||||
@{ */
|
@{ */
|
||||||
const char * gncInvoiceGetID (const GncInvoice *invoice);
|
const char * gncInvoiceGetID (const GncInvoice *invoice);
|
||||||
GncOwner * gncInvoiceGetOwner (GncInvoice *invoice);
|
const GncOwner * gncInvoiceGetOwner (const GncInvoice *invoice);
|
||||||
Timespec gncInvoiceGetDateOpened (const GncInvoice *invoice);
|
Timespec gncInvoiceGetDateOpened (const GncInvoice *invoice);
|
||||||
Timespec gncInvoiceGetDatePosted (const GncInvoice *invoice);
|
Timespec gncInvoiceGetDatePosted (const GncInvoice *invoice);
|
||||||
Timespec gncInvoiceGetDateDue (const GncInvoice *invoice);
|
Timespec gncInvoiceGetDateDue (const GncInvoice *invoice);
|
||||||
GncBillTerm * gncInvoiceGetTerms (const GncInvoice *invoice);
|
GncBillTerm * gncInvoiceGetTerms (const GncInvoice *invoice);
|
||||||
const char * gncInvoiceGetBillingID (const GncInvoice *invoice);
|
const char * gncInvoiceGetBillingID (const GncInvoice *invoice);
|
||||||
const char * gncInvoiceGetNotes (const GncInvoice *invoice);
|
const char * gncInvoiceGetNotes (const GncInvoice *invoice);
|
||||||
GncOwnerType gncInvoiceGetOwnerType (GncInvoice *invoice);
|
GncOwnerType gncInvoiceGetOwnerType (const GncInvoice *invoice);
|
||||||
GList * gncInvoiceGetTypeListForOwnerType (const GncOwnerType type);
|
GList * gncInvoiceGetTypeListForOwnerType (const GncOwnerType type);
|
||||||
GncInvoiceType gncInvoiceGetType (GncInvoice *invoice);
|
GncInvoiceType gncInvoiceGetType (const GncInvoice *invoice);
|
||||||
const char * gncInvoiceGetTypeString (GncInvoice *invoice);
|
const char * gncInvoiceGetTypeString (const GncInvoice *invoice);
|
||||||
gnc_commodity * gncInvoiceGetCurrency (const GncInvoice *invoice);
|
gnc_commodity * gncInvoiceGetCurrency (const GncInvoice *invoice);
|
||||||
GncOwner * gncInvoiceGetBillTo (GncInvoice *invoice);
|
GncOwner * gncInvoiceGetBillTo (GncInvoice *invoice);
|
||||||
gnc_numeric gncInvoiceGetToChargeAmount (const GncInvoice *invoice);
|
gnc_numeric gncInvoiceGetToChargeAmount (const GncInvoice *invoice);
|
||||||
@ -170,7 +170,7 @@ GNCPrice * gncInvoiceGetPrice(GncInvoice *invoice, gnc_commodity* commodity);
|
|||||||
* Returns TRUE if the invoice will increase the balance or FALSE
|
* Returns TRUE if the invoice will increase the balance or FALSE
|
||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
gboolean gncInvoiceAmountPositive (GncInvoice *invoice);
|
gboolean gncInvoiceAmountPositive (const GncInvoice *invoice);
|
||||||
|
|
||||||
/** Post this invoice to an account. Returns the new Transaction
|
/** Post this invoice to an account. Returns the new Transaction
|
||||||
* that is tied to this invoice. The transaction is set with
|
* that is tied to this invoice. The transaction is set with
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "gncOwner.h"
|
#include "gncOwner.h"
|
||||||
|
|
||||||
gboolean gncInvoiceRegister (void);
|
gboolean gncInvoiceRegister (void);
|
||||||
gchar *gncInvoiceNextID (QofBook *book, GncOwner *owner);
|
gchar *gncInvoiceNextID (QofBook *book, const GncOwner *owner);
|
||||||
void gncInvoiceSetPostedAcc (GncInvoice *invoice, Account *acc);
|
void gncInvoiceSetPostedAcc (GncInvoice *invoice, Account *acc);
|
||||||
void gncInvoiceSetPostedTxn (GncInvoice *invoice, Transaction *txn);
|
void gncInvoiceSetPostedTxn (GncInvoice *invoice, Transaction *txn);
|
||||||
void gncInvoiceSetPostedLot (GncInvoice *invoice, GNCLot *lot);
|
void gncInvoiceSetPostedLot (GncInvoice *invoice, GNCLot *lot);
|
||||||
|
@ -571,7 +571,7 @@ GncGUID gncOwnerRetGUID (GncOwner *owner)
|
|||||||
return *guid_null ();
|
return *guid_null ();
|
||||||
}
|
}
|
||||||
|
|
||||||
GncOwner * gncOwnerGetEndOwner (GncOwner *owner)
|
const GncOwner * gncOwnerGetEndOwner (const GncOwner *owner)
|
||||||
{
|
{
|
||||||
if (!owner) return NULL;
|
if (!owner) return NULL;
|
||||||
switch (owner->type)
|
switch (owner->type)
|
||||||
@ -615,11 +615,10 @@ int gncOwnerCompare (const GncOwner *a, const GncOwner *b)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const GncGUID * gncOwnerGetEndGUID (GncOwner *owner)
|
const GncGUID * gncOwnerGetEndGUID (const GncOwner *owner)
|
||||||
{
|
{
|
||||||
if (!owner) return NULL;
|
if (!owner) return NULL;
|
||||||
owner = gncOwnerGetEndOwner (owner);
|
return gncOwnerGetGUID (gncOwnerGetEndOwner (owner));
|
||||||
return gncOwnerGetGUID (owner);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void gncOwnerAttachToLot (const GncOwner *owner, GNCLot *lot)
|
void gncOwnerAttachToLot (const GncOwner *owner, GNCLot *lot)
|
||||||
|
@ -175,8 +175,8 @@ GncGUID gncOwnerRetGUID (GncOwner *owner);
|
|||||||
* Get the "parent" Owner or GncGUID thereof. The "parent" owner
|
* Get the "parent" Owner or GncGUID thereof. The "parent" owner
|
||||||
* is the Customer or Vendor, or the Owner of a Job
|
* is the Customer or Vendor, or the Owner of a Job
|
||||||
*/
|
*/
|
||||||
GncOwner * gncOwnerGetEndOwner (GncOwner *owner);
|
const GncOwner * gncOwnerGetEndOwner (const GncOwner *owner);
|
||||||
const GncGUID * gncOwnerGetEndGUID (GncOwner *owner);
|
const GncGUID * gncOwnerGetEndGUID (const GncOwner *owner);
|
||||||
|
|
||||||
/** attach an owner to a lot */
|
/** attach an owner to a lot */
|
||||||
void gncOwnerAttachToLot (const GncOwner *owner, GNCLot *lot);
|
void gncOwnerAttachToLot (const GncOwner *owner, GNCLot *lot);
|
||||||
|
Loading…
Reference in New Issue
Block a user