mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
merge from entity-mess branch: minor tweaks to bring into line
with entity reworjk in engine. Add GPL licenses to some of the files. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9533 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -44,6 +44,7 @@
|
|||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
|
|
||||||
@@ -432,7 +433,7 @@ void gncBillTermChanged (GncBillTerm *term)
|
|||||||
|
|
||||||
void gncBillTermBeginEdit (GncBillTerm *term)
|
void gncBillTermBeginEdit (GncBillTerm *term)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&term->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&term->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gncBillTermOnError (QofInstance *inst, QofBackendError errcode)
|
static void gncBillTermOnError (QofInstance *inst, QofBackendError errcode)
|
||||||
@@ -451,16 +452,14 @@ static inline void on_done (QofInstance *inst) {}
|
|||||||
void gncBillTermCommitEdit (GncBillTerm *term)
|
void gncBillTermCommitEdit (GncBillTerm *term)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&term->inst);
|
GNC_COMMIT_EDIT_PART1 (&term->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&term->inst, _GNC_MOD_NAME, gncBillTermOnError,
|
GNC_COMMIT_EDIT_PART2 (&term->inst, gncBillTermOnError,
|
||||||
on_done, bill_free);
|
on_done, bill_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get Functions */
|
/* Get Functions */
|
||||||
GncBillTerm * gncBillTermLookup (QofBook *book, const GUID *guid)
|
GncBillTerm * gncBillTermLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP(GncBillTerm);
|
||||||
return qof_entity_lookup (qof_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GncBillTerm *gncBillTermLookupByName (QofBook *book, const char *name)
|
GncBillTerm *gncBillTermLookupByName (QofBook *book, const char *name)
|
||||||
@@ -714,16 +713,16 @@ static void _gncBillTermMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncBillTermForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncBillTermForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, (QofEntityForeachCB) cb, user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QofObject gncBillTermDesc =
|
static QofObject gncBillTermDesc =
|
||||||
{
|
{
|
||||||
interface_version: QOF_OBJECT_VERSION,
|
interface_version: QOF_OBJECT_VERSION,
|
||||||
name: _GNC_MOD_NAME,
|
e_type: _GNC_MOD_NAME,
|
||||||
type_label: "Billing Term",
|
type_label: "Billing Term",
|
||||||
book_begin: _gncBillTermCreate,
|
book_begin: _gncBillTermCreate,
|
||||||
book_end: _gncBillTermDestroy,
|
book_end: _gncBillTermDestroy,
|
||||||
|
|||||||
@@ -21,8 +21,17 @@ typedef struct _gncBookInfo {
|
|||||||
} GncBookInfo;
|
} GncBookInfo;
|
||||||
|
|
||||||
|
|
||||||
#define gncBusinessForeach(book,mod_name,cb,user_data) \
|
#define gncBusinessForeach(book,mod_name,cb,userdata) \
|
||||||
qof_entity_foreach(qof_book_get_entity_table(book), mod_name, cb, user_data)
|
qof_collection_foreach(qof_book_get_collection((book), (mod_name)), ((QofEntityForeachCB)(cb)), (userdata))
|
||||||
|
|
||||||
|
/** another temporary hack for entity lookup */
|
||||||
|
|
||||||
|
#define ELOOKUP(c_type) { \
|
||||||
|
QofCollection *col; \
|
||||||
|
if (!guid || !book) return NULL; \
|
||||||
|
col = qof_book_get_collection (book, _GNC_MOD_NAME); \
|
||||||
|
return (c_type *) qof_collection_lookup_entity (col, guid); \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void gncBusinessCreate (QofBook *book, QofIdType mod_name);
|
void gncBusinessCreate (QofBook *book, QofIdType mod_name);
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquerycore.h"
|
#include "qofquerycore.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
@@ -398,7 +399,7 @@ void gncCustomerRemoveJob (GncCustomer *cust, GncJob *job)
|
|||||||
|
|
||||||
void gncCustomerBeginEdit (GncCustomer *cust)
|
void gncCustomerBeginEdit (GncCustomer *cust)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&cust->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&cust->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gncCustomerOnError (QofInstance *inst, QofBackendError errcode)
|
static inline void gncCustomerOnError (QofInstance *inst, QofBackendError errcode)
|
||||||
@@ -422,7 +423,7 @@ static inline void cust_free (QofInstance *inst)
|
|||||||
void gncCustomerCommitEdit (GncCustomer *cust)
|
void gncCustomerCommitEdit (GncCustomer *cust)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&cust->inst);
|
GNC_COMMIT_EDIT_PART1 (&cust->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&cust->inst, _GNC_MOD_NAME, gncCustomerOnError,
|
GNC_COMMIT_EDIT_PART2 (&cust->inst, gncCustomerOnError,
|
||||||
gncCustomerOnDone, cust_free);
|
gncCustomerOnDone, cust_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,9 +540,7 @@ GncCustomer * gncCustomerLookupDirect (GUID guid, QofBook *book)
|
|||||||
|
|
||||||
GncCustomer * gncCustomerLookup (QofBook *book, const GUID *guid)
|
GncCustomer * gncCustomerLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP (GncCustomer);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean gncCustomerIsDirty (GncCustomer *cust)
|
gboolean gncCustomerIsDirty (GncCustomer *cust)
|
||||||
@@ -585,7 +584,7 @@ static void _gncCustomerMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncCustomerForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncCustomerForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
#include "qofquerycore.h"
|
#include "qofquerycore.h"
|
||||||
@@ -283,23 +284,7 @@ Account * gncEmployeeGetCCard (GncEmployee *employee)
|
|||||||
|
|
||||||
GncEmployee * gncEmployeeLookup (QofBook *book, const GUID *guid)
|
GncEmployee * gncEmployeeLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP(GncEmployee);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
GUID gncEmployeeRetGUID (GncEmployee *employee)
|
|
||||||
{
|
|
||||||
if (!employee)
|
|
||||||
return *guid_null();
|
|
||||||
|
|
||||||
return employee->inst.entity.guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
GncEmployee * gncEmployeeLookupDirect (GUID guid, QofBook *book)
|
|
||||||
{
|
|
||||||
if (!book) return NULL;
|
|
||||||
return gncEmployeeLookup (book, &guid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean gncEmployeeIsDirty (GncEmployee *employee)
|
gboolean gncEmployeeIsDirty (GncEmployee *employee)
|
||||||
@@ -310,7 +295,7 @@ gboolean gncEmployeeIsDirty (GncEmployee *employee)
|
|||||||
|
|
||||||
void gncEmployeeBeginEdit (GncEmployee *employee)
|
void gncEmployeeBeginEdit (GncEmployee *employee)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&employee->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&employee->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gncEmployeeOnError (QofInstance *employee, QofBackendError errcode)
|
static inline void gncEmployeeOnError (QofInstance *employee, QofBackendError errcode)
|
||||||
@@ -334,7 +319,7 @@ static inline void emp_free (QofInstance *inst)
|
|||||||
void gncEmployeeCommitEdit (GncEmployee *employee)
|
void gncEmployeeCommitEdit (GncEmployee *employee)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&employee->inst);
|
GNC_COMMIT_EDIT_PART1 (&employee->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&employee->inst, _GNC_MOD_NAME, gncEmployeeOnError,
|
GNC_COMMIT_EDIT_PART2 (&employee->inst, gncEmployeeOnError,
|
||||||
gncEmployeeOnDone, emp_free);
|
gncEmployeeOnDone, emp_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -370,7 +355,7 @@ static void _gncEmployeeMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncEmployeeForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncEmployeeForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
|
|
||||||
typedef struct _gncEmployee GncEmployee;
|
typedef struct _gncEmployee GncEmployee;
|
||||||
|
|
||||||
#include "gnc-book.h"
|
#include "qofbook.h"
|
||||||
|
#include "qofid.h"
|
||||||
#include "gncAddress.h"
|
#include "gncAddress.h"
|
||||||
#include "Account.h"
|
#include "Account.h"
|
||||||
|
|
||||||
@@ -35,7 +36,6 @@ void gncEmployeeSetCCard (GncEmployee *employee, Account* ccard_acc);
|
|||||||
/* Get Functions */
|
/* Get Functions */
|
||||||
|
|
||||||
QofBook * gncEmployeeGetBook (GncEmployee *employee);
|
QofBook * gncEmployeeGetBook (GncEmployee *employee);
|
||||||
const GUID * gncEmployeeGetGUID (GncEmployee *employee);
|
|
||||||
const char * gncEmployeeGetID (GncEmployee *employee);
|
const char * gncEmployeeGetID (GncEmployee *employee);
|
||||||
const char * gncEmployeeGetUsername (GncEmployee *employee);
|
const char * gncEmployeeGetUsername (GncEmployee *employee);
|
||||||
GncAddress * gncEmployeeGetAddr (GncEmployee *employee);
|
GncAddress * gncEmployeeGetAddr (GncEmployee *employee);
|
||||||
@@ -50,8 +50,6 @@ Account * gncEmployeeGetCCard (GncEmployee *employee);
|
|||||||
GncEmployee * gncEmployeeLookup (QofBook *book, const GUID *guid);
|
GncEmployee * gncEmployeeLookup (QofBook *book, const GUID *guid);
|
||||||
gboolean gncEmployeeIsDirty (GncEmployee *employee);
|
gboolean gncEmployeeIsDirty (GncEmployee *employee);
|
||||||
|
|
||||||
GUID gncEmployeeRetGUID (GncEmployee *employee);
|
|
||||||
GncEmployee * gncEmployeeLookupDirect (GUID guid, QofBook *book);
|
|
||||||
|
|
||||||
void gncEmployeeBeginEdit (GncEmployee *employee);
|
void gncEmployeeBeginEdit (GncEmployee *employee);
|
||||||
void gncEmployeeCommitEdit (GncEmployee *employee);
|
void gncEmployeeCommitEdit (GncEmployee *employee);
|
||||||
@@ -61,4 +59,9 @@ int gncEmployeeCompare (GncEmployee *a, GncEmployee *b);
|
|||||||
#define EMPLOYEE_USERNAME "username"
|
#define EMPLOYEE_USERNAME "username"
|
||||||
#define EMPLOYEE_ADDR "addr"
|
#define EMPLOYEE_ADDR "addr"
|
||||||
|
|
||||||
|
/** deprecated routines */
|
||||||
|
// const GUID * gncEmployeeGetGUID (GncEmployee *employee);
|
||||||
|
#define gncEmployeeRetGUID(E) (*(qof_entity_get_guid(QOF_ENTITY(E))))
|
||||||
|
#define gncEmployeeLookupDirect(G,B) gncEmployeeLookup((B),&(G))
|
||||||
|
|
||||||
#endif /* GNC_EMPLOYEE_H_ */
|
#endif /* GNC_EMPLOYEE_H_ */
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
#include "qofquerycore.h"
|
#include "qofquerycore.h"
|
||||||
@@ -734,9 +735,7 @@ GncOrder * gncEntryGetOrder (GncEntry *entry)
|
|||||||
|
|
||||||
GncEntry * gncEntryLookup (QofBook *book, const GUID *guid)
|
GncEntry * gncEntryLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP(GncEntry);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1080,7 +1079,7 @@ gboolean gncEntryIsOpen (GncEntry *entry)
|
|||||||
|
|
||||||
void gncEntryBeginEdit (GncEntry *entry)
|
void gncEntryBeginEdit (GncEntry *entry)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&entry->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&entry->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gncEntryOnError (QofInstance *entry, QofBackendError errcode)
|
static inline void gncEntryOnError (QofInstance *entry, QofBackendError errcode)
|
||||||
@@ -1088,9 +1087,8 @@ static inline void gncEntryOnError (QofInstance *entry, QofBackendError errcode)
|
|||||||
PERR("Entry QofBackend Failure: %d", errcode);
|
PERR("Entry QofBackend Failure: %d", errcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gncEntryOnDone (QofInstance *inst)
|
static inline void gncEntryOnDone (QofInstance *inst) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
static inline void entry_free (QofInstance *inst)
|
static inline void entry_free (QofInstance *inst)
|
||||||
{
|
{
|
||||||
GncEntry *entry = (GncEntry *)inst;
|
GncEntry *entry = (GncEntry *)inst;
|
||||||
@@ -1100,7 +1098,7 @@ static inline void entry_free (QofInstance *inst)
|
|||||||
void gncEntryCommitEdit (GncEntry *entry)
|
void gncEntryCommitEdit (GncEntry *entry)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&entry->inst);
|
GNC_COMMIT_EDIT_PART1 (&entry->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&entry->inst, _GNC_MOD_NAME, gncEntryOnError,
|
GNC_COMMIT_EDIT_PART2 (&entry->inst, gncEntryOnError,
|
||||||
gncEntryOnDone, entry_free);
|
gncEntryOnDone, entry_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1148,7 +1146,7 @@ static void _gncEntryMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncEntryForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncEntryForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gncInvoice.c -- the Core Business Invoice *
|
||||||
|
* *
|
||||||
|
* 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 *
|
||||||
|
* *
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gncInvoice.c -- the Core Business Invoice
|
|
||||||
* Copyright (C) 2001,2002 Derek Atkins
|
* Copyright (C) 2001,2002 Derek Atkins
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||||
*/
|
*/
|
||||||
@@ -20,6 +41,7 @@
|
|||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquerycore.h"
|
#include "qofquerycore.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
@@ -144,15 +166,14 @@ static void gncInvoiceFree (GncInvoice *invoice)
|
|||||||
g_free (invoice);
|
g_free (invoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set Functions */
|
GncInvoice *
|
||||||
|
gncInvoiceLookup(QofBook *book, const GUID *guid)
|
||||||
void gncInvoiceSetGUID (GncInvoice *invoice, const GUID *guid)
|
|
||||||
{
|
{
|
||||||
if (!invoice || !guid) return;
|
ELOOKUP(GncInvoice);
|
||||||
|
|
||||||
qof_entity_set_guid(&invoice->inst.entity, guid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set Functions */
|
||||||
|
|
||||||
void gncInvoiceSetID (GncInvoice *invoice, const char *id)
|
void gncInvoiceSetID (GncInvoice *invoice, const char *id)
|
||||||
{
|
{
|
||||||
if (!invoice || !id) return;
|
if (!invoice || !id) return;
|
||||||
@@ -588,9 +609,7 @@ GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot)
|
|||||||
if (!value) return NULL;
|
if (!value) return NULL;
|
||||||
|
|
||||||
guid = kvp_value_get_guid (value);
|
guid = kvp_value_get_guid (value);
|
||||||
|
return gncInvoiceLookup(book, guid);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -614,7 +633,8 @@ gncInvoiceAttachToTxn (GncInvoice *invoice, Transaction *txn)
|
|||||||
gncInvoiceSetPostedTxn (invoice, txn);
|
gncInvoiceSetPostedTxn (invoice, txn);
|
||||||
}
|
}
|
||||||
|
|
||||||
GncInvoice * gncInvoiceGetInvoiceFromTxn (Transaction *txn)
|
GncInvoice *
|
||||||
|
gncInvoiceGetInvoiceFromTxn (Transaction *txn)
|
||||||
{
|
{
|
||||||
KvpFrame *kvp;
|
KvpFrame *kvp;
|
||||||
KvpValue *value;
|
KvpValue *value;
|
||||||
@@ -629,9 +649,7 @@ GncInvoice * gncInvoiceGetInvoiceFromTxn (Transaction *txn)
|
|||||||
if (!value) return NULL;
|
if (!value) return NULL;
|
||||||
|
|
||||||
guid = kvp_value_get_guid (value);
|
guid = kvp_value_get_guid (value);
|
||||||
|
return gncInvoiceLookup(book,guid);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct lotmatch {
|
struct lotmatch {
|
||||||
@@ -1207,40 +1225,17 @@ gboolean gncInvoiceIsPaid (GncInvoice *invoice)
|
|||||||
return gnc_lot_is_closed(invoice->posted_lot);
|
return gnc_lot_is_closed(invoice->posted_lot);
|
||||||
}
|
}
|
||||||
|
|
||||||
GUID gncInvoiceRetGUID (GncInvoice *invoice)
|
|
||||||
{
|
|
||||||
if (!invoice)
|
|
||||||
return *guid_null();
|
|
||||||
|
|
||||||
return invoice->inst.entity.guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
GncInvoice * gncInvoiceLookupDirect (GUID guid, QofBook *book)
|
|
||||||
{
|
|
||||||
if (!book) return NULL;
|
|
||||||
return gncInvoiceLookup (book, &guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
GncInvoice * gncInvoiceLookup (QofBook *book, const GUID *guid)
|
|
||||||
{
|
|
||||||
if (!book || !guid) return NULL;
|
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gncInvoiceBeginEdit (GncInvoice *invoice)
|
void gncInvoiceBeginEdit (GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&invoice->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&invoice->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void inline gncInvoiceOnError (QofInstance *inst, QofBackendError errcode)
|
static inline void gncInvoiceOnError (QofInstance *inst, QofBackendError errcode)
|
||||||
{
|
{
|
||||||
PERR("Invoice QofBackend Failure: %d", errcode);
|
PERR("Invoice QofBackend Failure: %d", errcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gncInvoiceOnDone (QofInstance *invoice)
|
static inline void gncInvoiceOnDone (QofInstance *invoice) { }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void invoice_free (QofInstance *inst)
|
static inline void invoice_free (QofInstance *inst)
|
||||||
{
|
{
|
||||||
@@ -1251,7 +1246,7 @@ static inline void invoice_free (QofInstance *inst)
|
|||||||
void gncInvoiceCommitEdit (GncInvoice *invoice)
|
void gncInvoiceCommitEdit (GncInvoice *invoice)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&invoice->inst);
|
GNC_COMMIT_EDIT_PART1 (&invoice->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&invoice->inst, _GNC_MOD_NAME, gncInvoiceOnError,
|
GNC_COMMIT_EDIT_PART2 (&invoice->inst, gncInvoiceOnError,
|
||||||
gncInvoiceOnDone, invoice_free);
|
gncInvoiceOnDone, invoice_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1292,12 +1287,12 @@ static gboolean _gncInvoiceIsDirty (QofBook *book)
|
|||||||
return gncBusinessIsDirty (book, _GNC_MOD_NAME);
|
return gncBusinessIsDirty (book, _GNC_MOD_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncInvoiceMarkClean (QofBook *book)
|
static inline void _gncInvoiceMarkClean (QofBook *book)
|
||||||
{
|
{
|
||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncInvoiceForeach (QofBook *book, QofEntityForeachCB cb,
|
static inline void _gncInvoiceForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gncInvoice.h -- the Core Business Invoice 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 *
|
||||||
|
* *
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gncInvoice.h -- the Core Business Invoice Interface
|
|
||||||
* Copyright (C) 2001 Derek Atkins
|
* Copyright (C) 2001 Derek Atkins
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||||
*/
|
*/
|
||||||
@@ -113,9 +134,6 @@ GncInvoice * gncInvoiceGetInvoiceFromTxn (Transaction *txn);
|
|||||||
/* Given a LOT, find and return the Invoice attached to the lot */
|
/* Given a LOT, find and return the Invoice attached to the lot */
|
||||||
GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot);
|
GncInvoice * gncInvoiceGetInvoiceFromLot (GNCLot *lot);
|
||||||
|
|
||||||
GUID gncInvoiceRetGUID (GncInvoice *invoice);
|
|
||||||
GncInvoice * gncInvoiceLookupDirect (GUID guid, QofBook *book);
|
|
||||||
|
|
||||||
GncInvoice * gncInvoiceLookup (QofBook *book, const GUID *guid);
|
GncInvoice * gncInvoiceLookup (QofBook *book, const GUID *guid);
|
||||||
gboolean gncInvoiceIsDirty (GncInvoice *invoice);
|
gboolean gncInvoiceIsDirty (GncInvoice *invoice);
|
||||||
void gncInvoiceBeginEdit (GncInvoice *invoice);
|
void gncInvoiceBeginEdit (GncInvoice *invoice);
|
||||||
@@ -146,5 +164,7 @@ gboolean gncInvoiceIsPaid (GncInvoice *invoice);
|
|||||||
/** deprecated functions */
|
/** deprecated functions */
|
||||||
#define gncInvoiceGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
|
#define gncInvoiceGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
|
||||||
#define gncInvoiceGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
|
#define gncInvoiceGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
|
||||||
|
#define gncInvoiceRetGUID(x) (*(qof_instance_get_guid(QOF_INSTANCE(x))))
|
||||||
|
#define gncInvoiceLookupDirect(G,B) gncInvoiceLookup((B),&(G))
|
||||||
|
|
||||||
#endif /* GNC_INVOICE_H_ */
|
#endif /* GNC_INVOICE_H_ */
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gncInvoiceP.h -- the Core Busines Invoice 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 *
|
||||||
|
* *
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gncInvoiceP.h -- the Core Busines Invoice Interface
|
|
||||||
* Copyright (C) 2001 Derek Atkins
|
* Copyright (C) 2001 Derek Atkins
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||||
*/
|
*/
|
||||||
@@ -11,14 +32,15 @@
|
|||||||
#include "Account.h"
|
#include "Account.h"
|
||||||
#include "Transaction.h"
|
#include "Transaction.h"
|
||||||
#include "gnc-lot.h"
|
#include "gnc-lot.h"
|
||||||
|
#include "qofid-p.h"
|
||||||
|
|
||||||
gboolean gncInvoiceRegister (void);
|
gboolean gncInvoiceRegister (void);
|
||||||
gint64 gncInvoiceNextID (QofBook *book);
|
gint64 gncInvoiceNextID (QofBook *book);
|
||||||
void gncInvoiceSetGUID (GncInvoice *invoice, const GUID *guid);
|
|
||||||
void gncInvoiceSetDirty (GncInvoice *invoice, gboolean dirty);
|
void gncInvoiceSetDirty (GncInvoice *invoice, gboolean dirty);
|
||||||
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);
|
||||||
void gncInvoiceSetPaidTxn (GncInvoice *invoice, Transaction *txn);
|
void gncInvoiceSetPaidTxn (GncInvoice *invoice, Transaction *txn);
|
||||||
|
|
||||||
|
#define gncInvoiceSetGUID(I,G) qof_entity_set_guid(QOF_ENTITY(I),(G))
|
||||||
#endif /* GNC_INVOICEP_H_ */
|
#endif /* GNC_INVOICEP_H_ */
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include "qofbook.h"
|
#include "qofbook.h"
|
||||||
#include "qofclass.h"
|
#include "qofclass.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
@@ -269,7 +270,7 @@ void gncJobSetActive (GncJob *job, gboolean active)
|
|||||||
|
|
||||||
void gncJobBeginEdit (GncJob *job)
|
void gncJobBeginEdit (GncJob *job)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&job->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&job->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gncJobOnError (QofInstance *inst, QofBackendError errcode)
|
static void gncJobOnError (QofInstance *inst, QofBackendError errcode)
|
||||||
@@ -288,7 +289,7 @@ static inline void gncJobOnDone (QofInstance *qof) { }
|
|||||||
void gncJobCommitEdit (GncJob *job)
|
void gncJobCommitEdit (GncJob *job)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&job->inst);
|
GNC_COMMIT_EDIT_PART1 (&job->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&job->inst, _GNC_MOD_NAME, gncJobOnError,
|
GNC_COMMIT_EDIT_PART2 (&job->inst, gncJobOnError,
|
||||||
gncJobOnDone, job_free);
|
gncJobOnDone, job_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,14 +320,6 @@ GncOwner * gncJobGetOwner (GncJob *job)
|
|||||||
return &(job->owner);
|
return &(job->owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
GUID gncJobRetGUID (GncJob *job)
|
|
||||||
{
|
|
||||||
const GUID *guid = qof_instance_get_guid (&job->inst);
|
|
||||||
if (guid)
|
|
||||||
return *guid;
|
|
||||||
return *guid_null ();
|
|
||||||
}
|
|
||||||
|
|
||||||
gboolean gncJobGetActive (GncJob *job)
|
gboolean gncJobGetActive (GncJob *job)
|
||||||
{
|
{
|
||||||
if (!job) return FALSE;
|
if (!job) return FALSE;
|
||||||
@@ -335,15 +328,7 @@ gboolean gncJobGetActive (GncJob *job)
|
|||||||
|
|
||||||
GncJob * gncJobLookup (QofBook *book, const GUID *guid)
|
GncJob * gncJobLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP(GncJob);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
GncJob * gncJobLookupDirect (GUID guid, QofBook *book)
|
|
||||||
{
|
|
||||||
if (!book) return NULL;
|
|
||||||
return gncJobLookup (book, &guid);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Other functions */
|
/* Other functions */
|
||||||
@@ -379,7 +364,7 @@ static void _gncJobMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncJobForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncJobForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
|
|||||||
@@ -59,9 +59,6 @@ const char * gncJobGetReference (GncJob *job);
|
|||||||
GncOwner * gncJobGetOwner (GncJob *job);
|
GncOwner * gncJobGetOwner (GncJob *job);
|
||||||
gboolean gncJobGetActive (GncJob *job);
|
gboolean gncJobGetActive (GncJob *job);
|
||||||
|
|
||||||
GUID gncJobRetGUID (GncJob *job);
|
|
||||||
GncJob *gncJobLookupDirect (GUID guid, QofBook *book);
|
|
||||||
|
|
||||||
GncJob * gncJobLookup (QofBook *book, const GUID *guid);
|
GncJob * gncJobLookup (QofBook *book, const GUID *guid);
|
||||||
gboolean gncJobIsDirty (GncJob *job);
|
gboolean gncJobIsDirty (GncJob *job);
|
||||||
|
|
||||||
@@ -78,5 +75,7 @@ int gncJobCompare (const GncJob *a, const GncJob *b);
|
|||||||
/** deprecated functions */
|
/** deprecated functions */
|
||||||
#define gncJobGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
|
#define gncJobGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
|
||||||
#define gncJobGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
|
#define gncJobGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
|
||||||
|
#define gncJobRetGUID(x) (*(qof_instance_get_guid(QOF_INSTANCE(x))))
|
||||||
|
#define gncJobLookupDirect(G,B) gncJobLookup((B),&(G))
|
||||||
|
|
||||||
#endif /* GNC_JOB_H_ */
|
#endif /* GNC_JOB_H_ */
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gncOrder.c -- the Core Business Order *
|
||||||
|
* *
|
||||||
|
* 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 *
|
||||||
|
* *
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gncOrder.c -- the Core Business Order
|
|
||||||
* Copyright (C) 2001,2002 Derek Atkins
|
* Copyright (C) 2001,2002 Derek Atkins
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||||
*/
|
*/
|
||||||
@@ -18,6 +39,7 @@
|
|||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
#include "qofquerycore.h"
|
#include "qofquerycore.h"
|
||||||
@@ -123,13 +145,6 @@ static void gncOrderFree (GncOrder *order)
|
|||||||
|
|
||||||
/* Set Functions */
|
/* Set Functions */
|
||||||
|
|
||||||
void gncOrderSetGUID (GncOrder *order, const GUID *guid)
|
|
||||||
{
|
|
||||||
if (!order || !guid) return;
|
|
||||||
|
|
||||||
qof_entity_set_guid(&order->inst.entity, guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
void gncOrderSetID (GncOrder *order, const char *id)
|
void gncOrderSetID (GncOrder *order, const char *id)
|
||||||
{
|
{
|
||||||
if (!order || !id) return;
|
if (!order || !id) return;
|
||||||
@@ -285,9 +300,7 @@ GList * gncOrderGetEntries (GncOrder *order)
|
|||||||
|
|
||||||
GncOrder * gncOrderLookup (QofBook *book, const GUID *guid)
|
GncOrder * gncOrderLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP(GncOrder);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean gncOrderIsClosed (GncOrder *order)
|
gboolean gncOrderIsClosed (GncOrder *order)
|
||||||
@@ -299,7 +312,7 @@ gboolean gncOrderIsClosed (GncOrder *order)
|
|||||||
|
|
||||||
void gncOrderBeginEdit (GncOrder *order)
|
void gncOrderBeginEdit (GncOrder *order)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&order->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&order->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gncOrderOnError (QofInstance *order, QofBackendError errcode)
|
static inline void gncOrderOnError (QofInstance *order, QofBackendError errcode)
|
||||||
@@ -307,9 +320,7 @@ static inline void gncOrderOnError (QofInstance *order, QofBackendError errcode)
|
|||||||
PERR("Order QofBackend Failure: %d", errcode);
|
PERR("Order QofBackend Failure: %d", errcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gncOrderOnDone (QofInstance *order)
|
static inline void gncOrderOnDone (QofInstance *order) {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void order_free (QofInstance *inst)
|
static inline void order_free (QofInstance *inst)
|
||||||
{
|
{
|
||||||
@@ -320,7 +331,7 @@ static inline void order_free (QofInstance *inst)
|
|||||||
void gncOrderCommitEdit (GncOrder *order)
|
void gncOrderCommitEdit (GncOrder *order)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&order->inst);
|
GNC_COMMIT_EDIT_PART1 (&order->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&order->inst, _GNC_MOD_NAME, gncOrderOnError,
|
GNC_COMMIT_EDIT_PART2 (&order->inst, gncOrderOnError,
|
||||||
gncOrderOnDone, order_free);
|
gncOrderOnDone, order_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,7 +377,7 @@ static void _gncOrderMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncOrderForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncOrderForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gncOrder.h -- the Core Business Order 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 *
|
||||||
|
* *
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gncOrder.h -- the Core Business Order Interface
|
|
||||||
* Copyright (C) 2001 Derek Atkins
|
* Copyright (C) 2001 Derek Atkins
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gncOrderP.h -- the Core Busines Order 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 *
|
||||||
|
* *
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gncOrderP.h -- the Core Busines Order Interface
|
|
||||||
* Copyright (C) 2001 Derek Atkins
|
* Copyright (C) 2001 Derek Atkins
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||||
*/
|
*/
|
||||||
@@ -8,10 +29,12 @@
|
|||||||
#define GNC_ORDERP_H_
|
#define GNC_ORDERP_H_
|
||||||
|
|
||||||
#include "gncOrder.h"
|
#include "gncOrder.h"
|
||||||
|
#include "qofid-p.h"
|
||||||
|
|
||||||
gboolean gncOrderRegister (void);
|
gboolean gncOrderRegister (void);
|
||||||
gint64 gncOrderNextID (QofBook *book);
|
gint64 gncOrderNextID (QofBook *book);
|
||||||
void gncOrderSetGUID (GncOrder *order, const GUID *guid);
|
|
||||||
void gncOrderSetDirty (GncOrder *order, gboolean dirty);
|
void gncOrderSetDirty (GncOrder *order, gboolean dirty);
|
||||||
|
|
||||||
|
#define gncOrderSetGUID(O,G) qof_entity_set_guid(QOF_ENTITY(O),(G))
|
||||||
|
|
||||||
#endif /* GNC_ORDERP_H_ */
|
#endif /* GNC_ORDERP_H_ */
|
||||||
|
|||||||
@@ -1,5 +1,26 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gncOwner.h -- Business Interface: Object OWNERs *
|
||||||
|
* *
|
||||||
|
* 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 *
|
||||||
|
* *
|
||||||
|
\********************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* gncOwner.h -- Business Interface: Object OWNERs
|
|
||||||
* Copyright (C) 2001, 2002 Derek Atkins
|
* Copyright (C) 2001, 2002 Derek Atkins
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
* Author: Derek Atkins <warlord@MIT.EDU>
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
#include "qofquerycore.h"
|
#include "qofquerycore.h"
|
||||||
@@ -539,20 +540,17 @@ void gncTaxTableChanged (GncTaxTable *table)
|
|||||||
|
|
||||||
void gncTaxTableBeginEdit (GncTaxTable *table)
|
void gncTaxTableBeginEdit (GncTaxTable *table)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&table->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&table->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gncTaxTableOnError (QofInstance *inst, QofBackendError errcode)
|
static inline void gncTaxTableOnError (QofInstance *inst, QofBackendError errcode)
|
||||||
{
|
{
|
||||||
PERR("TaxTable QofBackend Failure: %d", errcode);
|
PERR("TaxTable QofBackend Failure: %d", errcode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gncTaxTableOnDone (QofInstance *inst)
|
static inline void gncTaxTableOnDone (QofInstance *inst) {}
|
||||||
{
|
|
||||||
inst->dirty = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void table_free (QofInstance *inst)
|
static inline void table_free (QofInstance *inst)
|
||||||
{
|
{
|
||||||
GncTaxTable *table = (GncTaxTable *) inst;
|
GncTaxTable *table = (GncTaxTable *) inst;
|
||||||
gncTaxTableFree (table);
|
gncTaxTableFree (table);
|
||||||
@@ -561,7 +559,7 @@ static void table_free (QofInstance *inst)
|
|||||||
void gncTaxTableCommitEdit (GncTaxTable *table)
|
void gncTaxTableCommitEdit (GncTaxTable *table)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&table->inst);
|
GNC_COMMIT_EDIT_PART1 (&table->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&table->inst, _GNC_MOD_NAME, gncTaxTableOnError,
|
GNC_COMMIT_EDIT_PART2 (&table->inst, gncTaxTableOnError,
|
||||||
gncTaxTableOnDone, table_free);
|
gncTaxTableOnDone, table_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -570,9 +568,7 @@ void gncTaxTableCommitEdit (GncTaxTable *table)
|
|||||||
/* Get Functions */
|
/* Get Functions */
|
||||||
GncTaxTable * gncTaxTableLookup (QofBook *book, const GUID *guid)
|
GncTaxTable * gncTaxTableLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP(GncTaxTable);
|
||||||
return qof_entity_lookup (qof_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name)
|
GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name)
|
||||||
@@ -791,20 +787,6 @@ void gncAccountValueDestroy (GList *list)
|
|||||||
g_list_free (list);
|
g_list_free (list);
|
||||||
}
|
}
|
||||||
|
|
||||||
GUID gncTaxTableRetGUID (GncTaxTable *table)
|
|
||||||
{
|
|
||||||
if (!table)
|
|
||||||
return *guid_null();
|
|
||||||
|
|
||||||
return table->inst.entity.guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
GncTaxTable *gncTaxTableLookupDirect (GUID guid, QofBook *book)
|
|
||||||
{
|
|
||||||
if (!book) return NULL;
|
|
||||||
return gncTaxTableLookup (book, &guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Package-Private functions */
|
/* Package-Private functions */
|
||||||
|
|
||||||
static void _gncTaxTableCreate (QofBook *book)
|
static void _gncTaxTableCreate (QofBook *book)
|
||||||
@@ -839,7 +821,7 @@ static void _gncTaxTableMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncTaxTableForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncTaxTableForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
@@ -848,7 +830,7 @@ static void _gncTaxTableForeach (QofBook *book, QofEntityForeachCB cb,
|
|||||||
static QofObject gncTaxTableDesc =
|
static QofObject gncTaxTableDesc =
|
||||||
{
|
{
|
||||||
interface_version: QOF_OBJECT_VERSION,
|
interface_version: QOF_OBJECT_VERSION,
|
||||||
name: _GNC_MOD_NAME,
|
e_type: _GNC_MOD_NAME,
|
||||||
type_label: "Tax Table",
|
type_label: "Tax Table",
|
||||||
book_begin: _gncTaxTableCreate,
|
book_begin: _gncTaxTableCreate,
|
||||||
book_end: _gncTaxTableDestroy,
|
book_end: _gncTaxTableDestroy,
|
||||||
|
|||||||
@@ -106,9 +106,6 @@ gnc_numeric gncTaxTableEntryGetAmount (GncTaxTableEntry *entry);
|
|||||||
int gncTaxTableCompare (GncTaxTable *a, GncTaxTable *b);
|
int gncTaxTableCompare (GncTaxTable *a, GncTaxTable *b);
|
||||||
int gncTaxTableEntryCompare (GncTaxTableEntry *a, GncTaxTableEntry *b);
|
int gncTaxTableEntryCompare (GncTaxTableEntry *a, GncTaxTableEntry *b);
|
||||||
|
|
||||||
GUID gncTaxTableRetGUID (GncTaxTable *table);
|
|
||||||
GncTaxTable *gncTaxTableLookupDirect (GUID guid, QofBook *book);
|
|
||||||
|
|
||||||
/************************************************/
|
/************************************************/
|
||||||
|
|
||||||
struct _gncAccountValue {
|
struct _gncAccountValue {
|
||||||
@@ -131,9 +128,10 @@ gnc_numeric gncAccountValueTotal (GList *list);
|
|||||||
/** Destroy a list of accountvalues */
|
/** Destroy a list of accountvalues */
|
||||||
void gncAccountValueDestroy (GList *list);
|
void gncAccountValueDestroy (GList *list);
|
||||||
|
|
||||||
|
|
||||||
/** deprecated routine */
|
/** deprecated routine */
|
||||||
#define gncTaxTableGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
|
#define gncTaxTableGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
|
||||||
|
#define gncTaxTableRetGUID(x) (*(qof_instance_get_guid(QOF_INSTANCE(x))))
|
||||||
|
#define gncTaxTableLookupDirect(G,B) gncTaxTableLookup((B), &(G))
|
||||||
|
|
||||||
#endif /* GNC_TAXTABLE_H_ */
|
#endif /* GNC_TAXTABLE_H_ */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include "qofid.h"
|
#include "qofid.h"
|
||||||
#include "qofid-p.h"
|
#include "qofid-p.h"
|
||||||
#include "qofinstance.h"
|
#include "qofinstance.h"
|
||||||
|
#include "qofinstance-p.h"
|
||||||
#include "qofobject.h"
|
#include "qofobject.h"
|
||||||
#include "qofquery.h"
|
#include "qofquery.h"
|
||||||
#include "qofquerycore.h"
|
#include "qofquerycore.h"
|
||||||
@@ -354,7 +355,7 @@ void gncVendorRemoveJob (GncVendor *vendor, GncJob *job)
|
|||||||
|
|
||||||
void gncVendorBeginEdit (GncVendor *vendor)
|
void gncVendorBeginEdit (GncVendor *vendor)
|
||||||
{
|
{
|
||||||
GNC_BEGIN_EDIT (&vendor->inst, _GNC_MOD_NAME);
|
GNC_BEGIN_EDIT (&vendor->inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void gncVendorOnError (QofInstance *vendor, QofBackendError errcode)
|
static inline void gncVendorOnError (QofInstance *vendor, QofBackendError errcode)
|
||||||
@@ -377,7 +378,7 @@ static inline void vendor_free (QofInstance *inst)
|
|||||||
void gncVendorCommitEdit (GncVendor *vendor)
|
void gncVendorCommitEdit (GncVendor *vendor)
|
||||||
{
|
{
|
||||||
GNC_COMMIT_EDIT_PART1 (&vendor->inst);
|
GNC_COMMIT_EDIT_PART1 (&vendor->inst);
|
||||||
GNC_COMMIT_EDIT_PART2 (&vendor->inst, _GNC_MOD_NAME, gncVendorOnError,
|
GNC_COMMIT_EDIT_PART2 (&vendor->inst, gncVendorOnError,
|
||||||
gncVendorOnDone, vendor_free);
|
gncVendorOnDone, vendor_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -410,25 +411,9 @@ GList * gncVendorGetJoblist (GncVendor *vendor, gboolean show_all)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GUID gncVendorRetGUID (GncVendor *vendor)
|
|
||||||
{
|
|
||||||
if (!vendor)
|
|
||||||
return *guid_null();
|
|
||||||
|
|
||||||
return vendor->inst.entity.guid;
|
|
||||||
}
|
|
||||||
|
|
||||||
GncVendor * gncVendorLookupDirect (GUID guid, QofBook *book)
|
|
||||||
{
|
|
||||||
if (!book) return NULL;
|
|
||||||
return gncVendorLookup (book, &guid);
|
|
||||||
}
|
|
||||||
|
|
||||||
GncVendor * gncVendorLookup (QofBook *book, const GUID *guid)
|
GncVendor * gncVendorLookup (QofBook *book, const GUID *guid)
|
||||||
{
|
{
|
||||||
if (!book || !guid) return NULL;
|
ELOOKUP (GncVendor);
|
||||||
return qof_entity_lookup (gnc_book_get_entity_table (book),
|
|
||||||
guid, _GNC_MOD_NAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean gncVendorIsDirty (GncVendor *vendor)
|
gboolean gncVendorIsDirty (GncVendor *vendor)
|
||||||
@@ -460,7 +445,7 @@ static void _gncVendorMarkClean (QofBook *book)
|
|||||||
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
gncBusinessSetDirtyFlag (book, _GNC_MOD_NAME, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _gncVendorForeach (QofBook *book, QofEntityForeachCB cb,
|
static void _gncVendorForeach (QofBook *book, QofForeachCB cb,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
gncBusinessForeach (book, _GNC_MOD_NAME, cb, user_data);
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ GncTaxTable* gncVendorGetTaxTable (GncVendor *vendor);
|
|||||||
*/
|
*/
|
||||||
GList * gncVendorGetJoblist (GncVendor *vendor, gboolean show_all);
|
GList * gncVendorGetJoblist (GncVendor *vendor, gboolean show_all);
|
||||||
|
|
||||||
GUID gncVendorRetGUID (GncVendor *vendor);
|
|
||||||
GncVendor * gncVendorLookupDirect (GUID guid, QofBook *book);
|
|
||||||
|
|
||||||
GncVendor * gncVendorLookup (QofBook *book, const GUID *guid);
|
GncVendor * gncVendorLookup (QofBook *book, const GUID *guid);
|
||||||
gboolean gncVendorIsDirty (GncVendor *vendor);
|
gboolean gncVendorIsDirty (GncVendor *vendor);
|
||||||
int gncVendorCompare (GncVendor *a, GncVendor *b);
|
int gncVendorCompare (GncVendor *a, GncVendor *b);
|
||||||
@@ -74,5 +71,7 @@ int gncVendorCompare (GncVendor *a, GncVendor *b);
|
|||||||
/** deprecated functions */
|
/** deprecated functions */
|
||||||
#define gncVendorGetBook(X) qof_instance_get_book (QOF_INSTANCE(X))
|
#define gncVendorGetBook(X) qof_instance_get_book (QOF_INSTANCE(X))
|
||||||
#define gncVendorGetGUID(X) qof_instance_get_guid (QOF_INSTANCE(X))
|
#define gncVendorGetGUID(X) qof_instance_get_guid (QOF_INSTANCE(X))
|
||||||
|
#define gncVendorRetGUID(X) (*(qof_instance_get_guid (QOF_INSTANCE(X))))
|
||||||
|
#define gncVendorLookupDirect(G,B) gncVendorLookup((B),&(G))
|
||||||
|
|
||||||
#endif /* GNC_VENDOR_H_ */
|
#endif /* GNC_VENDOR_H_ */
|
||||||
|
|||||||
@@ -14,23 +14,23 @@
|
|||||||
static int count = 0;
|
static int count = 0;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_string_fcn (GNCBook *book, const char *message,
|
test_string_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, const char *str),
|
void (*set) (GncEmployee *, const char *str),
|
||||||
const char * (*get)(GncEmployee *));
|
const char * (*get)(GncEmployee *));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_numeric_fcn (GNCBook *book, const char *message,
|
test_numeric_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, gnc_numeric),
|
void (*set) (GncEmployee *, gnc_numeric),
|
||||||
gnc_numeric (*get)(GncEmployee *));
|
gnc_numeric (*get)(GncEmployee *));
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_bool_fcn (GNCBook *book, const char *message,
|
test_bool_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, gboolean),
|
void (*set) (GncEmployee *, gboolean),
|
||||||
gboolean (*get) (GncEmployee *));
|
gboolean (*get) (GncEmployee *));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
test_gint_fcn (GNCBook *book, const char *message,
|
test_gint_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, gint),
|
void (*set) (GncEmployee *, gint),
|
||||||
gint (*get) (GncEmployee *));
|
gint (*get) (GncEmployee *));
|
||||||
#endif
|
#endif
|
||||||
@@ -38,10 +38,10 @@ test_gint_fcn (GNCBook *book, const char *message,
|
|||||||
static void
|
static void
|
||||||
test_employee (void)
|
test_employee (void)
|
||||||
{
|
{
|
||||||
GNCBook *book;
|
QofBook *book;
|
||||||
GncEmployee *employee;
|
GncEmployee *employee;
|
||||||
|
|
||||||
book = gnc_book_new ();
|
book = qof_book_new ();
|
||||||
|
|
||||||
/* Test creation/destruction */
|
/* Test creation/destruction */
|
||||||
{
|
{
|
||||||
@@ -106,7 +106,7 @@ test_employee (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_string_fcn (GNCBook *book, const char *message,
|
test_string_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, const char *str),
|
void (*set) (GncEmployee *, const char *str),
|
||||||
const char * (*get)(GncEmployee *))
|
const char * (*get)(GncEmployee *))
|
||||||
{
|
{
|
||||||
@@ -125,7 +125,7 @@ test_string_fcn (GNCBook *book, const char *message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_numeric_fcn (GNCBook *book, const char *message,
|
test_numeric_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, gnc_numeric),
|
void (*set) (GncEmployee *, gnc_numeric),
|
||||||
gnc_numeric (*get)(GncEmployee *))
|
gnc_numeric (*get)(GncEmployee *))
|
||||||
{
|
{
|
||||||
@@ -144,7 +144,7 @@ test_numeric_fcn (GNCBook *book, const char *message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_bool_fcn (GNCBook *book, const char *message,
|
test_bool_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, gboolean),
|
void (*set) (GncEmployee *, gboolean),
|
||||||
gboolean (*get) (GncEmployee *))
|
gboolean (*get) (GncEmployee *))
|
||||||
{
|
{
|
||||||
@@ -166,7 +166,7 @@ test_bool_fcn (GNCBook *book, const char *message,
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
static void
|
static void
|
||||||
test_gint_fcn (GNCBook *book, const char *message,
|
test_gint_fcn (QofBook *book, const char *message,
|
||||||
void (*set) (GncEmployee *, gint),
|
void (*set) (GncEmployee *, gint),
|
||||||
gint (*get) (GncEmployee *))
|
gint (*get) (GncEmployee *))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user