<?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="57.0" y1="57.0" width="481" height="728"/>
    </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="Tableau1">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <blockBackground colorName="#c0c0c0" start="0,0" stop="0,0"/>
      <blockBackground colorName="#c0c0c0" start="1,0" stop="1,0"/>
      <blockBackground colorName="#c0c0c0" start="2,0" stop="2,0"/>
      <blockBackground colorName="#c0c0c0" start="3,0" stop="3,0"/>
      <blockBackground colorName="#c0c0c0" start="4,0" stop="4,0"/>
    </blockTableStyle>
    <initialize>
      <paraStyle name="all" alignment="justify"/>
    </initialize>
    <paraStyle name="P1" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="RIGHT"/>
    <paraStyle name="P2" fontName="Times-Roman" fontSize="12.0" leading="15"/>
    <paraStyle name="P3" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT"/>
    <paraStyle name="P4" fontName="Times-Roman" fontSize="12.0" leading="15"/>
    <paraStyle name="P5" fontName="Times-Roman" alignment="CENTER"/>
    <paraStyle name="P6" fontName="Times-Roman" fontSize="12.0" leading="15"/>
    <paraStyle name="P7" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="RIGHT"/>
    <paraStyle name="P8" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="CENTER"/>
    <paraStyle name="P9" fontName="Times-Roman" alignment="RIGHT"/>
    <paraStyle name="P10" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="CENTER"/>
    <paraStyle name="Standard" fontName="Times-Roman"/>
    <paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Heading" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
    <paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="Table Contents" fontName="Times-Roman"/>
    <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER"/>
    <paraStyle name="Caption" fontName="Times-Roman" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
    <paraStyle name="Index" fontName="Times-Roman"/>
  </stylesheet>
  <story>
    <para style="P1">[[ repeatIn(objects, 'o') ]]</para>
    <blockTable colWidths="280.0,202.0" repeatRows="1" style="Tableau2">
      <tr>
        <td>
          <para style="Table Contents">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P2">[[ o.partner['name'] ]]</para>
          <para style="P2">[[ o.partner.address[0]['street'] ]]</para>
          <para style="P2">[[ o.partner.address[0]['street2'] ]]</para>
          <para style="P2">[[ o.partner.address[0]['zip'] ]], [[ o.partner.address[0]['city'] ]]</para>
          <para style="P2">[[ o.partner.address[0].state_id['name'] ]]</para>
          <para style="P2">[[ o.partner.address[0].country_id['name'] ]]</para>
          <para style="P2">
            <font color="white"> </font>
          </para>
          <para style="P2">
            <font color="white"> </font>
          </para>
          <para style="P2">Phone : [[ o.partner.address[0]['phone'] ]]</para>
          <para style="P2">FAX : [[ o.partner.address[0]['fax'] ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P2">
      <font color="white"> </font>
    </para>
    <para style="P2">
      <font color="white"> </font>
    </para>
    <para style="P2">Document : [[ o['name'] ]]</para>
    <para style="P2">Date : [[ o['date'] ]]</para>
    <para style="P3">Printing date : [[ time.strftime('%d/%m/%Y') ]]</para>
    <para style="P2">
      <font color="white"> </font>
    </para>
    <para style="P4">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="192.0,71.0,87.0,69.0,64.0" style="Tableau1">
      <tr>
        <td>
          <para style="P5">Item</para>
        </td>
        <td>
          <para style="Table Heading">Quantity</para>
        </td>
        <td>
          <para style="Table Heading">User</para>
        </td>
        <td>
          <para style="Table Heading">Unit price</para>
        </td>
        <td>
          <para style="Table Heading">Total Price</para>
        </td>
      </tr>
      <tr>
        <td>
          <para style="P6"><b>[[ repeatIn(o.order_lines, 'a') ]]</b>
          [[ a.product_id['name'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ a['quantity'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ a.user_id['login'] ]]</para>
        </td>
        <td>
          <para style="P9">[[ a.product_id['price'] ]]</para>
        </td>
        <td>
          <para style="P9">[[ a.product_id['price'] * a['quantity'] ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P4">
      <font color="white"> </font>
    </para>
    <para style="P4">
      <font color="white"> </font>
    </para>
    <para style="P4">[[ o['note'] ]]</para>
    <para style="P4">
      <font color="white"> </font>
    </para>
    <para style="P10">
      <font color="white"> </font>
    </para>
  </story>
</document>

