<?xml version="1.0"?>
<document filename="test.pdf">
  <template pageSize="(842.0,595.0)" title="Test" author="Martin Simon" allowSplitting="20">
    <pageTemplate id="first">
      <frame id="first" x1="57.0" y1="57.0" width="728" height="481"/>
    </pageTemplate>
  </template>
  <stylesheet>
    <blockTableStyle id="Standard_Outline">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Table1">
      <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"/>
      <blockBackground colorName="#e6e6e6" start="0,1" stop="0,1"/>
      <blockBackground colorName="#e6e6e6" start="1,1" stop="1,1"/>
      <blockBackground colorName="#e6e6e6" start="2,1" stop="2,1"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau1">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau2">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau3">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
    </blockTableStyle>
    <initialize>
      <paraStyle name="all" alignment="justify"/>
    </initialize>
    <paraStyle name="P1" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P2" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P3" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P4" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P5" fontName="Times-Roman" alignment="CENTER"/>
    <paraStyle name="P6" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P7" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P8" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P9" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P10" fontName="Times-Roman" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <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" 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="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
    <paraStyle name="Index" fontName="Times-Roman"/>
  </stylesheet>
  <story>
    <blockTable colWidths="198.0,313.0,217.0" repeatRows="1" style="Table1">
      <tr>
        <td>
          <para style="Table Contents">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P1">Aged Trial balance</para>
        </td>
        <td>
          <para style="P2">From the beginning</para>
          <para style="P2">to [[ data['form']['4']['stop'] ]]</para>
        </td>
      </tr>
      <tr>
        <td>
          <para style="Table Contents">[[ company.name ]]</para>
        </td>
        <td>
          <para style="P3">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P4">Currency: [[ company.currency_id.name ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="Standard">
      <font color="white"> </font>
    </para>
    <para style="P5">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
    <para style="P5">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="218.0,71.0,71.0,71.0,71.0,71.0,71.0,85.0" style="Tableau1">
      <tr>
        <td>
          <para style="P6">Partners</para>
        </td>
        <td>
          <para style="P7">[[ data['form']['4']['name'] ]]</para>
        </td>
        <td>
          <para style="P7">[[ data['form']['3']['name'] ]]</para>
        </td>
        <td>
          <para style="P7">[[ data['form']['2']['name'] ]]</para>
        </td>
        <td>
          <para style="P7">[[ data['form']['1']['name'] ]]</para>
        </td>
        <td>
          <para style="P7">[[ data['form']['0']['name'] ]]</para>
        </td>
        <td>
          <para style="P7">Before [[ data['form']['0']['start'] ]]</para>
        </td>
        <td>
          <para style="P6">Total</para>
        </td>
      </tr>
    </blockTable>
    <blockTable colWidths="218.0,71.0,71.0,71.0,71.0,71.0,71.0,85.0" style="Tableau2">
      <tr>
        <td>
          <para style="P3">[[ repeatIn(get_lines(data['form']), 'partner') ]]</para>
          <para style="P3">[[ partner['name'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ '%.2f' % (partner['4'] or 0.0) ]]</para>
        </td>
        <td>
          <para style="P8">[[ '%.2f' % (partner['3'] or 0.0) ]]</para>
        </td>
        <td>
          <para style="P8">[[ '%.2f' % (partner['2'] or 0.0) ]]</para>
        </td>
        <td>
          <para style="P8">[[ '%.2f' % (partner['1'] or 0.0) ]]</para>
        </td>
        <td>
          <para style="P8">[[ '%.2f' % (partner['0'] or 0.0) ]]</para>
        </td>
        <td>
          <para style="P8">[[ '%.2f' % (partner['before'] or 0.0) ]]</para>
        </td>
        <td>
          <para style="P8">[[ '%.2f' % (partner['total'] or 0.0) ]]</para>
        </td>
      </tr>
    </blockTable>
    <blockTable colWidths="218.0,71.0,71.0,71.0,71.0,71.0,71.0,85.0" style="Tableau3">
      <tr>
        <td>
          <para style="P6">Account total</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % get_for_period(data['form']['4']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % get_for_period(data['form']['3']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % get_for_period(data['form']['2']) ]]</para>
        </td>
        <td>
          <para style="P9">[['%.2f' % get_for_period(data['form']['1']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % get_for_period(data['form']['0']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % get_before(data['form']['0']['start']) ]]</para>
        </td>
        <td>
          <para style="P10">[[ '%.2f' % get_total() ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P5">
      <font color="white"> </font>
    </para>
  </story>
</document>

