r22102 - gnucash/trunk/src/report/business-reports - Bug #670008: Add taxinvoice flexibility necessary to produce legally valid Australian Tax Invoice

Christian Stimming cstim at code.gnucash.org
Mon Mar 19 16:49:15 EDT 2012


Author: cstim
Date: 2012-03-19 16:49:15 -0400 (Mon, 19 Mar 2012)
New Revision: 22102
Trac: http://svn.gnucash.org/trac/changeset/22102

Modified:
   gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm
   gnucash/trunk/src/report/business-reports/taxinvoice.scm
Log:
Bug #670008: Add taxinvoice flexibility necessary to produce legally valid Australian Tax Invoice

Patch by Dmitry Smirnov:

Due to invoice limitations, Gnucash is not yet ready for small business use in
Australia. Lack of customisation options in taxinvoice do not allow to change
its presentation for compliance with legal requirements.

Those patches make taxinvoice practically useful for invoicing.
First patch introducing few changes to allow easy adjustments to report
presentation.

Modified: gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm
===================================================================
--- gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm	2012-03-19 20:49:03 UTC (rev 22101)
+++ gnucash/trunk/src/report/business-reports/taxinvoice.eguile.scm	2012-03-19 20:49:15 UTC (rev 22102)
@@ -121,12 +121,19 @@
   }
   table { /* table does not inherit font */
     <?scm:d opt-text-font ?>
+    <?scm:d opt-css-border-collapse ?>
   }
+  table[border="1"] th {
+    border-color:<?scm:d opt-css-border-color-th ?>;
+  }
+  table[border="1"] td {
+    border-color:<?scm:d opt-css-border-color-td ?>;
+  }
+
   h1.coyname {
     <?scm:d opt-heading-font ?>
-    /* font-size: 141%; */
-    text-align: left;
   }
+  <?scm:d opt-extra-css ?>
 </style>
 <?scm )) ?>
 
@@ -301,7 +308,7 @@
               (dsc-total 'add currency rdiscval)
     ?>
     <tr valign="top">
-      <td align="center" ><nobr><?scm:d (gnc-print-date (gncEntryGetDate entry)) ?></nobr></td>
+      <td align="center" ><nobr><?scm:d (nbsp (gnc-print-date (gncEntryGetDate entry))) ?></nobr></td>
       <td align="left"><?scm:d (gncEntryGetDescription entry) ?></td>
       <!-- td align="left">< ?scm:d (gncEntryGetNotes entry) ?></td -->
       <?scm (if units? (begin ?>

Modified: gnucash/trunk/src/report/business-reports/taxinvoice.scm
===================================================================
--- gnucash/trunk/src/report/business-reports/taxinvoice.scm	2012-03-19 20:49:03 UTC (rev 22101)
+++ gnucash/trunk/src/report/business-reports/taxinvoice.scm	2012-03-19 20:49:15 UTC (rev 22102)
@@ -86,6 +86,10 @@
 ;(define filespage    (N_ "Files"))
 (define displaypage  (N_ "Display"))
 ; option names 
+(define optname-border-collapse		(N_ "table-border-collapse"))
+(define optname-border-color-th		(N_ "table-header-border-color"))
+(define optname-border-color-td		(N_ "table-cell-border-color"))
+(define optname-extra-css		(N_ "Embedded CSS"))
 (define optname-report-title   (N_ "Report title"))
 (define optname-template-file  (N_ "Template file"))
 (define optname-css-file       (N_ "CSS stylesheet file"))
@@ -152,6 +156,9 @@
                 ""))
   (add-option (gnc:make-string-option
                 displaypage optname-logo-width "f" (N_ "Width of the logo in CSS format, e.g. 10% or 32px.  Leave blank to display the logo at its natural width.  The height of the logo will be scaled accordingly.") ""))
+(add-option (gnc:make-simple-boolean-option	displaypage	optname-border-collapse	"g" (N_ "Border-collapse?") #f))
+(add-option (gnc:make-string-option		displaypage	optname-border-color-th "h" "CSS color" (N_ "black")))
+(add-option (gnc:make-string-option		displaypage	optname-border-color-td "i" "CSS color" (N_ "black")))
 
   ;; Heading options
   (add-option (gnc:make-string-option
@@ -189,6 +196,8 @@
                 ""))
                 ;(N_ "(Development version -- don't rely on the numbers on this report without double-checking them.<br>Change the 'Extra Notes' option to get rid of this message)")))
 
+  (add-option (gnc:make-text-option	notespage optname-extra-css "b"
+                (N_ "Embedded CSS")	"h1.coyname { text-align: left; }"))
   (gnc:options-set-default-section
     report-options gnc:pagename-general)
 
@@ -219,6 +228,9 @@
                                       (opt-value displaypage optname-text-font)))
          (opt-logofile              (opt-value displaypage  optname-logofile)) 
          (opt-logo-width            (opt-value displaypage  optname-logo-width)) 
+         (opt-css-border-collapse   (if (opt-value displaypage optname-border-collapse) "border-collapse:collapse;"))
+         (opt-css-border-color-th   (opt-value displaypage optname-border-color-th))
+         (opt-css-border-color-td   (opt-value displaypage optname-border-color-td))
          (opt-report-title          (opt-value headingpage  optname-report-title))
          (opt-units-heading         (opt-value headingpage  optname-units))
          (opt-qty-heading           (opt-value headingpage  optname-qty))
@@ -232,6 +244,7 @@
          (opt-subtotal-heading      (opt-value headingpage2 optname-subtotal))
          (opt-amount-due-heading    (opt-value headingpage2 optname-amount-due))
          (opt-payment-recd-heading  (opt-value headingpage2 optname-payment-recd))
+         (opt-extra-css             (opt-value notespage    optname-extra-css)) 
          (opt-extra-notes           (opt-value notespage    optname-extra-notes)) 
          (css? #t) ;(and (defined? 'gnc-html-engine-supports-css) (gnc-html-engine-supports-css)))
          (html #f))



More information about the gnucash-changes mailing list