mirror of
https://github.com/Gnucash/gnucash.git
synced 2026-08-08 12:08:32 -05:00
remove set_guid from customer, add clone to vendor
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9595 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -268,14 +268,6 @@ void gncCustomerSetNotes (GncCustomer *cust, const char *notes)
|
||||
gncCustomerCommitEdit (cust);
|
||||
}
|
||||
|
||||
void gncCustomerSetGUID (GncCustomer *cust, const GUID *guid)
|
||||
{
|
||||
if (!cust || !guid) return;
|
||||
if (guid_equal (guid, &cust->inst.entity.guid)) return;
|
||||
|
||||
qof_entity_set_guid (&cust->inst.entity, guid);
|
||||
}
|
||||
|
||||
void gncCustomerSetTerms (GncCustomer *cust, GncBillTerm *terms)
|
||||
{
|
||||
if (!cust) return;
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
gboolean gncCustomerRegister (void);
|
||||
gint64 gncCustomerNextID (QofBook *book);
|
||||
void gncCustomerSetGUID (GncCustomer *customer, const GUID *guid);
|
||||
|
||||
/** The gncCloneCustomer() routine makes a copy of the indicated
|
||||
* customer, placing it in the indicated book. It copies
|
||||
@@ -54,4 +53,6 @@ GncCustomer * gncCloneCustomer (GncCustomer *from, QofBook *book);
|
||||
*/
|
||||
GncCustomer * gncCustomerObtainTwin (GncCustomer *from, QofBook *book);
|
||||
|
||||
#define gncCustomerSetGUID(E,G) qof_entity_set_guid(QOF_ENTITY(E),(G))
|
||||
|
||||
#endif /* GNC_CUSTOMERP_H_ */
|
||||
|
||||
@@ -141,6 +141,58 @@ static void gncVendorFree (GncVendor *vendor)
|
||||
g_free (vendor);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/** Create a copy of a vendor, placing the copy into a new book. */
|
||||
GncVendor *
|
||||
gncCloneVendor (GncVendor *from, QofBook *book)
|
||||
{
|
||||
GncVendor *vendor;
|
||||
|
||||
if (!book) return NULL;
|
||||
|
||||
vendor = g_new0 (GncVendor, 1);
|
||||
qof_instance_init (&vendor->inst, _GNC_MOD_NAME, book);
|
||||
qof_instance_gemini (&vendor->inst, &from->inst);
|
||||
|
||||
vendor->id = CACHE_INSERT (from->id);
|
||||
vendor->name = CACHE_INSERT (from->name);
|
||||
vendor->notes = CACHE_INSERT (from->notes);
|
||||
vendor->addr = gncCloneAddress (from->addr, book);
|
||||
vendor->taxincluded = from->taxincluded;
|
||||
vendor->active = from->active;
|
||||
|
||||
vendor->jobs = NULL; xxx
|
||||
|
||||
GncBillTerm * terms;
|
||||
GncAddress * addr;
|
||||
gnc_commodity * currency;
|
||||
GncTaxTable* taxtable;
|
||||
gboolean taxtable_override;
|
||||
GncTaxIncluded taxincluded;
|
||||
gboolean active;
|
||||
GList * jobs;
|
||||
|
||||
gnc_engine_gen_event (&vendor->inst.entity, GNC_EVENT_CREATE);
|
||||
|
||||
return vendor;
|
||||
}
|
||||
|
||||
GncVendor *
|
||||
gncVendorObtainTwin (GncVendor *from, QofBook *book)
|
||||
{
|
||||
GncVendor *vendor;
|
||||
if (!book) return NULL;
|
||||
|
||||
vendor = (GncVendor *) qof_instance_lookup_twin (QOF_INSTANCE(from), book);
|
||||
if (!vendor)
|
||||
{
|
||||
employee = gncCloneEmployee (from, book);
|
||||
}
|
||||
|
||||
return vendor;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ============================================================== */
|
||||
/* Set Functions */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user