r14657 - gnucash/branches/swigify/src/business/business-reports - Convert the business reports to use the new SWIG bindings.

Chris Shoemaker chris at cvs.gnucash.org
Sat Aug 12 22:39:48 EDT 2006


Author: chris
Date: 2006-08-12 22:39:47 -0400 (Sat, 12 Aug 2006)
New Revision: 14657
Trac: http://svn.gnucash.org/trac/changeset/14657

Modified:
   gnucash/branches/swigify/src/business/business-reports/aging.scm
   gnucash/branches/swigify/src/business/business-reports/business-reports.scm
   gnucash/branches/swigify/src/business/business-reports/easy-invoice.scm
   gnucash/branches/swigify/src/business/business-reports/fancy-invoice.scm
   gnucash/branches/swigify/src/business/business-reports/invoice.scm
   gnucash/branches/swigify/src/business/business-reports/owner-report.scm
Log:
   Convert the business reports to use the new SWIG bindings.
   Mostly, this involves using the exact name of the wrapped function, but
   there's also some places where NULL needs to be represented by '() instead
   of by #f, like the default-getters for options.


Modified: gnucash/branches/swigify/src/business/business-reports/aging.scm
===================================================================
--- gnucash/branches/swigify/src/business/business-reports/aging.scm	2006-08-13 02:37:06 UTC (rev 14656)
+++ gnucash/branches/swigify/src/business/business-reports/aging.scm	2006-08-13 02:39:47 UTC (rev 14657)
@@ -180,12 +180,12 @@
 
   (define (do-update value)
     (let* ((transaction (gnc:split-get-parent split))
-	   (temp-owner (gnc:owner-create))
+	   (temp-owner (gncOwnerCreate))
 	   (owner (gnc:owner-from-split split temp-owner)))
 
       (if
        owner
-       (let* ((guid (gnc:owner-get-guid owner))
+       (let* ((guid (gncOwnerReturnGUID owner))
 	      (this-currency (gnc:transaction-get-currency transaction))
 	      (this-date (gnc:transaction-get-date-posted transaction))
 	      (company-info (hash-ref hash guid)))
@@ -198,13 +198,13 @@
 	     ;; if it's an existing company, destroy the temp owner and
 	     ;; then make sure the currencies match
 	     (begin
-	       (gnc:owner-destroy temp-owner)
+	       (gncOwnerDestroy temp-owner)
 	       (if (not (gnc:commodity-equiv?
 			 this-currency
 			 (company-get-currency company-info)))
 		   (cons #f (sprintf
 			     (_ "Transactions relating to '%s' contain \
-more than one currency.  This report is not designed to cope with this possibility.")  (gnc:owner-get-name owner)))
+more than one currency.  This report is not designed to cope with this possibility.")  (gncOwnerGetName owner)))
 		   (begin
 		     (gnc:debug "it's an old company")
 		     (if (gnc:numeric-negative-p value)
@@ -223,7 +223,7 @@
 		 (hash-set! hash guid new-company))
 	       (cons #t guid))))
        ; else (no owner)
-       (gnc:owner-destroy temp-owner))))
+       (gncOwnerDestroy temp-owner))))
   
   ;; figure out if this split is part of a closed lot
   ;; also save the split value...
@@ -386,7 +386,7 @@
 
   (define (get-name a)
     (let* ((owner (company-get-owner-obj (cdr a))))
-      (gnc:owner-get-name owner)))
+      (gncOwnerGetName owner)))
 
   ;; Predicates for sorting the companys once the data has been collected
 
@@ -602,7 +602,7 @@
 						(cdr company-list-entry))))
 			       (owner (company-get-owner-obj
 				       (cdr company-list-entry)))
-			       (company-name (gnc:owner-get-name owner)))
+			       (company-name (gncOwnerGetName owner)))
 
 			  (add-to-column-totals total-collector-list
 						monetary-list)
@@ -627,7 +627,7 @@
 				    (gnc:owner-anchor-text owner)
 				    company-name))
 				  monetary-list))
-			  (gnc:owner-destroy owner)))			
+			  (gncOwnerDestroy owner)))			
 		      company-list)
 
 	    ;; add the totals

Modified: gnucash/branches/swigify/src/business/business-reports/business-reports.scm
===================================================================
--- gnucash/branches/swigify/src/business/business-reports/business-reports.scm	2006-08-13 02:37:06 UTC (rev 14656)
+++ gnucash/branches/swigify/src/business/business-reports/business-reports.scm	2006-08-13 02:39:47 UTC (rev 14657)
@@ -38,60 +38,58 @@
   (gnc:html-build-url type (string-append idstr guid) #f))
 
 (define (gnc:customer-anchor-text customer)
-  (guid-ref "customer=" gnc:url-type-customer (gnc:customer-get-guid customer)))
+  (guid-ref "customer=" gnc:url-type-customer (gncCustomerReturnGUID customer)))
 
 (define (gnc:job-anchor-text job)
-  (guid-ref "job=" gnc:url-type-job (gnc:job-get-guid job)))
+  (guid-ref "job=" gnc:url-type-job (gncJobReturnGUID job)))
 
 (define (gnc:vendor-anchor-text vendor)
-  (guid-ref "vendor=" gnc:url-type-vendor (gnc:vendor-get-guid vendor)))
+  (guid-ref "vendor=" gnc:url-type-vendor (gncVendorReturnGUID vendor)))
 
 (define (gnc:employee-anchor-text employee)
-  (guid-ref "employee=" gnc:url-type-employee (gnc:employee-get-guid employee)))
+  (guid-ref "employee=" gnc:url-type-employee (gncEmployeeReturnGUID employee)))
 
 (define (gnc:invoice-anchor-text invoice)
-  (guid-ref "invoice=" gnc:url-type-invoice (gnc:invoice-get-guid invoice)))
+  (guid-ref "invoice=" gnc:url-type-invoice (gncInvoiceReturnGUID invoice)))
 
 (define (gnc:owner-anchor-text owner)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type (gnc:owner-get-end-owner owner)) #f)))
+  (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
     (case type
-      ((gnc-owner-customer)
-       (gnc:customer-anchor-text (gnc:owner-get-customer owner)))
+      ((GNC-OWNER-CUSTOMER)
+       (gnc:customer-anchor-text (gncOwnerGetCustomer owner)))
 
-      ((gnc-owner-vendor)
-       (gnc:vendor-anchor-text (gnc:owner-get-vendor owner)))
+      ((GNC-OWNER-VENDOR)
+       (gnc:vendor-anchor-text (gncOwnerGetVendor owner)))
 
-      ((gnc-owner-employee)
-       (gnc:employee-anchor-text (gnc:owner-get-employee owner)))
+      ((GNC-OWNER-EMPLOYEE)
+       (gnc:employee-anchor-text (gncOwnerGetEmployee owner)))
 
-      ((gnc-owner-job)
-       (gnc:job-anchor-text (gnc:owner-get-job owner)))
+      ((GNC-OWNER-JOB)
+       (gnc:job-anchor-text (gncOwnerGetJob owner)))
 
       (else
        ""))))
 
 (define (gnc:owner-report-text owner acc)
-  (let* ((end-owner (gnc:owner-get-end-owner owner))
-	 (type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type end-owner) #f))
+  (let* ((end-owner (gncOwnerGetEndOwner owner))
+	 (type (gncOwnerGetType end-owner))
 	 (ref #f))
 
     (case type
-      ((gnc-owner-customer)
+      ((GNC-OWNER-CUSTOMER)
        (set! ref "owner=c:"))
 
-      ((gnc-owner-vendor)
+      ((GNC-OWNER-VENDOR)
        (set! ref "owner=v:"))
 
-      ((gnc-owner-employee)
+      ((GNC-OWNER-EMPLOYEE)
        (set! ref "owner=e:"))
 
       (else (set! ref "unknown-type=")))
 
     (if ref
 	(begin
-	  (set! ref (string-append ref (gnc:owner-get-guid end-owner)))
+	  (set! ref (string-append ref (gncOwnerReturnGUID end-owner)))
 	  (if acc
 	      (set! ref (string-append ref "&acct="
 				       (gnc:account-get-guid acc))))

Modified: gnucash/branches/swigify/src/business/business-reports/easy-invoice.scm
===================================================================
--- gnucash/branches/swigify/src/business/business-reports/easy-invoice.scm	2006-08-13 02:37:06 UTC (rev 14656)
+++ gnucash/branches/swigify/src/business/business-reports/easy-invoice.scm	2006-08-13 02:39:47 UTC (rev 14657)
@@ -167,54 +167,54 @@
   (let* ((row-contents '())
 	 (entry-value (gnc:make-gnc-monetary
 		       currency
-		       (gnc:entry-get-value entry invoice?)))
+		       (gncEntryReturnValue entry invoice?)))
 	 (entry-tax-value (gnc:make-gnc-monetary
 			   currency
-			   (gnc:entry-get-tax-value entry invoice?))))
+			   (gncEntryReturnTaxValue entry invoice?))))
 
     (if (date-col column-vector)
         (addto! row-contents
-                (gnc:print-date (gnc:entry-get-date entry))))
+                (gnc:print-date (gncEntryGetDate entry))))
 
     (if (description-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-description entry)))
+		(gncEntryGetDescription entry)))
 
     (if (action-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-action entry)))
+		(gncEntryGetAction entry)))
 
     (if (quantity-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
-		 (gnc:entry-get-quantity entry))))
+		 (gncEntryGetQuantity entry))))
 
     (if (price-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
 		 (gnc:make-gnc-monetary
-		  currency (if invoice? (gnc:entry-get-inv-price entry)
-			       (gnc:entry-get-bill-price entry))))))
+		  currency (if invoice? (gncEntryGetInvPrice entry)
+			       (gncEntryGetBillPrice entry))))))
 
     (if (discount-col column-vector)
 	(addto! row-contents
 		(if invoice?
 		    (gnc:make-html-table-cell/markup
 		     "number-cell"
-		     (monetary-or-percent (gnc:entry-get-inv-discount entry)
+		     (monetary-or-percent (gncEntryGetInvDiscount entry)
 					  currency
-					  (gnc:entry-get-inv-discount-type entry)))
+					  (gncEntryGetInvDiscountType entry)))
 		    "")))
 
     (if (tax-col column-vector)
 	(addto! row-contents
 		(if (if invoice?
-			(and (gnc:entry-get-inv-taxable entry)
-			     (gnc:entry-get-inv-tax-table entry))
-			(and (gnc:entry-get-bill-taxable entry)
-			     (gnc:entry-get-bill-tax-table entry)))
+			(and (gncEntryGetInvTaxable entry)
+			     (gncEntryGetInvTaxTable entry))
+			(and (gncEntryGetBillTaxable entry)
+			     (gncEntryGetBillTaxTable entry)))
 		    ;; This "T" is supposed to be an abbrev. for Tax?
 		    (_ "T") "")))
 
@@ -244,7 +244,7 @@
 
   (gnc:register-inv-option
    (gnc:make-invoice-option invoice-page invoice-name "x" ""
-			    (lambda () #f) #f))
+			    (lambda () '()) #f))
 
   (gnc:register-inv-option
    (gnc:make-simple-boolean-option
@@ -376,9 +376,9 @@
 
   (let ((show-payments (opt-val "Display" "Payments"))
 	(display-all-taxes (opt-val "Display" "Individual Taxes"))
-	(lot (gnc:invoice-get-posted-lot invoice))
-	(txn (gnc:invoice-get-posted-txn invoice))
-	(currency (gnc:invoice-get-currency invoice)))
+	(lot (gncInvoiceGetPostedLot invoice))
+	(txn (gncInvoiceGetPostedTxn invoice))
+	(currency (gncInvoiceGetCurrency invoice)))
 
     (define (colspan monetary used-columns)
       (cond
@@ -506,7 +506,7 @@
 					      invoice?)))
 
 	    (if display-all-taxes
-		(let ((tax-list (gnc:entry-get-tax-values current invoice?)))
+		(let ((tax-list (gncEntryReturnTaxValues current invoice?)))
 		  (update-account-hash acct-hash tax-list))
 		(tax-collector 'add
 			       (gnc:gnc-monetary-commodity (cdr entry-values))
@@ -539,7 +539,7 @@
     (let* ((table (gnc:make-html-table))
 	   (used-columns (build-column-used options))
 	   (width (num-columns-required used-columns))
-	   (entries (gnc:invoice-get-entries invoice))
+	   (entries (gncInvoiceGetEntries invoice))
 	   (totals (gnc:make-commodity-collector)))
 
       (gnc:html-table-set-col-headers!
@@ -591,7 +591,7 @@
      (list "<br>"))
     (for-each
      (lambda (order)
-       (let* ((reference (gnc:order-get-reference order)))
+       (let* ((reference (GncOrderGetReference order)))
 	 (if (and reference (> (string-length reference) 0))
 	     (gnc:html-table-append-row!
 	      table
@@ -624,11 +624,11 @@
 
 (define (make-myname-table book)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*)))))
 
@@ -685,19 +685,18 @@
 
     (if invoice
 	(begin
-	  (set! owner (gnc:invoice-get-owner invoice))
-	  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-		       (gnc:owner-get-type 
-			(gnc:owner-get-end-owner owner)) #f)))
+	  (set! owner (gncInvoiceGetOwner invoice))
+	  (let ((type (gncOwnerGetType 
+			(gncOwnerGetEndOwner owner))))
 	    (case type
-	      ((gnc-owner-customer)
+	      ((GNC-OWNER-CUSTOMER)
 	       (set! invoice? #t))
-	      ((gnc-owner-vendor)
+	      ((GNC-OWNER-VENDOR)
 	       (set! title (_ "Bill")))
-	      ((gnc-owner-employee)
+	      ((GNC-OWNER-EMPLOYEE)
 	       (set! title (_ "Expense Voucher")))))
 	  (set! title (sprintf #f (_"%s #%d") title
-			       (gnc:invoice-get-id invoice)))))
+			       (gncInvoiceGetID invoice)))))
 
 ;    (gnc:html-document-set-title! document title)
 
@@ -715,14 +714,14 @@
         (add-html! document "<td align='left'>")
         (add-html! document "<b><u>")
 	(add-html! document (sprintf #f (_ "Invoice #%d")
-				     (gnc:invoice-get-id invoice)))
+				     (gncInvoiceGetID invoice)))
         (add-html! document "</u></b></td>")
         (add-html! document "<td align='right'>")
 
         (if (opt-val "Display" "My Company ID")
-          (let* ((book (gnc:invoice-get-book invoice))
-                 (slots (gnc:book-get-slots book))
-	         (taxid (gnc:kvp-frame-get-slot-path
+          (let* ((book (gncInvoiceGetBook invoice))
+                 (slots (gnc-book-get-slots book))
+	         (taxid (kvp-frame-get-slot-path-gslist
 		    slots (append gnc:*kvp-option-path*
 		                  (list gnc:*business-label* gnc:*company-id*)))))
                  (if (and taxid (> (string-length taxid) 0))
@@ -738,7 +737,7 @@
         (make-break! document)
 
         ; add the client and company name table
-	(let ((book (gnc:invoice-get-book invoice)))
+	(let ((book (gncInvoiceGetBook invoice)))
 	  (set! table (make-entry-table invoice
 					(gnc:report-options report-obj)
 					add-order invoice?))
@@ -761,8 +760,8 @@
 
         ; add the date
         (let ((date-table #f)
-              (post-date (gnc:invoice-get-date-posted invoice))
-              (due-date (gnc:invoice-get-date-due invoice)))
+              (post-date (gncInvoiceGetDatePosted invoice))
+              (due-date (gncInvoiceGetDateDue invoice)))
           (if (not (equal? post-date (cons 0 0)))
             (begin
               (add-html! document "<table border=0><tr>")
@@ -791,7 +790,7 @@
         (make-break! document)
 
         (if (opt-val "Display" "Billing ID")
-          (let ((billing-id (gnc:invoice-get-billing-id invoice)))
+          (let ((billing-id (gncInvoiceGetBillingID invoice)))
             (if (and billing-id (> (string-length billing-id) 0))
               (begin
                 (gnc:html-document-add-object!
@@ -803,8 +802,8 @@
                 (make-break! document)))))
 
         (if (opt-val "Display" "Billing Terms")
-          (let* ((term (gnc:invoice-get-terms invoice))
-            (terms (gnc:bill-term-get-description term)))
+          (let* ((term (gncInvoiceGetTerms invoice))
+            (terms (gncBillTermGetDescription term)))
             (if (and terms (> (string-length terms) 0))
               (gnc:html-document-add-object!
                 document
@@ -829,7 +828,7 @@
 
 	(if (opt-val "Display" "Invoice Notes")
           (begin
-            (let ((notes (gnc:invoice-get-notes invoice)))
+            (let ((notes (gncInvoiceGetNotes invoice)))
               (gnc:html-document-add-object!
                document
                (gnc:make-html-text

Modified: gnucash/branches/swigify/src/business/business-reports/fancy-invoice.scm
===================================================================
--- gnucash/branches/swigify/src/business/business-reports/fancy-invoice.scm	2006-08-13 02:37:06 UTC (rev 14656)
+++ gnucash/branches/swigify/src/business/business-reports/fancy-invoice.scm	2006-08-13 02:39:47 UTC (rev 14657)
@@ -173,54 +173,54 @@
   (let* ((row-contents '())
 	 (entry-value (gnc:make-gnc-monetary
 		       currency
-		       (gnc:entry-get-value entry invoice?)))
+		       (gncEntryReturnValue entry invoice?)))
 	 (entry-tax-value (gnc:make-gnc-monetary
 			   currency
-			   (gnc:entry-get-tax-value entry invoice?))))
+			   (gncEntryReturnTaxValue entry invoice?))))
 
     (if (date-col column-vector)
         (addto! row-contents
-                (gnc:print-date (gnc:entry-get-date entry))))
+                (gnc:print-date (gncEntryGetDate entry))))
 
     (if (description-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-description entry)))
+		(gncEntryGetDescription entry)))
 
     (if (action-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-action entry)))
+		(gncEntryGetAction entry)))
 
     (if (quantity-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
-		 (gnc:entry-get-quantity entry))))
+		 (gncEntryGetQuantity entry))))
 
     (if (price-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
 		 (gnc:make-gnc-monetary
-		  currency (if invoice? (gnc:entry-get-inv-price entry)
-			       (gnc:entry-get-bill-price entry))))))
+		  currency (if invoice? (gncEntryGetInvPrice entry)
+			       (gncEntryGetBillPrice entry))))))
 
     (if (discount-col column-vector)
 	(addto! row-contents
 		(if invoice?
 		    (gnc:make-html-table-cell/markup
 		     "number-cell"
-		     (monetary-or-percent (gnc:entry-get-inv-discount entry)
+		     (monetary-or-percent (gncEntryGetInvDiscount entry)
 					  currency
-					  (gnc:entry-get-inv-discount-type entry)))
+					  (gncEntryGetInvDiscountType entry)))
 		    "")))
 
     (if (tax-col column-vector)
 	(addto! row-contents
 		(if (if invoice?
-			(and (gnc:entry-get-inv-taxable entry)
-			     (gnc:entry-get-inv-tax-table entry))
-			(and (gnc:entry-get-bill-taxable entry)
-			     (gnc:entry-get-bill-tax-table entry)))
+			(and (gncEntryGetInvTaxable entry)
+			     (gncEntryGetInvTaxTable entry))
+			(and (gncEntryGetBillTaxable entry)
+			     (gncEntryGetBillTaxTable entry)))
 		    (_ "T") "")))
 
     (if (taxvalue-col column-vector)
@@ -251,7 +251,7 @@
 
   (gnc:register-inv-option
    (gnc:make-invoice-option invoice-page invoice-name "x" ""
-			    (lambda () #f) #f))
+			    (lambda () '()) #f))
 
   (gnc:register-inv-option
    (gnc:make-simple-boolean-option
@@ -389,9 +389,9 @@
 
   (let ((show-payments (opt-val "Display" "Payments"))
 	(display-all-taxes (opt-val "Display" "Individual Taxes"))
-	(lot (gnc:invoice-get-posted-lot invoice))
-	(txn (gnc:invoice-get-posted-txn invoice))
-	(currency (gnc:invoice-get-currency invoice))
+	(lot (gncInvoiceGetPostedLot invoice))
+	(txn (gncInvoiceGetPostedTxn invoice))
+	(currency (gncInvoiceGetCurrency invoice))
 	(entries-added 0))
 
     (define (colspan monetary used-columns)
@@ -534,7 +534,7 @@
 					      invoice?)))
 
 	    (if display-all-taxes
-		(let ((tax-list (gnc:entry-get-tax-values current invoice?)))
+		(let ((tax-list (gncEntryReturnTaxValues current invoice?)))
 		  (update-account-hash acct-hash tax-list))
 		(tax-collector 'add
 			       (gnc:gnc-monetary-commodity (cdr entry-values))
@@ -569,7 +569,7 @@
     (let* ((table (gnc:make-html-table))
 	   (used-columns (build-column-used options))
 	   (width (num-columns-required used-columns))
-	   (entries (gnc:invoice-get-entries invoice))
+	   (entries (gncInvoiceGetEntries invoice))
 	   (totals (gnc:make-commodity-collector)))
 
       (gnc:html-table-set-col-headers!
@@ -628,7 +628,7 @@
      (list "<br>"))
     (for-each
      (lambda (order)
-       (let* ((reference (gnc:order-get-reference order)))
+       (let* ((reference (GncOrderGetReference order)))
 	 (if (and reference (> (string-length reference) 0))
 	     (gnc:html-table-append-row!
 	      table
@@ -665,26 +665,26 @@
 
 (define (make-myname-table book date-format)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-;;	 (contact (gnc:kvp-frame-get-slot-path
+;;	 (contact (kvp-frame-get-slot-path-gslist
 ;;		slots (append gnc:*kvp-option-path*
 ;;			      (list gnc:*business-label* gnc:*company-contact*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*))))
-	 (id (gnc:kvp-frame-get-slot-path
+	 (id (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-id*))))
-	 (phone (gnc:kvp-frame-get-slot-path
+	 (phone (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-phone*))))
-	 (fax (gnc:kvp-frame-get-slot-path
+	 (fax (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-fax*))))
-	 (url (gnc:kvp-frame-get-slot-path
+	 (url (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-url*))))
 	 (invoice-cell (gnc:make-html-table-cell))
@@ -768,26 +768,25 @@
 
     (if invoice
 	(begin
-	  (set! owner (gnc:invoice-get-owner invoice))
-	  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-		       (gnc:owner-get-type 
-			(gnc:owner-get-end-owner owner)) #f)))
+	  (set! owner (gncInvoiceGetOwner invoice))
+	  (let ((type (gncOwnerGetType 
+			(gncOwnerGetEndOwner owner))))
 	    (case type
-	      ((gnc-owner-customer)
+	      ((GNC-OWNER-CUSTOMER)
 	       (set! invoice? #t))
-	      ((gnc-owner-vendor)
+	      ((GNC-OWNER-VENDOR)
 	       (set! title (_ "Bill")))
-	      ((gnc-owner-employee)
+	      ((GNC-OWNER-EMPLOYEE)
 	       (set! title (_ "Expense Voucher")))))
 	  (set! title (sprintf #f (_"%s #%d") title
-			       (gnc:invoice-get-id invoice)))))
+			       (gncInvoiceGetID invoice)))))
     ;; oli-custom - title redundant, "Invoice" moved to myname-table,
     ;; invoice number moved below
     ;;(gnc:html-document-set-title! document title)
 
     (if invoice
-	(let* ((book (gnc:invoice-get-book invoice))
-	      (slots (gnc:book-get-slots book))
+	(let* ((book (gncInvoiceGetBook invoice))
+	      (slots (gnc-book-get-slots book))
 	      (date-object #f)
 	      (helper-table (gnc:make-html-table)))
 	  (set! table (make-entry-table invoice
@@ -835,8 +834,8 @@
 	   'attribute (list "width" "100%"))
 
 	  (set! date-object (let ((date-table #f)
-		(post-date (gnc:invoice-get-date-posted invoice))
-		(due-date (gnc:invoice-get-date-due invoice)))
+		(post-date (gncInvoiceGetDatePosted invoice))
+		(due-date (gncInvoiceGetDateDue invoice)))
 
 	    (if (not (equal? post-date (cons 0 0)))
 		(begin
@@ -844,7 +843,7 @@
 		  ;; oli-custom - moved invoice number here
 		  (gnc:html-table-append-row!
 		   date-table (list (sprintf #f (_ "Invoice&nbsp;#&nbsp;%d")
-                                             (gnc:invoice-get-id invoice))))
+                                             (gncInvoiceGetID invoice))))
 		  (make-date-row! date-table (_ "Invoice&nbsp;Date") post-date)
 		  (make-date-row! date-table (_ "Due&nbsp;Date") due-date)
 		  date-table)
@@ -876,7 +875,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Billing ID")
-	      (let ((billing-id (gnc:invoice-get-billing-id invoice)))
+	      (let ((billing-id (gncInvoiceGetBillingID invoice)))
 		(if (and billing-id (> (string-length billing-id) 0))
 		    (begin
 		      (gnc:html-document-add-object!
@@ -888,8 +887,8 @@
 		      (make-break! document)))))
 
 	  (if (opt-val "Display" "Billing Terms")
-	      (let* ((term (gnc:invoice-get-terms invoice))
-		     (terms (gnc:bill-term-get-description term)))
+	      (let* ((term (gncInvoiceGetTerms invoice))
+		     (terms (gncBillTermGetDescription term)))
 		(if (and terms (> (string-length terms) 0))
 		    (gnc:html-document-add-object!
 		     document
@@ -906,7 +905,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Invoice Notes")
-	      (let ((notes (gnc:invoice-get-notes invoice)))
+	      (let ((notes (gncInvoiceGetNotes invoice)))
 		(gnc:html-document-add-object!
 		 document
 		 (gnc:make-html-text
@@ -915,7 +914,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Payable to")
-	      (let* ((name (gnc:kvp-frame-get-slot-path
+	      (let* ((name (kvp-frame-get-slot-path-gslist
 			    slots (append gnc:*kvp-option-path*
 					  (list gnc:*business-label*
 						gnc:*company-name*))))
@@ -930,7 +929,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Company contact")
-	      (let* ((contact (gnc:kvp-frame-get-slot-path
+	      (let* ((contact (kvp-frame-get-slot-path-gslist
 			       slots (append gnc:*kvp-option-path*
 					     (list gnc:*business-label*
 						   gnc:*company-contact*))))

Modified: gnucash/branches/swigify/src/business/business-reports/invoice.scm
===================================================================
--- gnucash/branches/swigify/src/business/business-reports/invoice.scm	2006-08-13 02:37:06 UTC (rev 14656)
+++ gnucash/branches/swigify/src/business/business-reports/invoice.scm	2006-08-13 02:39:47 UTC (rev 14657)
@@ -161,54 +161,54 @@
   (let* ((row-contents '())
 	 (entry-value (gnc:make-gnc-monetary
 		       currency
-		       (gnc:entry-get-value entry invoice?)))
+		       (gncEntryReturnValue entry invoice?)))
 	 (entry-tax-value (gnc:make-gnc-monetary
 			   currency
-			   (gnc:entry-get-tax-value entry invoice?))))
+			   (gncEntryReturnTaxValue entry invoice?))))
 
     (if (date-col column-vector)
         (addto! row-contents
-                (gnc:print-date (gnc:entry-get-date entry))))
+                (gnc:print-date (gncEntryGetDate entry))))
 
     (if (description-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-description entry)))
+		(gncEntryGetDescription entry)))
 
     (if (action-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-action entry)))
+		(gncEntryGetAction entry)))
 
     (if (quantity-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
-		 (gnc:entry-get-quantity entry))))
+		 (gncEntryGetQuantity entry))))
 
     (if (price-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
 		 (gnc:make-gnc-monetary
-		  currency (if invoice? (gnc:entry-get-inv-price entry)
-			       (gnc:entry-get-bill-price entry))))))
+		  currency (if invoice? (gncEntryGetInvPrice entry)
+			       (gncEntryGetBillPrice entry))))))
 
     (if (discount-col column-vector)
 	(addto! row-contents
 		(if invoice?
 		    (gnc:make-html-table-cell/markup
 		     "number-cell"
-		     (monetary-or-percent (gnc:entry-get-inv-discount entry)
+		     (monetary-or-percent (gncEntryGetInvDiscount entry)
 					  currency
-					  (gnc:entry-get-inv-discount-type entry)))
+					  (gncEntryGetInvDiscountType entry)))
 		    "")))
 
     (if (tax-col column-vector)
 	(addto! row-contents
 		(if (if invoice?
-			(and (gnc:entry-get-inv-taxable entry)
-			     (gnc:entry-get-inv-tax-table entry))
-			(and (gnc:entry-get-bill-taxable entry)
-			     (gnc:entry-get-bill-tax-table entry)))
+			(and (gncEntryGetInvTaxable entry)
+			     (gncEntryGetInvTaxTable entry))
+			(and (gncEntryGetBillTaxable entry)
+			     (gncEntryGetBillTaxTable entry)))
 		    (_ "T") "")))
 
     (if (taxvalue-col column-vector)
@@ -237,7 +237,7 @@
 
   (gnc:register-inv-option
    (gnc:make-invoice-option invoice-page invoice-name "x" ""
-			    (lambda () #f) #f))
+			    (lambda () '()) #f))
 
   (gnc:register-inv-option
    (gnc:make-simple-boolean-option
@@ -342,9 +342,9 @@
 
   (let ((show-payments (opt-val "Display" "Payments"))
 	(display-all-taxes (opt-val "Display" "Individual Taxes"))
-	(lot (gnc:invoice-get-posted-lot invoice))
-	(txn (gnc:invoice-get-posted-txn invoice))
-	(currency (gnc:invoice-get-currency invoice)))
+	(lot (gncInvoiceGetPostedLot invoice))
+	(txn (gncInvoiceGetPostedTxn invoice))
+	(currency (gncInvoiceGetCurrency invoice)))
 
     (define (colspan monetary used-columns)
       (cond
@@ -470,7 +470,7 @@
 					      invoice?)))
 
 	    (if display-all-taxes
-		(let ((tax-list (gnc:entry-get-tax-values current invoice?)))
+		(let ((tax-list (gncEntryReturnTaxValues current invoice?)))
 		  (update-account-hash acct-hash tax-list))
 		(tax-collector 'add
 			       (gnc:gnc-monetary-commodity (cdr entry-values))
@@ -503,7 +503,7 @@
     (let* ((table (gnc:make-html-table))
 	   (used-columns (build-column-used options))
 	   (width (num-columns-required used-columns))
-	   (entries (gnc:invoice-get-entries invoice))
+	   (entries (gncInvoiceGetEntries invoice))
 	   (totals (gnc:make-commodity-collector)))
 
       (gnc:html-table-set-col-headers!
@@ -555,7 +555,7 @@
      (list "<br>"))
     (for-each
      (lambda (order)
-       (let* ((reference (gnc:order-get-reference order)))
+       (let* ((reference (GncOrderGetReference order)))
 	 (if (and reference (> (string-length reference) 0))
 	     (gnc:html-table-append-row!
 	      table
@@ -587,11 +587,11 @@
 
 (define (make-myname-table book date-format)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*)))))
 
@@ -638,24 +638,23 @@
 
     (if invoice
 	(begin
-	  (set! owner (gnc:invoice-get-owner invoice))
-	  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-		       (gnc:owner-get-type 
-			(gnc:owner-get-end-owner owner)) #f)))
+	  (set! owner (gncInvoiceGetOwner invoice))
+	  (let ((type (gncOwnerGetType 
+			(gncOwnerGetEndOwner owner))))
 	    (case type
-	      ((gnc-owner-customer)
+	      ((GNC-OWNER-CUSTOMER)
 	       (set! invoice? #t))
-	      ((gnc-owner-vendor)
+	      ((GNC-OWNER-VENDOR)
 	       (set! title (_ "Bill")))
-	      ((gnc-owner-employee)
+	      ((GNC-OWNER-EMPLOYEE)
 	       (set! title (_ "Expense Voucher")))))
 	  (set! title (sprintf #f (_"%s #%d") title
-			       (gnc:invoice-get-id invoice)))))
+			       (gncInvoiceGetID invoice)))))
 
     (gnc:html-document-set-title! document title)
 
     (if invoice
-	(let ((book (gnc:invoice-get-book invoice)))
+	(let ((book (gncInvoiceGetBook invoice)))
 	  (set! table (make-entry-table invoice
 					(gnc:report-options report-obj)
 					add-order invoice?))
@@ -671,8 +670,8 @@
 	   (make-myname-table book (opt-val "Display" "Today Date Format")))
 
 	  (let ((date-table #f)
-		(post-date (gnc:invoice-get-date-posted invoice))
-		(due-date (gnc:invoice-get-date-due invoice)))
+		(post-date (gncInvoiceGetDatePosted invoice))
+		(due-date (gncInvoiceGetDateDue invoice)))
 
 	    (if (not (equal? post-date (cons 0 0)))
 		(begin
@@ -696,7 +695,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Billing ID")
-	      (let ((billing-id (gnc:invoice-get-billing-id invoice)))
+	      (let ((billing-id (gncInvoiceGetBillingID invoice)))
 		(if (and billing-id (> (string-length billing-id) 0))
 		    (begin
 		      (gnc:html-document-add-object!
@@ -708,8 +707,8 @@
 		      (make-break! document)))))
 
 	  (if (opt-val "Display" "Billing Terms")
-	      (let* ((term (gnc:invoice-get-terms invoice))
-		     (terms (gnc:bill-term-get-description term)))
+	      (let* ((term (gncInvoiceGetTerms invoice))
+		     (terms (gncBillTermGetDescription term)))
 		(if (and terms (> (string-length terms) 0))
 		    (gnc:html-document-add-object!
 		     document
@@ -726,7 +725,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Invoice Notes")
-	      (let ((notes (gnc:invoice-get-notes invoice)))
+	      (let ((notes (gncInvoiceGetNotes invoice)))
 		(gnc:html-document-add-object!
 		 document
 		 (gnc:make-html-text

Modified: gnucash/branches/swigify/src/business/business-reports/owner-report.scm
===================================================================
--- gnucash/branches/swigify/src/business/business-reports/owner-report.scm	2006-08-13 02:37:06 UTC (rev 14656)
+++ gnucash/branches/swigify/src/business/business-reports/owner-report.scm	2006-08-13 02:39:47 UTC (rev 14657)
@@ -156,8 +156,8 @@
     (for-each
      (lambda (lot)
        (let* ((bal (gnc:lot-get-balance lot))
-	      (invoice (gnc:invoice-get-invoice-from-lot lot))
-	      (post-date (gnc:invoice-get-date-posted invoice)))
+	      (invoice (gncInvoiceGetInvoiceFromLot lot))
+	      (post-date (gncInvoiceGetDatePosted invoice)))
 
 	 (if (not (gnc:numeric-zero-p bal))
 	     (begin
@@ -197,7 +197,7 @@
 	 (due-date #f)
 	 (value (gnc:transaction-get-account-value txn acc))
 	 (split (gnc:transaction-get-split txn 0))
-	 (invoice (gnc:invoice-get-invoice-from-txn txn))
+	 (invoice (gncInvoiceGetInvoiceFromTxn txn))
 	 (currency (gnc:transaction-get-currency txn))
 	 (type-str
 	  (cond
@@ -256,7 +256,7 @@
 	  
 	  ; Now print out the invoice row
 	  (if invoice
-	      (set! due-date (gnc:invoice-get-date-due invoice)))
+	      (set! due-date (gncInvoiceGetDateDue invoice)))
 
 	  (let ((row (make-row date due-date (gnc:transaction-get-num txn)
 			       type-str (gnc:split-get-memo split) value))
@@ -348,7 +348,7 @@
   (gnc:register-inv-option
    (gnc:make-owner-option owner-page owner-string "v"
 			  (N_ "The company for this report")
-			  (lambda () #f) #f owner-type))
+			  (lambda () '()) #f owner-type))
 
   (gnc:register-inv-option
    (gnc:make-internal-option "__reg" "owner-type" owner-type))
@@ -403,13 +403,13 @@
   gnc:*report-options*)
 	     
 (define (customer-options-generator)
-  (options-generator '(receivable) 'gnc-owner-customer (_ "Invoice") #f))
+  (options-generator '(receivable) GNC-OWNER-CUSTOMER (_ "Invoice") #f))
 
 (define (vendor-options-generator)
-  (options-generator '(payable) 'gnc-owner-vendor (_ "Bill") #t))
+  (options-generator '(payable) GNC-OWNER-VENDOR (_ "Bill") #t))
 
 (define (employee-options-generator)
-  (options-generator '(payable) 'gnc-owner-employee (_ "Expense Report") #t))
+  (options-generator '(payable) GNC-OWNER-EMPLOYEE (_ "Expense Report") #t))
 
 (define (string-expand string character replace-string)
   (define (car-line chars)
@@ -430,7 +430,7 @@
   (line-helper (string->list string)))
 
 (define (setup-query q owner account end-date)
-  (let* ((guid (gnc:owner-get-guid (gnc:owner-get-end-owner owner))))
+  (let* ((guid (gncOwnerReturnGUID (gncOwnerGetEndOwner owner))))
 
     (gnc:query-add-guid-match
      q 
@@ -491,11 +491,11 @@
 
 (define (make-myname-table book date-format)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*)))))
 
@@ -545,23 +545,23 @@
 	 (type-str ""))
 
     (case owner-type
-      ((gnc-owner-customer)
+      ((GNC-OWNER-CUSTOMER)
        (set! type-str (N_ "Customer")))
-      ((gnc-owner-vendor)
+      ((GNC-OWNER-VENDOR)
        (set! type-str (N_ "Vendor")))
-      ((gnc-owner-employee)
+      ((GNC-OWNER-EMPLOYEE)
        (set! type-str (N_ "Employee"))))
 
     (gnc:html-document-set-title!
      document (string-append (_ type-str) " " (_ "Report")))
 
-    (if (gnc:owner-is-valid? owner)
+    (if (gncOwnerIsValid owner)
 	(begin
 	  (setup-query query owner account end-date)
 
 	  (gnc:html-document-set-title!
 	   document
-           (string-append (_ type-str ) " " (_ "Report:") " " (gnc:owner-get-name owner)))
+           (string-append (_ type-str ) " " (_ "Report:") " " (gncOwnerGetName owner)))
 
            (gnc:html-document-set-headline!
             document (gnc:html-markup
@@ -570,7 +570,7 @@
                       " " (_ "Report:") " "
                       (gnc:html-markup-anchor
                        (gnc:owner-anchor-text owner)
-                       (gnc:owner-get-name owner))))
+                       (gncOwnerGetName owner))))
 	  
 	  (if account
 	      (begin
@@ -641,20 +641,19 @@
 	#f)))
 
 (define (find-first-account-for-owner owner)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type (gnc:owner-get-end-owner owner)) #f)))
+  (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
     (case type
-      ((gnc-owner-customer)
+      ((GNC-OWNER-CUSTOMER)
        (find-first-account 'receivable))
 
-      ((gnc-owner-vendor)
+      ((GNC-OWNER-VENDOR)
        (find-first-account 'payable))
 
-      ((gnc-owner-employee)
+      ((GNC-OWNER-EMPLOYEE)
        (find-first-account 'payable))
 
-      ((gnc-owner-job)
-       (find-first-account-for-owner (gnc:owner-get-end-owner owner)))
+      ((GNC-OWNER-JOB)
+       (find-first-account-for-owner (gncOwnerGetEndOwner owner)))
 
       (else
        #f))))
@@ -693,16 +692,15 @@
     (gnc:make-report report-name options)))
 
 (define (owner-report-create owner account)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type (gnc:owner-get-end-owner owner)) #f)))
+  (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
     (case type
-      ((gnc-owner-customer)
+      ((GNC-OWNER-CUSTOMER)
        (owner-report-create-internal (N_ "Customer Report") owner account))
 
-      ((gnc-owner-vendor)
+      ((GNC-OWNER-VENDOR)
        (owner-report-create-internal (N_ "Vendor Report") owner account))
 
-      ((gnc-owner-employee)
+      ((GNC-OWNER-EMPLOYEE)
        (owner-report-create-internal (N_ "Employee Report") owner account))
 
       (else #f))))
@@ -718,14 +716,14 @@
 	 account split query journal? double? title
 	 debit-string credit-string)
 
-  (let* ((temp-owner (gnc:owner-create))
+  (let* ((temp-owner (gncOwnerCreate))
 	 (owner (gnc:owner-from-split split temp-owner))
 	 (res #f))
 
     (if owner
 	(set! res (gnc:owner-report-create owner account)))
 
-    (gnc:owner-destroy temp-owner)
+    (gncOwnerDestroy temp-owner)
     res))
 
 (gnc:register-report-hook 'receivable #t



More information about the gnucash-changes mailing list