Problems with gncTaxTableGetEntries in Guile

Chris Dennis cgdennis at btinternet.com
Mon Feb 23 17:52:58 EST 2009


Derek Atkins wrote:
> Hi,
> 
> Chris Dennis <cgdennis at btinternet.com> writes:
> 
>> Hello folks
>>
>> I'm having trouble using gncTaxTableGetEntries in a report.
>>
>> I can get the tax table associated with an invoice entry using 
>> gncEntryGetInvTaxTable, giving a pointer that displays as #<swig-pointer 
>> GncTaxTable * 9735698>, and I can use that with gncTaxTableGetName to 
>> get the correct name for the tax table.
>>
>> But when I call gncTaxTableGetEntries for the same tax table, the result 
>> is something that shows up as #<swig-pointer PriceList * 9441110>.  The 
>> docs say that it should be a GList* rather than a PriceList*.  If I try 
>> to access anything related to that list (using for-each) I get these 
>> error details: wrong-type-arg / car / "Wrong type argument in position 1"
> 
> Yeah, looks like the swig wrapping is broken.  It should return
> a list of GncTaxTableEntry objects.
> 
>> I'm using updated SVN trunk (r17944) on Linux (Ubuntu Intrepid), with 
>> Guile 1.6.
>>
>> Has anyone else tried access tax tables from Guile?
> 
> Probably not.

I've grep'ed fairly thoroughly through the source, and I can't find
anything obviously wrong.  business-core.i includes gncTaxTable.h, which
has the line

   GList *gncTaxTableGetEntries (const GncTaxTable *table);

Is there anywhere else that defines the SWIG wrapper?

I'd like to be able to include details of the tax (specifically VAT)
charged on each line of the invoice, e.g.

     Description   Qty   VATrate   UnitPrice       VAT    Total
     Book            1       0%       £20.00     £0.00   £20.00
     Computer        1      15%      £100.00    £15.00  £115.00

cheers

Chris

-- 
Chris Dennis                                  cgdennis at btinternet.com
Fordingbridge, Hampshire, UK



More information about the gnucash-devel mailing list