<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt" version="1.0">
	<xsl:import href="../../../appl/shared/default.xsl"/>

	<xsl:variable name="Rev">
		<!-- Revision van deze cust.xsl -->
		<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
	</xsl:variable>

  <xsl:template name="stylesheet">
    <style>body {
       font-family: Verdana;
       background-color: rgb(255, 255, 255);
       margin-left:0px;
       margin-top:0px;
       cursor: auto;
    }

    table {
      border: 0;
    }

    table.details {
      background-color: #004f80;
    }

    th {
      font-family: Verdana;
      font-size: 9pt;
      font-weight: normal;
      color: #ffffff;
      text-decoration: none;
      padding-left:  3px;
      padding-right: 3px;
      padding-top: 3px;
      padding-bottom: 3px;
      background-color: #004f80;
    }

    td {
      font-family: Verdana;
      font-style: normal;
      font-size: 9pt;
      font-weight: normal;
      color:  #000000;
      text-align: left;
      vertical-align: top;
    }

    td.result {
      text-decoration: none;
      padding-bottom: 2px;
      padding-top: 2px;
      padding-left: 2px;
      padding-right: 2px;
      background-color: #D6D8E8;
    }

    td.sec_heading {
      font-size: 9pt;
      text-decoration: none;
      padding-bottom: 2px;
      padding-top: 2px;
      padding-left: 2px;
      padding-right: 2px;
      text-align: left;
      background-color: #D0D0D0;
    }

    td.caption {
      font-size: 18pt;
      padding-bottom: 30px;
      padding-top: 40px;
    }

    td.subcaption {
      font-size: 10pt;
      font-weight: bold;
      text-decoration: underline;
    }

    td.label {
      font-size: 10pt;
    }

    td.value {
      font-style: italic;
      font-size: 10pt;
    }

    td.tekst {
      font-size: 10pt;
    }

    td.adres {
      font-size: 8pt;
      text-align: right;
    }

    td.tekstkop {
      font-weight: bold;
      font-size: 10pt;
    }

    td.tiny {
      font-size: 6pt;
      text-align: right;
    }

    .fatal {
       background-color: red;
       color: white;
       font-weight: bold;
       padding-left: 2px;
       padding-right: 2px;
    }

    .nowrap {
      white-space: nowrap;
    }

    div#footer {
      position: fixed;
      bottom: 0;
      width: 100%;
    }
    </style>
	</xsl:template>

  <xsl:template match="opdracht" mode="include">
    <table border="0" style="width:100%;border-collapse:collapse;margin:0;padding:0" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2" style="width:67.5%;font-size:10pt;font-family:Verdana;">
          <!--xsl:element name="img">
            <xsl:attribute name="src">../../cust/renk/factuurlogo.png</xsl:attribute>
            <xsl:attribute name="style">height:26mm;</xsl:attribute>
          </xsl:element-->
          <xsl:choose>
            <xsl:when test="$mode='email'">
							<!--img src="cid:tmpl_logo.gif" height="26mm"/-->
							<xsl:element name="img">
								<xsl:attribute name="src">cid:tmpl_logo.gif</xsl:attribute>
								<xsl:attribute name="style">width:61mm;</xsl:attribute>
							</xsl:element>
            </xsl:when>
            <xsl:otherwise>
							<xsl:element name="img">
								<xsl:attribute name="src">../../cust/<xsl:value-of select="//header/custId"/>/tmpl_logo.gif</xsl:attribute>
								<xsl:attribute name="style">width:61mm;</xsl:attribute>
							</xsl:element>
            </xsl:otherwise>
          </xsl:choose>
        </td>
        <td style="width:32.5%;font-size:8pt;font-family:Verdana;">
          Generaal Urquhartlaan 4<br/>
          6861 GG Oosterbeek<br/>
          <br/>
          Postbus 9100<br/>
          6860 HA Oosterbeek<br/>
          Telefoon (026) 33 48 111<br/>
          Fax (026) 33 48 310
        </td>
      </tr>
      <tr>
        <td style="width:8.25%;">&#xA0;</td>
        <td style="width:59.25%;font-size:22pt;font-family:Verdana;text-align:center;">
          <br/>
          <b><u>Opdrachtbon</u></b>
        </td>
        <td style="width:32.5%;font-size:8pt;font-family:Verdana;">
          <br/>
          Internet www.renkum.nl<br/>
          <br/>
          IBAN: NL02BNGH0285007076<br/>
          BIC: BNGHNL2G<br/>
          KvK nummer: 09215649<br/>
          BTW nummer: NL 00.12.02.698.BO1
        </td>
      </tr>
      <tr>
        <td>&#xA0;</td>
        <td colspan="2" style="font-size:10pt;font-family:Verdana;">
          <br/>
          Nr: <xsl:value-of select="melding/stdmelding/discipline/srtdiscipline/prefix"/><xsl:value-of select="melding/key"/>/<xsl:value-of select="bedrijfopdr_volgnr"/>
		  <br/>
		  <br/>
		  Datum: <xsl:value-of select="substring(//header/dateTime,1,10)"/><br/><br/>
            <table border='0' style="border-collapse:collapse;margin:0;padding:0" cellpadding="0" cellspacing="0">
				<tr>
					<td style="font-size:10pt;font-family:Verdana;">Aan:&#xA0;
					</td>
					<td style="font-size:10pt;font-family:Verdana;"><xsl:value-of select="uitvoerende/bedrijf/naam"/>
					</td>
				</tr>
				<tr>
					<td>
					</td>
					<td style="font-size:10pt;font-family:Verdana;"><xsl:value-of select="uitvoerende/bedrijf/email"/>
					</td>
				</tr>
			</table>
			<br/>
		</td>
	</tr>
	<tr>
		<td/>
		<td colspan="2" style="font-size:10pt;font-family:Verdana;">
         	Hierbij verlenen wij u, conform bestaande contractvoorwaarden, opdracht voor onderstaande werkzaamheden/leveringen:</td>
    </tr>
	<tr>
		<td/>
		<td colspan="2" style="padding-left:15px;padding-right:100px"><xsl:call-template name="linebreaks"><xsl:with-param name="string" select="omschrijving"/></xsl:call-template></td>
	</tr>
    <tr>
        <td/>
        <td colspan="2" style="font-size:10pt;font-family:Verdana;">
          <br/>
          De werkzaamheden/levering(en) vinden plaats op: <xsl:value-of select="kenmerk[@key=241]"/>
        </td>
    </tr>
      <xsl:choose>
        <xsl:when test="kosten&gt;0">
          <tr>
            <td/>
            <td colspan="2" style="font-size:10pt;font-family:Verdana;">
              <br/>
              Geschat bedrag van deze opdracht: € <xsl:value-of select="kosten"/>&#xA0;<i>(max € 1000,-- excl. btw)</i>
            </td>
          </tr>
        </xsl:when>
        <xsl:otherwise>
          <tr>
            <td/>
            <td colspan="2" style="font-size:10pt;font-family:Verdana;">
              <br/>
              Geschat bedrag voor deze opdracht: € <xsl:value-of select="kosten"/>&#xA0;<i>(max € 1000,-- excl. btw)</i>
              <br/><i>Vereist nader overleg met contactpersoon voor overgang tot uitvoering</i>
            </td>
          </tr>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:choose>
        <xsl:when test="kenmerk[@key=246]='Gemeentehuis'">
          <tr>
            <td/>
            <td colspan="2" style="font-size:10pt;font-family:Verdana;">
              <br/>
              Werkadres/afleveradres:<br/>
              Generaal Urquhartlaan 4, 6861 GG Oosterbeek<br/>
            </td>
          </tr>
        </xsl:when>
        <xsl:otherwise>
          <tr>
            <td/>
            <td colspan="2" style="font-size:10pt;font-family:Verdana;">
              <br/>
              Werkadres/afleveradres:<br/>
              <xsl:value-of select="melding/plaats/regio/district/locatie/adres"/><br/>
              <xsl:value-of select="melding/plaats/regio/district/locatie/postcode"/><xsl:text>  </xsl:text><xsl:value-of select="melding/plaats/regio/district/locatie/plaats"/><br/>
              <xsl:if test="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/nr!=''"><xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/omschrijving"/><br/>
              <xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/nr"/></xsl:if>
            </td>
          </tr>
        </xsl:otherwise>
      </xsl:choose>
      <tr>
        <td/>
        <td colspan="2" style="font-size:10pt;font-family:Verdana;">
          <br/>
          Om vertraging in de betaling te voorkomen, dient u op de factuur te vermelden:
		</td>
      </tr>  
	  <tr>
		  <td/>
		  <td><b>FCL: <xsl:value-of select="kostenplaats/nr"/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ECL: <xsl:value-of select="substring(kenmerk[@key=244],1,6)"/></b></td>
      </tr>
      <tr>
        <td/>
        <td colspan="2" style="font-size:10pt;font-family:Verdana;">
          <br/>
          Voor vragen of opmerkingen over deze opdracht kunt u contact opnemen met:
		</td>
		</tr>
		<tr>	
        	<td/>	
			<td colspan="2">
		 		<table border="0" style="width:100%;">
		  			<td><xsl:value-of select="kenmerk[@key=245]/perslid/naam_full"/></td>
          			<td>
						<xsl:choose>
							<xsl:when test="kenmerk[@key=245]/perslid/mobiel!=''">T: <xsl:value-of select="kenmerk[@key=245]/perslid/mobiel"/>
	            			</xsl:when>
				            <xsl:otherwise>T: <xsl:value-of select="kenmerk[@key=245]/perslid/telefoonnr"/>
				            </xsl:otherwise>
			          	</xsl:choose>
					</td>
		  			<td>E: <xsl:value-of select="kenmerk[@key=245]/perslid/email"/>
        			</td>
				</table>
			</td>
		</tr>			
      <tr>
        <td/>
        <td colspan="2" style="font-size:10pt;font-family:Verdana;">
          <br/>
          <br/>
          <br/>
          <i>Op al onze opdrachten zijn de Algemene Inkoopvoorwaarden gemeente Renkum van toepassing. Op uw verzoek wordt hiervan een exemplaar toegezonden.</i>
        </td>
      </tr>
    </table>
  </xsl:template>

  <xsl:template match="opdracht" mode="full">
    <xsl:choose>
      <xsl:when test="$mode='summary'"></xsl:when>
      <xsl:otherwise>
        <html>
          <xsl:comment>================================ OPDRACHTEN ==============================</xsl:comment>
          <xsl:comment>FACILITOR default XSL template for opdracht</xsl:comment>
          <xsl:call-template name="htmlhead"/>
          <xsl:element name="body">
            <xsl:if test="$mode!='email'"><xsl:attribute name="onload">window.print();</xsl:attribute></xsl:if>
            <!--xsl:call-template name="pageheader"/-->
            <xsl:apply-templates select="." mode="include"/>
            <!--xsl:call-template name="pagefooter"/-->
          </xsl:element>
        </html>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>

	<xsl:template name="qrc_ins_new_page">
		<xsl:param name="p_page"/>
		<xsl:param name="p_rows"/>
		<xsl:param name="p_cols"/>
		<table>
			<xsl:for-each select="//facilitor/rapport/rapport_data/data_row">
				<xsl:sort select="FCLT_F_GEBOUW"/>
				<xsl:sort select="FCLT_F_VERDIEPING"/>
				<xsl:sort select="PLAATS"/>
				<xsl:if test="position() &gt;= (($p_page - 1) * ($p_rows * $p_cols) + 1) and position() &lt;= ($p_page * ($p_rows * $p_cols))">
					<xsl:if test="(position() mod $p_cols) = 0">
						<xsl:comment>=== Na elke 1 records (1x1 passen op 1 regel) ===</xsl:comment>
						<xsl:call-template name="qrc_ins_new_tr">
							<xsl:with-param name="p_pos" select="position() - $p_cols + 1"/>
							<xsl:with-param name="p_cols" select="$p_cols"/>
						</xsl:call-template>
					</xsl:if>
					<xsl:if test="(position() = last()) and (position() mod $p_cols) != 0">
						<xsl:comment>=== Na elke 1 records (1x1 passen op 1 regel) ===</xsl:comment>
						<xsl:call-template name="qrc_ins_new_tr">
							<xsl:with-param name="p_pos" select="floor(position() div $p_cols) * $p_cols + 1"/>
							<xsl:with-param name="p_cols" select="$p_cols"/>
						</xsl:call-template>
					</xsl:if>
				</xsl:if>
			</xsl:for-each>
		</table>
	</xsl:template>

	<xsl:template name="qrc_ins_new_tr">
		<xsl:param name="p_pos"/>
		<xsl:param name="p_cols"/>
		<tr height="80px">
			<xsl:for-each select="//facilitor/rapport/rapport_data/data_row">
				<xsl:sort select="FCLT_F_SOORTMELDING"/>
				<xsl:sort select="FCLT_F_LOCATIE"/>
				<xsl:sort select="FCLT_F_GEBOUW"/>
				<xsl:sort select="FCLT_F_VERDIEPING"/>
				<xsl:sort select="PLAATS"/>
				<xsl:sort select="FCLT_F_OBJECTGROEP"/>
				<xsl:sort select="FCLT_F_OBJECTSOORT"/>
				<xsl:sort select="DEEL_OMSCHRIJVING"/>
				<xsl:if test="position() &gt;= $p_pos and position() &lt;= $p_pos + $p_cols - 1">
					<xsl:choose>
						<xsl:when test="VARIABELE = 'INS_KEY'">
					<td width="25%" style="text-align:center">
						<xsl:element name="img">
							<xsl:attribute name="style">height: 5cm</xsl:attribute>
							<xsl:attribute name="src">
								../../appl/shared/qrcode.asp?size=16&amp;text=%3Fu%3D<xsl:value-of select="HIDE_F_BOOKMARK_ID"/>%26ins_key%3D<xsl:value-of select="DEEL_KEY"/>
							</xsl:attribute>
						</xsl:element>
						<br/>
					</td>
						</xsl:when>
						<xsl:when test="VARIABELE = 'RUIMTE_KEY'">
					<td width="25%" style="text-align:center">
						<xsl:element name="img">
							<xsl:attribute name="style">height: 5cm</xsl:attribute>
							<xsl:attribute name="src">
								../../appl/shared/qrcode.asp?size=16&amp;text=%3Fu%3D<xsl:value-of select="HIDE_F_BOOKMARK_ID"/>%26ruimte_key%3D<xsl:value-of select="RUIMTE_KEY"/>
							</xsl:attribute>
						</xsl:element>
						<br/>
					</td>
						</xsl:when>
						<xsl:when test="VARIABELE = 'GEBOUW_KEY'">
					<td width="25%" style="text-align:center">
						<xsl:element name="img">
							<xsl:attribute name="style">height: 5cm</xsl:attribute>
							<xsl:attribute name="src">
								../../appl/shared/qrcode.asp?size=16&amp;text=%3Fu%3D<xsl:value-of select="HIDE_F_BOOKMARK_ID"/>%26gebouw_key%3D<xsl:value-of select="RUIMTE_KEY"/>
							</xsl:attribute>
						</xsl:element>
						<br/>
					</td>
						</xsl:when>
						<xsl:when test="VARIABELE = 'RES_RUIMTE_KEY'">
					<td width="25%" style="text-align:center">
						<xsl:element name="img">
							<xsl:attribute name="style">height: 5cm</xsl:attribute>
							<xsl:attribute name="src">
								../../appl/shared/qrcode.asp?size=16&amp;text=%3Fu%3D<xsl:value-of select="HIDE_F_BOOKMARK_ID"/>%26res_ruimte_key%3D<xsl:value-of select="RUIMTE_KEY"/>
							</xsl:attribute>
						</xsl:element>
						<br/>
					</td>
						</xsl:when>
						<xsl:otherwise>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:if>
			</xsl:for-each>
		</tr>
		<tr height="80px">
			<xsl:for-each select="//facilitor/rapport/rapport_data/data_row">
				<xsl:sort select="FCLT_F_SOORTMELDING"/>
				<xsl:sort select="FCLT_F_LOCATIE"/>
				<xsl:sort select="FCLT_F_GEBOUW"/>
				<xsl:sort select="FCLT_F_VERDIEPING"/>
				<xsl:sort select="PLAATS"/>
				<xsl:sort select="FCLT_F_OBJECTGROEP"/>
				<xsl:sort select="FCLT_F_OBJECTSOORT"/>
				<xsl:sort select="DEEL_OMSCHRIJVING"/>
				<xsl:if test="position() &gt;= $p_pos and position() &lt;= $p_pos + $p_cols - 1">
					<td width="25%" style="text-align:center">
						<xsl:value-of select="FCLT_F_SOORTMELDING"/>
						<br/>
						<xsl:value-of select="FCLT_F_LOCATIE"/>
						<br/>
						<xsl:value-of select="PLAATS"/>
						<br/>
						<xsl:value-of select="FCLT_F_OBJECTGROEP"/>
						<br/>
						<xsl:value-of select="FCLT_F_OBJECTSOORT"/>
						<br/>
						<xsl:value-of select="DEEL_OMSCHRIJVING"/>
						<br/>
					</td>
				</xsl:if>
			</xsl:for-each>
		</tr>
	</xsl:template>

	<xsl:template name="substring-after-last">
		<xsl:param name="string"/>
		<xsl:param name="delimiter"/>
		<xsl:choose>
			<xsl:when test="contains($string, $delimiter)">
				<xsl:call-template name="substring-after-last">
					<xsl:with-param name="string" select="substring-after ($string, $delimiter)"/>
					<xsl:with-param name="delimiter" select="$delimiter"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
		</xsl:choose>
	</xsl:template>

	<xsl:template match="rapport">
		<!--De generatie van QR-codes (meldingen/objecten/reserveringen)-->
		<xsl:if test="@view='renk_v_rap_mldinsres_qrc' or @view='RENK_V_RAP_MLDINSRES_QRC'">
			<xsl:variable name="p_rows" select="3"/>
			<xsl:variable name="p_cols" select="2"/>

			<table>
				<tr height="200">
					<td width="50%" align="center">
						<span style="font-size:24pt;color:#000000">QR-codes</span>
					</td>
				</tr>
				<tr height="200">
					<td width="50%" align="center">
						<span style="font-size:24pt;color:#000000">object-meldingen</span>
					</td>
				</tr>
				<tr height="200">
					<td width="50%" align="center">
						<span style="font-size:24pt;color:#000000">(startpagina tbv. uitlijning)</span>
					</td>
				</tr>
			</table>

			<xsl:for-each select="//facilitor/rapport/rapport_data/data_row">
				<xsl:sort select="FCLT_F_SOORTMELDING"/>
				<xsl:sort select="FCLT_F_LOCATIE"/>
				<xsl:sort select="FCLT_F_GEBOUW"/>
				<xsl:sort select="FCLT_F_VERDIEPING"/>
				<xsl:sort select="PLAATS"/>
				<xsl:sort select="FCLT_F_OBJECTGROEP"/>
				<xsl:sort select="FCLT_F_OBJECTSOORT"/>
				<xsl:sort select="DEEL_OMSCHRIJVING"/>
				<xsl:if test="position() mod ($p_rows * $p_cols) = 0">
					<div style="page-break-before:always">&#160;</div>
					<xsl:comment>=== Na elke 2 records (2x1 passen op 1 A4) =====</xsl:comment>
					<xsl:call-template name="qrc_ins_new_page">
						<xsl:with-param name="p_page" select="floor(position() div ($p_rows * $p_cols))"/>
						<xsl:with-param name="p_rows" select="$p_rows"/>
						<xsl:with-param name="p_cols" select="$p_cols"/>
					</xsl:call-template>
				</xsl:if>
				<xsl:if test="position() = last() and position() mod ($p_rows * $p_cols) != 0 ">
					<div style="page-break-before:always">&#160;</div>
					<xsl:comment>=== De laatste paar, zijn minder dan 2 =====</xsl:comment>
					<xsl:call-template name="qrc_ins_new_page">
						<xsl:with-param name="p_page" select="floor((position() div ($p_rows * $p_cols)) + 1)"/>
						<xsl:with-param name="p_rows" select="$p_rows"/>
						<xsl:with-param name="p_cols" select="$p_cols"/>
					</xsl:call-template>
				</xsl:if>
			</xsl:for-each>
		</xsl:if>

		<style>.pagebreak {page-break-after:always;}</style>

		<xsl:if test="@view='renk_v_rap_res_actual' or @view='RENK_V_RAP_RES_ACTUAL' or @view='renk_v_rap_res_frozen' or @view='RENK_V_RAP_RES_FROZEN'">
			<html>
				<xsl:call-template name="htmlhead"/>
				<body>
					<table border="0" style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
						<xsl:if test="count(rapport_data/data_row)=0">
							<tr><td><center><b>Geen gegevens gevonden</b></center></td></tr>
						</xsl:if>

						<xsl:variable name="sortedall">
							<xsl:for-each select="rapport_data/data_row">
								<xsl:sort select="HIDE_F_GROEPERING"/>
								<xsl:sort select="HIDE_F_MINDATUM"/>
								<xsl:sort select="HIDE_F_MAXDATUM"/>
								<xsl:sort select="HIDE_F_RESTYPE"/>
								<xsl:copy-of select="."/>
							</xsl:for-each>
						</xsl:variable>

						<xsl:for-each select="msxml:node-set($sortedall)/data_row">
							<xsl:variable name="prev_fact">
								<xsl:choose>
									<xsl:when test="position()=1">Quqelequ</xsl:when>
									<!--xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/HIDE_F_GROEPERING"/></xsl:otherwise-->
									<!--ALS RAPPORTAGE EN ZONDER FILTERING MAAR EEN FACTUUR TONEN!-->
									<xsl:otherwise><xsl:value-of select="HIDE_F_GROEPERING"/></xsl:otherwise>
								</xsl:choose>
							</xsl:variable>
							<xsl:variable name="this_fact">
								<xsl:value-of select="HIDE_F_GROEPERING"/>
							</xsl:variable>

							<!--Als 'this' != 'prev', dan start nieuwe factuur!-->
							<xsl:if test="$this_fact!=$prev_fact">
								<xsl:if test="position()&gt;1">
									<tr class="pagebreak"><td/></tr>
								</xsl:if>

								<!--HEADER-table (incl. tenaamstelling)!-->
								<table border="0" style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
									<tr>
										<!--td colspan="2" style="width:158mm;font-size:9pt;font-family:Verdana;">
											<xsl:element name="img">
												<xsl:attribute name="src">../../cust/renk/factuurlogo.png</xsl:attribute>
												<xsl:attribute name="style">width:61mm;</xsl:attribute>
											</xsl:element>
										</td-->
										<td colspan="2" style="width:131mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
										<td style="font-size:9pt;font-family:Verdana;">
											<span style="font-size:7pt;font-family:Verdana;">Generaal Urquhartlaan 4<br/></span>
											<span style="font-size:7pt;font-family:Verdana;">6861 GG Oosterbeek<br/></span>
											<br/>
											<span style="font-size:7pt;font-family:Verdana;">Postbus 9100<br/></span>
											<span style="font-size:7pt;font-family:Verdana;">6860 HA Oosterbeek<br/></span>
											<span style="font-size:7pt;font-family:Verdana;">Telefoon (026) 33 48 111<br/></span>
											<span style="font-size:7pt;font-family:Verdana;">Fax (026) 33 48 310</span>
										</td>
									</tr>
									<tr>
										<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
										<td style="width:116mm;font-size:9pt;font-family:Verdana;">
											<br/>
											<br/>
											<br/>
											<xsl:value-of select="NAAM"/><br/>
											<xsl:if test="AFD!=''"><xsl:value-of select="AFD"/><br/></xsl:if>
											<xsl:if test="TAV!=''"><xsl:value-of select="TAV"/><br/></xsl:if>
											<xsl:value-of select="ADRES"/><br/>
											<xsl:value-of select="POSTCODE"/><xsl:text> </xsl:text><xsl:value-of select="PLAATS"/>
											<xsl:if test="not(AFD!='')"><br/></xsl:if>
											<xsl:if test="not(TAV!='')"><br/></xsl:if>
										</td>
										<td style="font-size:9pt;font-family:Verdana;">
											<br/>
											<span style="font-size:7pt;font-family:Verdana;">www.renkum.nl<br/></span>
											<br/>
											<span style="font-size:7pt;font-family:Verdana;">IBAN: NL02BNGH0285007076<br/></span>
											<span style="font-size:7pt;font-family:Verdana;">BIC: BNGHNL2G</span>
										</td>
									</tr>
								</table>

								<!--Ruimte-reserveringen (1R) uit factuur gesorteerd op dag-periode-van-tot!-->
								<xsl:variable name="sortedfac1">
									<xsl:for-each select="msxml:node-set($sortedall)/data_row">
										<xsl:sort select="DAGNR"/>
										<xsl:sort select="HIDE_F_MINDATUM"/>
										<xsl:sort select="HIDE_F_MAXDATUM"/>
										<xsl:sort select="VAN"/>
										<xsl:sort select="TOT"/>
										<xsl:if test="HIDE_F_GROEPERING=$this_fact and substring(HIDE_F_RESTYPE,1,2)='1R'">
											<xsl:copy-of select="."/>
										</xsl:if>
									</xsl:for-each>
								</xsl:variable>

								<xsl:variable name="verzoekdatum">
									<xsl:value-of select="concat(substring(DATUMVERZOEK,7,2),'-',substring(DATUMVERZOEK,5,2),'-',substring(DATUMVERZOEK,1,4))"/>
								</xsl:variable>

								<!--INHOUD-table (van datum+onderwerp t/m intro)!-->
								<table border="0" style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
									<tr><td height="60px"/></tr>
									<tr>
										<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
										<td style="width:44mm;font-size:9pt;font-family:Verdana;">
											<span style="font-size:7pt;font-family:Verdana;">Datum<br/></span>
											<xsl:value-of select="FACTUURDATUM"/>
										</td>
										<td style="width:116mm;font-size:9pt;font-family:Verdana;">
											<span style="font-size:7pt;font-family:Verdana;">Onderwerp<br/></span>
											<xsl:value-of select="ONDERWERP"/>
										</td>
										<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
									</tr>
									<tr><td height="40px"/></tr>
									<xsl:choose>
										<!--Regelmatige verhuur (aantal reserveringen >1; eventueel incl. Instructieruimte)-->
										<!--NB. Eenmalige verhuur volgens V-tarief krijgt opmaak zoals igv. I- of C-tarief!-->
										<!--xsl:when test="TARIEF_CODE='V'"-->
										<xsl:when test="sum(msxml:node-set($sortedfac1)/data_row/AANT_WEKEN)&gt;1">
											<tr>
												<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
												<td colspan="2" style="width:160mm;font-size:9pt;font-family:Verdana;">
Geachte <xsl:value-of select="AANHEF"/>,<br/>
<br/>
<!--Naar aanleiding van uw <xsl:value-of select="SOORTVERZOEK"/> verzoek van <span class="nowrap" style="font-size:9pt;font-family:Verdana;"><xsl:value-of select="$verzoekdatum"/></span> bevestigen wij hierbij dat <xsl:choose><xsl:when test="AFD!='' or TAV!=''"><xsl:value-of select="NAAM"/></xsl:when><xsl:otherwise>u</xsl:otherwise></xsl:choose> in de periode <xsl:choose><xsl:when test="substring(PERIODE,5,1)='1'">januari t/m juni <xsl:value-of select="substring(PERIODE,1,4)"/>:</xsl:when><xsl:otherwise>juli t/m december <xsl:value-of select="substring(PERIODE,1,4)"/>:</xsl:otherwise></xsl:choose><br/>-->
Naar aanleiding van uw <xsl:value-of select="SOORTVERZOEK"/> verzoek van <span class="nowrap" style="font-size:9pt;font-family:Verdana;"><xsl:value-of select="$verzoekdatum"/></span> bevestigen wij hierbij uw reservering in de periode:<br/>
<br/>
												</td>
												<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
											</tr>
										</xsl:when>
										<!--Eenmalige verhuur Instructieruimte sporthal DW=121 (normaliter I-tarief?)-->
										<xsl:when test="RES_RUIMTE_KEY='121'">
											<tr>
												<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
												<td colspan="2" style="width:160mm;font-size:9pt;font-family:Verdana;">
Geachte <xsl:value-of select="AANHEF"/>,<br/>
<br/>
Van de beheerders van de sporhal te Doorwerth hebben wij vernomen dat op <span class="nowrap" style="font-size:9pt;font-family:Verdana;"><xsl:value-of select="concat(substring(HIDE_F_MINDATUM,9,2),'-',substring(HIDE_F_MINDATUM,6,2),'-',substring(HIDE_F_MINDATUM,1,4))"/></span><xsl:text> </xsl:text><xsl:value-of select="NAAM"/> van <xsl:value-of select="VAN"/> uur tot <xsl:value-of select="TOT"/> uur gebruik heeft gemaakt van de instructieruimte op genoemde locatie.<br/>
<br/>
												</td>
												<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
											</tr>
										</xsl:when>
										<!--Eenmalige verhuur volgens I- of C-tarief-->
										<xsl:otherwise>
											<tr>
												<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
												<td colspan="2" style="width:160mm;font-size:9pt;font-family:Verdana;">
Geachte <xsl:value-of select="AANHEF"/>,<br/>
<br/>
Naar aanleiding van uw <xsl:value-of select="SOORTVERZOEK"/> verzoek van <span class="nowrap" style="font-size:9pt;font-family:Verdana;"><xsl:value-of select="$verzoekdatum"/></span> bevestigen wij hierbij uw reservering op <span class="nowrap" style="font-size:9pt;font-family:Verdana;"><xsl:value-of select="concat(substring(HIDE_F_MINDATUM,9,2),'-',substring(HIDE_F_MINDATUM,6,2),'-',substring(HIDE_F_MINDATUM,1,4))"/></span> van <xsl:value-of select="VAN"/> uur tot <xsl:value-of select="TOT"/> uur van genoemde accommodatie.<br/>
<br/>
												</td>
												<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
											</tr>
										</xsl:otherwise>
									</xsl:choose>
								</table>

								<!--Dynamisch deel voor vaste verhuur (of als >1 reservering?)!-->
								<xsl:if test="sum(msxml:node-set($sortedfac1)/data_row/AANT_WEKEN)&gt;1">
								 <xsl:for-each select="msxml:node-set($sortedfac1)/data_row">
									<xsl:variable name="prev_dagnr">
										<xsl:choose>
											<xsl:when test="position()=1">Quqelequ</xsl:when>
											<xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/DAGNR"/></xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="this_dagnr">
										<xsl:value-of select="DAGNR"/>
									</xsl:variable>
									<xsl:variable name="prev_mindat">
										<xsl:choose>
											<xsl:when test="position()=1">Quqelequ</xsl:when>
											<!--xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/HIDE_F_MINDATUM"/></xsl:otherwise-->
											<!--xsl:otherwise><xsl:value-of select="substring(preceding-sibling::data_row[1]/HIDE_F_MINDATUM,1,16)"/></xsl:otherwise-->
											<xsl:otherwise><xsl:choose><xsl:when test="RES_DISCIPLINE_KEY='43'"><xsl:value-of select="substring(preceding-sibling::data_row[1]/HIDE_F_MINDATUM,1,16)"/></xsl:when><xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/HIDE_F_MINDATUM"/></xsl:otherwise></xsl:choose></xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="this_mindat">
										<!--xsl:value-of select="HIDE_F_MINDATUM"/-->
										<xsl:value-of select="substring(HIDE_F_MINDATUM,1,16)"/>
									</xsl:variable>
									<xsl:variable name="prev_maxdat">
										<xsl:choose>
											<xsl:when test="position()=1">Quqelequ</xsl:when>
											<!--xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/HIDE_F_MAXDATUM"/></xsl:otherwise-->
											<!--xsl:otherwise><xsl:value-of select="substring(preceding-sibling::data_row[1]/HIDE_F_MAXDATUM,1,16)"/></xsl:otherwise-->
											<xsl:otherwise><xsl:choose><xsl:when test="RES_DISCIPLINE_KEY='43'"><xsl:value-of select="substring(preceding-sibling::data_row[1]/HIDE_F_MAXDATUM,1,16)"/></xsl:when><xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/HIDE_F_MAXDATUM"/></xsl:otherwise></xsl:choose></xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="this_maxdat">
										<!--xsl:value-of select="HIDE_F_MAXDATUM"/-->
										<xsl:value-of select="substring(HIDE_F_MAXDATUM,1,16)"/>
									</xsl:variable>
									<xsl:variable name="prev_van">
										<xsl:choose>
											<xsl:when test="position()=1">Quqelequ</xsl:when>
											<xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/VAN"/></xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="this_van">
										<xsl:value-of select="VAN"/>
									</xsl:variable>
									<xsl:variable name="prev_tot">
										<xsl:choose>
											<xsl:when test="position()=1">Quqelequ</xsl:when>
											<xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/TOT"/></xsl:otherwise>
										</xsl:choose>
									</xsl:variable>
									<xsl:variable name="this_tot">
										<xsl:value-of select="TOT"/>
									</xsl:variable>

									<!--Als 'this' != 'prev', dan start nieuwe dag-regel!-->
									<xsl:if test="$this_dagnr!=$prev_dagnr or $this_mindat!=$prev_mindat or $this_maxdat!=$prev_maxdat or $this_van!=$prev_van or $this_tot!=$prev_tot">
										<!--Ruimte reserveringen uit factuur op dezelfde dag-periode-van-tot gesorteerd op datum (incl. res_ruimte_nr)!-->
										<xsl:variable name="sorteddag">
											<xsl:for-each select="msxml:node-set($sortedfac1)/data_row">
												<xsl:sort select="HIDE_F_MINDATUM"/>
												<xsl:if test="DAGNR=$this_dagnr and substring(HIDE_F_MINDATUM,1,16)=$this_mindat and substring(HIDE_F_MAXDATUM,1,16)=$this_maxdat and VAN=$this_van and TOT=$this_tot">
													<xsl:copy-of select="."/>
												</xsl:if>
											</xsl:for-each>
										</xsl:variable>

										<xsl:variable name="mindatum">
											<xsl:value-of select="concat(substring(HIDE_F_MINDATUM,9,2),'-',substring(HIDE_F_MINDATUM,6,2),'-',substring(HIDE_F_MINDATUM,1,4))"/>
										</xsl:variable>

										<xsl:variable name="maxdatum">
											<xsl:value-of select="concat(substring(HIDE_F_MAXDATUM,9,2),'-',substring(HIDE_F_MAXDATUM,6,2),'-',substring(HIDE_F_MAXDATUM,1,4))"/>
										</xsl:variable>

										<!--INHOUD-table (dag-regels)!-->
										<table border="0" style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
											<tr>
												<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
												<td style="width:55mm;font-size:9pt;font-family:Verdana;">
													<xsl:value-of select="$mindatum"/><xsl:if test="$mindatum!=$maxdatum"> t/m <xsl:value-of select="$maxdatum"/></xsl:if>
												</td>
												<td style="width:28mm;font-size:9pt;font-family:Verdana;">
													 op <xsl:value-of select="DAGNAAM"/>
												</td>
												<td style="width:44mm;font-size:9pt;font-family:Verdana;">
													 van <xsl:value-of select="VAN"/> tot <xsl:value-of select="TOT"/> uur
												</td>
												<td style="font-size:9pt;font-family:Verdana;">
												 <!--Voor Sporthal=41 en Gymzaal=42 ruimtenaam niet toevoegen; voor Schoolgebouw=43 wel!-->
												 <xsl:if test="RES_DISCIPLINE_KEY='43'">
													<xsl:for-each select="msxml:node-set($sorteddag)/data_row">
													  <xsl:variable name="prev_ruimte">
													    <xsl:choose>
													      <xsl:when test="position()=1">Quqelequ</xsl:when>
													      <xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/RES_RUIMTE_KEY"/></xsl:otherwise>
													    </xsl:choose>
													  </xsl:variable>
													  <xsl:variable name="this_ruimte">
													    <xsl:value-of select="RES_RUIMTE_KEY"/>
													  </xsl:variable>

													  <!--Als 'this' != 'prev', dan voeg ruimte toe op dag-regel!-->
													  <xsl:if test="$this_ruimte!=$prev_ruimte">
													    <xsl:choose>
													      <xsl:when test="position()=1"><xsl:value-of select="RVC_OMS"/></xsl:when>
													      <!--xsl:otherwise>, <xsl:value-of select="RVC_OMS"/></xsl:otherwise-->
													      <xsl:otherwise>, <xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="RVC_OMS"/><xsl:with-param name="delimiter" select="' '"/></xsl:call-template></xsl:otherwise>
													    </xsl:choose>
													  </xsl:if>
													</xsl:for-each>
												 </xsl:if>
												</td>
											</tr>
										</table>
									</xsl:if>
								 </xsl:for-each>
								</xsl:if>

								<!--Alle onderdelen (1R2V3C) uit factuur gesorteerd op prijs-#weken-dag-periode!-->
								<xsl:variable name="sortedfac2">
									<xsl:for-each select="msxml:node-set($sortedall)/data_row">
										<xsl:sort select="HIDE_F_RESTYPE"/>
										<xsl:sort select="STUKSPRIJS * KORTING"/>
										<xsl:sort select="AANT_WEKEN" data-type="number" order="descending"/>
										<xsl:sort select="DAGNR"/>
										<xsl:sort select="HIDE_F_MINDATUM"/>
										<xsl:sort select="HIDE_F_MAXDATUM"/>
										<xsl:if test="HIDE_F_GROEPERING=$this_fact">
											<xsl:copy-of select="."/>
										</xsl:if>
									</xsl:for-each>
								</xsl:variable>

								<xsl:variable name="totsumfact">
									<xsl:value-of select="sum(msxml:node-set($sortedfac2)/data_row/BRUTO)"/>
								</xsl:variable>

								<!--INHOUD-table (van uittro t/m ondertekening)!-->
								<table border="0" style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
									<xsl:choose>
										<!--Eenmalige verhuur Instructieruimte sporthal DW=121 (normaliter I-tarief?)-->
										<xsl:when test="RES_RUIMTE_KEY='121' and sum(msxml:node-set($sortedfac1)/data_row/AANT_WEKEN)=1">
											<tr>
												<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
												<td style="width:160mm;font-size:9pt;font-family:Verdana;">
													De hiervoor te betalen gebruiksvergoeding bedraagt € <xsl:value-of select="format-number($totsumfact, '0,00', 'european')"/> (incl. 6% BTW).
												</td>
												<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
											</tr>
										</xsl:when>
										<!--Zowel regelmatige (aantal reserveringen >1; eventueel incl. Instructieruimte) als-->
										<!--eenmalige verhuur (normaliter volgens I- of C-tarief, maar mogelijk ook V-tarief)-->
										<xsl:otherwise>
											<xsl:if test="sum(msxml:node-set($sortedfac1)/data_row/AANT_WEKEN)&gt;1">
												<tr>
													<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
													<td style="width:160mm;font-size:9pt;font-family:Verdana;">
													  <br/>
													  van genoemde accommodatie.<br/>
													  <br/>
													</td>
													<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
												</tr>
											</xsl:if>
											<tr>
												<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
												<td style="width:160mm;font-size:9pt;font-family:Verdana;">
													De hiervoor te betalen gebruiksvergoeding bedraagt € <xsl:value-of select="format-number($totsumfact, '0,00', 'european')"/> (incl. 6% BTW) zijnde:<br/>
													<br/>
												</td>
												<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
											</tr>

											<xsl:for-each select="msxml:node-set($sortedfac2)/data_row">
												<xsl:variable name="prev_tarief">
													<xsl:choose>
													  <xsl:when test="position()=1">Quqelequ</xsl:when>
													  <xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/STUKSPRIJS"/></xsl:otherwise>
													</xsl:choose>
												</xsl:variable>
												<xsl:variable name="this_tarief">
													<xsl:value-of select="STUKSPRIJS"/>
												</xsl:variable>
												<xsl:variable name="prev_korting">
													<xsl:choose>
													  <xsl:when test="position()=1">Quqelequ</xsl:when>
													  <xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/KORTING"/></xsl:otherwise>
													</xsl:choose>
												</xsl:variable>
												<xsl:variable name="this_korting">
													<xsl:value-of select="KORTING"/>
												</xsl:variable>
												<xsl:variable name="prev_weken">
													<xsl:choose>
													  <xsl:when test="position()=1">Quqelequ</xsl:when>
													  <xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/AANT_WEKEN"/></xsl:otherwise>
													</xsl:choose>
												</xsl:variable>
												<xsl:variable name="this_weken">
													<xsl:value-of select="AANT_WEKEN"/>
												</xsl:variable>

												<!--Als 'this' != 'prev', dan start nieuwe toelichting-regel!-->
												<xsl:if test="$this_tarief!=$prev_tarief or $this_korting!=$prev_korting or $this_weken!=$prev_weken">
													<tr>
													  <td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
													  <td style="width:160mm;font-size:9pt;font-family:Verdana;">
													    <xsl:value-of select="format-number(sum(msxml:node-set($sortedfac2)/data_row[STUKSPRIJS=$this_tarief and KORTING=$this_korting and AANT_WEKEN=$this_weken]/AANTAL), '0,00', 'european')"/> uur x € <xsl:value-of select="format-number(STUKSPRIJS * KORTING, '0,00', 'european')"/> x <xsl:choose><xsl:when test="AANT_WEKEN='1'">1 week</xsl:when><xsl:otherwise><xsl:value-of select="AANT_WEKEN"/> weken</xsl:otherwise></xsl:choose><xsl:if test="substring(HIDE_F_RESTYPE,1,2)!='1R'"> (<xsl:value-of select="RVC_OMS"/>)</xsl:if>
													  </td>
													  <td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
													</tr>
												</xsl:if>
											</xsl:for-each>
										</xsl:otherwise>
									</xsl:choose>
									<tr>
										<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
										<td style="width:160mm;font-size:9pt;font-family:Verdana;">
											<br/>
											Wij verzoeken u dit bedrag<xsl:if test="sum(msxml:node-set($sortedfac1)/data_row/AANT_WEKEN)&gt;1 and TERMIJNEN&gt;1"> in <xsl:value-of select="TERMIJNEN"/> termijnen</xsl:if> over te maken op IBANnummer: NL02 BNGH 0285 0070 76 o.v.v. ons kenmerk.
											De betalingstermijn is 21 dagen na verzenddatum van deze brief.<br/>
											<br/>
											<xsl:if test="RES_DISCIPLINE_KEY!='43'">
												Op al onze gemeentelijke sporthallen en gymzalen zijn de gebruikersvoorwaarden gemeente Renkum van toepassing. Op uw verzoek wordt hiervan een exemplaar toegezonden.<br/>
												<br/>
											</xsl:if>
											Hoogachtend,<br/>
											<br/>
											BURGEMEESTER EN WETHOUDERS VAN RENKUM<br/>
											namens hen,<br/>
											<br/><br/><br/>
											R. Kluin<br/>
											Hoofd Vastgoed en Facilitair
										</td>
										<td style="font-size:9pt;font-family:Verdana;">&#xA0;</td>
									</tr>
								</table>

								<!--FOOTER-div/table!-->
								<div id="footer">
									<table border="0" style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
										<tr>
											<td style="width:15mm;font-size:9pt;font-family:Verdana;">&#xA0;</td>
											<td style="width:44mm;font-size:9pt;font-family:Verdana;">
												<span style="font-style:italic;font-size:7pt;font-family:Verdana;">Uw brief van<br/></span>
												<xsl:if test="SOORTVERZOEK='schriftelijke'"><xsl:value-of select="$verzoekdatum"/></xsl:if>
												<br/><br/>
												<span style="font-style:italic;font-size:7pt;font-family:Verdana;">Verzenddatum deze brief</span>
											</td>
											<td style="width:44mm;font-size:9pt;font-family:Verdana;">
												<span style="font-style:italic;font-size:7pt;font-family:Verdana;">Uw kenmerk<br/></span>
												<br/><br/>
												<span style="font-style:italic;font-size:7pt;font-family:Verdana;">Ons kenmerk<br/></span>
												<xsl:value-of select="KENMERK"/><xsl:if test="FCLT_F_KENMERK!=''"><xsl:call-template name="substring-after-last"><xsl:with-param name="string" select="FCLT_F_KENMERK"/><xsl:with-param name="delimiter" select="'+'"/></xsl:call-template></xsl:if>
											</td>
											<td style="width:44mm;font-size:9t;font-family:Verdana;">
												<span style="font-style:italic;font-size:7pt;font-family:Verdana;">Behandeld door<br/></span>
												<xsl:value-of select="BEHANDELAAR_NAAM"/><br/>
												(026) 33 48 <xsl:value-of select="BEHANDELAAR_TEL"/><br/>
												<xsl:value-of select="BEHANDELAAR_MAIL"/>
											</td>
											<td style="font-size:9pt;font-family:Verdana;">
												<span style="font-style:italic;font-size:7pt;font-family:Verdana;">Bijlagen<br/></span>
											</td>
										</tr>
										<!--tr>
											<td style="width:15mm;font-size:8pt;font-family:Raavi;">&#xA0;</td>
											<td colspan="4" style="width:187mm;font-size:8pt;font-family:Raavi;color:#003399;">
												<br/>
												Gemeente Renkum bestaat uit de dorpen Doorwerth, Heelsum, Oosterbeek, Renkum, Heveadorp en Wolfheze
											</td>
										</tr-->
									</table>
								</div>
							</xsl:if>
						</xsl:for-each>
					</table>
				</body>
			</html>
		</xsl:if>

		<xsl:if test="@view='renk_v_rap_freezereserveringen' or @view='RENK_V_RAP_FREEZERESERVERINGEN'">
			<script>
				<xsl:text disable-output-escaping="yes">
					function run_opslaan (p_groepering) {
					l_id = 'ref_' + p_groepering;
					l_obj = document.getElementById (l_id);
					$.post('../../cust/renk/res_statusupdate.asp?groepering=' + p_groepering + '&amp;kenmerk=' + l_obj.value, {}, FcltCallbackRefresh, "json");
					}
				</xsl:text>
			</script>
			<html>
				<xsl:call-template name="htmlhead"/>
				<body>
					<table width="100%" class="rstable" cellpadding="0" cellspacing="0">
						<xsl:if test="count(rapport_data/data_row)=0">
							<tr><td><center><b>Geen gegevens gevonden</b></center></td></tr>
						</xsl:if>

						<xsl:variable name="sorted">
							<xsl:for-each select="rapport_data/data_row">
								<xsl:sort select="HIDE_F_GROEPERING"/>
								<xsl:copy-of select="."/>
							</xsl:for-each>
						</xsl:variable>

						<xsl:for-each select="msxml:node-set($sorted)/data_row">
							<xsl:if test="position()=1">
								<tr>
									<th style="text-align:left">Tenaamstelling</th>
									<th style="text-align:center">#Reserveringen</th>
									<th style="text-align:left">Eerder kenmerk</th>
									<th style="text-align:left">Generatie</th>
									<th style="text-align:left">Controle</th>
								</tr>
							</xsl:if>
							<tr>
								<td style="text-align:left">
									<xsl:value-of select="FCLT_F_NAAM"/>
									<xsl:if test="$mode!='excel'">&#xA0;</xsl:if>
								</td>
								<td style="text-align:center">
									<xsl:value-of select="AANTAL"/>
									<xsl:if test="$mode!='excel'">&#xA0;</xsl:if>
								</td>
								<td style="text-align:left">
									<xsl:value-of select="EERDER_KENMERK"/>
									<xsl:if test="$mode!='excel'">&#xA0;</xsl:if>
								</td>
								<xsl:element name="td">
									<table border="0" style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
										<tr>
											<xsl:element name="td">
												<xsl:attribute name="style">border-width:0px;padding:0px;</xsl:attribute>
												Kenmerk:
											</xsl:element>
											<xsl:element name="td">
												<xsl:attribute name="style">border-width:0px;padding:0px;</xsl:attribute>
												<xsl:element name="input">
													<xsl:attribute name="id">ref_<xsl:value-of select="HIDE_F_GROEPERING"/></xsl:attribute>
													<xsl:attribute name="type">text</xsl:attribute>
													<xsl:attribute name="size">40</xsl:attribute>
													<xsl:attribute name="maxlength">50</xsl:attribute>
												</xsl:element>
											</xsl:element>
										</tr>
										<tr>
											<xsl:element name="td">
												<xsl:attribute name="title">Genereer definitieve factuur!</xsl:attribute>
												<xsl:attribute name="style">cursor:pointer;border-width:0px;padding:0px;</xsl:attribute>
												<xsl:attribute name="onclick">if (confirm(L("lcl_R_U_sure"))){run_opslaan ('<xsl:value-of select="HIDE_F_GROEPERING"/>')}</xsl:attribute>
												<u>Factuur genereren</u>
											</xsl:element>
										</tr>
									</table>
								</xsl:element>
								<xsl:element name="td">
									<xsl:attribute name="title">Toon concept factuur.</xsl:attribute>
									<xsl:attribute name="style">cursor:pointer;text-align:left;</xsl:attribute>
									<xsl:attribute name="onclick">FcltMgr.openDetail('appl/fac/fac_usrrap_list.asp?usrrap_key=141&amp;fclt_f_colname1=HIDE_F_GROEPERING&amp;fclt_f_colvalue1=<xsl:value-of select="HIDE_F_GROEPERING"/>', 'Factuur <xsl:value-of select="FCLT_F_NAAM"/>');</xsl:attribute>
									<u>Factuur controleren</u>
								</xsl:element>
							</tr>
						</xsl:for-each>
					</table>
				</body>
			</html>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
<!-- Stylus Studio meta-information - (c) 2004-2007. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\TEMP\RENK_files\opdracht42_20140828111703.xml" htmlbaseurl="" outputurl="" processortype="internal" useresolver="yes" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator="" ><advancedProp name="sInitialMode" value=""/><advancedProp name="bXsltOneIsOkay" value="true"/><advancedProp name="bSchemaAware" value="true"/><advancedProp name="bXml11" value="false"/><advancedProp name="iValidation" value="0"/><advancedProp name="bExtensions" value="true"/><advancedProp name="iWhitespace" value="0"/><advancedProp name="sInitialTemplate" value=""/><advancedProp name="bTinyTree" value="true"/><advancedProp name="bWarnings" value="true"/><advancedProp name="bUseDTD" value="false"/><advancedProp name="iErrorHandling" value="fatal"/></scenario></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->