GnuCash c935c2f+
Loading...
Searching...
No Matches
Files | Data Structures | Macros | Functions

Files

file  gncCustomer.h
 Core Customer Interface.
 

Data Structures

struct  GncCustomer
 credit, discount and shipaddr are unique to GncCustomer
id, name, notes, terms, addr, currency, taxtable, taxtable_override taxincluded, active and jobs are identical to ::GncVendor. More...
 

Macros

#define GNC_ID_CUSTOMER   "gncCustomer"
 
#define GNC_TYPE_CUSTOMER   (gnc_customer_get_type ())
 
#define GNC_CUSTOMER(o)    (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_CUSTOMER, GncCustomer))
 
#define GNC_CUSTOMER_CLASS(k)    (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_CUSTOMER, GncCustomerClass))
 
#define GNC_IS_CUSTOMER(o)    (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_CUSTOMER))
 
#define GNC_IS_CUSTOMER_CLASS(k)    (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_CUSTOMER))
 
#define GNC_CUSTOMER_GET_CLASS(o)    (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_CUSTOMER, GncCustomerClass))
 
#define CUSTOMER_ID   "id"
 
#define CUSTOMER_NAME   "name"
 
#define CUSTOMER_ADDR   "addr"
 
#define CUSTOMER_SHIPADDR   "shipaddr"
 
#define CUSTOMER_NOTES   "notes"
 
#define CUSTOMER_DISCOUNT   "amount of discount"
 
#define CUSTOMER_CREDIT   "amount of credit"
 
#define CUSTOMER_TT_OVER   "tax table override"
 
#define CUSTOMER_TAX_INC   "customer_tax_included"
 
#define CUSTOMER_TERMS   "customer_terms"
 
#define CUSTOMER_ACTIVE   "customer_is_active"
 
#define CUSTOMER_SLOTS   "customer_values"
 
#define gncCustomerGetGUID(x)   qof_instance_get_guid(QOF_INSTANCE(x))
 
#define gncCustomerRetGUID(x)   (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
 
#define gncCustomerGetBook(x)   qof_instance_get_book(QOF_INSTANCE(x))
 
#define gncCustomerLookupDirect(g, b)   gncCustomerLookup((b), &(g))
 

Functions

GType gnc_customer_get_type (void)
 
int gncCustomerCompare (const GncCustomer *a, const GncCustomer *b)
 
gboolean gncCustomerEqual (const GncCustomer *a, const GncCustomer *b)
 Test support function, used in gets-dbi-business-stuff.c.
 
GList * gncCustomerGetJoblist (const GncCustomer *customer, gboolean show_all)
 
gboolean gncCustomerIsDirty (GncCustomer *customer)
 

Create/Destroy Functions

GncCustomergncCustomerCreate (QofBook *book)
 
void gncCustomerDestroy (GncCustomer *customer)
 
void gncCustomerBeginEdit (GncCustomer *customer)
 
void gncCustomerCommitEdit (GncCustomer *customer)
 

Set Functions

void gncCustomerSetID (GncCustomer *customer, const char *id)
 
void gncCustomerSetName (GncCustomer *customer, const char *name)
 
void gncCustomerSetNotes (GncCustomer *customer, const char *notes)
 
void gncCustomerSetTerms (GncCustomer *customer, GncBillTerm *term)
 
void gncCustomerSetTaxIncluded (GncCustomer *customer, GncTaxIncluded taxincl)
 
void gncCustomerSetActive (GncCustomer *customer, gboolean active)
 
void gncCustomerSetDiscount (GncCustomer *customer, gnc_numeric discount)
 
void gncCustomerSetCredit (GncCustomer *customer, gnc_numeric credit)
 
void gncCustomerSetCurrency (GncCustomer *customer, gnc_commodity *currency)
 
void gncCustomerSetTaxTableOverride (GncCustomer *customer, gboolean override)
 
void gncCustomerSetTaxTable (GncCustomer *customer, GncTaxTable *table)
 
void gncCustomerAddJob (GncCustomer *customer, GncJob *job)
 
void gncCustomerRemoveJob (GncCustomer *customer, GncJob *job)
 

Get Functions

const char * gncCustomerGetID (const GncCustomer *customer)
 
const char * gncCustomerGetName (const GncCustomer *customer)
 
GncAddressgncCustomerGetAddr (const GncCustomer *customer)
 
GncAddressgncCustomerGetShipAddr (const GncCustomer *customer)
 
const char * gncCustomerGetNotes (const GncCustomer *customer)
 
GncBillTerm * gncCustomerGetTerms (const GncCustomer *customer)
 
GncTaxIncluded gncCustomerGetTaxIncluded (const GncCustomer *customer)
 
gboolean gncCustomerGetActive (const GncCustomer *customer)
 
gnc_numeric gncCustomerGetDiscount (const GncCustomer *customer)
 
gnc_numeric gncCustomerGetCredit (const GncCustomer *customer)
 
gnc_commodity * gncCustomerGetCurrency (const GncCustomer *customer)
 
gboolean gncCustomerGetTaxTableOverride (const GncCustomer *customer)
 
GncTaxTablegncCustomerGetTaxTable (const GncCustomer *customer)
 

Detailed Description

Macro Definition Documentation

◆ CUSTOMER_ACTIVE

#define CUSTOMER_ACTIVE   "customer_is_active"

Definition at line 154 of file gncCustomer.h.

◆ CUSTOMER_ADDR

#define CUSTOMER_ADDR   "addr"

Definition at line 146 of file gncCustomer.h.

◆ CUSTOMER_CREDIT

#define CUSTOMER_CREDIT   "amount of credit"

Definition at line 150 of file gncCustomer.h.

◆ CUSTOMER_DISCOUNT

#define CUSTOMER_DISCOUNT   "amount of discount"

Definition at line 149 of file gncCustomer.h.

◆ CUSTOMER_ID

#define CUSTOMER_ID   "id"

Definition at line 144 of file gncCustomer.h.

◆ CUSTOMER_NAME

#define CUSTOMER_NAME   "name"

Definition at line 145 of file gncCustomer.h.

◆ CUSTOMER_NOTES

#define CUSTOMER_NOTES   "notes"

Definition at line 148 of file gncCustomer.h.

◆ CUSTOMER_SHIPADDR

#define CUSTOMER_SHIPADDR   "shipaddr"

Definition at line 147 of file gncCustomer.h.

◆ CUSTOMER_SLOTS

#define CUSTOMER_SLOTS   "customer_values"

Definition at line 155 of file gncCustomer.h.

◆ CUSTOMER_TAX_INC

#define CUSTOMER_TAX_INC   "customer_tax_included"

Definition at line 152 of file gncCustomer.h.

◆ CUSTOMER_TERMS

#define CUSTOMER_TERMS   "customer_terms"

Definition at line 153 of file gncCustomer.h.

◆ CUSTOMER_TT_OVER

#define CUSTOMER_TT_OVER   "tax table override"

Definition at line 151 of file gncCustomer.h.

◆ GNC_CUSTOMER

#define GNC_CUSTOMER (   o)     (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_CUSTOMER, GncCustomer))

Definition at line 73 of file gncCustomer.h.

121{
122 QOF_BOOK_RETURN_ENTITY(book, guid, GNC_ID_CUSTOMER, GncCustomer);
123}
124
125const char * gncCustomerGetID (const GncCustomer *customer);
126const char * gncCustomerGetName (const GncCustomer *customer);
127GncAddress * gncCustomerGetAddr (const GncCustomer *customer);
128GncAddress * gncCustomerGetShipAddr (const GncCustomer *customer);
129const char * gncCustomerGetNotes (const GncCustomer *customer);
130GncBillTerm * gncCustomerGetTerms (const GncCustomer *customer);
131GncTaxIncluded gncCustomerGetTaxIncluded (const GncCustomer *customer);
132gboolean gncCustomerGetActive (const GncCustomer *customer);
133gnc_numeric gncCustomerGetDiscount (const GncCustomer *customer);
134gnc_numeric gncCustomerGetCredit (const GncCustomer *customer);
135gnc_commodity * gncCustomerGetCurrency (const GncCustomer *customer);
136
137gboolean gncCustomerGetTaxTableOverride (const GncCustomer *customer);
138GncTaxTable* gncCustomerGetTaxTable (const GncCustomer *customer);
139
142int gncCustomerCompare (const GncCustomer *a, const GncCustomer *b);
143
144#define CUSTOMER_ID "id"
145#define CUSTOMER_NAME "name"
146#define CUSTOMER_ADDR "addr"
147#define CUSTOMER_SHIPADDR "shipaddr"
148#define CUSTOMER_NOTES "notes"
149#define CUSTOMER_DISCOUNT "amount of discount"
150#define CUSTOMER_CREDIT "amount of credit"
151#define CUSTOMER_TT_OVER "tax table override"
152#define CUSTOMER_TAX_INC "customer_tax_included"
153#define CUSTOMER_TERMS "customer_terms"
154#define CUSTOMER_ACTIVE "customer_is_active"
155#define CUSTOMER_SLOTS "customer_values"
156
158#define gncCustomerGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
159#define gncCustomerRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
160#define gncCustomerGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
161#define gncCustomerLookupDirect(g,b) gncCustomerLookup((b), &(g))
162
164gboolean gncCustomerEqual(const GncCustomer *a, const GncCustomer *b);
165
166GList * gncCustomerGetJoblist (const GncCustomer *customer, gboolean show_all);
167gboolean gncCustomerIsDirty (GncCustomer *customer);
168
169#ifdef __cplusplus
170}
171#endif
172
173
174#endif /* GNC_CUSTOMER_H_ */
#define QOF_BOOK_RETURN_ENTITY(book, guid, e_type, c_type)
Encapsulates all the information about a dataset manipulated by QOF.
Definition qofbook.h:101
gboolean gncCustomerEqual(const GncCustomer *a, const GncCustomer *b)
Test support function, used in gets-dbi-business-stuff.c.
GncTaxIncluded
How to interpret the TaxIncluded.
Definition gncTaxTable.h:86
credit, discount and shipaddr are unique to GncCustomer id, name, notes, terms, addr,...
modtime is the internal date of the last modtime See libgnucash/engine/TaxTableBillTermImmutability....

◆ GNC_CUSTOMER_CLASS

#define GNC_CUSTOMER_CLASS (   k)     (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_CUSTOMER, GncCustomerClass))

Definition at line 75 of file gncCustomer.h.

◆ GNC_CUSTOMER_GET_CLASS

#define GNC_CUSTOMER_GET_CLASS (   o)     (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_CUSTOMER, GncCustomerClass))

Definition at line 81 of file gncCustomer.h.

◆ GNC_ID_CUSTOMER

#define GNC_ID_CUSTOMER   "gncCustomer"

Definition at line 69 of file gncCustomer.h.

◆ GNC_IS_CUSTOMER

#define GNC_IS_CUSTOMER (   o)     (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_CUSTOMER))

Definition at line 77 of file gncCustomer.h.

◆ GNC_IS_CUSTOMER_CLASS

#define GNC_IS_CUSTOMER_CLASS (   k)     (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_CUSTOMER))

Definition at line 79 of file gncCustomer.h.

◆ GNC_TYPE_CUSTOMER

#define GNC_TYPE_CUSTOMER   (gnc_customer_get_type ())

Definition at line 72 of file gncCustomer.h.

◆ gncCustomerGetBook

#define gncCustomerGetBook (   x)    qof_instance_get_book(QOF_INSTANCE(x))

Definition at line 160 of file gncCustomer.h.

◆ gncCustomerGetGUID

#define gncCustomerGetGUID (   x)    qof_instance_get_guid(QOF_INSTANCE(x))
Deprecated:
functions, should be removed

Definition at line 158 of file gncCustomer.h.

◆ gncCustomerLookupDirect

#define gncCustomerLookupDirect (   g,
 
)    gncCustomerLookup((b), &(g))

Definition at line 161 of file gncCustomer.h.

◆ gncCustomerRetGUID

#define gncCustomerRetGUID (   x)    (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))

Definition at line 159 of file gncCustomer.h.

Function Documentation

◆ gncCustomerAddJob()

void gncCustomerAddJob ( GncCustomer customer,
GncJob *  job 
)

Definition at line 498 of file gncCustomer.c.

499{
500 if (!cust) return;
501 if (!job) return;
502
503 if (g_list_index(cust->jobs, job) == -1)
504 cust->jobs = g_list_insert_sorted (cust->jobs, job,
505 (GCompareFunc)gncJobCompare);
506
507 qof_event_gen (&cust->inst, QOF_EVENT_MODIFY, NULL);
508}
void qof_event_gen(QofInstance *entity, QofEventId event_id, gpointer event_data)
Invoke all registered event handlers using the given arguments.
Definition qofevent.cpp:231

◆ gncCustomerBeginEdit()

void gncCustomerBeginEdit ( GncCustomer customer)

Definition at line 530 of file gncCustomer.c.

531{
532 qof_begin_edit (&cust->inst);
533}
gboolean qof_begin_edit(QofInstance *inst)
begin_edit

◆ gncCustomerCommitEdit()

void gncCustomerCommitEdit ( GncCustomer customer)

Definition at line 554 of file gncCustomer.c.

555{
556 if (!qof_commit_edit (QOF_INSTANCE(cust))) return;
557 qof_commit_edit_part2 (&cust->inst, gncCustomerOnError,
558 gncCustomerOnDone, cust_free);
559}
gboolean qof_commit_edit_part2(QofInstance *inst, void(*on_error)(QofInstance *, QofBackendError), void(*on_done)(QofInstance *), void(*on_free)(QofInstance *))
part2 – deal with the backend
gboolean qof_commit_edit(QofInstance *inst)
commit_edit helpers

◆ gncCustomerCompare()

int gncCustomerCompare ( const GncCustomer a,
const GncCustomer b 
)

Definition at line 721 of file gncCustomer.c.

722{
723 if (!a && !b) return 0;
724 if (!a && b) return 1;
725 if (a && !b) return -1;
726
727 return(strcmp(a->name, b->name));
728}

◆ gncCustomerCreate()

GncCustomer * gncCustomerCreate ( QofBook book)

Definition at line 303 of file gncCustomer.c.

304{
305 GncCustomer *cust;
306
307 if (!book) return NULL;
308
309 cust = g_object_new (GNC_TYPE_CUSTOMER, NULL);
310 qof_instance_init_data (&cust->inst, _GNC_MOD_NAME, book);
311
312 cust->id = CACHE_INSERT ("");
313 cust->name = CACHE_INSERT ("");
314 cust->notes = CACHE_INSERT ("");
315 cust->addr = gncAddressCreate (book, &cust->inst);
316 cust->taxincluded = GNC_TAXINCLUDED_USEGLOBAL;
317 cust->active = TRUE;
318 cust->jobs = NULL;
319 cust->balance = NULL;
320
321 cust->discount = gnc_numeric_zero();
322 cust->credit = gnc_numeric_zero();
323 cust->shipaddr = gncAddressCreate (book, &cust->inst);
324
325 if (cust_qof_event_handler_id == 0)
326 cust_qof_event_handler_id = qof_event_register_handler (cust_handle_qof_events, NULL);
327
328 qof_event_gen (&cust->inst, QOF_EVENT_CREATE, NULL);
329
330 return cust;
331}
gint qof_event_register_handler(QofEventHandler handler, gpointer user_data)
Register a handler for events.
Definition qofevent.cpp:73
void qof_instance_init_data(QofInstance *inst, QofIdType type, QofBook *book)
Initialise the settings associated with an instance.
@ GNC_TAXINCLUDED_USEGLOBAL
use the global setting
Definition gncTaxTable.h:89

◆ gncCustomerDestroy()

void gncCustomerDestroy ( GncCustomer customer)

Definition at line 333 of file gncCustomer.c.

334{
335 if (!cust) return;
336 qof_instance_set_destroying(cust, TRUE);
337 qof_instance_set_dirty (&cust->inst);
338 gncCustomerCommitEdit (cust);
339}

◆ gncCustomerEqual()

gboolean gncCustomerEqual ( const GncCustomer a,
const GncCustomer b 
)

Test support function, used in gets-dbi-business-stuff.c.

Definition at line 731 of file gncCustomer.c.

732{
733 if (a == NULL && b == NULL) return TRUE;
734 if (a == NULL || b == NULL) return FALSE;
735
736 g_return_val_if_fail(GNC_IS_CUSTOMER(a), FALSE);
737 g_return_val_if_fail(GNC_IS_CUSTOMER(b), FALSE);
738
739 if (g_strcmp0(a->id, b->id) != 0)
740 {
741 PWARN("IDs differ: %s vs %s", a->id, b->id);
742 return FALSE;
743 }
744
745 if (g_strcmp0(a->name, b->name) != 0)
746 {
747 PWARN("Names differ: %s vs %s", a->name, b->name);
748 return FALSE;
749 }
750
751 if (g_strcmp0(a->notes, b->notes) != 0)
752 {
753 PWARN("Notes differ: %s vs %s", a->notes, b->notes);
754 return FALSE;
755 }
756
757 if (!gncBillTermEqual(a->terms, b->terms))
758 {
759 PWARN("Bill terms differ");
760 return FALSE;
761 }
762
763 if (!gnc_commodity_equal(a->currency, b->currency))
764 {
765 PWARN("currencies differ");
766 return FALSE;
767 }
768
769 if (!gncTaxTableEqual(a->taxtable, b->taxtable))
770 {
771 PWARN("tax tables differ");
772 return FALSE;
773 }
774
775 if (a->taxtable_override != b->taxtable_override)
776 {
777 PWARN("Tax table override flags differ");
778 return FALSE;
779 }
780
781 if (a->taxincluded != b->taxincluded)
782 {
783 PWARN("Tax included flags differ");
784 return FALSE;
785 }
786
787 if (a->active != b->active)
788 {
789 PWARN("Active flags differ");
790 return FALSE;
791 }
792
793 if (!gncAddressEqual(a->addr, b->addr))
794 {
795 PWARN("addresses differ");
796 return FALSE;
797 }
798 if (!gncAddressEqual(a->shipaddr, b->shipaddr))
799 {
800 PWARN("addresses differ");
801 return FALSE;
802 }
803
804 if (!gnc_numeric_equal(a->credit, b->credit))
805 {
806 PWARN("Credit amounts differ");
807 return FALSE;
808 }
809
810 if (!gnc_numeric_equal(a->discount, b->discount))
811 {
812 PWARN("Discount amounts differ");
813 return FALSE;
814 }
815
816 /* FIXME: Need to check jobs list
817 GList * jobs;
818 */
819
820 return TRUE;
821}
gboolean gncAddressEqual(const GncAddress *a, const GncAddress *b)
Deeply compare two addresses.
Definition gncAddress.c:577
gboolean gncBillTermEqual(const GncBillTerm *a, const GncBillTerm *b)
Check if all internal fields of a and b match.
gboolean gnc_commodity_equal(const gnc_commodity *a, const gnc_commodity *b)
This routine returns TRUE if the two commodities are equal.
#define PWARN(format, args...)
Log a warning.
Definition qoflog.h:250
gboolean gnc_numeric_equal(gnc_numeric a, gnc_numeric b)
Equivalence predicate: Returns TRUE (1) if a and b represent the same number.

◆ gncCustomerGetActive()

gboolean gncCustomerGetActive ( const GncCustomer customer)

Definition at line 660 of file gncCustomer.c.

661{
662 if (!cust) return FALSE;
663 return cust->active;
664}

◆ gncCustomerGetAddr()

GncAddress * gncCustomerGetAddr ( const GncCustomer customer)

Definition at line 576 of file gncCustomer.c.

577{
578 if (!cust) return NULL;
579 return cust->addr;
580}

◆ gncCustomerGetCredit()

gnc_numeric gncCustomerGetCredit ( const GncCustomer customer)

Definition at line 672 of file gncCustomer.c.

673{
674 if (!cust) return gnc_numeric_zero();
675 return cust->credit;
676}

◆ gncCustomerGetCurrency()

gnc_commodity * gncCustomerGetCurrency ( const GncCustomer customer)

Definition at line 654 of file gncCustomer.c.

655{
656 if (!cust) return NULL;
657 return cust->currency;
658}

◆ gncCustomerGetDiscount()

gnc_numeric gncCustomerGetDiscount ( const GncCustomer customer)

Definition at line 666 of file gncCustomer.c.

667{
668 if (!cust) return gnc_numeric_zero();
669 return cust->discount;
670}

◆ gncCustomerGetID()

const char * gncCustomerGetID ( const GncCustomer customer)

Definition at line 564 of file gncCustomer.c.

565{
566 if (!cust) return NULL;
567 return cust->id;
568}

◆ gncCustomerGetJoblist()

GList * gncCustomerGetJoblist ( const GncCustomer customer,
gboolean  show_all 
)

Definition at line 690 of file gncCustomer.c.

691{
692 if (!cust) return NULL;
693
694 if (show_all)
695 {
696 return (g_list_copy (cust->jobs));
697 }
698 else
699 {
700 GList *list = NULL, *iterator;
701 for (iterator = cust->jobs; iterator; iterator = iterator->next)
702 {
703 GncJob *j = iterator->data;
704 if (gncJobGetActive (j))
705 list = g_list_prepend (list, j);
706 }
707 return g_list_reverse (list);
708 }
709}

◆ gncCustomerGetName()

const char * gncCustomerGetName ( const GncCustomer customer)

Definition at line 570 of file gncCustomer.c.

571{
572 if (!cust) return NULL;
573 return cust->name;
574}

◆ gncCustomerGetNotes()

const char * gncCustomerGetNotes ( const GncCustomer customer)

Definition at line 636 of file gncCustomer.c.

637{
638 if (!cust) return NULL;
639 return cust->notes;
640}

◆ gncCustomerGetShipAddr()

GncAddress * gncCustomerGetShipAddr ( const GncCustomer customer)

Definition at line 630 of file gncCustomer.c.

631{
632 if (!cust) return NULL;
633 return cust->shipaddr;
634}

◆ gncCustomerGetTaxIncluded()

GncTaxIncluded gncCustomerGetTaxIncluded ( const GncCustomer customer)

Definition at line 648 of file gncCustomer.c.

649{
650 if (!cust) return GNC_TAXINCLUDED_USEGLOBAL;
651 return cust->taxincluded;
652}

◆ gncCustomerGetTaxTable()

GncTaxTable * gncCustomerGetTaxTable ( const GncCustomer customer)

Definition at line 684 of file gncCustomer.c.

685{
686 if (!customer) return NULL;
687 return customer->taxtable;
688}

◆ gncCustomerGetTaxTableOverride()

gboolean gncCustomerGetTaxTableOverride ( const GncCustomer customer)

Definition at line 678 of file gncCustomer.c.

679{
680 if (!customer) return FALSE;
681 return customer->taxtable_override;
682}

◆ gncCustomerGetTerms()

GncBillTerm * gncCustomerGetTerms ( const GncCustomer customer)

Definition at line 642 of file gncCustomer.c.

643{
644 if (!cust) return NULL;
645 return cust->terms;
646}

◆ gncCustomerIsDirty()

gboolean gncCustomerIsDirty ( GncCustomer customer)

Definition at line 711 of file gncCustomer.c.

712{
713 if (!cust) return FALSE;
714 return (qof_instance_is_dirty(&cust->inst) ||
715 gncAddressIsDirty (cust->addr) ||
716 gncAddressIsDirty (cust->shipaddr));
717}
#define qof_instance_is_dirty
Return value of is_dirty flag.

◆ gncCustomerRemoveJob()

void gncCustomerRemoveJob ( GncCustomer customer,
GncJob *  job 
)

Definition at line 510 of file gncCustomer.c.

511{
512 GList *node;
513
514 if (!cust) return;
515 if (!job) return;
516
517 node = g_list_find (cust->jobs, job);
518 if (!node)
519 {
520 /* PERR ("split not in account"); */
521 }
522 else
523 {
524 cust->jobs = g_list_remove_link (cust->jobs, node);
525 g_list_free_1 (node);
526 }
527 qof_event_gen (&cust->inst, QOF_EVENT_MODIFY, NULL);
528}

◆ gncCustomerSetActive()

void gncCustomerSetActive ( GncCustomer customer,
gboolean  active 
)

Definition at line 432 of file gncCustomer.c.

433{
434 if (!cust) return;
435 if (active == cust->active) return;
436 gncCustomerBeginEdit (cust);
437 cust->active = active;
438 mark_customer (cust);
439 gncCustomerCommitEdit (cust);
440}

◆ gncCustomerSetCredit()

void gncCustomerSetCredit ( GncCustomer customer,
gnc_numeric  credit 
)

Definition at line 452 of file gncCustomer.c.

453{
454 if (!cust) return;
455 if (gnc_numeric_equal (credit, cust->credit)) return;
456 gncCustomerBeginEdit (cust);
457 cust->credit = credit;
458 mark_customer (cust);
459 gncCustomerCommitEdit (cust);
460}

◆ gncCustomerSetCurrency()

void gncCustomerSetCurrency ( GncCustomer customer,
gnc_commodity *  currency 
)

Definition at line 462 of file gncCustomer.c.

463{
464 if (!cust || !currency) return;
465 if (cust->currency && gnc_commodity_equal (cust->currency, currency)) return;
466 gncCustomerBeginEdit (cust);
467 cust->currency = currency;
468 mark_customer (cust);
469 gncCustomerCommitEdit (cust);
470}

◆ gncCustomerSetDiscount()

void gncCustomerSetDiscount ( GncCustomer customer,
gnc_numeric  discount 
)

Definition at line 442 of file gncCustomer.c.

443{
444 if (!cust) return;
445 if (gnc_numeric_equal (discount, cust->discount)) return;
446 gncCustomerBeginEdit (cust);
447 cust->discount = discount;
448 mark_customer (cust);
449 gncCustomerCommitEdit (cust);
450}

◆ gncCustomerSetID()

void gncCustomerSetID ( GncCustomer customer,
const char *  id 
)

Definition at line 380 of file gncCustomer.c.

381{
382 if (!cust) return;
383 if (!id) return;
384 SET_STR(cust, cust->id, id);
385 mark_customer (cust);
386 gncCustomerCommitEdit (cust);
387}

◆ gncCustomerSetName()

void gncCustomerSetName ( GncCustomer customer,
const char *  name 
)

Definition at line 389 of file gncCustomer.c.

390{
391 if (!cust) return;
392 if (!name) return;
393 SET_STR(cust, cust->name, name);
394 mark_customer (cust);
395 gncCustomerCommitEdit (cust);
396}

◆ gncCustomerSetNotes()

void gncCustomerSetNotes ( GncCustomer customer,
const char *  notes 
)

Definition at line 398 of file gncCustomer.c.

399{
400 if (!cust) return;
401 if (!notes) return;
402 SET_STR(cust, cust->notes, notes);
403 mark_customer (cust);
404 gncCustomerCommitEdit (cust);
405}

◆ gncCustomerSetTaxIncluded()

void gncCustomerSetTaxIncluded ( GncCustomer customer,
GncTaxIncluded  taxincl 
)

Definition at line 422 of file gncCustomer.c.

423{
424 if (!cust) return;
425 if (taxincl == cust->taxincluded) return;
426 gncCustomerBeginEdit (cust);
427 cust->taxincluded = taxincl;
428 mark_customer (cust);
429 gncCustomerCommitEdit (cust);
430}

◆ gncCustomerSetTaxTable()

void gncCustomerSetTaxTable ( GncCustomer customer,
GncTaxTable table 
)

Definition at line 482 of file gncCustomer.c.

483{
484 if (!customer) return;
485 if (customer->taxtable == table) return;
486
487 gncCustomerBeginEdit (customer);
488 if (customer->taxtable)
489 gncTaxTableDecRef (customer->taxtable);
490 if (table)
491 gncTaxTableIncRef (table);
492 customer->taxtable = table;
493 mark_customer (customer);
494 gncCustomerCommitEdit (customer);
495}

◆ gncCustomerSetTaxTableOverride()

void gncCustomerSetTaxTableOverride ( GncCustomer customer,
gboolean  override 
)

Definition at line 472 of file gncCustomer.c.

473{
474 if (!customer) return;
475 if (customer->taxtable_override == override) return;
476 gncCustomerBeginEdit (customer);
477 customer->taxtable_override = override;
478 mark_customer (customer);
479 gncCustomerCommitEdit (customer);
480}

◆ gncCustomerSetTerms()

void gncCustomerSetTerms ( GncCustomer customer,
GncBillTerm *  term 
)

Definition at line 407 of file gncCustomer.c.

408{
409 if (!cust) return;
410 if (cust->terms == terms) return;
411
412 gncCustomerBeginEdit (cust);
413 if (cust->terms)
414 gncBillTermDecRef (cust->terms);
415 cust->terms = terms;
416 if (cust->terms)
417 gncBillTermIncRef (cust->terms);
418 mark_customer (cust);
419 gncCustomerCommitEdit (cust);
420}