<?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"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau2">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau3">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau4">
      <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" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P2" fontName="Times-Bold" 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="10.0" leading="13" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P5" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="CENTER"/>
    <paraStyle name="P6" fontName="Times-Roman" fontSize="10.0" leading="13" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P7" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="LEFT"/>
    <paraStyle name="P8" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
    <paraStyle name="P9" fontName="Times-Roman" fontSize="9.0" leading="11" alignment="RIGHT" 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"/>
    <paraStyle name="Preformatted Text" fontName="Courier" fontSize="10.0" leading="13" spaceBefore="0.0" spaceAfter="0.0"/>
  </stylesheet>
  <story>
    <blockTable colWidths="161.0,161.0,161.0" repeatRows="1" style="Tableau1">
      <tr>
        <td>
          <para style="P1">[[ company.name ]]</para>
        </td>
        <td>
          <para style="P2">Year to Day Check</para>
        </td>
        <td>
          <para style="P3">Periods from [[ start_date(data['form']['date1'],data['form']['date2']) ]]</para>
          <para style="P3">to [[ end_date(data['form']['date1'],data['form']['date2']) ]]</para>
          <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="57.0,142.0,142.0,71.0,71.0" style="Tableau2">
      <tr>
        <td>
          <para style="P6">Period</para>
        </td>
        <td>
          <para style="P6">General moves</para>
          <para style="P6">debit credit</para>
        </td>
        <td>
          <para style="P6">Analytic moves</para>
          <para style="P6">debit credit</para>
        </td>
        <td>
          <para style="P6">delta general and analytic debit moves</para>
        </td>
        <td>
          <para style="P6">delta general and analytic credit moves</para>
        </td>
      </tr>
    </blockTable>
    <para style="P7">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="57.0,71.0,71.0,71.0,71.0,71.0,71.0" style="Tableau3">
      <tr>
        <td>
          <para style="P8">[[ repeatIn(lines_p(data['form']['date1'],data['form']['date2']),'period') ]]</para>
          <para style="P8">[[ period['name'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ period['gen_debit'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ period['gen_credit'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ period['ana_debit'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ period['ana_credit'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ period['delta_debit'] ]]</para>
        </td>
        <td>
          <para style="P8">[[ period['delta_credit'] ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P7">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="57.0,71.0,71.0,71.0,71.0,73.0,69.0" style="Tableau4">
      <tr>
        <td>
          <para style="P9">Sums</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % general_debit(data['form']['date1'],data['form']['date2']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % general_credit(data['form']['date1'],data['form']['date2']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % analytic_debit(data['form']['date1'],data['form']['date2']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % analytic_credit(data['form']['date1'],data['form']['date2']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % delta_debit(data['form']['date1'],data['form']['date2']) ]]</para>
        </td>
        <td>
          <para style="P9">[[ '%.2f' % delta_credit(data['form']['date1'],data['form']['date2']) ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="P7">
      <font color="white"> </font>
    </para>
  </story>
</document>

