Last-Update: 2012-02-13
Author: Dmitry Smirnov <onlyjob@member.fsf.org>
Bug-Debian: http://bugs.debian.org/655951
Description: improvement to taxinvoice presentation
 * new dialog elements in [Report Options]:[Display]
   with default values matching original report presentation
   + table-border-collapse (boolean)
   + table-header-border-color (string)
   + table-cell-border-color (string)
 * new dialog element in [Report Options]:[Notes]
   + Embedded CSS (text); some hardcoded CSS is moved
     as default value of this field.
 * no text wrapping in date column


--- a/src/report/business-reports/taxinvoice.eguile.scm
+++ b/src/report/business-reports/taxinvoice.eguile.scm
@@ -120,12 +120,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 )) ?>
 
@@ -300,7 +307,7 @@
               (dsc-total 'add currency rdiscval)
     ?>
     <tr valign="top">
-      <td align="center"><?scm:d (gnc-print-date (gncEntryGetDate entry)) ?></td>
+      <td align="center"><?scm:d (nbsp (gnc-print-date (gncEntryGetDate entry))) ?></td>
       <td align="left"><?scm:d (gncEntryGetDescription entry) ?></td>
       <!-- td align="left">< ?scm:d (gncEntryGetNotes entry) ?></td -->
       <?scm (if units? (begin ?>
--- a/src/report/business-reports/taxinvoice.scm
+++ b/src/report/business-reports/taxinvoice.scm
@@ -88,6 +88,10 @@
 (define displaypage  (N_ "Display"))
 (define generalpage  gnc:pagename-general)
 ; 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-invoice-number (N_ "Invoice number"))
 (define optname-template-file  (N_ "Template file"))
@@ -155,6 +159,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
@@ -192,6 +199,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 generalpage)
 
@@ -222,6 +231,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))
@@ -235,6 +247,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))
