How to get tax table value for invoice report?

Mike Evans mikee at saxicola.idps.co.uk
Mon May 24 12:49:18 EDT 2010


On Monday May 24 2010 17:23:17 Valdis Vītoliņš wrote:
> I need to get name of Tax table name (because I have tax value in name)
> http://code.gnucash.org/docs/HEAD/structGncTaxTable.html
> Or better should be concatenated tax table name, entry amount and type
> (e.g. VAT 21%, or VAT 10%)
> http://code.gnucash.org/docs/HEAD/structGncTaxTableEntry.html
> 
> Usually we don't need to sum different tax table entries in one general
> tax, so dealing with
> several entries is hypothetical case and is important only for
> localizations.
> 
> (Or, if I could choose which entry to use from several, I could define
> one tax table "VAT" with entries 0%, 10%, 21%)
> 
> Valdis
> 

If you change the line at about line 212 in invoice.scm 
(_ "T") "")))
to 
(_ (gncTaxTableGetName (gncEntryGetInvTaxTable entry))) "")))


This should print the tax table name in the cell instead of "T"
At least it works with a the simple VAT rate I use in the UK, I haven't tested 
it with several tax rates.  I assume though that a single item would attract a 
single tax rate?

Mike Evans

> > Hi,
> > 
> > On Mon, May 24, 2010 11:29 am, Valdis Vītoliņš wrote:
> > > Hello!
> > > I'm studying Bill/Invoice reports, and I investigate how for Fancy
> > > invoice
> > > (fancy-invoice.scm) include field with Tax Table value (not simple T,
> > > if it is taxed).
> > 
> > What exactly do you mean by "Tax Table Value"?
> > 
> > > Currently I use
> > > ...
> > > 
> > >     (if (tax-col column-vector)
> > > 	
> > > 	(addto! row-contents
> > > 	
> > > 		(gnc:make-html-table-cell/markup
> > > 		
> > > 		 "number-cell"
> > > 		 (and (gncEntryGetBillTaxable entry) (gncEntryGetInvTaxTable
> > > 
> > > entry)))))
> > > ..
> > > But it shows:
> > > #[unknown]
> > > in report without any warnings/errors in the log.
> > 
> > Right, because you're getting the Tax Table object, which could contain
> > multiple Tax Table Entries.  Do you just want to print the Tax Table
> > Name?
> > 
> >  If you want to print the percentage, well, there could be multiple
> > 
> > numbers.
> > 
> > > Any ideas/directions (including API description, where I could look to
> > > know how to invoke it) are welcomed.
> > 
> > Use a text cell instead of number cell and use gncTaxTableGetName?
> > 
> > for API reference:   http://code.gnucash.org/docs/HEAD/
> > 
> > > Thanks in advance,
> > > Valdis
> > 
> > -derek
> 
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel



-- 
GPG Key: 1024D/050895C2
Keyserver: http://pgp.mit.edu/          
Search String: 0x050895C2


More information about the gnucash-devel mailing list