<?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="full">
       <xsl:choose>
            <xsl:when test="$mode='summary'"></xsl:when>
       <xsl:otherwise>
		<html>
			<xsl:comment>================================ MELDINGEN ==============================</xsl:comment>
			<xsl:comment>FACILITOR default XSL template for melding</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:choose>
		         <xsl:when test="$srtnotificatiecode = 'MLDKTO'">
			         <xsl:apply-templates select="." mode="kto"/>
		         </xsl:when>
			      <xsl:otherwise>
      		      <xsl:apply-templates select="." mode="include"/>
      		   </xsl:otherwise>
            </xsl:choose>
      		<xsl:call-template name="pagefooter"/>
			</xsl:element>
		</html>
       </xsl:otherwise>
      </xsl:choose>
	</xsl:template>                

  <xsl:template match="melding" mode="include">
    <table border="0" width="100%" cellpadding="2">
    <tr>
        <td colspan="3"/>
    	<td style="text-align:right"><xsl:element name="img">
					  <xsl:attribute name="width">140px</xsl:attribute>
						<xsl:attribute name="src">../../appl/shared/barcode.asp?text=<xsl:value-of select="discipline/srtdiscipline/prefix"/><xsl:value-of select="key"/>&amp;height=50&amp;narrow=1&amp;wide=3</xsl:attribute>
					</xsl:element>
                </td>
                </tr>
      <xsl:choose>
      <!-- Met HOUT#22944 CUST01/02-noti vervallen!!!   -->
      <xsl:when test="$srtnotificatiecode='CUSTXX'">
      </xsl:when>
      <!--==============================================-->
      <!-- DEFAULT BON                                  -->
      <!--==============================================-->
      <xsl:when test="discipline/srtdiscipline/key=121">
      <tr height="30px">
        <td colspan="3"/>
      </tr>
      <tr>
      <td colspan="3">Statusmelding Facilities <xsl:value-of select="discipline/omschrijving"/></td>
      </tr>
      <tr height="20px">
        <td colspan="3"/>
      </tr>
      <tr>
        <td align="right" width="16%"><b>Status:</b></td>
        <td align="left"><b><xsl:value-of select="status"/></b></td>
      </tr>
      <tr height="20px">
        <td colspan="3"/>
      </tr>
      <tr>
        <td align="right" width="16%"><b>Nummer:</b></td>
        <td align="left"><xsl:value-of select="discipline/srtdiscipline/prefix"/><xsl:value-of select="key"/></td>
      </tr>
      <tr>
        <td align="right" width="16%"><b>Startdatum:</b></td>
        <td align="left"><xsl:value-of select="gemeld/datum"/></td>
      </tr> 
      <tr>
        <td align="right" width="16%"><b>Behandelaar:</b></td>
        <td align="left"><xsl:value-of select="behandelaar/naam_full"/></td>
      </tr>
      <tr>
        <td align="right" width="16%"><b>Betreft:</b></td>
        <td align="left"><xsl:value-of select="stdmelding/omschrijving"/></td>
      </tr>
      <tr height="20px">
        <td colspan="3"/>
      </tr>       
      <tr>
        <td align="right" width="16%"><b>Aanvrager:</b></td>
        <td align="left"><xsl:value-of select="voor/naam_full"/></td>
      </tr>
      <tr>
        <td align="right" width="16%"><b>Omschrijving:</b></td>
        <td align="left">          
            <xsl:call-template name="linebreaks">
                <xsl:with-param name="string" select="omschrijving"/>
            </xsl:call-template>
        </td>
      </tr> 
      <tr height="20px">
        <td colspan="3"/>
      </tr>
      <xsl:if test="opmerking!=''">
      <tr>
        <td align="right" width="16%"><b>Afhandeling:</b></td>
        <td align="left">          
            <xsl:call-template name="linebreaks">
                <xsl:with-param name="string" select="opmerking"/>
            </xsl:call-template>
        </td>
      </tr>
      </xsl:if>       
      <tr height="20px">
        <td colspan="3"/>
      </tr>    
        <xsl:if test="$srtnotificatiecode='MLDMAI'">
      <tr>                
        <td colspan="3">
      **********************************************************************<br/>
This communication is sent to you from Houthoff Buruma Coöperatief U.A. This e-mail and its contents
are for the use of the addressee only and may be confidential or privileged. Unauthorised use, disclosure or
copying is strictly prohibited. If you are not the addressee, please notify us immediately. Houthoff Buruma
is the trade name of Houthoff Buruma Coöperatief U.A., a Dutch law firm based in Amsterdam and registered
in the Amsterdam Chamber of Commerce as no. 34216182. Houthoff Buruma’s General Terms and
Conditions are available on request and at <a href="http://www.houthoff.com.">www.houthoff.com</a> Applying to all work performed, our General
Terms and Conditions state that our liability is limited, that Dutch law applies and that the Hague Court
has exclusive jurisdiction. Whenever we use the word "partner" in our communications, it means “partner”
as defined in our General Terms and Conditions.<br/>
**********************************************************************
</td>
</tr>
</xsl:if>                                        
      </xsl:when>
     <xsl:otherwise>
      <tr height="30px">
        <td colspan="3"/>
      </tr>
      <tr>
        <td align="left">
          <b>Facilities&#xA0;
          <xsl:value-of select="voor/werkplek/plaats/regio/district/locatie/code"/>&#xA0;
          <xsl:if test="voor/werkplek/plaats/regio/district/locatie/omschrijving!=''">(<xsl:value-of select="voor/werkplek/plaats/regio/district/locatie/omschrijving"/>)</xsl:if>
          </b>
        </td>   
      </tr>
      <tr>
        <td/>
      </tr>
      <tr>     
        <td align="right" width="16%">
          <b>Bonnummer:</b>
        </td>
        <td align="left">
 			<xsl:element name="a">
  				<xsl:attribute name="href">https://<xsl:value-of select="$FacilitorRoot"/>?<xsl:value-of select="../bookmarks/melding"/><xsl:value-of select="key"/>
 			    </xsl:attribute><b><xsl:value-of select="discipline/srtdiscipline/prefix"/><xsl:value-of select="key"/></b>
			</xsl:element>
        </td>
      </tr>
      <tr>     
        <td align="right" width="16%">
          <b>Datum:</b>
        </td>
        <td align="left">
          <b><xsl:value-of select="gemeld/datum"/>&#xA0;
          <xsl:value-of select="gemeld/tijd"/></b>
        </td>
      </tr>
      <tr>
        <td/>
      </tr> 
      <tr>     
        <td align="right" width="16%">
          <b>Behandelaar:</b>
        </td>
        <td align="left">
          <xsl:value-of select="behandelaar/naam_full"/>
        </td>
      </tr>
      <tr>
        <td colspan="4">
          <hr/>
        </td>
      </tr> 
      <tr height="20px">
        <td colspan="3"/>
      </tr>              
      <tr>  
        <td align="left">
          <b>Melding van:</b>
        </td>
        <td align="left">
          <b><xsl:value-of select="voor/naam_full"/></b>
        </td>
      </tr>
      <tr>
        <td align="left">
          <b>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>
     </tr>
     <tr>       
        <td align="right" width="16%">
          <b>Telefoon:</b>
        </td>
        <td align="left" width="34%">
          <xsl:if test="voor/telefoonnr=''">-</xsl:if>
          <xsl:value-of select="voor/telefoonnr"/>
        </td>
      </tr>
      <tr>
        <td/>
      </tr>
      <tr>
        <td/>
      </tr>
      <tr>       
        <td align="left">
          <b>Vakgroep:</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>Melding:</b>
        </td>
        <td align="left">
          <xsl:if test="stdmelding/omschrijving=''">-</xsl:if>
          <xsl:value-of select="stdmelding/omschrijving"/>
        </td>       
      </tr> 
      <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>Betreft:</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="30px">
        <td colspan="3"/>
      </tr>         
      <tr>
        <td align="right">
          <b>Uiterlijk gereed/geleverd:</b>
        </td>
        <td align="left">
          <xsl:value-of select="uitvoertijd"/><xsl:choose><xsl:when test="uitvoertijd[@eenheid='U']">&#160;<xsl:value-of select="//lcl/MLD/uren"/></xsl:when><xsl:otherwise>&#160;<xsl:value-of select="//lcl/FAC/dagen"/></xsl:otherwise></xsl:choose>&#xA0;(<xsl:value-of select="datum_gepland/datum"/>)</td>
      </tr>
      <tr height="30px">
        <td colspan="3"/>
      </tr>      
      <tr>
        <td align="left" colspan="3">
          <xsl:call-template name="linebreaks">
            <xsl:with-param name="string" select="omschrijving"/>
          </xsl:call-template>
        </td>
      </tr>
            <tr height="20px">
        <td colspan="3"/>
      </tr> 
      <xsl:for-each select="kenmerk[@type!='L' and @type!='Q']">
        <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>
        <td colspan="4">
          <hr/>
        </td>
      </xsl:otherwise>
      </xsl:choose>
    </table>
  </xsl:template>

<xsl:template match="opdracht" mode="include">
<style>
    td.subcaption {
      font-size: 10pt;
      font-weight: bold;
      text-decoration: none;
      padding-bottom: 2px;
      padding-top: 2px;      
    }
</style>
<xsl:choose>
<!-- ubw opdrachten (key 221) -->
<xsl:when test="melding/discipline/srtdiscipline/key=221">
<table border="0" width="100%" cellpadding="2" style="padding-left:40px">
  <tr>
    <td colspan="4" class="caption">
      <xsl:value-of select="melding/discipline/srtdiscipline/omschrijving"/>: <xsl:value-of select="melding/discipline/srtdiscipline/prefix"/><xsl:value-of select="melding_key"/>/<xsl:value-of select="bedrijfopdr_volgnr"/>
    </td>
  </tr>
  <tr>
    <td class="subcaption">Afzender:</td>
  </tr>
  <tr>
    <td class="tekst" colspan="4">Houthoff Buruma</td>
  </tr>
  <tr>
    <td class="tekst" width="15%">Functioneel Applicatiebeheer</td>
    <td width="30%"></td>
    <td width="20%"></td>
    <td width="34%"></td>
  </tr>
  <tr>
    <td colspan="4" height="20px"/>
  </tr>
  <tr>
    <td class="subcaption" colspan="4">Aan: </td>
  </tr>
  <tr>
    <td class="label" colspan="1">Naam:</td>
    <td class="value" colspan="3"><xsl:value-of select="uitvoerende/persoon/naam_full"/></td>
  </tr>  
  <tr>
    <td class="label" colspan="1">Datum:</td>
    <td class="value" colspan="3"><xsl:value-of select="datumbegin/datum"/></td>
  </tr>
  <tr>
    <td colspan="4" height="20px"/>
  </tr>  
  <tr>
    <td class="subcaption" colspan="4">Gemeld door:</td>
  </tr>
  <tr>
    <td class="label" colspan="1">Naam:</td>    
    <td class="value" colspan="3"><xsl:value-of select="melding/voor/naam_full"/></td>
  </tr>
  <tr>
    <td class="label" colspan="1">Datum:</td>
    <td class="value" colspan="3"><xsl:value-of select="melding/begindatum/datum"/></td>
  </tr>
  <tr>
    <td class="label" colspan="1">Verantwoordelijke HB:</td>
    <td class="value" colspan="3"><xsl:value-of select="melding/behandelaar/naam_full"/></td>
  </tr>
  <tr>
    <td class="label" colspan="1">Categorie:</td>
    <td class="value" colspan="3"><xsl:value-of select="melding/discipline/omschrijving"/>/<xsl:value-of select="melding/stdmelding/omschrijving"/></td>
  </tr>
  <tr>
    <td class="label" colspan="1">Prioriteit:</td>
    <td class="value" colspan="3">
    <xsl:choose>
    <xsl:when test="spoed&lt;3">Hoog</xsl:when>
    <xsl:when test="spoed=2">Normaal</xsl:when>
    <xsl:otherwise>Laag</xsl:otherwise>
    </xsl:choose>
    </td>    
  </tr>
  <tr>
    <td colspan="4" height="20px"/>
  </tr>
  <tr>
    <td class="subcaption" colspan="4">Issue omschrijving:</td>
  </tr>
  <tr>
    <td class="value" colspan="4">
      <xsl:call-template name="linebreaks"><xsl:with-param name="string" select="melding/omschrijving"/></xsl:call-template>
    </td>
  </tr>
  <tr>
    <td colspan="4" height="20px"/>
  </tr>  
  <tr>
    <td class="subcaption" colspan="4">Uitvoeren:</td>
  </tr>
  <tr>
    <td class="label" colspan="1">Uiterlijk voor:</td>
    <td class="value" colspan="3"><xsl:value-of select="einddatum/datum"/></td>
  </tr>
  <tr>
    <td class="value" colspan="4">
      <xsl:call-template name="linebreaks"><xsl:with-param name="string" select="omschrijving"/></xsl:call-template>
    </td>
  </tr>   
  <tr>
    <td colspan="4" height="20px"/>
  </tr>  
  <tr>
    <td class="subcaption" colspan="4">Afhandeling:</td>
  </tr>
  <tr>    
    <td class="value" colspan="4">
      <xsl:call-template name="linebreaks"><xsl:with-param name="string" select="opmerking"/></xsl:call-template>
    </td>
  </tr>
  <tr>
    <td colspan="4" height="40px"/>
  </tr>    
  <tr>
    <td colspan="3">
    **********************************************************************<br/>
This communication is sent to you from Houthoff Buruma Coöperatief U.A. This e-mail and its contents are for the use of the addressee only and may be confidential or privileged. Unauthorised use, disclosure or copying is strictly prohibited. If you are not the addressee, please notify us immediately. Houthoff Buruma is the trade name of Houthoff Buruma Coöperatief U.A., a Dutch law firm based in Amsterdam and registered in the Amsterdam Chamber of Commerce as no. 34216182. Houthoff Buruma's general terms and conditions, which stipulate a limitation of liability, the applicability of Dutch law and the exclusive jurisdiction of the District Court of Amsterdam, the Netherlands, are applicable to all services performed. The general terms and conditions are available on request and at www.houthoff.com.<br/>
**********************************************************************

    </td>
  </tr>                               
</table>
</xsl:when>
<xsl:otherwise>
<table border="0" width="100%" cellpadding="2">
    <tr>
        <td colspan="3"/>
    	<td style="text-align:right"><xsl:element name="img">
					  <xsl:attribute name="width">140px</xsl:attribute>
						<xsl:attribute name="src">../../appl/shared/barcode.asp?text=<xsl:value-of select="melding/discipline/srtdiscipline/prefix"/><xsl:value-of select="melding_key"/>&amp;height=50&amp;narrow=1&amp;wide=3</xsl:attribute>
					</xsl:element>
                </td>
</tr>
<tr>
<td/>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="melding/plaats/regio/district/locatie/kenmerk[@naam='Aanhef ID']"/>
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="backoffice_contact/naam_full"/>
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/afleveradres/bezoek_adres"/>
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/afleveradres/bezoek_postcode"/>&#xA0;&#xA0;<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/afleveradres/bezoek_plaats"/>
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="melding/plaats/regio/district/locatie/verantw_tel"/>
</td>
</tr>
<tr>
<td colspan="2">
<xsl:value-of select="melding/plaats/regio/district/locatie/kenmerk[@naam='E-mail ID']"/>
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td/>
</tr>
<tr>
<td/>
</tr>
<tr>
<td  rowspan="2" valign="top">
<b style="font-size:12pt">
<xsl:value-of select="melding/plaats/regio/district/locatie/gebouw/afleveradres/bezoek_plaats"/>, <xsl:value-of select="tracking/track/datum/datum"/>&#xA0;<xsl:value-of select="tracking/track/datum/tijd"/>
</b>
</td>
<td width="34%" valign="bottom">&#xA0;</td>
<td width="16%" rowspan="2" valign="top">
<b style="font-size:12pt">
</b>
</td>
</tr>
<tr>
<td colspan="2"/>
</tr>
<tr>
<td colspan="4" style="height:10"/>
</tr>
<tr>
<td>
<b>Bonnummer:</b>
</td>
<td>
<xsl:value-of select="melding/discipline/srtdiscipline/prefix"/>
<xsl:value-of select="melding_key"/>
</td>
</tr>
<tr>
<td>
<b>Aan:</b>
</td>
<td>
<xsl:value-of select="uitvoerende/bedrijf/naam"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<xsl:value-of select="uitvoerende/bedrijf/contact_persoon"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<xsl:value-of select="uitvoerende/bedrijf/post_adres"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<xsl:value-of select="uitvoerende/bedrijf/post_postcode"/>&#xA0;&#xA0;<xsl:value-of select="uitvoerende/bedrijf/post_plaats"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<xsl:value-of select="uitvoerende/bedrijf/contact_telefoon"/>
</td>
</tr>
<tr>
<td>
</td>
<td>
<xsl:value-of select="uitvoerende/bedrijf/email"/>
</td>
</tr>
<tr>
<td colspan="4">
<hr/>
</td>
</tr>
<tr>
<td colspan="2" rowspan="2" valign="top">
<b style="font-size:12pt">Melding/Opdracht:</b>
</td>
</tr>
<td colspan="2"/>
<tr>
</tr>
<tr>
<td colspan="3">
<xsl:call-template name="linebreaks">
<xsl:with-param name="string" select="omschrijving"/>
</xsl:call-template>
</td>
</tr>
<tr>
<td colspan="2"/>
</tr>
<tr>
<td colspan="4" style="height:10"/>
</tr>
<tr>
<xsl:if test="melding/plaats/@type!='T'">
<td>
<b>Ruimtenummer:</b>
</td>
<td>
<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='T'">
<td colspan="2"/>
</xsl:if>
</tr>
<xsl:if test="count(melding/deel)&gt;0">
<tr>
<td colspan="4" style="height:10"/>
<p align="justify">
</p>
</tr>
<xsl:for-each select="melding/deel">
<xsl:sort select="omschrijving"/>
<tr>
<xsl:choose>
<xsl:when test="position()=1">
<td>
<b>Betreft:</b>
</td>
</xsl:when>
<xsl:otherwise>
<td/>
</xsl:otherwise>
</xsl:choose>
<td>
<xsl:value-of select="omschrijving"/>
</td>
<td colspan="2">
<xsl:comment>NADER TE DEFINIEREN</xsl:comment>
</td>
</tr>
</xsl:for-each>
</xsl:if>
<tr>
<td>
<b>Uiterlijk gereed/geleverd:</b>
</td>
<td>
<xsl:value-of select="datumgereed/datum"/>
</td>
<td colspan="2"/>
</tr>
<tr>
<td colspan="4" style="height:10"/>
</tr>
<tr>
<td colspan="4">
<hr/>
</td>
</tr>
<tr>
<td colspan="4">
<b>*** Attentie ***</b>
</td>
</tr>
<tr>
<td colspan="4">Indien u per e-mail wilt reageren op deze melding/opdracht verzoeken wij u uw reactie uitsluitend te zenden naar bovenvermeld e-mail adres en niet via een reply.</td>
</tr>
<tr/>
<td/>
<tr>
<td>Bij alle correspondentie (ook op facturen) svp bovenstaand bonnummer vermelden.</td>
</tr>
</table>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

	<xsl:template match="opdracht" mode="full">
		<html>
			<xsl:comment>================================ OPDRACHTEN ==============================</xsl:comment>
			<xsl:comment>Facilitor new style 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">print_report();</xsl:attribute>
				</xsl:if>
				<xsl:call-template name="pageheader"/>
				<xsl:apply-templates select="." mode="include"/>
			</xsl:element>
		</html>
	</xsl:template>

	<xsl:template name="rsv_ruimte">
		<xsl:param name="min_volgnr"/>
		<xsl:param name="prijs_info"/>
		<xsl:choose>
			<xsl:when test="res_ruimte!=''">
				<tr>
					<td width="20%" class="tekst"><b>Datum reservering</b></td>
					<td width="80%" class="tekst"><b>: <xsl:value-of select="van/datum"/><xsl:if test="dirtlevel!='0'"><span class="fatal">&#xA0;<xsl:value-of select="//lcl/RES/ongeldig"/></span></xsl:if></b></td>
				</tr>
				<tr>
					<td width="20%" class="tekst"><b>Activiteit</b></td>
					<td width="80%" class="tekst"><b>: <xsl:value-of select="res_activiteit/omschrijving"/></b></td>
				</tr>
				<tr>
					<td width="20%" class="tekst"><b><xsl:value-of select="//lcl/FAC/locatie"/></b></td>
					<td width="80%" class="tekst"><b>: <xsl:value-of select="res_ruimte/plaats/regio/district/locatie/omschrijving"/></b></td>
				</tr>
			</xsl:when>
			<!-- "roomservice" -->
			<xsl:otherwise>
				<tr>
					<td width="20%" class="tekst"><b>Datum reservering</b></td>
					<td width="80%" class="tekst"><b>: <xsl:value-of select="van/datum"/><xsl:if test="dirtlevel!='0'"><span class="fatal">&#xA0;<xsl:value-of select="//lcl/RES/ongeldig"/></span></xsl:if></b></td>
				</tr>
				<tr>
					<td width="20%" class="tekst"><b>Activiteit</b></td>
					<td width="80%" class="tekst"><b>: <xsl:value-of select="res_activiteit/omschrijving"/></b></td>
				</tr>
				<tr>
					<td width="20%" class="tekst"><b><xsl:value-of select="//lcl/FAC/locatie"/></b></td>
					<td width="80%" class="tekst"><b>: <xsl:value-of select="plaats/plaatsaanduiding"/></b></td>
				</tr>
			</xsl:otherwise>
		</xsl:choose>
		<tr><td height="5px"/></tr>
		<xsl:if test="string(omschrijving)!=string(//reservering/rsv_ruimte[volgnr=$min_volgnr]/omschrijving)">
			<tr>
				<td class="tekst">- <xsl:value-of select="//lcl/FAC/omschrijving"/>:</td>
				<td class="tekst"><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="tekst">- <xsl:value-of select="//lcl/FAC/opmerking"/>:</td>
				<td class="tekst">
					<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="tekst">- <xsl:value-of select="//lcl/FAC/aanvrager"/>:</td>
				<td class="tekst"><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="tekst">- <xsl:value-of select="//lcl/RES/gastheer_vrouw"/>:</td>
				<td class="tekst"><xsl:value-of select="host_user/naam_full"/></td>
			</tr>
		</xsl:if>
		<tr><td height="5px"/></tr>
		<tr><td colspan="2"><table cellpadding="0" cellspacing="0" border="1" bordercolor="#000000" frame="box">
		<tr>
			<th><xsl:value-of select="//lcl/FAC/omschrijving"/></th>
			<th><xsl:value-of select="//lcl/RES/aantal"/></th>
			<xsl:if test="$prijs_info='1'"><th style="text-align:right"><xsl:value-of select="//lcl/RES/prijs"/></th></xsl:if>
			<!--<th width="80">Datum</th>-->
			<th style="text-align:right"><xsl:value-of select="//lcl/RES/begintijd"/></th>
			<th style="text-align:right"><xsl:value-of select="//lcl/RES/eindtijd"/></th>
			<th><xsl:value-of select="//lcl/RES/status"/></th>
			<th><xsl:value-of select="//lcl/RES/opstelling"/></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:text> </xsl:text><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>
				<xsl:if test="$prijs_info='1'">
					<td class="result" style="text-align:right">
						<xsl:call-template name="europrijs">
							<xsl:with-param name="prijs" select="prijs"/>
						</xsl:call-template>
					</td>
				</xsl:if>
				<!--<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>
				<td class="result" style="text-align:left"><xsl:value-of select="status_fo"/></td>
				<td class="result" style="text-align:left"><xsl:value-of select="res_ruimte/opstelling"/></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>
				<xsl:if test="$prijs_info='1'">
					<td class="result" style="text-align:right">
						<xsl:call-template name="europrijs">
							<xsl:with-param name="prijs" select="prijs"/>
						</xsl:call-template>
					</td>
				</xsl:if>
				<!--<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>
				<xsl:if test="$prijs_info='1'">
					<td class="result" style="text-align:right">
						<xsl:call-template name="europrijs">
							<xsl:with-param name="prijs" select="prijs"/>
						</xsl:call-template>
					</td>
				</xsl:if>
				<!--<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:if test="$prijs_info='1'">
			<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;">
					<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>
				</td>
			</tr>
		</xsl:if>
		<!-- 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_gereserveerd"/></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="3"><xsl:value-of select="deel/omschrijving"/></td>
			</tr>
		</xsl:for-each>
		<!-- kenmerk -->
		<xsl:for-each select="kenmerk[count(@xmlnode)=0]">
			<xsl:sort select="@volgnummer" data-type="number"/>
			<xsl:if test=".!=''">
				<tr>
					<td width="20%" class="tekst"><xsl:value-of select="@naam"/></td>
					<td width="80%" class="tekst">: <xsl:value-of select="."/></td>
				</tr>
			</xsl:if>
		</xsl:for-each>
		</table></td></tr>
		<tr><td height="20px"/></tr>
	</xsl:template>

	<xsl:template match="reservering" mode="include">
		<table border="0" width="100%">
			<xsl:choose>
				<xsl:when test="not(boolean(rsv_ruimte))">
					<tr><td height="20"/></tr>
					<tr>
						<td class="caption"><xsl:value-of select="//lcl/RES/annulering"/></td>
					</tr>
					<tr>
						<td>
							<b><xsl:value-of select="//lcl/RES/annulering_text1"/><xsl:if test="key!=''"><xsl:value-of select="//lcl/RES/annulering_text2"/><xsl:value-of select="key"/></xsl:if><xsl:value-of select="//lcl/RES/annulering_text3"/></b>
							<br/><br/><xsl:value-of select="//lcl/RES/annulering_text4"/>
							<br/><br/><xsl:value-of select="//lcl/RES/annulering_text5"/>
						</td>
					</tr>
				</xsl:when>
				<xsl:otherwise>
					<!-- Bevestiging reservering -->

					<!-- 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>

					<tr>
						<td class="tekst" colspan="2"><b><xsl:value-of select="//lcl/RES/reservering"/><xsl:text> </xsl:text><xsl:value-of select="key"/></b></td>
					</tr>
					<tr>
						<td class="tekst" colspan="2"><b>(<xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/omschrijving"/>)</b></td>
					</tr>
					<tr><td height="20px"/></tr>
					<tr>
						<td class="tekst" colspan="2">Hartelijk dank voor de reservering. Hieronder staan de specificaties. Mochten er nog wijzigingen zijn, dan horen wij het graag.</td>
					</tr>
					<tr><td height="20px"/></tr>
					<tr>
						<td class="tekst" colspan="2">Wat koffie/thee betreft zijn er twee mogelijkheden.
							<table border="0" width="100%">
								<tr>
									<td class="tekst">1)</td>
									<td class="tekst">U haalt met uw gasten koffie naar keuze bij het self-service koffiebuffet.<br/>De gastvrouw kan in overleg, alleen indien haar werkzaamheden het toelaten, hierbij assisteren.</td>
								</tr>
								<tr>
									<td class="tekst">2)</td>
									<td class="tekst">Wij verzorgen kannen met koffie/thee in de kamer. Indien u 5 personen of meer ontvangt is ons advies hiervan gebruik te maken.</td>
								</tr>
							</table>
						</td>
					</tr>
					<tr><td height="20px"/></tr>
					<tr>
						<td width="20%" class="tekst"><xsl:value-of select="//lcl/FAC/aanvrager"/></td>
						<td width="80%" class="tekst">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/naam_full"/></td>
					</tr>
					<tr>
						<td width="20%" class="tekst"><xsl:value-of select="//lcl/FAC/e-mail"/></td>
						<td width="80%" class="tekst">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/email"/></td>
					</tr>
					<tr>
						<td width="20%" class="tekst">Afdeling/Sectie</td>
						<td width="80%" class="tekst">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/afdeling/omschrijving"/></td>
					</tr>
					<tr>
						<td width="20%" class="tekst"><xsl:value-of select="//lcl/FAC/locatie"/></td>
						<td width="80%" class="tekst">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/contact_user/werkplek/plaats/regio/district/locatie/omschrijving"/></td>
					</tr>
					<tr><td height="20px"/></tr>
					<tr>
						<td width="20%" class="tekst"><xsl:value-of select="//lcl/RES/gastheer_vrouw"/></td>
						<td width="80%" class="tekst">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/host_user/naam_full"/></td>
					</tr>
					<tr>
						<td width="20%" class="tekst">Afdeling/Sectie</td>
						<td width="80%" class="tekst">: <xsl:value-of select="rsv_ruimte[volgnr=$min_volgnr]/host_user/afdeling/omschrijving"/></td>
					</tr>
					<tr><td height="10px"/></tr>
					<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:choose>
						</td>
					</tr>
					<tr><td height="10px"/></tr>
					<xsl:if test="string(rsv_ruimte[volgnr=$min_volgnr]/opmerking)!=''">
						<tr>
							<td colspan="2" class="tekst"><xsl:value-of select="//lcl/FAC/opmerking"/></td>
						</tr>
						<tr>
							<td colspan="2" class="tekst">
								<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="20px"/></tr>
					</xsl:if>
					<!-- 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:with-param name="prijs_info" select="0"/>
						</xsl:call-template>
					</xsl:for-each>
					<!-- Bevestiging reservering -->
				</xsl:otherwise>
			</xsl:choose>
		</table>
	</xsl:template>

	<xsl:template match="reservering" mode="full">
		<xsl:choose>
			<xsl:when test="$mode='summary'"></xsl:when>
			<xsl:otherwise>
				<xsl:choose>
					<xsl:when test="$srtnotificatiecode = 'OUTLOOK'">
						<xsl:apply-templates select="." mode="outlook"/>
					</xsl:when>
					<xsl:otherwise>
						<html>
							<xsl:comment>================================ RESERVERINGEN ==============================</xsl:comment>
							<xsl:comment>FACILITOR default XSL template for reservering</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:choose>
									<xsl:when test="$srtnotificatiecode = 'RESKTO'">
										<xsl:apply-templates select="." mode="kto"/>
									</xsl:when>
									<xsl:otherwise>
										<xsl:apply-templates select="." mode="include"/>
									</xsl:otherwise>
								</xsl:choose>
								<!--xsl:call-template name="pagefooter"/-->
							</xsl:element>
						</html>
					</xsl:otherwise>
				</xsl:choose>
			</xsl:otherwise>
		</xsl:choose>
	</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>Factuuradres:</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">
                Houthoff Buruma
                <br/>
                <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/>
                <br/>
                <b>E-Mailadres e-facturen: </b> <a href="mailto:fz-efacturen.general@dms.houthoff.com" target="_blank">fz-efacturen.general@dms.houthoff.com</a>
              </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">
              </td>
            </tr>
            <tr>           
              <td colspan="2" style="vertical-align:top">
                <xsl:value-of select="afleveradres/contactpers_bureau"/>
                <br/>
                <xsl:value-of select="bestelling/aanvrager/naam_full"/>
                <br/>
                <xsl:value-of select="afleveradres/telefoon"/>
                <br/>
                <xsl:value-of select="afleveradres/contactpersoon"/>
              </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/>
                  <xsl:comment><b><xsl:value-of select="//lcl/BES/gewenste_afleverdatum"/>: </b><xsl:value-of select="bestelling/leverdatum/datum"/></xsl:comment>
              </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">
                Houthoff Buruma
                <br/>
                <xsl:value-of select="afleveradres/naam"/>
                <br/>
                <xsl:value-of select="afleveradres/gebouw_ruimte"/>
                <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/>                
              </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(bestelitem/prijs, '0,00', 'european')"/>
                      </td>
                      <td class="result" style="text-align:right">
                        <xsl:value-of select="format-number(bestelitem/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:template match="rapport">
		<style>th {
      border: 1px solid #808080;
    }</style>
    
        <xsl:if test="@view='HOUT_V_RAP_PRJ_OVZ'">
            <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="FCLT_F_PROJECTTYPE"/>
						<xsl:sort select="FCLT_F_PROJECT"/>
						<xsl:copy-of select="."/>
					</xsl:for-each>
				</xsl:variable>
				
			    <xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:variable name="prev_vakgroep">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_PROJECTTYPE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="prev_project">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_PROJECT"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>						
					<xsl:if test="FCLT_F_PROJECTTYPE!=$prev_vakgroep">	        
			        <tr>
			        <td colspan="12"  style="text-align:center"><b><xsl:value-of select="FCLT_F_PROJECTTYPE"/></b></td>
			        </tr>
			        </xsl:if>
			        <xsl:if test="FCLT_F_PROJECT!=$prev_project">
			        <tr>
			        <th colspan="12" class="DefResultsetHeading" style="text-align:left"><u><xsl:value-of select="FCLT_F_PROJECT"/></u></th>
			        </tr>
			        <tr>
    				<th width="6%" class="DefResultsetHeading" style="text-align:left">Projectnr</th>
    				<th width="25%" class="DefResultsetHeading" style="text-align:center">Projectomschrijving</th>
    				<th width="11%" class="DefResultsetHeading" style="text-align:center">Projectmanager</th>
    				<th width="11%" class="DefResultsetHeading" style="text-align:center">Adviseur</th>    				
    				<th width="11%" class="DefResultsetHeading" style="text-align:center">Opdrachtgever</th>
    				<th width="6%" class="DefResultsetHeading" style="text-align:center">Startdatum</th>
    				<th width="6%" class="DefResultsetHeading" style="text-align:center">Einddatum</th>
    				<th width="8%" class="DefResultsetHeading" style="text-align:center">Status</th>
    				<th width="4%" class="DefResultsetHeading" style="text-align:center">Innovatief</th>
    				<th width="4%" class="DefResultsetHeading" style="text-align:center">Samen</th>
    				<th width="4%" class="DefResultsetHeading" style="text-align:center">Duurzaam</th>
    				<th width="4%" class="DefResultsetHeading" style="text-align:center">Divers</th>
			        </tr>
			         </xsl:if>
			        <tr>
			            <td><xsl:value-of select="PROJECTNR"/></td>
			            <td><xsl:value-of select="PROJECTOMSCHRIJVING"/></td>
			            <td><xsl:value-of select="PROJECTMANAGER"/></td>
			            <td><xsl:value-of select="ADVISEUR"/></td>
			            <td><xsl:value-of select="OPDRACHTGEVER"/></td>
			            <td style="text-align:center"><xsl:value-of select="STARTDATUM"/></td>
			            <td style="text-align:center"><xsl:value-of select="EINDDATUM"/></td>
			            <td><xsl:value-of select="STATUS"/></td>
			            <td style="text-align:center">
			                <xsl:if test="INNOVATIEF=1">X</xsl:if>
			            </td>
			            <td style="text-align:center">
			                <xsl:if test="SAMEN=1">X</xsl:if>
			            </td>
			            <td style="text-align:center">
			                <xsl:if test="DUURZAAM=1">X</xsl:if>
			            </td>
			            <td style="text-align:center">
			                <xsl:if test="DIVERS=1">X</xsl:if>
			            </td>			                           
			        </tr>
			    </xsl:for-each>
            </table>
        </xsl:if>    

		<xsl:if test="@view='hout_v_rap_wp_func_rui'">
			<table width="100%" class="rstable" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="15%"/>
					<col width="15%"/>
					<col span="3" width="5%"/>
					<col width="55%"/>
				</colgroup>

				<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="FCLT_F_GEBOUW_CODE"/>
						<xsl:sort select="FCLT_F_VERDIEPING_CODE" data-type="number"/>
						<xsl:sort select="FCLT_F_RUIMTE_FUNCTIE"/>
						<xsl:sort select="RUIMTE_NR"/>
						<xsl:copy-of select="."/>
					</xsl:for-each>
				</xsl:variable>

				<xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:variable name="prev_gebouw">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_GEBOUW_CODE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="prev_verdieping">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_VERDIEPING_CODE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="prev_functie">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_RUIMTE_FUNCTIE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<!--als gebouw anders dan vorige -->
					<xsl:if test="FCLT_F_GEBOUW_CODE!=$prev_gebouw">
						<tr>
							<td colspan="6">
								<hr noshade="noshade" size="5pt"/>
							</td>
						</tr>
					</xsl:if>

					<!--als gebouw of verdieping anders dan vorige -->
					<xsl:if test="FCLT_F_GEBOUW_CODE!=$prev_gebouw or FCLT_F_VERDIEPING_CODE!=$prev_verdieping">
						<tr>
							<td colspan="6">
								<hr/>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<b>
									<xsl:value-of select="FCLT_F_GEBOUW_CODE"/>/Verdieping <xsl:value-of select="FCLT_F_VERDIEPING_CODE"/></b>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<hr/>
							</td>
						</tr>
					</xsl:if>

					<!--als gebouw, verdieping of functie anders dan vorige en niet verdieping-totaal -->
					<xsl:if test="(FCLT_F_GEBOUW_CODE!=$prev_gebouw or FCLT_F_VERDIEPING_CODE!=$prev_verdieping or FCLT_F_RUIMTE_FUNCTIE!=$prev_functie) and RUIMTE_NR!='zzzTotaal etage'">
						<tr>
							<td>
								<b>
									<xsl:value-of select="FCLT_F_RUIMTE_FUNCTIE"/>
								</b>
							</td>
							<th class="DefResultsetHeading" style="text-align:left">Ruimtenummer</th>
							<th class="DefResultsetHeading" style="text-align:center">Bezet</th>
							<th class="DefResultsetHeading" style="text-align:center">Mogelijk</th>
							<th class="DefResultsetHeading" style="text-align:center">Vrij</th>
							<td/>
						</tr>
					</xsl:if>

					<xsl:choose>
						<xsl:when test="RUIMTE_NR='zzzTotaal functie'">
							<tr>
								<td/>
								<td style="text-align:left">
									<b>Totaal</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_BEZET"/>
									</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_MOGELIJK"/>
									</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_MOGELIJK+(-AANTAL_BEZET)"/>
									</b>
								</td>
								<td/>
							</tr>
							<tr>
								<td/>
								<td colspan="5" style="text-align:left">
									<b>Bezettingsgraad <xsl:value-of select="format-number((AANTAL_BEZET div AANTAL_MOGELIJK) * 100, '###.##0', 'european')"/>%</b>
								</td>
							</tr>
							<tr>
								<td colspan="6">&#xA0;</td>
							</tr>
						</xsl:when>
						<xsl:when test="RUIMTE_NR='zzzTotaal etage'">
							<tr>
								<td>
									<b>TOTAAL Verdieping <xsl:value-of select="FCLT_F_VERDIEPING_CODE"/></b>
								</td>
								<th class="DefResultsetHeading" style="text-align:left">&#xA0;</th>
								<th class="DefResultsetHeading" style="text-align:center">Bezet</th>
								<th class="DefResultsetHeading" style="text-align:center">Mogelijk</th>
								<th class="DefResultsetHeading" style="text-align:center">Vrij</th>
								<td/>
							</tr>
							<tr>
								<td colspan="2"></td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_BEZET"/>
									</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_MOGELIJK"/>
									</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_MOGELIJK+(-AANTAL_BEZET)"/>
									</b>
								</td>
								<td/>
							</tr>
							<tr>
								<td/>
								<td colspan="5" style="text-align:left">
									<b>Bezettingsgraad <xsl:value-of select="format-number((AANTAL_BEZET div AANTAL_MOGELIJK) * 100, '###.##0', 'european')"/>%</b>
								</td>
							</tr>
							<tr>
								<td colspan="6">&#xA0;</td>
							</tr>
						</xsl:when>
						<xsl:otherwise>
							<tr>
								<td/>
								<td style="text-align:left">
									<xsl:value-of select="RUIMTE_NR"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL_BEZET"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL_MOGELIJK"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL_MOGELIJK+(-AANTAL_BEZET)"/>
								</td>
								<td/>
							</tr>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:for-each>
				<tr>
					<td colspan="6">
						<hr noshade="noshade" size="5pt"/>
					</td>
				</tr>
			</table>
		</xsl:if>
		<xsl:if test="@view='hout_v_rap_wp_func_ver'">
			<table width="100%" class="rstable" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="15%"/>
					<col width="15%"/>
					<col span="3" width="5%"/>
					<col width="55%"/>
				</colgroup>

				<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="FCLT_F_GEBOUW_CODE"/>
						<xsl:sort select="FCLT_F_RUIMTE_FUNCTIE"/>
						<xsl:sort select="VERDIEPING_CODE" data-type="number"/>
						<xsl:copy-of select="."/>
					</xsl:for-each>
				</xsl:variable>

				<xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:variable name="prev_gebouw">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_GEBOUW_CODE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="prev_functie">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_RUIMTE_FUNCTIE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<!--als gebouw anders dan vorige -->
					<xsl:if test="FCLT_F_GEBOUW_CODE!=$prev_gebouw">
						<tr>
							<td colspan="6">
								<hr noshade="noshade" size="5pt"/>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<hr/>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<b>
									<xsl:value-of select="FCLT_F_GEBOUW_CODE"/>
								</b>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<hr/>
							</td>
						</tr>
					</xsl:if>

					<!--als gebouw of functie anders dan vorige en niet gebouw-totaal -->
					<xsl:if test="(FCLT_F_GEBOUW_CODE!=$prev_gebouw or FCLT_F_RUIMTE_FUNCTIE!=$prev_functie) and FCLT_F_RUIMTE_FUNCTIE!='zzzTotaal gebouw'">
						<tr>
							<td>
								<b>
									<xsl:value-of select="FCLT_F_RUIMTE_FUNCTIE"/>
								</b>
							</td>
							<th class="DefResultsetHeading" style="text-align:left">Verdieping</th>
							<th class="DefResultsetHeading" style="text-align:center">Bezet</th>
							<th class="DefResultsetHeading" style="text-align:center">Mogelijk</th>
							<th class="DefResultsetHeading" style="text-align:center">Vrij</th>
							<td/>
						</tr>
					</xsl:if>

					<!--als gebouw of functie anders dan vorige en wel gebouw-totaal -->
					<xsl:if test="(FCLT_F_GEBOUW_CODE!=$prev_gebouw or FCLT_F_RUIMTE_FUNCTIE!=$prev_functie) and FCLT_F_RUIMTE_FUNCTIE='zzzTotaal gebouw'">
						<tr>
							<td>
								<b>TOTAAL Gebouw <xsl:value-of select="FCLT_F_GEBOUW_CODE"/></b>
							</td>
							<th class="DefResultsetHeading" style="text-align:left">&#xA0;</th>
							<th class="DefResultsetHeading" style="text-align:center">Bezet</th>
							<th class="DefResultsetHeading" style="text-align:center">Mogelijk</th>
							<th class="DefResultsetHeading" style="text-align:center">Vrij</th>
							<td/>
						</tr>
					</xsl:if>

					<xsl:choose>
						<xsl:when test="VERDIEPING_CODE='99999'">
							<tr>
								<td/>
								<td style="text-align:left">
									<b>Totaal</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_BEZET"/>
									</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_MOGELIJK"/>
									</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="AANTAL_MOGELIJK+(-AANTAL_BEZET)"/>
									</b>
								</td>
								<td/>
							</tr>
							<tr>
								<td/>
								<td colspan="5" style="text-align:left">
									<b>Bezettingsgraad <xsl:value-of select="format-number((AANTAL_BEZET div AANTAL_MOGELIJK) * 100, '###.##0', 'european')"/>%</b>
								</td>
							</tr>
							<tr>
								<td colspan="6">&#xA0;</td>
							</tr>
						</xsl:when>
						<xsl:otherwise>
							<tr>
								<td/>
								<td style="text-align:left">
									Verdieping <xsl:value-of select="VERDIEPING_CODE"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL_BEZET"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL_MOGELIJK"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL_MOGELIJK+(-AANTAL_BEZET)"/>
								</td>
								<td/>
							</tr>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:for-each>
				<tr>
					<td colspan="6">
						<hr noshade="noshade" size="5pt"/>
					</td>
				</tr>
			</table>
		</xsl:if>
		<xsl:if test="@view='hout_v_rap_wp_ver_gebr'">
			<table width="100%" class="rstable" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="15%"/>
					<col width="15%"/>
					<col span="2" width="5%"/>
					<col width="60%"/>
				</colgroup>

				<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="FCLT_F_GEBOUW_CODE"/>
						<xsl:sort select="FCLT_F_VERDIEPING_CODE" data-type="number"/>
						<xsl:sort select="FCLT_F_KOSTENPLAATS"/>
						<xsl:copy-of select="."/>
					</xsl:for-each>
				</xsl:variable>

				<xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:variable name="prev_gebouw">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_GEBOUW_CODE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="prev_verdieping">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise>
								<xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_VERDIEPING_CODE"/>
							</xsl:otherwise>
						</xsl:choose>
					</xsl:variable>

					<!--als gebouw anders dan vorige -->
					<xsl:if test="FCLT_F_GEBOUW_CODE!=$prev_gebouw">
						<tr>
							<td colspan="6">
								<hr noshade="noshade" size="5pt"/>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<hr/>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<b>
									<xsl:value-of select="FCLT_F_GEBOUW_CODE"/>
								</b>
							</td>
						</tr>
						<tr>
							<td colspan="6">
								<hr/>
							</td>
						</tr>
					</xsl:if>

					<!--als gebouw of verdieping anders dan vorige en niet gebouw-totaal -->
					<xsl:if test="(FCLT_F_GEBOUW_CODE!=$prev_gebouw or FCLT_F_VERDIEPING_CODE!=$prev_verdieping) and FCLT_F_VERDIEPING_CODE!='99999'">
						<tr>
							<td>
								<b>Verdieping <xsl:value-of select="FCLT_F_VERDIEPING_CODE"/></b>
							</td>
							<th class="DefResultsetHeading" style="text-align:left">Kostenplaats</th>
							<th class="DefResultsetHeading" style="text-align:center">Bezet</th>
							<th class="DefResultsetHeading" style="text-align:center">Percentage</th>
							<td colspan="2"/>
						</tr>
					</xsl:if>

					<!--als gebouw of verdieping anders dan vorige en wel gebouw-totaal -->
					<xsl:if test="(FCLT_F_GEBOUW_CODE!=$prev_gebouw or FCLT_F_VERDIEPING_CODE!=$prev_verdieping)and FCLT_F_VERDIEPING_CODE='99999'">
						<tr>
							<td>
								<b>TOTAAL Gebouw <xsl:value-of select="FCLT_F_GEBOUW_CODE"/></b>
							</td>
							<th class="DefResultsetHeading" style="text-align:left">Kostenplaats</th>
							<th class="DefResultsetHeading" style="text-align:center">Bezet</th>
							<th class="DefResultsetHeading" style="text-align:center">Percentage</th>
							<td colspan="2"/>
						</tr>
					</xsl:if>

					<xsl:choose>
						<xsl:when test="FCLT_F_KOSTENPLAATS='zzzVrij'">
							<tr>
								<td/>
								<td style="text-align:left">Vrij</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="format-number((AANTAL div TOTAAL) * 100, '###.##0,0', 'european')"/>
								</td>
								<td colspan="2"/>
							</tr>
							<tr>
								<td/>
								<td style="text-align:left">
									<b>Totaal</b>
								</td>
								<td style="text-align:right">
									<b>
										<xsl:value-of select="TOTAAL"/>
									</b>
								</td>
								<td style="text-align:right">
									<b>100%</b>
								</td>
								<td colspan="2"/>
							</tr>
							<tr>
								<td/>
								<td colspan="5" style="text-align:left">
									<b>Bezettingsgraad <xsl:value-of select="format-number(((TOTAAL+(-AANTAL)) div TOTAAL) * 100, '###.##0', 'european')"/>%</b>
								</td>
							</tr>
							<tr>
								<td colspan="6">&#xA0;</td>
							</tr>
						</xsl:when>
						<xsl:otherwise>
							<tr>
								<td/>
								<td style="text-align:left">
									<xsl:value-of select="FCLT_F_KOSTENPLAATS"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="AANTAL"/>
								</td>
								<td style="text-align:right">
									<xsl:value-of select="format-number((AANTAL div TOTAAL) * 100, '###.##0,0', 'european')"/>
								</td>
								<td colspan="2"/>
							</tr>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:for-each>
				<tr>
					<td colspan="6">
						<hr noshade="noshade" size="5pt"/>
					</td>
				</tr>
			</table>
		</xsl:if>
		<xsl:if test="@view='hout_v_rap_wk_uren_psc' or @view='HOUT_V_RAP_WK_UREN_PSC'">
			<table 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="min_locatie">
					<xsl:for-each select="rapport_data/data_row">
						<xsl:sort select="FCLT_F_LOCATIE" order="ascending"/>
						<xsl:if test="position()=1"><xsl:value-of select="FCLT_F_LOCATIE"/></xsl:if>
					</xsl:for-each>
				</xsl:variable>

				<xsl:variable name="max_locatie">
					<xsl:for-each select="rapport_data/data_row">
						<xsl:sort select="FCLT_F_LOCATIE" order="descending"/>
						<xsl:if test="position()=1"><xsl:value-of select="FCLT_F_LOCATIE"/></xsl:if>
					</xsl:for-each>
				</xsl:variable>

				<xsl:variable name="besteed">
					<xsl:for-each select="rapport_data/data_row">
						<xsl:sort select="WKNR"/>
						<xsl:sort select="OPDR_OMS"/>
						<xsl:sort select="FCLT_F_MEDEWERKER"/>
						<xsl:if test="HIDE_F_BV='B'"><xsl:copy-of select="."/></xsl:if>
					</xsl:for-each>
				</xsl:variable>

				<xsl:variable name="vast">
					<xsl:for-each select="rapport_data/data_row">
						<xsl:sort select="FCLT_F_MEDEWERKER"/>
						<xsl:sort select="UURTARIEF"/>
						<xsl:if test="HIDE_F_BV='V'"><xsl:copy-of select="."/></xsl:if>
					</xsl:for-each>
				</xsl:variable>

				<!--In kop de geselecteerde locatie (als dat zo is)-->
				<xsl:if test="$min_locatie=$max_locatie and $min_locatie!=''">
					<tr><td>
						<table width="100%" cellpadding="0" cellspacing="0">
							<tr><td style="text-align:left"><b>Locatie: <u><xsl:value-of select="$min_locatie"/></u></b></td></tr>
							<tr><td height="10px"/></tr>
						</table>
					</td></tr>
				</xsl:if>

<xsl:if test="count(msxml:node-set($besteed)/data_row)&gt;0">
<tr><td>
			<table style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="20%"/>
					<col width="8%"/>
					<col span="7" width="6%"/>
					<col width="8%"/>
					<col width="22%"/>
				</colgroup>
        <!--Uren deze periode-->
				<xsl:for-each select="msxml:node-set($besteed)/data_row">
					<xsl:variable name="this_wk">
						<xsl:value-of select="WKNR"/>
					</xsl:variable>
					<xsl:variable name="next_wk">
						<xsl:value-of select="following-sibling::data_row[1]/WKNR"/>
					</xsl:variable>

					<!--als 1e regel, dan uren-kop!-->
					<xsl:if test="position()=1">
						<tr>
							<th style="text-align:left">Geschreven deze periode</th>
							<th style="text-align:center">Week</th>
							<th style="text-align:center">Ma</th>
							<th style="text-align:center">Di</th>
							<th style="text-align:center">Wo</th>
							<th style="text-align:center">Do</th>
							<th style="text-align:center">Vr</th>
							<th style="text-align:center">Za</th>
							<th style="text-align:center">Zo</th>
							<th style="text-align:center">Totaal</th>
							<th style="text-align:left">Omschrijving</th>
						</tr>
					</xsl:if>
					<xsl:choose>
						<!--als uren geschreven, dan urenregel gevolgd door evt. sluitregel!-->
						<xsl:when test="UREN_BESTEED&gt;0">
							<tr>
								<td style="text-align:left"><xsl:value-of select="FCLT_F_MEDEWERKER"/></td>
								<td style="text-align:right"><xsl:value-of select="WKNR"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(MA_UREN, '0,00', 'european')"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(DI_UREN, '0,00', 'european')"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(WO_UREN, '0,00', 'european')"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(DO_UREN, '0,00', 'european')"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(VR_UREN, '0,00', 'european')"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(ZA_UREN, '0,00', 'european')"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(ZO_UREN, '0,00', 'european')"/></td>
								<td style="text-align:right"><xsl:value-of select="format-number(UREN_BESTEED, '0,00', 'european')"/></td>
								<td style="text-align:left"><xsl:value-of select="OPDR_OMS"/></td>
							</tr>
							<xsl:if test="$this_wk!=$next_wk or $next_wk=''">
								<tr>
									<td style="text-align:left"><b>Totaal</b></td>
									<td style="text-align:right"><b><xsl:value-of select="WKNR"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/MA_UREN), '0,00', 'european')"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/DI_UREN), '0,00', 'european')"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/WO_UREN), '0,00', 'european')"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/DO_UREN), '0,00', 'european')"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/VR_UREN), '0,00', 'european')"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/ZA_UREN), '0,00', 'european')"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/ZO_UREN), '0,00', 'european')"/></b></td>
									<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[WKNR=$this_wk]/UREN_BESTEED), '0,00', 'european')"/></b></td>
									<td/>
								</tr>
							</xsl:if>
						</xsl:when>
						<!--anders voor deze week geen uren!-->
						<xsl:otherwise>
							<tr>
								<td style="text-align:left">Geen uren</td>
								<td style="text-align:right"><xsl:value-of select="WKNR"/></td>
								<td colspan="9"/>
							</tr>
						</xsl:otherwise>
					</xsl:choose>
					<tr><td colspan="11" height="10px"/></tr>
				</xsl:for-each>
			</table>
</td></tr>
</xsl:if>

<xsl:if test="count(msxml:node-set($vast)/data_row)&gt;0">
<tr><td>
			<table style="width:100%;border-collapse:collapse;" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="20%"/>
					<col width="8%"/>
					<col span="6" width="12%"/>
				</colgroup>
        <!--Totaal deze periode-->
				<xsl:for-each select="msxml:node-set($vast)/data_row">
					<xsl:variable name="prev_mdw">
						<xsl:choose>
							<xsl:when test="position()=1">Quqelequ</xsl:when>
							<xsl:otherwise><xsl:value-of select="preceding-sibling::data_row[1]/FCLT_F_MEDEWERKER"/></xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="this_mdw">
						<xsl:value-of select="FCLT_F_MEDEWERKER"/>
					</xsl:variable>
					<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]/UURTARIEF"/></xsl:otherwise>
						</xsl:choose>
					</xsl:variable>
					<xsl:variable name="this_tarief">
						<xsl:value-of select="UURTARIEF"/>
					</xsl:variable>

					<!--als 1e regel, dan totaal-kop!-->
					<xsl:if test="position()=1">
						<tr>
<th style="text-align:left">Totaal overzicht uren deze periode</th>
<th style="text-align:center">Uurtarief</th>
<th style="text-align:center">Te besteden uren</th>
<th style="text-align:center">Te besteden uurloon</th>
<th style="text-align:center">Geschreven uren</th>
<th style="text-align:center">Geschreven uurloon</th>
<th style="text-align:center">Restant uren</th>
<th style="text-align:center">Restant uurloon</th>
						</tr>
					</xsl:if>
					<xsl:if test="$this_mdw!=$prev_mdw or $this_tarief!=$prev_tarief">
						<tr>
<td style="text-align:left"><xsl:value-of select="$this_mdw"/></td>
<td style="text-align:right"><xsl:if test="$this_tarief&gt;0"><xsl:value-of select="format-number($this_tarief, '0,00', 'european')"/></xsl:if></td>
<td style="text-align:right">
  <xsl:if test="msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/UREN_VAST&gt;0"><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/UREN_VAST), '0,00', 'european')"/></xsl:if>
</td>
<td style="text-align:right">
  <xsl:if test="msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/LOON_VAST&gt;0"><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/LOON_VAST), '0,00', 'european')"/></xsl:if>
</td>
<td style="text-align:right">
  <xsl:if test="msxml:node-set($besteed)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/UREN_BESTEED&gt;0"><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/UREN_BESTEED), '0,00', 'european')"/></xsl:if>
</td>
<td style="text-align:right">
  <xsl:if test="msxml:node-set($besteed)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/LOON_BESTEED&gt;0"><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/LOON_BESTEED), '0,00', 'european')"/></xsl:if>
</td>
<td style="text-align:right">
  <xsl:if test="msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/UREN_VAST&gt;0"><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/UREN_VAST) - sum(msxml:node-set($besteed)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/UREN_BESTEED), '0,00', 'european')"/></xsl:if>
</td>
<td style="text-align:right">
  <xsl:if test="msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/LOON_VAST&gt;0"><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/LOON_VAST) - sum(msxml:node-set($besteed)/data_row[FCLT_F_MEDEWERKER=$this_mdw and UURTARIEF=$this_tarief]/LOON_BESTEED), '0,00', 'european')"/></xsl:if>
</td>
						</tr>
					</xsl:if>
				</xsl:for-each>
				<tr>
<td style="text-align:left"><b>Totaal</b></td>
<td/>
<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row/UREN_VAST), '0,00', 'european')"/></b></td>
<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row/LOON_VAST), '0,00', 'european')"/></b></td>
<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row/UREN_BESTEED), '0,00', 'european')"/></b></td>
<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($besteed)/data_row/LOON_BESTEED), '0,00', 'european')"/></b></td>
<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row/UREN_VAST) - sum(msxml:node-set($besteed)/data_row/UREN_BESTEED), '0,00', 'european')"/></b></td>
<td style="text-align:right"><b><xsl:value-of select="format-number(sum(msxml:node-set($vast)/data_row/LOON_VAST) - sum(msxml:node-set($besteed)/data_row/LOON_BESTEED), '0,00', 'european')"/></b></td>
				</tr>
			</table>
</td></tr>
</xsl:if>
			</table>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
