|
|
|
|
@ -1,6 +1,28 @@
|
|
|
|
|
/********************************************************************\
|
|
|
|
|
* gncCustomer.c -- the Core Customer Interface *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software; you can redistribute it and/or *
|
|
|
|
|
* modify it under the terms of the GNU General Public License as *
|
|
|
|
|
* published by the Free Software Foundation; either version 2 of *
|
|
|
|
|
* the License, or (at your option) any later version. *
|
|
|
|
|
* *
|
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU General Public License*
|
|
|
|
|
* along with this program; if not, contact: *
|
|
|
|
|
* *
|
|
|
|
|
* Free Software Foundation Voice: +1-617-542-5942 *
|
|
|
|
|
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
|
|
|
|
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
|
|
|
|
* *
|
|
|
|
|
\********************************************************************/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* gncCustomer.c -- the Core Customer Interface
|
|
|
|
|
* Copyright (C) 2001,2002 Derek Atkins
|
|
|
|
|
* Copyright (C) 2003 Linas Vepstas <linas@linas.org>
|
|
|
|
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@ -98,6 +120,35 @@ GncCustomer *gncCustomerCreate (QofBook *book)
|
|
|
|
|
return cust;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** Create a copy of a customer, placing the copy into a new book. */
|
|
|
|
|
GncCustomer *
|
|
|
|
|
gncCloneCustomer (GncCustomer *from, QofBook *book)
|
|
|
|
|
{
|
|
|
|
|
GncCustomer *cust;
|
|
|
|
|
|
|
|
|
|
cust = g_new0 (GncCustomer, 1);
|
|
|
|
|
|
|
|
|
|
qof_instance_init (&cust->inst, book);
|
|
|
|
|
qof_instance_gemini (&cust->inst, &from->inst);
|
|
|
|
|
|
|
|
|
|
cust->id = CACHE_INSERT (from->id);
|
|
|
|
|
cust->name = CACHE_INSERT (from->name);
|
|
|
|
|
cust->notes = CACHE_INSERT (from->notes);
|
|
|
|
|
cust->discount = from->discount;
|
|
|
|
|
cust->credit = from->credit;
|
|
|
|
|
cust->taxincluded = from->taxincluded;
|
|
|
|
|
cust->active = from->active;
|
|
|
|
|
|
|
|
|
|
/* cust->jobs = ??? XXX fixme not sure what to do here */
|
|
|
|
|
/* cust->terms = ??? XXX fixme not sure what to do here */
|
|
|
|
|
/* cust->taxtable = ??? XXX fixme not sure what to do here */
|
|
|
|
|
cust->addr = gncCloneAddress (from->addr, book);
|
|
|
|
|
cust->shipaddr = gncCloneAddress (from->shipaddr, book);
|
|
|
|
|
addObj (cust);
|
|
|
|
|
|
|
|
|
|
return cust;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void gncCustomerDestroy (GncCustomer *cust)
|
|
|
|
|
{
|
|
|
|
|
if (!cust) return;
|
|
|
|
|
|