<?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="42.0" y1="42.0" width="511" height="758"/>
    </pageTemplate>
  </template>
  <stylesheet>
    <blockTableStyle id="Standard_Outline">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau6">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau10">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau2">
      <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="Tableau3">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau5">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau1">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau4">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <initialize>
      <paraStyle name="all" alignment="justify"/>
    </initialize>
    <paraStyle name="P1" fontName="Times-Roman" fontSize="9.0" leading="11"/>
    <paraStyle name="P2" fontName="Times-Bold" fontSize="10.0" leading="13"/>
    <paraStyle name="P3" fontName="Times-Roman" fontSize="10.0" leading="13"/>
    <paraStyle name="P4" fontName="Times-Roman" fontSize="10.0" leading="13"/>
    <paraStyle name="P5" fontName="Times-Roman" fontSize="10.0" leading="13"/>
    <paraStyle name="P6" fontName="Times-Roman" fontSize="9.0" leading="11"/>
    <paraStyle name="P7" fontName="Times-Roman" fontSize="11.0" leading="14"/>
    <paraStyle name="P8" fontName="Times-Roman" fontSize="4.0" leading="5"/>
    <paraStyle name="P9" fontName="Times-Roman"/>
    <paraStyle name="P10" fontName="Times-Roman" fontSize="16.0" leading="20"/>
    <paraStyle name="P11" fontName="Times-Roman" fontSize="11.0" leading="14"/>
    <paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14"/>
    <paraStyle name="P13" fontName="Times-Bold" fontSize="8.0" leading="10"/>
    <paraStyle name="P14" fontName="Times-Bold" fontSize="8.0" leading="10" alignment="CENTER"/>
    <paraStyle name="P15" fontName="Times-BoldItalic" fontSize="6.0" leading="8" alignment="LEFT"/>
    <paraStyle name="P16" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT"/>
    <paraStyle name="P17" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER"/>
    <paraStyle name="P18" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT"/>
    <paraStyle name="P19" fontName="Times-BoldItalic" fontSize="9.0" leading="11" alignment="LEFT"/>
    <paraStyle name="P20" fontName="Times-Italic" fontSize="9.0" leading="11" alignment="LEFT"/>
    <paraStyle name="P21" fontName="Times-Roman" fontSize="7.0" leading="9"/>
    <paraStyle name="P22" fontName="Times-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
    <paraStyle name="P23" fontName="Times-Roman" fontSize="7.0" leading="9"/>
    <paraStyle name="P24" fontName="Times-Bold" fontSize="9.0" leading="11" alignment="RIGHT"/>
    <paraStyle name="P25" fontName="Times-Bold" fontSize="9.0" leading="11"/>
    <paraStyle name="P26" fontName="Times-Roman" alignment="LEFT"/>
    <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>
    <para style="P1">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="241.0,57.0,213.0" style="Tableau6">
      <tr>
        <td>
          <blockTable colWidths="241.0" style="Tableau10">
            <tr>
              <td>
                <para style="P2">
                  <font color="white"> </font>
                </para>
              </td>
            </tr>
            <tr>
              <td>
                <para style="P3">[[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]</para>
                <para style="P2">Shipping address :</para>
                <para style="P4">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
                <para style="P4">[[ addr.title or '' ]] [[ addr.name ]]</para>
                <para style="P4">[[ addr.street ]]</para>
                <para style="P4">[[ addr.street2 or '' ]]</para>
                <para style="P5"><font face="Times-Roman">[[ addr.zip or '' ]]</font> [[ addr.city or '' ]]</para>
                <para style="P5">[[ addr.state_id and addr.state_id.name or '' ]]</para>
                <para style="P5">[[ addr.country_id and addr.country_id.name or '' ]]</para>
              </td>
            </tr>
          </blockTable>
          <para style="P6">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P6">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P7">[[ o.partner_id.title or '' ]] [[ o.partner_id.name ]]</para>
          <para style="P7">[[ o.partner_address_id.title or '' ]] [[ o.partner_address_id.name ]]</para>
          <para style="P7">[[ o.partner_address_id.street ]]</para>
          <para style="P7">[[ o.partner_address_id.street2 or '' ]]</para>
          <para style="P7">[[ o.partner_address_id.zip or '' ]] [[ o.partner_address_id.city or '' ]]</para>
          <para style="P7">[[ o.partner_address_id.state_id and o.partner_address_id.state_id.name or '' ]]</para>
          <para style="P7">[[ o.partner_address_id.country_id and o.partner_address_id.country_id.name or '' ]]</para>
          <para style="P8">
            <font color="white"> </font>
          </para>
          <para style="P4">Tél. : [[ o.partner_address_id.phone or '' ]]</para>
          <para style="P4">Fax : [[ o.partner_address_id.fax or '' ]]</para>
          <para style="P4">TVA : [[ o.partner_id.vat or '' ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P9">
      <font color="white"> </font>
    </para>
    <para style="P10">
      <font face="Times-Roman">Request for Quotation [[ (o.state=='draft' or removeParentNode('font')) and '' ]]</font>
      <font face="Times-Roman"/>
      <font face="Times-Roman">Order [[ (o.state&lt;&gt;'draft' or removeParentNode('font')) and '' ]]</font>
      <font face="Times-Roman">N° : [[ o.name ]]</font>
    </para>
    <para style="P11">
      <font color="white"> </font>
    </para>
    <para style="P11">Project: [[ o.project_id and o.project_id.complete_name ]]</para>
    <para style="P12">Our order reference : [[ o.ref or '' ]]</para>
    <para style="P12">Your order reference : [[ o.partner_ref or '' ]]</para>
    <para style="P12">Date ordered : [[ time.strftime('%d/%m/%Y', time.strptime(o.date_order, '%Y-%m-%d')) ]]</para>
    <para style="P12">Validated by : [[ o.validator and o.validator.name or '' ]]</para>
    <para style="P9">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="195.0,65.0,52.0,65.0,65.0,69.0" repeatRows="1" style="Tableau2">
      <tr>
        <td>
          <para style="P13">Product Description</para>
        </td>
        <td>
          <para style="P14">Applicable Taxes</para>
        </td>
        <td>
          <para style="P14">Date Requested</para>
        </td>
        <td>
          <para style="P14">Qty</para>
        </td>
        <td>
          <para style="P14">Unit Price</para>
        </td>
        <td>
          <para style="P14">Net Price</para>
        </td>
      </tr>
    </blockTable>
    <section>
      <para style="P15">[[ repeatIn(o.order_line,'line') ]]</para>
      <blockTable colWidths="194.0,65.0,52.0,65.0,64.0,69.0" style="Tableau3">
        <tr>
          <td>
            <para style="P16">[[ line.product_id and line.product_id.default_code or '' ]]</para>
            <para style="P16">[[ line.name ]]</para>
          </td>
          <td>
            <para style="P17">[[ ', '.join(map(lambda x: x.name, line.taxes_id))]]</para>
          </td>
          <td>
            <para style="P17">[[ time.strftime('%d/%m/%Y', time.strptime( line.date_planned, '%Y-%m-%d')) ]]</para>
          </td>
          <td>
            <para style="P18">[[ line.product_qty ]] [[ line.product_uom.name ]]</para>
          </td>
          <td>
            <para style="P18">[[ '%.2f' % line.price_unit ]]</para>
          </td>
          <td>
            <para style="P18">[[ '%.2f' % line.price_subtotal ]]</para>
          </td>
        </tr>
      </blockTable>
      <blockTable colWidths="43.0,333.0,135.0" style="Tableau5">
        <tr>
          <td>
            <para style="P19">[[ repeatIn((line.notes and [line.notes]) or [], 'l') ]]</para>
          </td>
          <td>
            <para style="P20">[[ l or removeParentNode('table') ]]</para>
          </td>
          <td>
            <para style="P19">
              <font color="white"> </font>
            </para>
          </td>
        </tr>
      </blockTable>
    </section>
    <para style="Standard">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="376.0,65.0,69.0" style="Tableau1">
      <tr>
        <td>
          <para style="P21">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P22">Net Total :</para>
        </td>
        <td>
          <para style="P22">[[ '%.2f' % o.amount_untaxed ]] [[ o.pricelist_id.currency_id.name ]]</para>
        </td>
      </tr>
      <tr>
        <td>
          <para style="P21">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P22">Taxes :</para>
        </td>
        <td>
          <para style="P22">[[ '%.2f' % o.amount_tax ]] [[ o.pricelist_id.currency_id.name ]]</para>
        </td>
      </tr>
      <tr>
        <td>
          <para style="P23">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P24">TOTAL :</para>
        </td>
        <td>
          <para style="P24">[[ '%.2f' % o.amount_total ]] [[ o.pricelist_id.currency_id.name ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P25">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="510.0" style="Tableau4">
      <tr>
        <td>
          <para style="P26">[[ o.notes or '' ]] [[ setTag('para','xpre') ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P26">
      <font color="white"> </font>
    </para>
  </story>
</document>

