How to remove Subtotle and Tax rows from invoice template

Jerry Bond gbond at rochester.rr.com
Thu Oct 1 10:34:31 EDT 2009


Thanks for answering this post! 

I am working with the Printable Invoice, using a Custom Style Sheet and 
a modified invoice.scm template (with what I think to be the relevant 
sections below).

Turning that "Totals" item off makes no visible change at all that I can 
see.  What I would like to do is eliminate the rows "Totals" and 
"Taxes," leaving only "Amount Due." 

-----
Modified invoice.scm, lines 234-319, 419-454

 (define (gnc:register-inv-option new-option)
    (gnc:register-option gnc:*report-options* new-option))

  (gnc:register-inv-option
   (gnc:make-invoice-option invoice-page invoice-name "x" ""
                (lambda () '()) #f))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Date")
    "b" (N_ "Display the date?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Description")
    "d" (N_ "Display the description?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Action")
    "g" (N_ "Display the action?") #f))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Quantity")
    "ha" (N_ "Display the quantity of items?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Price")
    "hb" (N_ "Display the price per item?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Discount")
    "k" (N_ "Display the entry's discount") #f))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Taxable")
    "l" (N_ "Display the entry's taxable status") #f))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Tax Amount")
    "m" (N_ "Display each entry's total total tax") #f))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display Columns") (N_ "Total")
    "n" (N_ "Display the entry's value") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display") (N_ "Individual Taxes")
    "o" (N_ "Display all the individual taxes?") #f))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display") (N_ "Totals")
    "p" (N_ "Display the totals?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display") (N_ "References")
    "s" (N_ "Display the invoice references?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display") (N_ "Billing Terms")
    "t" (N_ "Display the invoice billing terms?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display") (N_ "Billing ID")
    "ta" (N_ "Display the billing id?") #t))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display") (N_ "Invoice Notes")
    "tb" (N_ "Display the invoice notes?") #f))

  (gnc:register-inv-option
   (gnc:make-simple-boolean-option
    (N_ "Display") (N_ "Payments")
    "tc" (N_ "Display the payments applied to this invoice?") #f))

<snip>

      (if (null? entries)
      (begin
        (add-subtotal-row table used-columns value-collector
                  "grand-total" (_ "Total"))

        (if display-all-taxes
        (hash-for-each
         (lambda (acct value)
           (let ((collector (gnc:make-commodity-collector))
             (commodity (xaccAccountGetCommodity acct))
             (name (xaccAccountGetName acct)))
             (collector 'add commodity value)
             (add-subtotal-row table used-columns collector
                       "grand-total" name)))
         acct-hash)

        ; nope, just show the total tax.
        (add-subtotal-row table used-columns tax-collector
                  "grand-total" (_ "Tax")))

        (if (and show-payments (not (null? lot)))
        (let ((splits (sort-list!
                   (gnc-lot-get-split-list lot)
                   (lambda (s1 s2)
                 (let ((t1 (xaccSplitGetParent s1))
                       (t2 (xaccSplitGetParent s2)))
                   (< (xaccTransOrder t1 t2) 0))))))
          (for-each
           (lambda (split)
             (if (not (equal? (xaccSplitGetParent split) txn))
             (add-payment-row table used-columns
                      split total-collector)))
           splits)))

        (add-subtotal-row table used-columns total-collector
                  "grand-total" (_ "Amount Due")))

Derek Atkins wrote:
> Hi,
>
> Jerry3904 <gbond at rochester.rr.com> writes:
>
>   
>> I have read the FAQs on how to modify the invoice.scm template, and that
>> helps.  I would like to remove the Subtotal and Tax rows, since my company
>> does not apply tax to its services, but did not see how to do that.  
>>
>> Any help would be appreciated--BTW, I'm using 2.2.9 on MEPIS 8 (Debian
>> Lenny/Stable)
>>     
>
> Which Invoice Report are you using?  Printable Invoice or Fancy Invoice?
> Try turning off the "Totals" in the Display page of the Report Options.
>
> -derek
>
>   


More information about the gnucash-user mailing list