Placeholder

Customer Forum

Modify PDF Template to show Customers VAT Number

External Posted: 2012-03-14 15:25

Hi!

I'm trying to modify the *.xsl template to show an additional field containing the customer's VAT Number (needed in Italy) under the customer's address. 

This is the xsl: 

<fo:table-cell>
  <fo:block>
    <fo:inline>
      <xsl:value-of select="/hash/party_name"/>
    </fo:inline>
  </fo:block>
  <fo:block linefeed-treatment="preserve">
    <fo:inline>
      <xsl:value-of select="/hash/address"/>
    </fo:inline>
  </fo:block>
  <fo:block>
    <fo:inline>
      P.IVA &#160;
      <xsl:value-of select="/hash/???"/>      <= here is the problem
    </fo:inline>
  </fo:block>
</fo:table-cell>
 

I did quite a lot attempts but i can't find the right value for select to point to the customers VAT Number.

Can somebody help me?

 

Thanks in advance.

Workbooks Support Posted: Wed, 14.03.2012 - 16:30

Hello Riccardo

 

You need  /hash/vat_number

 

A tip: when a PDF is generated by Workbooks the browser downloads this using a URL like

https://secure.workbooks.com/accounting/sales_orders/4709.pdf?template=225

If you replace the .pdf with .xml you can fetch the XML and browse this. For the example the URL would be

https://secure.workbooks.com/accounting/sales_orders/4709.xml?template=225

 

I use Chrome which has an effective XML viewer but all the major browsers now seem to do a decent job of this.

External Posted: Wed, 14.03.2012 - 17:21

It works perfectly! Is there a KB page or else where i can find all those placeholders? 

Thanks for the tip!

 
External Posted: Wed, 14.03.2012 - 17:27

Sorry maybe the answer is in the tip, but i'm really bad with xml...

Workbooks Support Posted: Wed, 14.03.2012 - 18:09

Yes, the answer's in the tip because the set of available fields depends on things like whether you have added any custom fields.  We could document the 'main' fields but it's a long list.