<?xml version="1.0"?>
<document filename="test.pdf">
  <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
    <pageTemplate id="first">
      <frame id="first" x1="34.0" y1="28.0" width="527" height="786"/>
    </pageTemplate>
  </template>
  <stylesheet>
    <blockTableStyle id="Standard_Outline">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau2">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau6">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
      <blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
      <blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
      <blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
      <blockBackground colorName="#e6e6e6" start="3,0" stop="3,0"/>
      <blockBackground colorName="#e6e6e6" start="4,0" stop="4,0"/>
      <blockBackground colorName="#e6e6e6" start="5,0" stop="5,0"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau7">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau8">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau3">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau4">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
      <blockBackground colorName="#e6e6e6" start="1,0" stop="1,0"/>
      <blockBackground colorName="#e6e6e6" start="2,0" stop="2,0"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau5">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <initialize>
      <paraStyle name="all" alignment="justify"/>
    </initialize>
    <paraStyle name="P1" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P2" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P3" fontName="Times-Roman" fontSize="14.0" leading="17" alignment="LEFT"/>
    <paraStyle name="P4" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="LEFT"/>
    <paraStyle name="P5" fontName="Times-Roman" fontSize="14.0" leading="17" alignment="CENTER"/>
    <paraStyle name="P6" fontName="Times-Roman" fontSize="11.0" leading="14"/>
    <paraStyle name="P7" fontName="Times-Roman" fontSize="11.0" leading="14"/>
    <paraStyle name="P8" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P9" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P10" fontName="Times-Roman" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P11" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P12" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P13" fontName="Times-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P14" fontName="Times-Italic" fontSize="8.0" leading="10" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P15" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P16" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P17" fontName="Times-Bold" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P18" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P19" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P20" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P21" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P22" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT"/>
    <paraStyle name="P23" fontName="Courier-Bold" fontSize="11.0" leading="14" alignment="CENTER"/>
    <paraStyle name="P24" fontName="Courier-Bold" fontSize="12.0" leading="15" alignment="CENTER"/>
    <paraStyle name="P25" fontName="Courier-Bold" fontSize="12.0" leading="15" alignment="LEFT"/>
    <paraStyle name="Standard" fontName="Times-Roman"/>
    <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
    <paraStyle name="Index" fontName="Times-Roman"/>
  </stylesheet>
  <story>
    <para style="P1">[[ repeatIn(objects,'o') ]]</para>
    <para style="P1">[[ setLang(o.partner_id.lang) ]]</para>
    <blockTable colWidths="295.0,232.0" style="Tableau2">
      <tr>
        <td>
          <para style="P2">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="Standard">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
          <para style="Standard">[[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]]</para>
          <para style="Standard">[[ o.address_invoice_id.street ]]</para>
          <para style="Standard">[[ o.address_invoice_id.street2 or '' ]]</para>
          <para style="Standard">[[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]]</para>
          <para style="Standard">[[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]]</para>
          <para style="Standard">[[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]]</para>
          <para style="Standard">
            <font color="white"> </font>
          </para>
          <para style="Standard">Tél. : [[ o.address_invoice_id.phone or '' ]]</para>
          <para style="Standard">Fax : [[ o.address_invoice_id.fax or '' ]]</para>
          <para style="Standard">TVA : [[ o.partner_id.vat or '' ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P3">
      <font color="white"> </font>
    </para>
    <para style="P4">
      <font face="Times-Roman">Invoice [[ (o.type=='out_invoice' or removeParentNode('font')) and '' ]]</font>
      <font face="Times-Roman">Refund [[ (o.type=='out_refund' or removeParentNode('font')) and '' ]]</font>
      <font face="Times-Roman">Supplier Refund [[ (o.type=='in_refund' or removeParentNode('font')) and '' ]]</font>
      <font face="Times-Roman">Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('font')) and '' ]]</font>
      <font face="Times-Roman">[[ o.number ]]</font>
    </para>
    <para style="P5">
      <font color="white"> </font>
    </para>
    <para style="P6">
      <font face="Times-Roman">Document</font>
      <font face="Times-Roman">:</font>
      <font face="Times-Roman">[[o.name]]</font>
    </para>
    <para style="P6">
      <font face="Times-Roman">Invoice Date: </font>
      <font face="Times-Roman">[[o.date_invoice]]</font>
    </para>
    <para style="P7"><font face="Times-Roman">Customer Ref:</font> [[ o.address_invoice_id.partner_id.ref or '/' ]]</para>
    <para style="Standard">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau6">
      <tr>
        <td>
          <para style="P8">Description</para>
        </td>
        <td>
          <para style="P9">Taxes</para>
        </td>
        <td>
          <para style="P9">Quantity</para>
        </td>
        <td>
          <para style="P9">Unit Price</para>
        </td>
        <td>
          <para style="P9">Disc.</para>
        </td>
        <td>
          <para style="P9">Net Price</para>
        </td>
      </tr>
    </blockTable>
    <section>
      <para style="P10">[[repeatIn(o.invoice_line,'l') ]]</para>
      <blockTable colWidths="216.0,62.0,62.0,62.0,51.0,74.0" style="Tableau7">
        <tr>
          <td>
            <para style="Table Contents">[[ l.name ]]</para>
          </td>
          <td>
            <para style="P11">[[ ', '.join([lt.name for lt in l.invoice_line_tax_id]) ]]</para>
          </td>
          <td>
            <para style="P12">[[ l.quantity ]] [[l.uos_id and l.uos_id.name or '' ]]</para>
          </td>
          <td>
            <para style="P12">[[ '%.2f' % l.price_unit ]]</para>
          </td>
          <td>
            <para style="P12">[[ '%.3f' % (l.discount or 0.0) ]] </para>
          </td>
          <td>
            <para style="P12">[[ '%.2f' %l.price_subtotal ]] [[o.currency_id.code ]]</para>
          </td>
        </tr>
      </blockTable>
      <blockTable colWidths="28.0,499.0" style="Tableau8">
        <tr>
          <td>
            <para style="P13">[[ repeatIn((l.note and [l.note]) or [], 'note') ]]</para>
          </td>
          <td>
            <para style="P14">[[ note or removeParentNode('table') ]] [[ setTag('para','xpre') ]]</para>
          </td>
        </tr>
      </blockTable>
    </section>
    <para style="Standard">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="215.0,313.0" style="Tableau3">
      <tr>
        <td>
          <blockTable colWidths="81.0,73.0,60.0" style="Tableau4">
            <tr>
              <td>
                <para style="P15">Tax</para>
              </td>
              <td>
                <para style="P12">Base</para>
              </td>
              <td>
                <para style="P12">Amount</para>
              </td>
            </tr>
            <tr>
              <td>
                <para style="P16"><font face="Times-Roman">[[ repeatIn(o.tax_line,'t') ]]</font> [[ t.name ]]</para>
              </td>
              <td>
                <para style="P17">[[ '%.2f' % t.base ]]</para>
              </td>
              <td>
                <para style="P17">[[ '%.2f' % t.amount]]</para>
              </td>
            </tr>
          </blockTable>
        </td>
        <td>
          <blockTable colWidths="214.0,95.0" style="Tableau5">
            <tr>
              <td>
                <para style="P18">Subtotal :</para>
              </td>
              <td>
                <para style="P19">[[ '%.2f' % o.amount_untaxed ]] [[o.currency_id.code ]]</para>
              </td>
            </tr>
            <tr>
              <td>
                <para style="P18">Taxes :</para>
              </td>
              <td>
                <para style="P19">[[ '%.2f' % o.amount_tax ]] [[o.currency_id.code ]]</para>
              </td>
            </tr>
            <tr>
              <td>
                <para style="P20">Total :</para>
              </td>
              <td>
                <para style="P21">[[ '%.2f' % o.amount_total ]] [[o.currency_id.code ]]</para>
              </td>
            </tr>
          </blockTable>
          <para style="Table Contents">
            <font color="white"> </font>
          </para>
        </td>
      </tr>
    </blockTable>
    <para style="P22">[[ o.comment or '' ]] <font face="Times-Roman">[[ setTag('para','xpre') ]]</font></para>
    <para style="P22">
      <font color="white"> </font>
    </para>
    <para style="P22">[[ (o.payment_term and o.payment_term.note) or '' ]] <font face="Times-Roman">[[ setTag('para','xpre') ]]</font></para>
    <para style="P23">
      <font color="white"> </font>
    </para>
    <para style="P23">
      <font color="white"> </font>
    </para>
    <para style="P24">
      <font color="white"> </font>
    </para>
    <para style="P25">
      <font color="white"> </font>
    </para>
  </story>
</document>

