<?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:variable name="Xsrtnotificatiecode">RESNOS</xsl:variable>	

  <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"><u>
            <xsl:if test="dirtlevel!='0'">
                <span class="fatal"><xsl:value-of select="//lcl/RES/ongeldig"/></span>&#xA0;
            </xsl:if>
            <xsl:value-of select="van/datum"/>&#xA0;
            <xsl:value-of select="//lcl/RES/deelreservering"/>&#xA0;<xsl:value-of select="../key"/>&#xA0;/<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"/></u>
          </td>
        </xsl:when>
        <!-- "roomservice" -->
        <xsl:otherwise>
          <td class="tekstkop" colspan="10" frame="box" style="border-style:solid;border-width:0px;"><u>
        <xsl:if test="dirtlevel!='0'">
            <span class="fatal"><xsl:value-of select="//lcl/RES/ongeldig"/></span>&#xA0;
        </xsl:if>
           <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:value-of select="//lcl/RES/deelreservering"/>&#xA0;<xsl:value-of select="../key"/>&#xA0;/<xsl:value-of select="volgnr"/>&#xA0;
            <xsl:value-of select="plaats/plaatsaanduiding"/></u>
          </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(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>
    <tr>
    <td class="label"><xsl:value-of select="//lcl/RES/status"/></td>
    <td class="value" colspan="5">: <xsl:value-of select="status_fo"/>
    </td>
    </tr>
   <tr>
    <td class="label"><xsl:value-of select="//lcl/RES/gastheer_vrouw"/></td>
    <td class="value" colspan="5">: <xsl:value-of select="host_user/naam_full"/></td>
  </tr>
  <tr>
    <td class="label"><xsl:value-of select="//lcl/FAC/kostenplaats"/></td>
    <td class="value" colspan="5">: <xsl:value-of select="kostenplaats/nr"/>&#xA0;
      <xsl:value-of select="kostenplaats/omschrijving"/>
    </td>
  </tr>
  <xsl:if test="string(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>
    <tr>
        <td colspan="10" style="border-top:1px solid #000;"/>
    </tr>
    <tr>
      <th class="resth" width="24%" align="left"><xsl:value-of select="//lcl/FAC/omschrijving"/></th>
      <th class="resth" width="14%" align="left"><xsl:value-of select="//lcl/RES/aantal"/></th>
      <!--<th width="80">Datum</th>-->
      <th class="resth" width="14%" style="text-align:right"><xsl:value-of select="//lcl/RES/begintijd"/></th>
      <th class="resth" width="14%" style="text-align:right"><xsl:value-of select="//lcl/RES/eindtijd"/></th>
      <th class="resth" width="16%" align="center"><xsl:value-of select="//lcl/RES/opstelling"/></th>
      <th class="resth" width="17%" style="text-align:right"><xsl:value-of select="//lcl/RES/prijs"/></th>
    </tr>
    <xsl:if test="res_ruimte!=''">
      <tr>
        <td width="24%" class="resresult" 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"/>&#xA0;<xsl:value-of select="//lcl/FAC/personen"/>)</td>
        <td width="14%" class="resresult" 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:value-of select="van/datum"/>
        </td>-->
        <td width="14%" class="resresult" style="text-align:right">
          <xsl:value-of select="van/tijd"/>
        </td>
        <td width="14%" class="resresult" style="text-align:right">
          <xsl:value-of select="tot/tijd"/>
        </td>
        <td width="16%" class="resresult" style="text-align:center">
          <xsl:value-of select="res_ruimte/opstelling"/>
        </td>
        <td width="17%" class="resresult" style="text-align:right">
          <xsl:call-template name="europrijs">
            <xsl:with-param name="prijs" select="prijs"/>
          </xsl:call-template>
        </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="resresult"><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="resresult">
          <xsl:value-of select="aantal"/>
        </td>
        <!--<td class="result" style="text-align:right">
          <xsl:value-of select="van/datum"/>
        </td>-->
        <td class="resresult" style="text-align:right">
          <xsl:value-of select="van/tijd"/>
        </td>
        <td class="resresult" style="text-align:right">
          <xsl:value-of select="tot/tijd"/>
        </td>
        <td></td>
        <td class="resresult" style="text-align:right">
          <xsl:call-template name="europrijs">
            <xsl:with-param name="prijs" select="prijs"/>
          </xsl:call-template>
        </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="resresult">
          <xsl:value-of select="res_artikel/omschrijving"/>
        </td>
        <td class="resresult">
          <xsl:value-of select="aantal"/>
        </td>
        <!--<td class="result" style="text-align:right">
          <xsl:value-of select="levering/datum"/>
        </td>-->
        <td class="resresult" style="text-align:right">
          <xsl:value-of select="levering/tijd"/>
        </td>
        <td></td>
        <td></td>
        <td class="resresult" style="text-align:right">
          <xsl:call-template name="europrijs">
            <xsl:with-param name="prijs" select="prijs"/>
          </xsl:call-template>
        </td>
      </tr>
    </xsl:for-each>
    <!-- totaal per deelreservering -->
    <tr  height="1">
      <td colspan="10" style="border-top:1px solid #000;"/>
    </tr>
    <tr>
      <td class="tekst" colspan="4" style="border-style:solid;border-width:0px;"></td>
      <td class="tekst" colspan="2" 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="4"><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>
    
    <xsl:choose>
    <xsl:when test="$srtnotificatiecode='RESNOS'">
    <!-- kenmerk zonder label. Ipv label tonen we no show tekst -->
    <xsl:if test="kenmerk">
    <tr>
    <td colspan="5">
    <table>
     <xsl:for-each select="kenmerk[count(@xmlnode)=0]">
        <xsl:if test="(@type!='L' and @type!='l' and @type!='Q')">
      <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>
    <tr>
      <td height="10px"/>
    </tr>    
    </xsl:if>
    <tr>
    <td colspan="5" class="label">
        Beste collega,<br/><br/>
        Er is geconstateerd dat de bovenstaande reservering niet is doorgegaan. Waarschijnlijk is het je ontgaan om deze reservering van te voren te annuleren;  deze annulering kun je zelf in het vergadersysteem aanpassen.<br/><br/>
        Het vriendelijke verzoek om dit de volgende keer wel te doen zodat collega’s gebruik kunnen maken van deze ruimte. Hiermee voorkomen we onnodige leegstand en indien van toepassing, het weggooien van producten.<br/><br/><br/>
        Indien je vragen hebt kun je contact opnemen met de Facilitydesk.<br/><br/>
        De Facilitydesk.
    </td>
    </tr>
    </xsl:when>
    <xsl:otherwise>
    <!-- kenmerk -->
    <xsl:if test="kenmerk">
    <tr>
    <td colspan="5">
    <table>
      <xsl:for-each select="kenmerk[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:otherwise>
    </xsl:choose>

  </xsl:template>
	
	<xsl:template match="afspraak" 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="not(boolean(bezoeker))">
              <table>
                <tr>
                  <td height="20"/>
                </tr>
                <tr>
                  <td class="caption"><xsl:value-of select="//lcl/BEZ/geen_bezoekers"/></td>
                </tr>
              </table>
            </xsl:when>
            <xsl:otherwise>
              <!-- Bevestiging bezoekers registratie -->
              <table border="0" bordercolor="#ffffff" width="100%">
                <tr>
                  <td class="caption" valign="top" colspan="2"><xsl:value-of select="//lcl/BEZ/bevestiging_bezoekersregistratie"/>&#xA0;<xsl:value-of select="key"/><br/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/aanvrager"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/naam_full"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/e-mail"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/email"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/locatie"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/werkplek/plaats/regio/district/locatie/omschrijving"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/afdeling"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="contact_user/afdeling/omschrijving"/></td>
                </tr>
                <tr>
                  <td height="20px"/>
                </tr>
                <xsl:if test="contact_user/key!=ingevoerd_user/key">
                  <tr>
                    <td width="20%" class="label"><xsl:value-of select="//lcl/BEZ/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 class="tekst" colspan="2">Hiermee bevestigen wij uw bezoek</td>
                </tr>
                <tr>
                  <td height="20px"/>
                </tr>
                <tr>
                  <td class="tekstkop" colspan="2"><xsl:value-of select="//lcl/BEZ/bezoekgegevens"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/datum_bezoek"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="datum/datum"/>
                    <xsl:if test="datum/datum!=eind/datum">- <xsl:value-of select="eind/datum"/></xsl:if>
                  </td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/tijd_bezoek"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="datum/tijd"/> - <xsl:value-of select="eind/tijd"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/op_bezoek_bij"/></td>
                  <td class="value" width="80%">: <xsl:value-of select="gastheer"/></td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/telefoon"/></td>
                  <td class="value" width="80%">: 070 - 3160160</td>
                </tr>
                <tr>
                  <td class="label" width="20%"><xsl:value-of select="//lcl/BEZ/bezoek_locatie"/></td>
                  <td class="value" width="80%">
                     <xsl:choose>
                        <xsl:when test="plaats/plaatsaanduiding">
                          <xsl:choose>
                            <xsl:when test="plaats/regio/district/locatie/kenmerk[@naam='Locatienaam']">
                              :&#xA0;<xsl:value-of select="plaats/regio/district/locatie/kenmerk[@naam='Locatienaam']"/>
                            </xsl:when>
                            <xsl:otherwise>
                              :&#xA0;<xsl:value-of select="plaats/plaatsaanduiding"/>
                            </xsl:otherwise>
                          </xsl:choose>  
                        </xsl:when>
                        <xsl:otherwise>
                           :&#xA0;<xsl:value-of select="ruimte"/>
                        </xsl:otherwise>
                     </xsl:choose>
                  </td>
                </tr>
								<tr>									
                  <td class="tekst" colspan="2">								
										<xsl:if test="plaats/regio/district/locatie/key='2'"><a href="http://www.mn.nl/media/1511/routebeschrijving-mn-den-haag.pdf">Klik hier voor uw routebeschrijving</a>
									</xsl:if>								

									<xsl:if test="plaats/regio/district/locatie/key='1'"><a href="http://www.mn.nl/media/1510/routebeschrijving-mn-amsterdam.pdf">Klik hier voor uw routebeschrijving</a>
									</xsl:if></td>
                </tr>
                <xsl:if test="opmerking!=''">
                  <tr>
                    <td class="label" width="20%"><xsl:value-of select="//lcl/FAC/opmerking"/></td>
                    <td class="value" width="80%">: <xsl:value-of select="opmerking"/></td>
                  </tr>
                </xsl:if>
                <tr>
                  <td height="20px"/>
                </tr>
                <!-- afspraak -->
                <xsl:for-each select="bezoeker">
                  <xsl:sort select="naam"/>
                  <tr>
                    <td class="result">
                      <xsl:value-of select="naam"/>
                    </td>
                    <td class="result">
                      <xsl:value-of select="bedrijf"/>
                      <xsl:if test="deel">,&#xA0;<xsl:value-of select="//lcl/BEZ/parkeerplaats_gereserveerd"/></xsl:if>
                          <xsl:for-each select="kenmerk[@type!='L' and @type!='l' and @type!='Q' and count(@xmlnode)=0]">
                                    <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>
                  </tr>
                </xsl:for-each>
                <xsl:call-template name="bez_endtext"/>
              </table>
              <!-- Bevestiging bezoekers registratie -->
            </xsl:otherwise>
          </xsl:choose>
        </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\MNNL_files\afspraak54475_20160330164043.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>
-->