<?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="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="Tableau3">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
      <lineStyle kind="GRID" colorName="black"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau1">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </blockTableStyle>
    <blockTableStyle id="Tableau2">
      <blockAlignment value="LEFT"/>
      <blockValign value="TOP"/>
    </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" fontSize="11.0" leading="14" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P6" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P7" fontName="Times-Roman" alignment="CENTER"/>
    <paraStyle name="P8" fontName="Times-Roman" alignment="LEFT"/>
    <paraStyle name="P9" fontName="Times-Roman" fontSize="6.0" leading="8"/>
    <paraStyle name="P10" fontName="Times-Roman" fontSize="6.0" leading="8" alignment="LEFT"/>
    <paraStyle name="P11" fontName="Times-Roman" fontSize="7.0" leading="9" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
    <paraStyle name="P13" fontName="Times-Roman" fontSize="11.0" leading="14" 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="139.0,220.0,152.0" repeatRows="1" style="Table1">
      <tr>
        <td>
          <para style="Table Contents">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P1">Tax Report</para>
        </td>
        <td>
          <para style="P2">Period: [[ get_period(data['form']['period_id']) ]]</para>
        </td>
      </tr>
      <tr>
        <td>
          <para style="Table Contents">[[ get_company(data['form']) ]]</para>
        </td>
        <td>
          <para style="P3">
            <font color="white"> </font>
          </para>
        </td>
        <td>
          <para style="P4">Currency: [[ get_currency(data['form']) ]]</para>
        </td>
      </tr>
    </blockTable>
    <para style="Standard">
      <font color="white"> </font>
    </para>
    <para style="P7"><font face="Times-Roman">Printing date: </font>[[ time.strftime('%Y-%m-%d') ]] <font face="Times-Roman">at</font> [[ time.strftime('%H:%M:%S') ]]</para>
    <para style="P8">
      <font color="white"> </font>
    </para>
    <blockTable colWidths="148.0,168.0,64.0,59.0,71.0" repeatRows="1" style="Tableau3">
      <tr>
        <td>
          <para style="Table Heading">Tax Code / Account</para>
        </td>
        <td>
          <para style="Table Heading">General Account</para>
        </td>
        <td>
          <para style="Table Heading">Debit</para>
        </td>
        <td>
          <para style="Table Heading">Credit</para>
        </td>
        <td>
          <para style="Table Heading">Tax Amount</para>
        </td>
      </tr>
    </blockTable>
    <para style="P9">
      <font color="white"> </font>
    </para>
    <section>
      <para style="P9">[[ repeatIn(get_codes(data['form']['period_id'], data['form']['based_on']), 'o') ]]</para>
      <blockTable colWidths="316.0,64.0,59.0,71.0" repeatRows="1" style="Tableau1">
        <tr>
          <td>
            <para style="P5">[[ o[0] ]] [[ o[1].code ]] - [[ o[1].name ]]</para>
          </td>
          <td>
            <para style="P5">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P5">
              <font color="white"> </font>
            </para>
          </td>
          <td>
            <para style="P6">[[ o[1].sum_period and ('%.2f' % o[1].sum_period) or '' ]]</para>
          </td>
        </tr>
      </blockTable>
      <blockTable colWidths="44.0,273.0,62.0,60.0,72.0" repeatRows="1" style="Tableau2">
        <tr>
          <td>
            <para style="P11">[[repeatIn(get_general(o[1], data['form']['period_id'], data['form']['company_id'], data['form']['based_on']), 'g') ]]</para>
          </td>
          <td>
            <para style="P12">[[ g['account'].code ]] - [[ g['account'].name ]]</para>
          </td>
          <td>
            <para style="P13">[[ g['debit'] and '%.2f' % g['debit'] or '' ]]</para>
          </td>
          <td>
            <para style="P13">[[ g['credit'] and '%.2f' % g['credit'] or '' ]]</para>
          </td>
          <td>
            <para style="P13">[[ g['tax_amount'] and '%.2f' % g['tax_amount'] or '' ]]</para>
          </td>
        </tr>
      </blockTable>
      <para style="P10">
        <font color="white"> </font>
      </para>
    </section>
  </story>
</document>

