<?xml version="1.0" encoding="UTF-8"?>
<Layout xmlns="urn:speedata.de:2009/publisher/en" xmlns:sd="urn:speedata:2009/publisher/functions/en">

  <Options show-grid="no" mainlanguage="German"/>

  <SetGrid nx="16" height="12pt"/>
  <Pageformat width="10cm" height="11cm"/>

  <DefineColor name="weiß" value="#fff"/>
  <DefineColor name="grau" value="#eee"/>

  <LoadFontfile name="MyriadPro-Regular" filename="MyriadPro-Regular.otf"/>
  <LoadFontfile name="MyriadPro-Bold" filename="MyriadPro-Bold.otf"/>

  <DefineFontfamily name="text" fontsize="10" leading="12">
    <Regular fontface="MyriadPro-Regular"/>
    <Bold fontface="MyriadPro-Bold"/>
  </DefineFontfamily>

  <Record element="data">
    <SetVariable variable="_last_tr_data" select="0"/>
    <PlaceObject>
      <Table stretch="max" padding="4pt">
        <Tablehead page="first">
          <Tr backgroundcolor="grau">
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Nr.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Bild</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Name</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Art-Nr.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Preis</Value></B></Paragraph></Td>
          </Tr>
        </Tablehead>
        <Tablehead page="all">
          <Tr backgroundcolor="grau">
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Nr.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Bild</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Name</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Art-Nr.</Value></B></Paragraph></Td>
            <Td border-bottom="0.25pt" align="center"><Paragraph><B><Value>Preis</Value></B></Paragraph></Td>
          </Tr>
          <Tr>
            <Td colspan="3"/>
            <Td border-bottom="0.25pt" colspan="2" align="right"><Paragraph fontface="text"><Value>Übertrag: </Value><Value select="$_last_tr_data"/></Paragraph></Td>
          </Tr>
        </Tablehead>
        <Tablefoot page="all">
          <Tr>
            <Td colspan="3"/>
            <Td border-top="0.25pt" colspan="2" align="right"><Paragraph fontface="text"><Value>Summe:</Value><HSpace/><Value select="$_last_tr_data"/></Paragraph></Td>
          </Tr>
        </Tablefoot>
        <Tablefoot page="last">
          <Tr>
            <Td colspan="3"/>
            <Td border-top="0.25pt" colspan="2" align="right"><Paragraph fontface="text"><Value>Gesamt:</Value><HSpace/><Value select="$_last_tr_data"/></Paragraph></Td>
          </Tr>
        </Tablefoot>
        <ForAll select="artikel">
          <Tr data="@summe" backgroundcolor="{sd:alternating('tab','weiß','grau')}">
            <Td align="center"><Paragraph><Value select="position()"/></Paragraph></Td>
            <Td align="center"><Image maxwidth="2" maxheight="3" file="{@bild}"/></Td>
            <Td align="left"><Paragraph><Value select="@name"/></Paragraph></Td>
            <Td align="left"><Paragraph><Value select="@artnr"/></Paragraph></Td>
            <Td align="right"><Paragraph><Value select="@preis"/></Paragraph></Td>
          </Tr>
        </ForAll>
      </Table>
    </PlaceObject>
  </Record>
</Layout>
