<?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="Tableau1">
      <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="Tableau2">
      <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="Tableau3">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau4">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau6">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau7">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau5">
      <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" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P2" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P3" fontName="Times-Bold" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P4" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P5" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P6" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER"/>
    <paraStyle name="P7" fontName="Times-Roman" alignment="CENTER"/>
    <paraStyle name="P8" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P9" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P10" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P11" fontName="Times-Roman" fontSize="6.0" leading="8"/>
    <paraStyle name="P12" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P13" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P14" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P15" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P16" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P17" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P18" fontName="Times-Roman" fontSize="6.0" leading="8" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P19" fontName="Times-Bold" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P20" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P21" fontName="Times-Bold" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P22" fontName="Times-Roman" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.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="0.0"/>
    <paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.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>
    <para style="P1">[[ repeatIn(objects,'o') ]]</para>
    <blockTable colWidths="152.0,176.0,154.0" repeatRows="1" style="Tableau1">
      <tr>
        <td>
          <para style="Table Contents">[[ company.name ]]</para>
        </td>
        <td>
          <para style="P2">Analytic journal</para>
        </td>
        <td>
          <para style="P3">Period from [[ data['form']['date1'] ]]</para>
          <para style="P3">to [[ data['form']['date2'] ]]</para>
        </td>
      </tr>
    </blockTable>
    <blockTable colWidths="152.0,176.0,154.0" repeatRows="1" style="Tableau2">
      <tr>
        <td>
          <para style="P4">[[ o.code ]]</para>
        </td>
        <td>
          <para style="P4">[[ o.name ]]</para>
        </td>
        <td>
          <para style="P5">Currency: [[ company.currency_id.name ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="Standard">
      <font color="white"> </font>
    </para>
    <para style="P6">Printing date: [[ time.strftime('%Y-%m-%d') ]] at [[ time.strftime('%H:%M:%S') ]]</para>
    <para style="P7">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="57.0,51.0,190.0,85.0,99.0" style="Tableau3">
      <tr>
        <td>
          <para style="P8">Date</para>
        </td>
        <td>
          <para style="P8">Code</para>
        </td>
        <td>
          <para style="P8">Move name</para>
        </td>
        <td>
          <para style="P8">Account n°</para>
        </td>
        <td>
          <para style="P8">Accounting moves</para>
          <para style="P9">General</para>
          <para style="P10">Analytic</para>
        </td>
      </tr>
    </blockTable>
    <para style="P11">
      <font color="white"> </font>
    </para>
    <section>
      <para style="P12">[[ repeatIn(lines(o.id,data['form']['date1'],data['form']['date2']), 'move') ]]</para>
      <blockTable colWidths="57.0,51.0,190.0,85.0,99.0" repeatRows="1" style="Tableau4">
        <tr>
          <td>
            <para style="P13">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P13">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P14">[[ move.name ]]</para>
          </td>
          <td>
            <para style="P14">[[ move.account_id.code ]] - [[ move.account_id.name ]]</para>
          </td>
          <td>
            <para style="P14">[[ '%.2f' % (move.debit-move.credit) ]]</para>
          </td>
        </tr>
      </blockTable>
      <blockTable colWidths="57.0,51.0,190.0,85.0,99.0" style="Tableau6">
        <tr>
          <td>
            <para style="P15">[[ repeatIn(lines_a(move.id,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
            <para style="P16">[[ move_a.date ]]</para>
          </td>
          <td>
            <para style="P16">[[ move_a.code ]]</para>
          </td>
          <td>
            <para style="P17">[[ move_a.name ]]</para>
          </td>
          <td>
            <para style="P17">[[ move_a.account_id.code ]] - [[ move_a.account_id.name ]]</para>
          </td>
          <td>
            <para style="P17">[[ '%.2f' % move_a.amount ]]</para>
          </td>
        </tr>
      </blockTable>
      <para style="P18">
        <font color="white"> </font>
      </para>
    </section>
    <blockTable colWidths="57.0,51.0,190.0,85.0,99.0" style="Tableau7">
      <tr>
        <td>
          <para style="P15">[[ repeatIn(lines_a(False,o.id,data['form']['date1'],data['form']['date2']),'move_a') ]]</para>
          <para style="P16">[[ move_a.date ]]</para>
        </td>
        <td>
          <para style="P16">[[ move_a.code ]]</para>
        </td>
        <td>
          <para style="P17">[[ move_a.name ]]</para>
        </td>
        <td>
          <para style="P17">[[move_a.account_id.code ]] - [[ move_a.account_id.name ]]</para>
        </td>
        <td>
          <para style="P17">[[ '%.2f' % move_a.amount ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P19">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="383.0,99.0" repeatRows="1" style="Tableau5">
      <tr>
        <td>
          <para style="P20">Sums of the journal</para>
        </td>
        <td>
          <para style="P21">[[ '%.2f' % sum_general(o.id,data['form']['date1'],data['form']['date2']) ]]</para>
          <para style="P20">[[ '%.2f' % sum_analytic(o.id,data['form']['date1'],data['form']['date2']) ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P22">
      <font color="white"> </font>
    </para>
  </story>
</document>

