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:
Linas Vepstas
2003-10-20 13:44:41 +00:00
parent 77fd3e74ce
commit 93e1d35a87
3 changed files with 54 additions and 9 deletions
-8
View File
@@ -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;
+2 -1
View File
@@ -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_ */
+52
View File
@@ -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 */