<?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 match="melding" mode="include">
		<table border="0" width="100%" cellpadding="2">
			<tr>
				<td colspan="2" class="caption" style="padding-top:20px">
					<b><xsl:value-of select="//lcl/MLD/melding"/>&#160;<xsl:value-of select="discipline/srtdiscipline/prefix"/><xsl:value-of select="key"/></b>
				</td>
			    <tr>
				    <td colspan="2"> <b>Medewerker facilitair servicepunt: </b>&#xA0;<xsl:value-of select="tracking/track[code='MLDNEW']/user/naam_full"/>
				</td>				
				</tr>
				<td colspan="2" class="caption" style="padding-top:20px;padding-bottom:20px">
					<xsl:if test="spoed&lt;3">
						<b><xsl:value-of select="//lcl/MLD/spoed"/></b>
					</xsl:if>
				</td>
			</tr>
			<tr height="40px">
				<td colspan="4">
					<hr/>
				</td>
			</tr>
			<tr>
				<td align="right" width="16%">
					<b><xsl:value-of select="//lcl/FAC/aanvrager"/>:</b>
				</td>
				<td align="left" width="34%">
					<xsl:value-of select="voor/naam_full"/>
				</td>
				<td align="right" width="16%">
					<b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
				</td>
				<td align="left" width="34%">
					<xsl:if test="voor/telefoonnr=''">-</xsl:if>
					<xsl:value-of select="voor/telefoonnr"/>
				</td>
			</tr>
			<xsl:if test="string(voor/naam_full)!=string(voor/naam_full)">
													<tr>
								<td align="right" width="16%"><b><xsl:value-of select="//lcl/MLD/meldingvoor"/>:</b></td>
								<td align="left" width="34%"><xsl:value-of select="voor/naam_full"/></td>
							</tr>
						</xsl:if>
			<tr>
				<td align="right" valign="top">
					<b><xsl:value-of select="//lcl/FAC/afdeling"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="voor/afdeling/omschrijving"/>
				</td>
			</tr>
			<xsl:if test="kenmerk/@naam='Afdelingsmedewerker'">
			<tr>
			    <td align="right" valign="top">
			    <b>Afdelingsmedewerker:</b>
			    </td>
	            <td align="left">
					<xsl:value-of select="kenmerk[@naam='Afdelingsmedewerker']"/>
			    </td>        
			</tr>
			</xsl:if>
			<tr>
				<td colspan="2"/>
			</tr>
			<tr height="40px">
				<td colspan="4">
					<hr/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/locatie"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="plaats/regio/district/locatie/code"/>&#xA0;
					<xsl:if test="plaats/regio/district/locatie/omschrijving!=''">(<xsl:value-of select="plaats/regio/district/locatie/omschrijving"/>)</xsl:if>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/melddatum"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="gemeld/datum"/>&#xA0;
					<xsl:value-of select="gemeld/tijd"/>
				</td>
			</tr>
			<tr>
				<xsl:choose>
					<xsl:when test="plaats/@type='T'">
						<td align="right">
							<b><xsl:value-of select="//lcl/FAC/terrein"/>:</b>
						</td>
						<td align="left">
							<xsl:value-of select="plaats/regio/district/locatie/terrein/code"/>-<xsl:value-of select="plaats/regio/district/locatie/terrein/naam"/></td>
					</xsl:when>
					<xsl:otherwise>
						<td align="right">
							<b>Afdeling:</b>
						</td>
						<td align="left">
							<xsl:value-of select="plaats/regio/district/locatie/gebouw/code"/>-<xsl:value-of select="plaats/regio/district/locatie/gebouw/naam"/></td>
					</xsl:otherwise>
				</xsl:choose>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/ordernr"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="kenmerk[@naam='Ordernr']"/>
				</td>
			</tr>
			<tr>
				<xsl:if test="plaats/@type='T' or plaats/@type='G'">
					<td colspan="2"/>
				</xsl:if>
				<xsl:if test="plaats/@type!='T' and plaats/@type!='G'">
					<td align="right">
						<b>Verdieping:</b>
					</td>
					<td align="left">
						<xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/code"/>&#xA0;
						<xsl:if test="plaats/regio/district/locatie/gebouw/verdieping/omschrijving!=''">(<xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/omschrijving"/>)</xsl:if>
					</td>
				</xsl:if>
			</tr>
			<tr>
				<xsl:if test="plaats/@type='R'">
					<td align="right" valign="top">
						<b><xsl:value-of select="//lcl/FAC/ruimte"/>:</b>
					</td>
					<td align="left">
						<xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/ruimte/nr"/>&#xA0;
						<xsl:if test="plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving!=''">(<xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving"/>)</xsl:if>
					</td>
				</xsl:if>
				<xsl:if test="plaats/@type!='R'">
					<td colspan="2"/>
				</xsl:if>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/status"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="status"/>
				</td>
			</tr>
			<tr height="30px">
				<td colspan="4"/>
			</tr>
			<tr>
				<td align="right">
					<b>Onderdeel:</b>
				</td>
				<td align="left">
					<xsl:if test="discipline/omschrijving=''">-</xsl:if>
					<xsl:value-of select="discipline/omschrijving"/>
				</td>
			</tr>	
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/stdmelding"/>:</b>
				</td>
				<td align="left">
					<xsl:if test="stdmelding/omschrijving=''">-</xsl:if>
					<xsl:value-of select="stdmelding/omschrijving"/>
				</td>
			</tr>
			<xsl:comment>als we binnen een opdracht zijn, tonen we de meldingtekst niet</xsl:comment>
			<tr>
				<td align="right" valign="top">
					<b><xsl:value-of select="//lcl/FAC/omschrijving"/>:</b>
				</td>
				<td align="left" colspan="3">
					<xsl:call-template name="linebreaks">
						<xsl:with-param name="string" select="omschrijving"/>
					</xsl:call-template>
				</td>
			</tr>
			<xsl:for-each select="kenmerk[@type!='L' and @type!='Q' and @naam!='Afdelingsmedewerker']">
				<xsl:sort select="@volgnummer" data-type="number"/>
				<xsl:if test=".!=''">
					<tr>
						<td align="right">
							<b>
								<xsl:value-of select="@naam"/>:</b>
						</td>
						<td colspan="3">
							<xsl:value-of select="."/>
						</td>
					</tr>
				</xsl:if>
			</xsl:for-each>
			<xsl:if test="count(deel)&gt;0">
				<xsl:for-each select="deel">
					<xsl:sort select="omschrijving"/>
					<tr>
						<xsl:choose>
							<xsl:when test="position()=1">
								<td align="right" valign="top">
									<b><xsl:value-of select="//lcl/MLD/objecten"/>:</b>
								</td>
							</xsl:when>
							<xsl:otherwise>
								<td/>
							</xsl:otherwise>
						</xsl:choose>
						<td align="left" valign="top">
							<xsl:value-of select="omschrijving"/>
						</td>
						<td colspan="2" valign="top">
							<xsl:comment>NADER TE DEFINIEREN</xsl:comment>
						</td>
					</tr>
				</xsl:for-each>
			</xsl:if>
				<tr height="40px">
				    <td colspan="4">
					    <hr/>
				</td>
			    </tr>
			    <tr>
					<td align="right">
						<b>Behandelaar:</b>
					</td>
					<td>
					<xsl:choose>
					<xsl:when test="behandelaar/naam_full">
						<xsl:value-of select="behandelaar/naam_full"/>
					</xsl:when>
					<xsl:otherwise>
					    <xsl:value-of select="tracking/track[code='MLDAFM']/user/naam_full"/>
                    </xsl:otherwise>
                    </xsl:choose>	
					</td>
				</tr>
				<tr>
					<td align="right" valign="top">
						<b><xsl:value-of select="//lcl/MLD/afhandeling"/>:</b>
					</td>
					<td colspan="3">
						<xsl:call-template name="linebreaks">
							<xsl:with-param name="string" select="opmerking"/>
						</xsl:call-template>
					</td>
				</tr>
				<tr height="40px">
				<td colspan="4">
					<hr/>
				</td>
			</tr>
		</table>
	</xsl:template>

	<xsl:template match="opdracht" mode="include">
		<table border="0" width="100%" cellpadding="2">
			<tr>
				<td colspan="4" class="caption" style="padding-top:5px;padding-bottom:20px">
					<b>
						<xsl:value-of select="opdrachttype/omschrijving"/>&#160;
						<xsl:value-of select="melding/stdmelding/discipline/srtdiscipline/prefix"/>
						<xsl:value-of select="melding/key"/>/<xsl:value-of select="bedrijfopdr_volgnr"/></b>
				</td>
			</tr>
			<tr>
				<td width="16%"/>
				<td width="34%"/>
				<td width="16%" align="right">
					<b><xsl:value-of select="//lcl/FAC/bedrijf"/>:</b>
				</td>
				<td width="34%">
					<xsl:value-of select="uitvoerende/bedrijf/naam"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/contactpersoon"/>:</b>
				</td>
				<td>
					<xsl:value-of select="contactpersoon/naam_full"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
				</td>
				<td>
					<xsl:value-of select="contactpersoon/telefoon1"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/adres"/>:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/post_adres"/>
				</td>
			</tr>		
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/plaats"/>:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/post_plaats"/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<b>Sutfene</b>
				</td>
				<td>
				</td>
			</tr>				
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/contactpersoon"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="backoffice_contact/naam_full"/>
				</td>
				<td colspan="2"/>
			</tr>
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="backoffice_contact/telefoonnr"/>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/kostenplaats"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="kostenplaats/nr"/>
				</td>
			</tr>
			<xsl:if test="melding/kenmerk[@naam='Ordernr']!=''">
				<tr>
					<td colspan="2"/>
					<td align="right">
						<b><xsl:value-of select="//lcl/MLD/ordernr"/>:</b>
					</td>
					<td align="left">
						<xsl:value-of select="melding/kenmerk[@naam='Ordernr']"/>
					</td>
				</tr>
			</xsl:if>
			<tr>
				<td align="right">
					<b>Adres:</b>
				</td>
				<td align="left">
					<xsl:value-of select="melding/plaats/regio/district/locatie/omschrijving"/>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/datum_gereed"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="datumgereed/datum"/>
				</td>
			</tr>
			<tr>
				<td align="right">				
				</td>
				<td align="left">
					<xsl:value-of select="melding/plaats/regio/district/locatie/adres"/>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/datum_verzonden"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="datumverzonden/datum"/>
				</td>
			</tr>
			<tr>
				<td align="right">				
				</td>
				<td align="left">
					<xsl:value-of select="melding/plaats/regio/district/locatie/postcode"/>&#xA0;&#xA0;<xsl:value-of select="melding/plaats/regio/district/locatie/plaats"/>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/status"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="status"/>
				</td>
			</tr>
			<tr height="10px">
			</tr>
			<tr>
				<td align="right" valign="top">
					<b><xsl:value-of select="//lcl/FAC/omschrijving"/>:</b>
				</td>
				<td align="left" colspan="3">
					<xsl:call-template name="linebreaks">
						<xsl:with-param name="string" select="omschrijving"/>
					</xsl:call-template>
				</td>
			</tr>
			<tr height="10px">
			</tr>
			<tr>
				<td colspan="4" align="right">
                <b>S.v.p. een opdrachtbevestiging sturen naar: facilitair@sutfene.nl</b> 
				</td>	
			</tr>
			<tr height="10px">
			<td colspan="4">
			<hr/>
			</td>
			</tr>
			<tr>
				<td colspan="4" align="center">
					<table width="99%" style="background-color:#EEEEEE;border: 1px solid blue">
						<tr>
							<td>
										<table border="0" width="100%" cellpadding="2">
			<tr>
				<td colspan="2" style="padding-top:10px">
					<b><xsl:value-of select="//lcl/MLD/melding"/>&#160;<xsl:value-of select="melding/discipline/srtdiscipline/prefix"/><xsl:value-of select="melding/key"/></b>
				</td>
			    <tr>
				    <td colspan="2"> <b>Medewerker facilitair servicepunt: </b>&#xA0;<xsl:value-of select="melding/tracking/track[code='MLDNEW']/user/naam_full"/>
				</td>				
				</tr>
				<td colspan="2" class="caption" style="padding-top:20px;padding-bottom:20px">
					<xsl:if test="spoed&lt;3">
						<b><xsl:value-of select="//lcl/MLD/spoed"/></b>
					</xsl:if>
				</td>
			</tr>
			<tr height="40px">
				<td colspan="4">
					<hr/>
				</td>
			</tr>
			<tr>
				<td align="right" width="16%">
					<b><xsl:value-of select="//lcl/FAC/aanvrager"/>:</b>
				</td>
				<td align="left" width="34%">
					<xsl:value-of select="melding/voor/naam_full"/>
				</td>
				<td align="right" width="16%">
					<b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
				</td>
				<td align="left" width="34%">
					<xsl:if test="melding/voor/telefoonnr=''">-</xsl:if>
					<xsl:value-of select="melding/voor/telefoonnr"/>
				</td>
			</tr>
			<xsl:if test="string(melding/voor/naam_full)!=string(melding/voor/naam_full)">
													<tr>
								<td align="right" width="16%"><b><xsl:value-of select="//lcl/MLD/meldingvoor"/>:</b></td>
								<td align="left" width="34%"><xsl:value-of select="melding/voor/naam_full"/></td>
							</tr>
						</xsl:if>
			<tr>
				<td align="right" valign="top">
					<b><xsl:value-of select="//lcl/FAC/afdeling"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="melding/voor/afdeling/omschrijving"/>
				</td>
			</tr>
			<xsl:if test="melding/kenmerk/@naam='Afdelingsmedewerker'">
			<tr>
			    <td align="right" valign="top">
			    <b>Afdelingsmedewerker:</b>
			    </td>
	            <td align="left">
					<xsl:value-of select="melding/kenmerk[@naam='Afdelingsmedewerker']"/>
			    </td>        
			</tr>
			</xsl:if>
			<tr>
				<td colspan="2"/>
			</tr>
			<tr height="40px">
				<td colspan="4">
					<hr/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/locatie"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="melding/plaats/regio/district/locatie/code"/>&#xA0;
					<xsl:if test="melding/plaats/regio/district/locatie/omschrijving!=''">(<xsl:value-of select="melding/plaats/regio/district/locatie/omschrijving"/>)</xsl:if>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/melddatum"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="melding/gemeld/datum"/>&#xA0;
					<xsl:value-of select="melding/gemeld/tijd"/>
				</td>
			</tr>
			<tr>
				<xsl:choose>
					<xsl:when test="melding/plaats/@type='T'">
						<td align="right">
							<b><xsl:value-of select="//lcl/FAC/terrein"/>:</b>
						</td>
						<td align="left">
							<xsl:value-of select="melding/plaats/regio/district/locatie/terrein/code"/>-<xsl:value-of select="melding/plaats/regio/district/locatie/terrein/naam"/></td>
					</xsl:when>
					<xsl:otherwise>
						<td align="right">
							<b>Afdeling:</b>
						</td>
						<td align="left">
							<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/code"/>-<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/naam"/></td>
					</xsl:otherwise>
				</xsl:choose>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/ordernr"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="melding/kenmerk[@naam='Ordernr']"/>
				</td>
			</tr>
			<tr>
				<xsl:if test="melding/plaats/@type='T' or plaats/@type='G'">
					<td colspan="2"/>
				</xsl:if>
				<xsl:if test="melding/plaats/@type!='T' and plaats/@type!='G'">
					<td align="right">
						<b>Verdieping:</b>
					</td>
					<td align="left">
						<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/code"/>&#xA0;
						<xsl:if test="melding/plaats/regio/district/locatie/gebouw/verdieping/omschrijving!=''">(<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/omschrijving"/>)</xsl:if>
					</td>
				</xsl:if>
			</tr>
			<tr>
				<xsl:if test="melding/plaats/@type='R'">
					<td align="right" valign="top">
						<b><xsl:value-of select="//lcl/FAC/ruimte"/>:</b>
					</td>
					<td align="left">
						<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/nr"/>&#xA0;
						<xsl:if test="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving!=''">(<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/verdieping/ruimte/omschrijving"/>)</xsl:if>
					</td>
				</xsl:if>
				<xsl:if test="melding/plaats/@type!='R'">
					<td colspan="2"/>
				</xsl:if>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/status"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="melding/status"/>
				</td>
			</tr>
		
			<xsl:for-each select="melding/kenmerk[@type!='L' and @type!='Q' and @naam!='Afdelingsmedewerker']">
				<xsl:sort select="@volgnummer" data-type="number"/>
				<xsl:if test=".!=''">
					<tr>
						<td align="right">
							<b>
								<xsl:value-of select="@naam"/>:</b>
						</td>
						<td colspan="3">
							<xsl:value-of select="."/>
						</td>
					</tr>
				</xsl:if>
			</xsl:for-each>
			<xsl:if test="count(melding/deel)&gt;0">
				<xsl:for-each select="melding/deel">
					<xsl:sort select="melding/omschrijving"/>
					<tr>
						<xsl:choose>
							<xsl:when test="position()=1">
								<td align="right" valign="top">
									<b><xsl:value-of select="//lcl/MLD/objecten"/>:</b>
								</td>
							</xsl:when>
							<xsl:otherwise>
								<td/>
							</xsl:otherwise>
						</xsl:choose>
						<td align="left" valign="top">
							<xsl:value-of select="melding/omschrijving"/>
						</td>
						<td colspan="2" valign="top">
							<xsl:comment>NADER TE DEFINIEREN</xsl:comment>
						</td>
					</tr>
				</xsl:for-each>
			</xsl:if>
				<tr height="40px">
				    <td colspan="4">
					    <hr/>
				</td>
			    </tr>
			    <tr>
					<td align="right">
						<b>Behandelaar:</b>
					</td>
					<td>
						<xsl:value-of select="melding/behandelaar/naam_full"/>				    
					</td>
				</tr>
				<tr>
					<td align="right" valign="top">
						<b><xsl:value-of select="//lcl/MLD/afhandeling"/>:</b>
					</td>
					<td colspan="3">
						<xsl:call-template name="linebreaks">
							<xsl:with-param name="string" select="opmerking"/>
						</xsl:call-template>
					</td>
				</tr>
				<tr>
				<td colspan="4">
					<hr/>
				</td>
			</tr>
		</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>			
		</table>
	</xsl:template>	

    <xsl:template name="rsv_ruimte">
        <xsl:param name="min_volgnr"/>
        <tr>
          <xsl:choose>
            <xsl:when test="res_ruimte!=''">
              <td class="tekstkop" colspan="10" frame="box" style="border-style:solid;border-width:0px;">
                <br/><xsl:value-of select="van/datum"/>&#xA0;<xsl:if test="dirtlevel!='0'"><span class="fatal"><xsl:value-of select="//lcl/RES/ongeldig"/></span>&#xA0;</xsl:if><xsl:value-of select="//lcl/RES/deelreservering"/>  <xsl:value-of select="volgnr"/>&#xA0;
                <xsl:if test="string(res_activiteit/omschrijving)!=''">(<xsl:value-of select="res_activiteit/omschrijving"/>)&#xA0;</xsl:if>
                <xsl:value-of select="res_ruimte/plaats/regio/district/locatie/omschrijving"/>
    
              </td>
            </xsl:when>
            <!-- "roomservice" -->
            <xsl:otherwise>
              <td class="tekstkop" colspan="10" frame="box" style="border-style:solid;border-width:0px;">
                <br/><xsl:value-of select="van/datum"/><xsl:if test="string(van/datum)!=string(tot/datum)">&#xA0;-&#xA0;<xsl:value-of select="tot/datum"/></xsl:if>&#xA0;<xsl:if test="dirtlevel!='0'"><span class="fatal"><xsl:value-of select="//lcl/RES/ongeldig"/></span>&#xA0;</xsl:if><xsl:value-of select="//lcl/RES/deelreservering"/>  <xsl:value-of select="volgnr"/>&#xA0;
                <xsl:value-of select="plaats/plaatsaanduiding"/>
              </td>
            </xsl:otherwise>
          </xsl:choose>
        </tr>
        <xsl:if test="string(omschrijving)!=string(//reservering/rsv_ruimte[volgnr=$min_volgnr]/omschrijving)">
          <tr>
            <td class="label" frame="box" style="border-style:solid;border-width:0px;">- <xsl:value-of select="//lcl/FAC/omschrijving"/>:</td>
            <td class="value" colspan="9" frame="box" style="border-style:solid;border-width:0px;">
              <xsl:value-of select="omschrijving"/>
            </td>
          </tr>
        </xsl:if>
        <xsl:if test="string(opmerking)!=string(//reservering/rsv_ruimte[volgnr=$min_volgnr]/opmerking)">
          <tr>
            <td class="label" frame="box" style="border-style:solid;border-width:0px;">- <xsl:value-of select="//lcl/FAC/opmerking"/>:</td>
            <td class="value" colspan="9" frame="box" style="border-style:solid;border-width:0px;">
              <xsl:call-template name="linebreaks">
                <xsl:with-param name="string" select="opmerking"/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:if>
        <xsl:if test="string(contact_user/naam_full)!=string(//reservering/rsv_ruimte[volgnr=$min_volgnr]/contact_user/naam_full)">
          <tr>
            <td class="label" frame="box" style="border-style:solid;border-width:0px;">- <xsl:value-of select="//lcl/FAC/aanvrager"/>:</td>
            <td class="value" colspan="9" frame="box" style="border-style:solid;border-width:0px;">
              <xsl:value-of select="contact_user/naam_full"/>/ <xsl:value-of select="contact_user/werkplek/plaats/regio/district/locatie/omschrijving"/></td>
          </tr>
        </xsl:if>
        <xsl:if test="string(host_user/naam_full)!=string(//reservering/rsv_ruimte[volgnr=$min_volgnr]/host_user/naam_full)">
          <tr>
            <td class="label" frame="box" style="border-style:solid;border-width:0px;">- <xsl:value-of select="//lcl/RES/gastheer_vrouw"/>:</td>
            <td class="value" colspan="9" frame="box" style="border-style:solid;border-width:0px;">
              <xsl:value-of select="host_user/naam_full"/>
            </td>
          </tr>
        </xsl:if>
        <xsl:if test="string(kostenplaats/nr)!=string(//reservering/rsv_ruimte[volgnr=$min_volgnr]/kostenplaats/nr)">
          <tr>
            <td class="label" frame="box" style="border-style:solid;border-width:0px;">- <xsl:value-of select="//lcl/FAC/kostenplaats"/>:</td>
            <td class="value" colspan="9" frame="box" style="border-style:solid;border-width:0px;">
              <xsl:value-of select="kostenplaats/nr"/>&#xA0;<xsl:value-of select="kostenplaats/omschrijving"/></td>
          </tr>
        </xsl:if>
        
        <xsl:if test="res_ruimte!=''">
          <xsl:apply-templates select="res_ruimte" mode="zaalinfo"/>
        </xsl:if>
        <tr>
          <th width="25%" align="left"><xsl:value-of select="//lcl/FAC/omschrijving"/></th>
          <th width="10%" align="left"><xsl:value-of select="//lcl/RES/aantal"/></th>
          <th width="20%" style="text-align:right"><xsl:value-of select="//lcl/RES/prijs"/> excl. BTW</th>
          <th width="10%" style="text-align:right">BTW</th>
          <th width="15%" style="text-align:right"><xsl:value-of select="//lcl/RES/prijs"/></th>
          <th width="10%" style="text-align:right"><xsl:value-of select="//lcl/RES/begintijd"/></th>
          <th width="10%" style="text-align:right"><xsl:value-of select="//lcl/RES/eindtijd"/></th>
        </tr>
        <xsl:if test="res_ruimte!=''">
          <tr>
            <td class="result" style="text-align:left"><xsl:if test="dirtlevel!='0'"><span class="fatal"><xsl:value-of select="//lcl/RES/ongeldig"/></span>&#xA0;</xsl:if>
              <xsl:value-of select="res_ruimte/nr"/>
              <br/>(max. <xsl:value-of select="res_ruimte/bezoekers"/> <xsl:value-of select="//lcl/FAC/personen"/>)</td>
            <td class="result" style="text-align:left">
              <xsl:value-of select="bezoekers"/>&#xA0;<xsl:value-of select="//lcl/FAC/personen"/></td>
            <td class="result" style="text-align:right">
              <xsl:call-template name="europrijs">
                <xsl:with-param name="prijs" select="prijs * (100 div 121)"/>
              </xsl:call-template>
            </td>
            <td class="result" style="text-align:right">
              21%
            </td>
            <td class="result" style="text-align:right">
              <xsl:call-template name="europrijs">
                <xsl:with-param name="prijs" select="prijs"/>
              </xsl:call-template>
            </td>
            <!--<td class="result" style="text-align:right">
              <xsl:value-of select="van/datum"/>
            </td>-->
            <td class="result" style="text-align:right">
              <xsl:value-of select="van/tijd"/>
            </td>
            <td class="result" style="text-align:right">
              <xsl:value-of select="tot/tijd"/>
            </td>
          </tr>
        </xsl:if>
        <!-- rsv_deel-lijst gesorteerd op van-tijd -->
        <xsl:for-each select="rsv_deel">
          <xsl:sort select="van/tijd"/>
          <tr>
            <td class="result"><xsl:if test="dirtlevel!='0'"><span class="fatal"><xsl:value-of select="//lcl/RES/ongeldig"/></span>&#xA0;</xsl:if>
              <xsl:value-of select="res_deel/deel/omschrijving"/>
            </td>
            <td class="result">
              <xsl:value-of select="aantal"/>
            </td>
            <td class="result" style="text-align:right">
              <xsl:call-template name="europrijs">
                <xsl:with-param name="prijs" select="prijs * (100 div 121)"/>
              </xsl:call-template>
            </td>
            <td class="result" style="text-align:right">
              21%
            </td>
            <td class="result" style="text-align:right">
              <xsl:call-template name="europrijs">
                <xsl:with-param name="prijs" select="prijs"/>
              </xsl:call-template>
            </td>
            <!--<td class="result" style="text-align:right">
              <xsl:value-of select="van/datum"/>
            </td>-->
            <td class="result" style="text-align:right">
              <xsl:value-of select="van/tijd"/>
            </td>
            <td class="result" style="text-align:right">
              <xsl:value-of select="tot/tijd"/>
            </td>
          </tr>
        </xsl:for-each>
        <!-- rsv_artikel-lijst gesorteerd op van-tijd -->
        <xsl:for-each select="rsv_artikel">
          <xsl:sort select="levering/tijd"/>
          <tr>
            <td class="result">
              <xsl:value-of select="res_artikel/omschrijving"/>
            </td>
            <td class="result">
              <xsl:value-of select="aantal"/>
            </td>
            <td class="result" style="text-align:right">
              <xsl:call-template name="europrijs">
                <xsl:with-param name="prijs" select="prijs * (100 div (100 + res_artikel/btw))"/>
              </xsl:call-template>
            </td>
            <td class="result" style="text-align:right">
              <xsl:value-of select="res_artikel/btw"/>%
            </td>
            <td class="result" style="text-align:right">
              <xsl:call-template name="europrijs">
                <xsl:with-param name="prijs" select="prijs"/>
              </xsl:call-template>
            </td>
            <!--<td class="result" style="text-align:right">
              <xsl:value-of select="levering/datum"/>
            </td>-->
            <td class="result" style="text-align:right">
              <xsl:value-of select="levering/tijd"/>
            </td>
          </tr>
        </xsl:for-each>
        <!-- totaal per deelreservering -->
        
        
        <xsl:variable name="ruimte_ex_btw">
            <xsl:value-of select="(100 div 121) * sum(prijs[string(number(.))!='NaN'])"/>
        </xsl:variable>
        
        <xsl:variable name="objecten_ex_btw">
            <xsl:value-of select="(100 div 121) * sum(rsv_deel/prijs[string(number(.))!='NaN'])"/>
        </xsl:variable>
        
        <xsl:variable name="l_catering">
    			<xsl:for-each select="rsv_artikel">
    				<xsl:copy-of select="."/>
    			</xsl:for-each>
    		</xsl:variable>
        <xsl:variable name="catering_ex_btw">
            <xsl:call-template name="sumProducts">
                <xsl:with-param name="pList" select="msxml:node-set($l_catering)/rsv_artikel[*]"/>
            </xsl:call-template>
        </xsl:variable>
        
        
        <tr>
          <td class="tekst" colspan="2" style="border-style:solid;border-width:0px;"><xsl:value-of select="//lcl/RES/totaal_deelreservering"/></td>
          <td class="tekst" style="text-align:right;border-style:solid;border-width:0px;">
              <b>
                <xsl:call-template name="europrijs">
                   <xsl:with-param name="prijs" select="$ruimte_ex_btw + $objecten_ex_btw + $catering_ex_btw"/>
                 </xsl:call-template>
              </b>
          </td>
          <td class="tekst" style="border-style:solid;border-width:0px;"></td>
          <td class="tekst" style="text-align:right;border-style:solid;border-width:0px;">
              <b>
                 <xsl:call-template name="europrijs">
                   <xsl:with-param name="prijs" select="sum(prijs[string(number(.))!='NaN'])+sum(rsv_deel/prijs[string(number(.))!='NaN'])+sum(rsv_artikel/prijs[string(number(.))!='NaN'])"/>
                 </xsl:call-template>
              </b>
          </td>      
        </tr>
        <!-- afspraak-lijst gesorteerd op naam -->
        <xsl:for-each select="afspraak/bezoeker">
          <xsl:sort select="naam"/>
          <xsl:choose>
            <xsl:when test="position() = 1">
              <tr>
                <td class="tekst" style="border-style:solid;border-width:0px;">
                  <br/><xsl:value-of select="//lcl/BEZ/bezoekers"/></td>
              </tr>
              <tr>
                <th><xsl:value-of select="//lcl/FAC/naam"/></th>
                <th colspan="3"><xsl:value-of select="//lcl/FAC/bedrijf"/></th>
                <th colspan="3"><xsl:value-of select="//lcl/BEZ/parkeerplaats"/></th>
              </tr>
            </xsl:when>
          </xsl:choose>
          <tr>
            <td class="result">
              <xsl:value-of select="naam"/>
            </td>
            <td class="result" colspan="3">
              <xsl:value-of select="bedrijf"/>
            </td>
            <td class="result" colspan="4">
              <xsl:value-of select="deel/omschrijving"/>
            </td>
          </tr>
        </xsl:for-each>
    
        <!-- kenmerk -->
        <xsl:if test="kenmerk">
        <tr>
        <td colspan="5">
        <table>
          <xsl:for-each select="kenmerk[@type!='L' and @type!='Q' and count(@xmlnode)=0]">
            <xsl:sort select="@volgnummer" data-type="number"/>
            <xsl:if test=".!=''">
              <tr>
                <td class="label">
                  <xsl:value-of select="@naam"/></td>
                <td class="value">
                  : <xsl:value-of select="."/>
                </td>
              </tr>
            </xsl:if>
          </xsl:for-each>
        </table>
        </td>
        </tr>
        </xsl:if>
        
    </xsl:template>
    
  <xsl:template match="reservering" mode="include">
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
      <TR>
        <TD WIDTH="40" ROWSPAN="30" ID="LINKERMARGE"/>
        <TD>
          <xsl:choose>
             <xsl:when test="$srtnotificatiecode='RESDEL' and verwijder">
              <table>
                <tr>
                  <td height="20"/>
                </tr>
                <tr>
                  <td class="caption" style="color: red"><xsl:value-of select="//lcl/RES/annulering"/></td>
                </tr>
              </table>
            </xsl:when>
          </xsl:choose>
            <!-- Bevestiging reservering -->
            <!-- Ook tonen voor verwijderde reserveringen -->

            <!-- De algemene gegevens van de deelreservering met het laagste volgnummer worden gebruikt als referentie gegevens! -->
            <xsl:variable name="min_volgnr">
              <xsl:value-of select="//reservering/rsv_ruimte/volgnr[not(. &gt; //reservering/rsv_ruimte/volgnr)]"/>
            </xsl:variable>

            <table border="0" bordercolor="#ffffff" width="100%">
              <tr>
                <td style="font-size:18pt;padding-top:20px;padding-bottom:20px" valign="top" colspan="2">
                  <xsl:choose>
                    <xsl:when test="@content='complete'"><xsl:value-of select="//lcl/RES/reservering"/>&#xA0;<xsl:value-of select="key"/>&#xA0;</xsl:when>
                    <xsl:otherwise><xsl:value-of select="//lcl/RES/deelreservering"/>&#xA0;<xsl:value-of select="key"/> / <xsl:value-of select="$min_volgnr"/>&#xA0;</xsl:otherwise>
                  </xsl:choose>
                  <xsl:if test="string(rsv_ruimte[volgnr=$min_volgnr]/omschrijving)!=''">(<xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/omschrijving"/>)</xsl:if>&#xA0;</td>
              </tr>
              <tr>
                <td width="20%" class="label"><xsl:value-of select="//lcl/FAC/aanvrager"/></td>
                <td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/naam_full"/></td>
              </tr>
              <tr>
                <td width="20%" class="label"><xsl:value-of select="//lcl/FAC/e-mail"/></td>
                <td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/email"/></td>
              </tr>
              <tr>
                <td width="20%" class="label"><xsl:value-of select="//lcl/FAC/locatie"/></td>
                <td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/werkplek/plaats/regio/district/locatie/omschrijving"/></td>
              </tr>
              <tr>
                <td width="20%" class="label"><xsl:value-of select="//lcl/FAC/afdeling"/></td>
                <td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/afdeling/omschrijving"/></td>
              </tr>
              <tr>
                <td width="20%" class="label"><xsl:value-of select="//lcl/RES/gastheer_vrouw"/></td>
                <td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/host_user/naam_full"/></td>
              </tr>
              <tr>
                <td width="20%" class="label"><xsl:value-of select="//lcl/FAC/kostenplaats"/></td>
                <td width="80%" class="value">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/kostenplaats/nr"/>&#xA0;
                  <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/kostenplaats/omschrijving"/>
                </td>
              </tr>
             <xsl:if test="$srtnotificatiecode='RESDEL'">
              <tr>
                <td width="20%" class="label"><xsl:value-of select="//lcl/RES/begintijd"/></td>
                <td width="80%" class="value">: <xsl:value-of select="rsv_ruimte/van/datum"/>&#xA0;<xsl:value-of select="rsv_ruimte/van/tijd"/></td>
              </tr>
             </xsl:if>
              <tr>
                <td height="20px"/>
              </tr>
              <xsl:if test="rsv_ruimte[volgnr=$min_volgnr]/contact_user/key!=ingevoerd_user/key">
                <tr>
                  <td width="20%" class="label"><xsl:value-of select="//lcl/RES/behandeld_door"/></td>
                  <td width="80%" class="value">: <xsl:value-of select="ingevoerd_user/naam_full"/></td>
                </tr>
                <tr>
                  <td height="20px"/>
                </tr>
              </xsl:if>
              <tr>
                <td colspan="2" class="tekst">
                  <xsl:choose>
                    <xsl:when test="$srtnotificatiecode='RESNEW'"/>
                    <xsl:when test="$srtnotificatiecode='RESDEL'"><xsl:value-of select="//lcl/RES/reservering_vervallen"/></xsl:when>
                    <xsl:otherwise>
                      <xsl:call-template name="res_begintext"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </td>
              </tr>
                    <xsl:choose>
                        <xsl:when test="$srtnotificatiecode!='RESDEL'">
              <tr>
                <td class="tekstkop" colspan="2" style="text-decoration:underline"><xsl:value-of select="//lcl/RES/reserveringsgegevens"/></td>
              </tr>
              <tr>
                <td height="5px"/>
              </tr>
              <xsl:if test="string(rsv_ruimte[volgnr=$min_volgnr]/opmerking)!=''">
                <tr>
                  <td colspan="2" class="label"><xsl:value-of select="//lcl/FAC/opmerking"/></td>
                </tr>
                <tr>
                  <td colspan="2" class="value">
                    <xsl:call-template name="linebreaks">
                      <xsl:with-param name="string" select="rsv_ruimte[volgnr=$min_volgnr]/opmerking"/>
                    </xsl:call-template>
                  </td>
                </tr>
                <tr>
                  <td height="5px"/>
                </tr>
              </xsl:if>
              <tr>
                <td colspan="2">
                  <table cellpadding="0" cellspacing="0" border="1" bordercolor="#000000" frame="box">
                    <!-- rsv_ruimte -->
                    <xsl:for-each select="rsv_ruimte">
                      <xsl:sort select="van/timestamp"/>
                      <xsl:call-template name="rsv_ruimte">
                        <xsl:with-param name="min_volgnr" select="$min_volgnr"/>
                      </xsl:call-template>
                    </xsl:for-each>
                    <!-- totaal reservering -->
                    <tr>
                      <td height="10px" style="border-style:solid;border-width:0px;"/>
                    </tr>
                    <tr>
                      <td class="tekstkop" align="right" colspan="2" style="border-width:0px;"><xsl:value-of select="//lcl/RES/totaalprijs_reservering"/>:</td>
                      <td class="tekstkop" style="text-align:right;border-width:0px;">
                                              <xsl:call-template name="europrijs">
                                                  <xsl:with-param name="prijs" select="sum(rsv_ruimte/prijs[string(number(.))!='NaN'])+sum(rsv_ruimte/rsv_deel/prijs[string(number(.))!='NaN'])+sum(rsv_ruimte/rsv_artikel/prijs[string(number(.))!='NaN'])"/>
                                              </xsl:call-template>
                      </td>
                    </tr>
                  </table>
                </td>
              </tr>
              <xsl:call-template name="res_endtext">
                <xsl:with-param name="min_volgnr" select="$min_volgnr"/>
              </xsl:call-template>
                </xsl:when>
              </xsl:choose>
            </table>
            <!-- Bevestiging reservering -->
        </TD>
        <TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
      </TR>
    </TABLE>
  </xsl:template>    


    <xsl:template name="sumProducts">
        <xsl:param name="pList"/>
        <xsl:param name="pResult" select="0"/>
        <xsl:choose>
          <xsl:when test="$pList">
            <xsl:variable name="vHead" select="$pList[1]"/>
            <xsl:call-template name="sumProducts">
              <xsl:with-param name="pList" select="$pList[position() > 1]"/>
              <xsl:with-param name="pResult"
               select="$pResult + $vHead/prijs * (100 div (100 + $vHead/res_artikel/btw))"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$pResult"/>
          </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

    <xsl:template match="res_ruimte" mode="zaalinfo">
          <tr height='10'/>
          <tr>
            <td class="label">
                <u><xsl:value-of select="//lcl//FAC/locatie"/></u>
            </td>
            <td colspan='4' class="value">
            <xsl:value-of select="plaats/regio/district/locatie/adres"/>
            </td>
            <td colspan='2' rowspan='4' class="label" style="text-align:right">
              <xsl:if test="plaats/regio/district/locatie/gebouw/verdieping/ruimte/kenmerk[@type='X' and @key='1000'] != ''">
                  <xsl:element name="img">
                    <xsl:attribute name="src">https://<xsl:value-of select="$FacilitorRoot"/>/cust/<xsl:value-of select="//header/custId"/><xsl:value-of select="plaats/regio/district/locatie/gebouw/verdieping/ruimte/kenmerk[@type='X' and @key='1000']"/></xsl:attribute>
                    <xsl:attribute name="height">80px</xsl:attribute>
                  </xsl:element>
              </xsl:if>
            </td>
          </tr>
          <tr>
            <td class="label"> </td>
            <td colspan='5' class="value">
               <xsl:value-of select="plaats/regio/district/locatie/postcode"/>&#160;&#160;<xsl:value-of select="plaats/regio/district/locatie/plaats"/>
            </td>
          </tr>
          <tr>
            <td class="label">
                <u><xsl:value-of select="//lcl//FAC/ruimte"/></u>
            </td>
            <td colspan='5' class="value">
               <xsl:value-of select="nr"/>
            </td>            
          </tr>
          <tr>
            <td class="label">
                <u><xsl:value-of select="//lcl//RES/opstelling"/></u>
            </td>
            <td colspan='6' class="value">
            <xsl:value-of select="opstelling"/>
            </td>
            
          </tr>
          <tr>
            <td height='50' colspan='7' style="text-align:left;font-size:8pt">
            <xsl:value-of select="omschrijving"/>
            </td>   
          </tr>
    </xsl:template>
    
    <xsl:template name="PageBreak">
        <div style="page-break-before:always">&#160;</div>    
    </xsl:template>
    
    <xsl:template name="res_endtext">
    
        <xsl:variable name="ruimte_ex_btw">
            <xsl:value-of select="(100 div 121) * sum(rsv_ruimte/prijs[string(number(.))!='NaN'])"/>
        </xsl:variable>
        
             
        <xsl:variable name="objecten_ex_btw">
            <xsl:value-of select="(100 div 121) * sum(rsv_ruimte/rsv_deel/prijs[string(number(.))!='NaN'])"/>
        </xsl:variable>
               
        <xsl:variable name="l_catering">
    			<xsl:for-each select="rsv_ruimte/rsv_artikel">
    				<xsl:copy-of select="."/>
    			</xsl:for-each>
    		</xsl:variable>
        
        <xsl:variable name="catering_ex_btw">
            <xsl:call-template name="sumProducts">
                <xsl:with-param name="pList" select="msxml:node-set($l_catering)/rsv_artikel[*]"/>
            </xsl:call-template>
        </xsl:variable>
           
    
        <xsl:if test="@content='complete'">
            <tr>
              <td class="label" colspan="2" style="font-size:8pt;text-align:left; border-width:0px;">
              (
              <xsl:value-of select="//lcl/RES/totaalprijs_reservering"/> excl. BTW:
              <xsl:call-template name="europrijs">
               <xsl:with-param name="prijs" select="$ruimte_ex_btw + $objecten_ex_btw + $catering_ex_btw"/>
              </xsl:call-template>
              )                
              </td>
            </tr>
        </xsl:if>
    </xsl:template>      
    
  <xsl:template match="bestelopdracht" mode="include">
    <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
      <TR>
        <TD WIDTH="40" ROWSPAN="30" ID="LINKERMARGE"></TD>
        <TD>
          <!-- Bestelopdracht -->
          <table border="0" bordercolor="#ffffff" width="100%">
            <tr>
              <td colspan="5" class="caption" style="text-align:center">
                <b><xsl:value-of select="//lcl/BES/inkooporder"/></b>
              </td>
            </tr>
            <tr>
              <td colspan="5" style="height:30"/>
            </tr>
            <tr>
              <td colspan="2" style="width:47%">
                <b><xsl:value-of select="//lcl/BES/factuur_aan"/>:</b>
              </td>
              <td style="width:6%"></td>
              <td colspan="2" style="width:47%">
                <b><xsl:value-of select="//lcl/BES/leverancier"/>:</b>
              </td>
            </tr>
            <tr>
              <td colspan="2">
                <xsl:value-of select="factuuradres/naam"/>
                <br/>
                <xsl:value-of select="factuuradres/post_adres"/>
                <br/>
                <xsl:value-of select="factuuradres/post_postcode"/>&#xA0;
                <xsl:value-of select="factuuradres/post_plaats"/>
                <br/>
                <xsl:value-of select="factuuradres/post_land"/>
              </td>
              <td/>
              <td colspan="2">
                <xsl:value-of select="bedrijf/naam"/>
                <br/>
                <xsl:value-of select="bedrijf/post_adres"/>
                <br/>
                <xsl:value-of select="bedrijf/post_postcode"/>&#xA0;
                <xsl:value-of select="bedrijf/post_plaats"/>
                <br/>
                <xsl:value-of select="bedrijf/post_land"/>
              </td>
            </tr>
            <tr>
              <td colspan="5" style="height:20"/>
            </tr>
            <tr>
              <td colspan="2">
                <b><xsl:value-of select="//lcl/FAC/contactgegevens"/>:</b>
              </td>
              <td/>
              <td colspan="2">
                <b/>
              </td>
            </tr>
            <tr>
              <td colspan="2" style="vertical-align:top">
                <b><xsl:value-of select="//lcl/BES/besteller"/>: </b>
                <xsl:value-of select="bestelling/aanvrager/naam_full"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/e-mail"/>: </b>
                <xsl:value-of select="bestelling/aanvrager/email"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/telefoon"/>: </b>
                <xsl:value-of select="bestelling/aanvrager/telefoonnr"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/kostenplaats"/>: </b>
                <xsl:value-of select="bestelling/kostenplaats/nr"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/werkplek"/>: </b>
                <xsl:value-of select="bestelling/plaats"/>
              </td>
              <td/>
              <td colspan="2" style="vertical-align:top">
                <b><xsl:value-of select="//lcl/BES/aanvraagnummers"/>: </b>
                <xsl:value-of select="bestelling/key"/>
                <br/>
                <b><xsl:value-of select="//lcl/BES/opdrachtnummer"/>: </b>
                <xsl:value-of select="id"/>
                <br/>
                <b><xsl:value-of select="//lcl/BES/orderdatum"/>: </b>
                <xsl:value-of select="datum/datum"/>
                <br/>
                  <b><xsl:value-of select="//lcl/BES/gewenste_afleverdatum"/>: </b>
                  <xsl:value-of select="bestelling/leverdatum/datum"/>
              </td>
            </tr>
            <tr>
              <td colspan="5" style="height:20"/>
            </tr>
            <tr>
              <td colspan="2">
                <b><xsl:value-of select="//lcl/BES/afleveradres"/>:</b>
              </td>
              <td/>
              <td colspan="2">
                <b/>
              </td>
            </tr>
            <tr>
              <td colspan="2" style="vertical-align:top">
                <xsl:value-of select="afleveradres/naam"/>
                <br/>
                <xsl:value-of select="afleveradres/bezoek_adres"/>
                <br/>
                <xsl:value-of select="afleveradres/bezoek_postcode"/>&#xA0;
                <xsl:value-of select="afleveradres/bezoek_plaats"/>
                <br/>
                <xsl:value-of select="afleveradres/bezoek_land"/>
              </td>
              <td/>
              <td colspan="2" style="vertical-align:top">
                <xsl:for-each select="bestelling/kenmerk[@type!='L' and @type!='l' and @type!='Q']">
                  <b>
                    <xsl:value-of select="@naam"/>: </b>
                  <xsl:value-of select="."/>
                  <br/>
                </xsl:for-each>&#xA0;</td>
            </tr>
            <tr>
              <td colspan="5" style="height:20"/>
            </tr>
            <TR>
              <TD colspan="5">
                <TABLE cellpadding="0" cellspacing="0" border="1" bordercolor="#303030" width="100%">
                  <tr>
                    <th style="width:20"><xsl:value-of select="//lcl/BES/regel"/></th>
                    <th style="width:20"><xsl:value-of select="//lcl/BES/artikelnr"/></th>
                    <th style="width:200"><xsl:value-of select="//lcl/FAC/omschrijving"/></th>
                    <th style="width:20"><xsl:value-of select="//lcl/FAC/eenheid"/></th>
                    <th style="width:20; text-align:right"><xsl:value-of select="//lcl/FAC/aantal"/></th>
                    <th style="width:20; text-align:right"><xsl:value-of select="//lcl/FAC/prijs"/></th>
                    <th style="width:20; text-align:right"><xsl:value-of select="//lcl/FAC/totaal"/></th>
                  </tr>
                  <xsl:for-each select="bestelopdrachtitem">
                    <xsl:sort select="srtdeel/omschrijving"/>
                    <xsl:sort select="posnr" data-type="number"/>
                    <tr>
                      <td class="result">
                        <xsl:value-of select="posnr"/>
                      </td>
                      <td class="result">
                        <xsl:value-of select="bestelitem/srtdeel/artikel_nummer"/>
                      </td>
                      <td class="result">
                        <xsl:value-of select="bestelitem/srtdeel/omschrijving"/>&#xA0;
                        <xsl:for-each select="bestelitem/kenmerk">
                          <br/>
                          <xsl:value-of select="@naam"/>: <xsl:value-of select="."/></xsl:for-each>
                      </td>
                      <td class="result">
                        <xsl:value-of select="bestelitem/srtdeel/eenheid"/>
                      </td>
                      <td class="result" style="text-align:right">
                        <xsl:value-of select="aantal"/>
                      </td>
                      <td class="result" style="text-align:right">
                        <xsl:value-of select="format-number(prijs, '0,00', 'european')"/>
                      </td>
                      <td class="result" style="text-align:right">
                        <xsl:value-of select="format-number(totaal, '0,00', 'european')"/>
                      </td>
                    </tr>
                  </xsl:for-each>
                  <tr>
                    <td colspan="6"/>
                    <td style="text-align:right">
                      <b>
                        <xsl:value-of select="format-number(sum(bestelopdrachtitem/totaal), '0,00', 'european')"/>
                      </b>
                    </td>
                  </tr>
                </TABLE>
              </TD>
            </TR>
            <tr>
              <td colspan="5" style="height:40"/>
            </tr>
            <tr>
              <td colspan="5" style="text-align:center; font-size:9px"><xsl:value-of select="//lcl/BES/order_disclaimer1"/>(<xsl:value-of select="id"/>)<xsl:value-of select="//lcl/BES/order_disclaimer2"/></td>
            </tr>
          </table>
        </TD>
        <TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
      </TR>
    </TABLE>
  </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\SUTF_files\reservering1449_20141013144533.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=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/><MapperBlockPosition></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->