QSF Import of gncCustomer and gncInvoice

Georgi Mirchev manager at mirchevideas.com
Wed May 31 15:30:10 EDT 2006


Hi,

I have managed to import gncInvoice and set its owner to be a 
gncCustomer. To do that I needed to do some changes in gncInvoice. Could 
someone review the following and let me know if this is ok for future 
inclusion in the main source. Also could someone explain to me why the 
INVOICE_OWNER param doesn't have setter.

Index: gncInvoice.c
===================================================================
--- gncInvoice.c        (revision 14209)
+++ gncInvoice.c        (working copy)
@@ -457,8 +459,10 @@
 static QofEntity*
 qofInvoiceGetOwner (GncInvoice *invoice)
 {
        if(!invoice) { return NULL; }
-       return (QofEntity*)&invoice->owner;
+       return qofOwnerGetOwner(&invoice->owner);
 }
 
 static QofEntity*
@@ -1543,6 +1548,7 @@
 {
   static QofParam params[] = {
     { INVOICE_ID,      QOF_TYPE_STRING, 
(QofAccessFunc)gncInvoiceGetID,     (QofSetterFunc)gncInvoiceSetID },
+    { INVOICE_OWNER_CUSTOMER, GNC_ID_CUSTOMER, 
(QofAccessFunc)qofInvoiceGetOwner, (QofSetterFunc)qofInvoiceSetOwner },
     { INVOICE_OWNER,   GNC_ID_OWNER, (QofAccessFunc)gncInvoiceGetOwner, 
NULL },
     { INVOICE_OPENED,  QOF_TYPE_DATE,   
(QofAccessFunc)gncInvoiceGetDateOpened, 
(QofSetterFunc)gncInvoiceSetDateOpened },
     { INVOICE_DUE,     QOF_TYPE_DATE,   
(QofAccessFunc)gncInvoiceGetDateDue, NULL },
Index: gncInvoice.h
===================================================================
--- gncInvoice.h        (revision 14209)
+++ gncInvoice.h        (working copy)
@@ -173,6 +173,7 @@
 
 #define INVOICE_ID     "id"
 #define INVOICE_OWNER  "owner"
+#define INVOICE_OWNER_CUSTOMER "owner-customer"
 #define INVOICE_OPENED "date_opened"
 #define INVOICE_POSTED "date_posted"
 #define INVOICE_DUE    "date_due"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: manager.vcf
Type: text/x-vcard
Size: 527 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20060531/30f2ec2e/manager.vcf


More information about the gnucash-devel mailing list