<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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="bestelling" mode="include">
		<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" WIDTH="100%">
			<TR>
				<TD WIDTH="40" ROWSPAN="30" ID="LINKERMARGE"></TD>
				<TD>
					<table border="0" width="100%" bordercolor="#000000">
						<tr>
							<td align="left" width="100%" class="caption" colspan="2">Bestelaanvraag <xsl:value-of select="key"/></td>
						</tr>
						<tr>
							<td width="20%" class="label">Aanvrager</td>
							<td width="80%" class="value">: <xsl:value-of select="voor/naam_full"/></td>
						</tr>
						<xsl:if test="string(voor/email)!=''">
							<tr>
								<td class="label">E-mail</td>
								<td class="value">: <xsl:value-of select="voor/email"/></td>
							</tr>
						</xsl:if>
						<xsl:if test="voor/telefoonnr!=''">
							<tr>
								<td class="label">Telefoon</td>
								<td class="value">: <xsl:value-of select="voor/telefoonnr"/></td>
							</tr>
						</xsl:if>
						<tr>
							<td class="label">Afdeling</td>
							<td class="value">:
								<xsl:if test="voor/afdeling/omschrijving=''">-</xsl:if>
								<xsl:value-of select="voor/afdeling/omschrijving"/>
							</td>
						</tr>
						<tr>
							<td class="label">Kostenplaats</td>
							<td class="value">:
								<xsl:if test="kostenplaats/nr=''">-</xsl:if>
								<xsl:value-of select="kostenplaats/nr"/>
							</td>
						</tr>
						<tr>
							<td height="20px"/>
						</tr>
						<tr>
							<td class="label">Aanvraagdatum</td>
							<td class="value">:
								<xsl:value-of select="datum/datum"/>&#xA0;
								<xsl:value-of select="datum/tijd"/>
							</td>
						</tr>
						<tr>
							<td class="label">Aanvraagstatus</td>
							<td class="value">: <xsl:value-of select="status"/></td>
						</tr>
						<xsl:if test="status_key != 1">
								<tr>
									<td class="label">Afleverdatum</td>
									<td class="value">: <xsl:value-of select="leverdatum/datum"/></td>
								</tr>
						</xsl:if>
						<xsl:if test="status_key = 1">
								<tr>
										<td class="label">Opmerking</td>
										<td class="value">:
												<xsl:call-template name="linebreaks">
														<xsl:with-param name="string" select="opmerking"/>
												</xsl:call-template>
										</td>
								</tr>
						</xsl:if>
						<!-- Bij de CYOD catalogus geen afleveradres -->
						<xsl:if test="bestelitem[1]/srtdeel/srtgroep/discipline/key != 221">
								<tr>
									<td class="label" style="vertical-align:top">Afleveradres</td>
									<td class="value">:
										<xsl:value-of select="afleveradres/naam"/>
										<br/>&#xA0;
										<xsl:value-of select="afleveradres/bezoek_adres"/>
										<br/>&#xA0;
										<xsl:value-of select="afleveradres/bezoek_postcode"/>&#xA0;
										<xsl:value-of select="afleveradres/bezoek_plaats"/>
										<br/>&#xA0;
										<xsl:value-of select="afleveradres/bezoek_land"/>
									</td>
								</tr>
						</xsl:if>
						<tr>
							<td height="20px"/>
						</tr>
						<xsl:for-each select="kenmerk">
						<xsl:if test="(@type!='L' and @type!='l')">
							<tr>
								<td class="label">
									<xsl:value-of select="@naam"/>
								</td>
								<td class="value">: <xsl:value-of select="."/></td>
							</tr>
							</xsl:if>
						</xsl:for-each>
						<tr>
							<td height="20px"/>
						</tr>
						<tr>
							<td colspan="2">
								<table cellpadding="0" cellspacing="0" border="1" bordercolor="#303030" width="100%">
									<tr>
										<th>Artikelnr</th>
										<th>Omschrijving</th>
										<th>Opmerkingen</th>
										<th style="text-align:right">Aantal</th>
										<th style="text-align:right">Prijs</th>
										<th style="text-align:right">Totaal</th>
									</tr>
									<xsl:for-each select="bestelitem">
										<tr>
											<td class="result" style="text-align:left">
												<xsl:value-of select="srtdeel/artikel_nummer"/>
											</td>
											<td class="result" style="text-align:left">
												<xsl:value-of select="srtdeel/omschrijving"/>
											</td>
											<td class="result">
												<xsl:for-each select="kenmerk">
												<xsl:if test="(@type!='L' and @type!='l')">
													<xsl:value-of select="@naam"/>:
													<xsl:value-of select="."/>
													<br/>
													</xsl:if>
												</xsl:for-each>&#xA0;</td>
											<td class="result" style="text-align:right">
												<xsl:value-of select="aantal"/>
											</td>
											<td class="result" style="text-align:right">
												<xsl:value-of select="format-number(prijs, '0,00', 'european')"/>
											</td>
											<td class="result" style="text-align:right">
												<xsl:value-of select="format-number(aantal*prijs, '0,00', 'european')"/>
											</td>
										</tr>
									</xsl:for-each>
									<tr>
										<td height="6px" style="border-style:solid;border-width:0px;"/>
									</tr>
									<tr>
										<td class="tekstkop" style="text-align:right;border-style:solid;border-width:0px;" colspan="5">Totaal:</td>
										<td class="tekstkop" style="text-align:right;border-style:solid;border-width:0px;">
											<xsl:value-of select="format-number(sum(/facilitor/bestelling/bestelitem/totaal), '0,00', 'european')"/>
										</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</TD>
				<TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
			</TR>
		</TABLE>
	</xsl:template>


<xsl:template match="bestelopdracht" mode="include">
		<xsl:variable name="l_incompleet">
			<xsl:apply-templates select="." mode="incompleet"/>
		</xsl:variable>
		<xsl:variable name="l_compleet">
			<xsl:apply-templates select="." mode="compleet"/>
		</xsl:variable>
		<xsl:variable name="l_nietsgeleverd">
			<xsl:apply-templates select="." mode="nietsgeleverd"/>
		</xsl:variable>

		<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>Inkooporder</b>
							</td>
						</tr>
						<tr>
							<td colspan="5" style="height:30"/>
						</tr>
						<tr>
							<td colspan="2" style="width:47%">
								<b>Factuur aan:</b>
							</td>
							<td style="width:6%"></td>
							<td colspan="2" style="width:47%">
								<b>Leverancier:</b>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<xsl:value-of select="factuuradres/naam"/>
								<br/>
								<xsl:value-of select="factuuradres/post_adres"/>
								<br/>
								<xsl:value-of select="factuuradres/post_postcode"/>&#xA0;
								<xsl:value-of select="factuuradres/post_plaats"/>
								<br/>
								<xsl:value-of select="factuuradres/post_land"/>
							</td>
							<td/>
							<td colspan="2">
								<xsl:value-of select="bedrijf/naam"/>
								<br/>
								<xsl:value-of select="bedrijf/post_adres"/>
								<br/>
								<xsl:value-of select="bedrijf/post_postcode"/>&#xA0;
								<xsl:value-of select="bedrijf/post_plaats"/>
								<br/>
								<xsl:value-of select="bedrijf/post_land"/>
							</td>
						</tr>
						<tr>
							<td colspan="5" style="height:20"/>
						</tr>
						<tr>
							<td colspan="2">
								<b>Contactgevevens:</b>
							</td>
							<td/>
							<td colspan="2">
								<b/>
							</td>
						</tr>
						<tr>
							<td colspan="2" style="vertical-align:top">
								<b>Besteller:</b>
								<xsl:value-of select="bestelling/voor/naam_full"/>
								<br/>
								<b>E-mail:</b>
								<xsl:value-of select="bestelling/voor/email"/>
								<br/>
								<b>Telefoon:</b>
								<xsl:value-of select="bestelling/voor/telefoonnr"/>
								<br/>
								<b>Kostenplaats:</b>
								<xsl:value-of select="bestelling/kostenplaats/nr"/>
								<br/>
								<b>Werkplek:</b>
								<xsl:value-of select="bestelling/plaats"/>
							</td>
							<td/>
							<td colspan="2" style="vertical-align:top">
								<b>Klantnummer:</b>
                <xsl:choose>
                  <xsl:when test="bestelopdrachtitem/bestelitem/srtdeel/srtgroep/discipline/key=784">
                    3993744
                  </xsl:when>                  
                  <xsl:when test="bestelopdrachtitem/bestelitem/srtdeel/srtgroep/discipline/key=761"><!--Bedrijfs- en beschermkleding-->
                    <xsl:value-of select="afleveradres/plaats/regio/district/locatie/kenmerk[@key='1020']"/>
                  </xsl:when>
				  <xsl:otherwise>
                    <xsl:value-of select="afleveradres/plaats/regio/district/locatie/kenmerk[@key='1001']"/>
                  </xsl:otherwise>
                </xsl:choose>
								<br/>
								<b>Aanvraagnummer(s):</b>
								<xsl:value-of select="bestelling/key"/>
								<br/>
								<b>Opdrachtnummer:</b>
								<xsl:value-of select="id"/>
								<br/>
								<b>Orderdatum:</b>
								<xsl:value-of select="datum/datum"/>
								<br/>
							</td>
						</tr>
						<tr>
							<td colspan="5" style="height:20"/>
						</tr>
						<tr>
							<td colspan="2">
								<b>Gewenste afleverdatum:</b> <xsl:value-of select="/facilitor/bestelopdracht/bestelling/leverdatum/datum"/>
							</td>
							<td/>
							<td colspan="2">
								<b/>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<b>Afleveradres:</b>
							</td>
							<td/>
							<td colspan="2">
								<b/>
							</td>
						</tr>
						<tr>
							<td colspan="2" style="vertical-align:top">
								<xsl:value-of select="afleveradres/naam"/>
								<br/>
								<xsl:value-of select="afleveradres/bezoek_adres"/>
								<br/>
								<xsl:value-of select="afleveradres/bezoek_postcode"/>&#xA0;
								<xsl:value-of select="afleveradres/bezoek_plaats"/>
								<br/>
								<xsl:value-of select="afleveradres/bezoek_land"/>
							</td>
							<td/>
							<td colspan="2" style="vertical-align:top">
								<xsl:for-each select="bestelling/kenmerk">
								<xsl:if test="(@type!='L' and @type!='l')">
									<b>
										<xsl:value-of select="@naam"/>:</b>
									<xsl:value-of select="."/>
									<br/>
								</xsl:if>
								</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">Regel</th>
										<th style="width:20">Artikelnr</th>
										<th style="width:200">Omschrijving</th>
										<th style="width:20">Eenheid</th>
										<th style="width:20; text-align:right">Aantal</th>
										<xsl:if test="$l_nietsgeleverd = 0">
											<th style="width:20; text-align:right">Geleverd</th>
										</xsl:if>
										<th style="width:20; text-align:right">Prijs</th>
										<th style="width:20; text-align:right">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">
												<xsl:if test="(@type!='L' and @type!='l')">
													<br/>
													<xsl:value-of select="@naam"/>: <xsl:value-of select="."/>
												</xsl:if>
												</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>
											<xsl:if test="$l_nietsgeleverd = 0">
												<td class="result" style="text-align:right">
													&#160;<xsl:value-of select="aantalontv"/>
												</td>
											</xsl:if>
											<td class="result" style="text-align:right">
												<xsl:choose>
												<xsl:when test="inkprijs!=''">
													<xsl:value-of select="format-number(inkprijs, '0,00', 'european')"/>
												</xsl:when>
												<xsl:otherwise>
													<xsl:value-of select="format-number(prijs, '0,00', 'european')"/>
												</xsl:otherwise>
												</xsl:choose>
											</td>
											<td class="result" style="text-align:right">
												<xsl:choose>
												<xsl:when test="inkprijs!=''">
													<xsl:value-of select="format-number(inktotaal, '0,00', 'european')"/>
												</xsl:when>
												<xsl:otherwise>
													<xsl:value-of select="format-number(totaal, '0,00', 'european')"/>
												</xsl:otherwise>
												</xsl:choose>
											</td>
										</tr>
									</xsl:for-each>
									<tr>
										<td colspan="6"/>
										<xsl:if test="$l_nietsgeleverd = 0">
											<td/>
										</xsl:if>
										<td style="text-align:right">
											<b>
												<xsl:choose>
												<xsl:when test="sum(bestelopdrachtitem/inktotaal)!=0">
													<xsl:value-of select="format-number(sum(bestelopdrachtitem/inktotaal), '0,00', 'european')"/>
												</xsl:when>
												<xsl:otherwise>
													<xsl:value-of select="format-number(sum(bestelopdrachtitem/inktotaal), '0,00', 'european')"/>
												</xsl:otherwise>
												</xsl:choose>
											</b>
										</td>
									</tr>
								</TABLE>
							</TD>
						</TR>
						<tr>
							<td colspan="5" style="text-align:right">Alle bedragen zijn exclusief BTW</td>
						</tr>
						<tr>
							<td colspan="5" style="height:40"/>
						</tr>
						<xsl:if test="$l_nietsgeleverd = 0">
							<tr>
								<td colspan="5">De order is <xsl:if test="$l_incompleet &gt; 0"><b><i><u><span style="color:red"> niet</span></u></i></b></xsl:if> compleet geleverd <xsl:if test="bestelling/tracking/track[@code = 'BESOTV']/datum != ''"> op <xsl:value-of select="bestelling/tracking/track[@code = 'BESOTV']/datum/datum"/> </xsl:if></td>
							</tr>
							<tr>
								<td colspan="5">De status van de order is <xsl:value-of select="status"/></td>
							</tr>
							<tr>
								<td colspan="5" style="height:40"/>
							</tr>
						</xsl:if>
						<tr>
							<td colspan="5" style="text-align:center; font-size:9px">Op leveringen die gedaan zijn op basis van deze opdracht zijn onze algemene inkoopvoorwaarden van toepassing.
		 Indien sprake is van een mantelovereenkomst geschiedt deze order onder de bepalingen uit de mantelovereenkomst.
		 Facturen zonder vermelding van het opdrachtnummer (<xsl:value-of select="key"/>) worden niet in behandeling genomen.</td>
						</tr>
					</table>
				</TD>
				<TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
			</TR>
		</TABLE>
	</xsl:template>



<xsl:template match="bestelopdracht" mode="nietsgeleverd">
	<xsl:choose>
		<xsl:when test="count(bestelopdrachtitem[aantalontv != '' and aantalontv != '0' ]) &gt; 0">0</xsl:when>
		<xsl:otherwise>1</xsl:otherwise>
	</xsl:choose>
</xsl:template>

<xsl:template match="bestelopdracht" mode="compleet">
	<xsl:value-of select="count(bestelopdrachtitem[aantal]) = count(bestelopdrachtitem[aantalontv])"/>
</xsl:template>

<xsl:template match="bestelopdracht" mode="incompleet">
	<xsl:value-of select="count(bestelopdrachtitem) - count(bestelopdrachtitem[aantal = aantalontv ]) "/>
</xsl:template>

<xsl:template match="bestelling" mode="preview">
		<xsl:variable name="lcletters">abcdefghijklmnopqrstuvwxyz</xsl:variable>
		<xsl:variable name="ucletters">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>
		<xsl:variable name="l_visitekaartje_key">10501</xsl:variable>
		<xsl:variable name="l_visitekaartje_vve_key">10502</xsl:variable>
		<xsl:variable name="l_visitekaartje_ssc_key">10503</xsl:variable>
		<html xmlns:msxml="urn:schemas-microsoft-com:xslt">
			<xsl:comment>================================ VISITEKAARTJES ==============================</xsl:comment>
			<head>
				<meta http-equiv="pragma" content="no-cache"/>
				<meta http-equiv="expires" content="0"/>
				<meta http-equiv="cache-control" content="no-cache"/>
				<xsl:call-template name="stylesheet"/>
				<title>Facilitor: Visitekaartje</title>
				<style>td {
			 font-family: Verdana;
			 vertical-align: top;
			 margin-left: 30px;
			 color: #00295C;
			 background-color: #ffffff;
			 font-size:9px;
			 }
		 td.error {
			 font-family: Verdana, Arial;
			 vertical-align: top;
			 margin-left: 30px;
			 color: yellow;
			 background-color: #ff0000;
			 font-size: 12px;
			 }</style>
			</head>
			<body>
				<table cellSpacing="0" cellPadding="10" width="400" align="center" border="0" style="; vertical-align: middle">
					<tbody>
						<tr>
							<td class="label" style="font-family: verdana; background-color: #cccccc; text-align: center">
								<b>Dit is het visitekaartje</b>
							</td>
						</tr>
						<tr>
							<td style="background-color: #cccccc">
								<table cellSpacing="0" cellPadding="0" align="center" border="1">
									<tbody>
										<tr>
											<td style="background-color: #ffffff">
												<table height="210" cellSpacing="0" cellPadding="0" width="320" align="center" border="0">
													<tbody>
														<tr>
															<td colSpan="2" height="65" style="background-color: #ffffff">
																<xsl:element name="img">
																	<xsl:choose>
																		<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_key">
																			<xsl:attribute name="src">../../cust/<xsl:value-of select="//header/custId"/>/images/alli_visitekaart_logo.jpg</xsl:attribute>
																		</xsl:when>
																		<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_vve_key">
																			<xsl:attribute name="src">../../cust/<xsl:value-of select="//header/custId"/>/images/alli_visitekaart_vve.jpg</xsl:attribute>
																		</xsl:when>
																		<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key">
																			<xsl:attribute name="src">../../cust/<xsl:value-of select="//header/custId"/>/images/alli_visitekaart_ssc.jpg</xsl:attribute>
																		</xsl:when>
																	</xsl:choose>
																</xsl:element>
															</td>
														</tr>
														<tr>
															<td width="5%"/>
															<td width="95%">
																<table width="100%" cellSpacing="0" cellPadding="0" border="0">
																	<tbody>
																		<xsl:choose>
																			<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_key">
																					<tr height="15">
																							<td colspan="3">&#xA0;</td>
																					</tr>
																			</xsl:when>
																			<xsl:otherwise>
																					<tr height="15">
																							<td colspan="3">&#xA0;</td>
																					</tr>
																			</xsl:otherwise>
																		</xsl:choose>
																		<tr height="15">
																			<td width="52%" style="text-align:right;color:#D41042;font-size:12px">
																				<b><xsl:value-of select="kenmerk[@naam='Voornaam']"/>&#xA0;<xsl:value-of select="kenmerk[@naam='Naam']"/></b>
																			</td>
																			<td width="3%">&#xA0;</td>
																			<td width="45%">&#xA0;</td>
																		</tr>
																		<tr height="30">
																			<td width="52%" style="text-align:right;color:#D41042">
																				<xsl:value-of select="kenmerk[@naam='Functie']"/>
																			</td>
																			<td width="3%">&#xA0;</td>
																			<td width="45%">&#xA0;</td>
																		</tr>
																		<tr height="15">
																			<td width="52%" style="text-align:right;color:#D41042">
																			<xsl:variable name="mailafdrukken">
																						<xsl:value-of select="kenmerk[@naam='Opties voor afdrukken e-mailadres']"/>
																			</xsl:variable>
																			<xsl:choose>
																				<xsl:when test="$mailafdrukken ='Geen e-mail afdrukken'"></xsl:when>
																				<xsl:when test="$mailafdrukken ='Het algemene mailadres afdrukken'"><xsl:value-of select="kenmerk[@naam='Standaard mailadres']"/></xsl:when>
																				<xsl:when test="$mailafdrukken ='Uw eigen mailadres afdrukken'"><xsl:value-of select="kenmerk[@naam='Email']"/></xsl:when>
																			</xsl:choose>
																			</td>
																			<td width="3%">&#xA0;</td>
																			<xsl:choose>
																				<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_key"><td width="45%" style="text-align:left;color:#009AC3"><i><xsl:value-of select="kenmerk[@naam='Bedrijfsonderdeel']"/></i></td></xsl:when>
																				<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_vve_key"><td width="45%" style="text-align:left;color:#009AC3"><i><xsl:value-of select="kenmerk[@naam='VvE vestiging']"/></i></td></xsl:when>
																				<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key"><td width="45%" style="text-align:left;color:#009AC3"><i><xsl:value-of select="kenmerk[@naam='Bedrijfsonderdeel']"/></i></td></xsl:when>
																			</xsl:choose>

																		</tr>
																		<tr height="15">
																			<td width="52%" style="text-align:right;color:#D41042">
																				<xsl:variable name="mobabonnee">
																						<xsl:value-of select="kenmerk[@naam='Mobiel nummer']"/>
																				</xsl:variable>
																				<xsl:variable name="mobielafdrukken">
																						<xsl:value-of select="kenmerk[@naam='Mobielnummer afdrukken']"/>
																				</xsl:variable>
																				<xsl:variable name="telefoon035nr">
																						<xsl:value-of select="kenmerk[@naam='Telefoonnummer']"/>
																				</xsl:variable>
																				<xsl:variable name="telefoon035afdrukken">
																						<xsl:value-of select="kenmerk[@naam='Telefoonnummer afdrukken']"/>
																				</xsl:variable>
																				<xsl:choose>
																					<xsl:when test="$mobielafdrukken=1 and string-length(translate($mobabonnee,' ','')) != 0">
																							<xsl:value-of select="substring(translate($mobabonnee,' ',''),1,2)"/>&#xA0;<xsl:value-of select="substring(translate($mobabonnee,' ',''),3,2)"/>&#xA0;<xsl:value-of select="substring(translate($mobabonnee,' ',''),5,3)"/>&#xA0;<xsl:value-of select="substring(translate($mobabonnee,' ',''),8,3)"/>
																					</xsl:when>
																					<xsl:when test="$telefoon035afdrukken=1 and string-length(translate($telefoon035nr,' ','')) != 0">
																							<xsl:value-of select="substring(translate($telefoon035nr,' ',''),1,3)"/>&#xA0;<xsl:value-of select="substring(translate($telefoon035nr,' ',''),4,2)"/>&#xA0;<xsl:value-of select="substring(translate($telefoon035nr,' ',''),6,3)"/>&#xA0;<xsl:value-of select="substring(translate($telefoon035nr,' ',''),9,2)"/>
																					</xsl:when>
																					<xsl:otherwise>
																						088 00 232 00
																					</xsl:otherwise>
																				</xsl:choose>
																			</td>
																			<td width="3%">&#xA0;</td>
																			<td width="45%" style="text-align:left;color:#009AC3">
																					<xsl:choose>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_key">Postbus 105</xsl:when>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_vve_key">Postbus 1178</xsl:when>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key">Postbus 105</xsl:when>
																					</xsl:choose>
																			</td>
																		</tr>
																		<tr height="15">
																			<td width="52%">&#xA0;</td>
																			<td width="3%">&#xA0;</td>
																			<td width="45%" style="text-align:left;color:#009AC3">
																					<xsl:choose>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_key">1200&#xA0;AC&#xA0;&#xA0;Hilversum</xsl:when>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_vve_key">1200&#xA0;BD&#xA0;&#xA0;Hilversum</xsl:when>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key">1200&#xA0;AC&#xA0;&#xA0;Hilversum</xsl:when>
																					</xsl:choose>
																			</td>
																		</tr>
																		<tr height="15">
																			<td width="52%">&#xA0;</td>
																			<td width="3%">&#xA0;</td>
																			<td width="45%" style="text-align:left;color:#009AC3">
																					<xsl:choose>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_key">de-alliantie.nl</xsl:when>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_vve_key">dealliantievvediensten.nl</xsl:when>
																						<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key">de-alliantie.nl</xsl:when>
																					</xsl:choose>
																			</td>
																		</tr>
																		<tr height="35">
																		</tr>

																	</tbody>
																</table>
															</td>
														</tr>
													</tbody>
												</table>
											</td>
										</tr>
									</tbody>
								</table>
							</td>
						</tr>
						<tr>
							<td>
								<table cellSpacing="0" cellPadding="3" align="center" border="3">
									<xsl:variable name="mobnr">
										<xsl:value-of select="kenmerk[@naam='Mobiel kengetal']"/><xsl:value-of select="kenmerk[@naam='Mobiel nummer']"/>
									</xsl:variable>
									<xsl:variable name="mobielafdrukken">
											<xsl:value-of select="kenmerk[@naam='Mobielnummer afdrukken']"/>
									</xsl:variable>
									<xsl:variable name="mobabonnee">
											<xsl:value-of select="kenmerk[@naam='Mobiel nummer']"/>
									</xsl:variable>
									<xsl:variable name="telefoon035nr">
											<xsl:value-of select="kenmerk[@naam='Telefoonnummer']"/>
									</xsl:variable>
									<xsl:variable name="telefoon035afdrukken">
											<xsl:value-of select="kenmerk[@naam='Telefoonnummer afdrukken']"/>
									</xsl:variable>
									<xsl:choose>
										<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key and $telefoon035afdrukken=1 and $mobielafdrukken=1 and string-length(translate($mobabonnee,' ','')) != 0 and string-length(translate($telefoon035nr,' ','')) != 0">
												<tr>
													<td>U kunt niet beide telefoonnummers op het visitekaartje laten afdrukken: het 06-nummer wordt nu gebruikt.</td>
												</tr>
										</xsl:when>
										<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key and $telefoon035afdrukken=1 and $mobielafdrukken=1 and string-length(translate($mobabonnee,' ','')) = 0 and string-length(translate($telefoon035nr,' ','')) != 0">
												<tr>
													<td>Uw mobiele nummer is niet bekend: het vaste telefoonnummer wordt nu gebruikt.</td>
												</tr>
										</xsl:when>
										<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key and $telefoon035afdrukken=1 and ($mobielafdrukken=0 or ($mobielafdrukken=1 and string-length(translate($mobabonnee,' ','')) = 0)) and string-length(translate($telefoon035nr,' ','')) = 0">
												<tr>
													<td>Uw vaste telefoonnummer is niet bekend: het 088 nummer wordt gebruikt.</td>
												</tr>
										</xsl:when>
										<xsl:when test="./ItemOut/ItemID/SupplierPartID=$l_visitekaartje_ssc_key and $telefoon035afdrukken=1 and ($mobielafdrukken=1 and string-length(translate($mobabonnee,' ','')) != 0)">
												<tr>
													<td>Uw vaste telefoonnummer is niet bekend: het 06 nummer wordt gebruikt.</td>
												</tr>
										</xsl:when>
										<xsl:when test="$mobielafdrukken=1 and string-length(translate($mobabonnee,' ','')) = 0">
												<tr>
													<td>Uw mobielnummer is niet bekend: het 088 nummer wordt gebruikt.</td>
												</tr>
										</xsl:when>
									</xsl:choose>
								</table>
							</td>
						</tr>
					</tbody>
				</table>
			</body>
		</html>
	</xsl:template>





		<xsl:template match="melding" mode="include">
				<xsl:if test="./stdmelding/discipline/srtdiscipline/key = 1">
						<xsl:comment>Dit is een bestelaanvraag, dus die gaat op een andere manier...</xsl:comment>
						<xsl:apply-templates select="." mode="IBA"/>
				</xsl:if>
				<xsl:if test="./stdmelding/discipline/srtdiscipline/key != 1">
						<xsl:comment>Dit is geen bestelaanvraag, dus die gaat op de default manier...</xsl:comment>
						<xsl:apply-templates select="." mode="default"/>
				</xsl:if>
		</xsl:template>







		<xsl:template match="melding" mode="IBA">
				<table border="0" width="100%" cellpadding="2">
					<tr>
						<td colspan="2" class="caption" style="padding-top:20px;padding-bottom:20px">
							<b>Aanvraag&#160;<xsl:value-of select="discipline/srtdiscipline/prefix"/><xsl:value-of select="key"/></b>
						</td>
						<td colspan="2" class="caption" style="padding-top:20px;padding-bottom:20px">
							<xsl:if test="spoed&lt;3">
								<b><xsl:value-of select="//lcl/MLD/spoed"/></b>
							</xsl:if>
						</td>
					</tr>
					<tr>
						<td align="right" width="16%">
							<b>Aanvrager:</b>
						</td>
						<td align="left" width="34%">
							<xsl:value-of select="melder/naam_full"/>
						</td>
						<td align="right" width="16%">
							<b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
						</td>
						<td align="left" width="34%">
							<xsl:if test="melder/telefoonnr=''">-</xsl:if>
							<xsl:value-of select="melder/telefoonnr"/>
						</td>
					</tr>


					<tr>
						<td align="right">
							<b>Datum:</b>
						</td>
						<td align="left">
							<xsl:value-of select="gemeld/datum"/>&#xA0;
							<xsl:value-of select="gemeld/tijd"/>u
						</td>
						<td align="right">
							<b>Planning/Afleverdatum:</b>
						</td>
						<td align="left">
							<xsl:value-of select="datum_gepland/datum"/>&#xA0;
							<xsl:value-of select="datum_gepland/tijd"/>u
						</td>
					</tr>
					<tr height="10px">
						<td colspan="4">
							<hr/>
						</td>
					</tr>

					<tr>
						<td align="right">
							<b>Categorie:</b>
						</td>
						<td align="left" colspan="3">>
							<xsl:value-of select="discipline/omschrijving"/>&#160;<xsl:value-of select="stdmelding/omschrijving"/>
						</td>
					</tr>



					<xsl:comment>als we binnen een opdracht zijn, tonen we de meldingtekst niet</xsl:comment>
					<tr>
						<td align="right" valign="top">
							<b><xsl:value-of select="//lcl/FAC/omschrijving"/>:</b>
						</td>
						<td align="left" colspan="3">
							<xsl:call-template name="linebreaks">
								<xsl:with-param name="string" select="omschrijving"/>
							</xsl:call-template>
						</td>
					</tr>

					<tr height="10px">
						<td colspan="4">
							<hr/>
						</td>
					</tr>

					<xsl:for-each select="kenmerk[@type!='L' and @type!='Q' and count(@xmlnode)=0]">
						<xsl:sort select="@volgnummer" data-type="number"/>
						<xsl:apply-templates select="." mode="default"/>
						</xsl:for-each>
					<xsl:if test="count(deel)&gt;0">
						<xsl:for-each select="deel">
							<xsl:sort select="omschrijving"/>
							<tr>
								<xsl:choose>
									<xsl:when test="position()=1">
										<td align="right" valign="top">
											<b><xsl:value-of select="//lcl/MLD/objecten"/>:</b>
										</td>
									</xsl:when>
									<xsl:otherwise>
										<td/>
									</xsl:otherwise>
								</xsl:choose>
								<td align="left" valign="top">
									<xsl:value-of select="omschrijving"/>
								</td>
								<td colspan="2" valign="top">
									<xsl:comment>NADER TE DEFINIEREN</xsl:comment>
								</td>
							</tr>
						</xsl:for-each>
					</xsl:if>
					<xsl:if test="opmerking!=''">
						<tr>
							<td align="right" valign="top">
								<b><xsl:value-of select="//lcl/MLD/afhandeling"/>:</b>
							</td>
							<td colspan="3">
								<xsl:call-template name="linebreaks">
									<xsl:with-param name="string" select="opmerking"/>
								</xsl:call-template>
							</td>
						</tr>
					</xsl:if>
					<tr height="10px">
						<td colspan="4">
							<hr/>
						</td>
					</tr>

					<tr>
						<td align="right" valign="top">
							<b>Afleveradres:</b>
						</td>
						<td align="right" valign="top">
							<b><xsl:value-of select="aflever_adres/naam"/></b><br/>
							<xsl:value-of select="aflever_adres/bezoek_adres"/><br/>
							<xsl:value-of select="aflever_adres/bezoek_postcode"/>&#160;&#160;<xsl:value-of select="aflever_adres/bezoek_plaats"/>
						</td>
						<td align="right" valign="top">
							<b>Factuuradres:</b>
						</td>
						<td align="right" valign="top">
							<b><xsl:value-of select="../factuuradres/naam"/></b><br/>
							<xsl:value-of select="../factuuradres/post_adres"/><br/>
							<xsl:value-of select="../factuuradres/post_postcode"/>&#160;&#160;<xsl:value-of select="aflever_adres/post_plaats"/>
						</td>
					</tr>


				</table>
</xsl:template>


	<xsl:template match="opdracht" mode="include">
		<table border="0" width="100%" cellpadding="2">
			<tr>
				<td colspan="4" class="caption" style="padding-top:20px;padding-bottom:20px">
					<b>
						<xsl:value-of select="opdrachttype/omschrijving"/>&#160;
						<xsl:value-of select="melding/stdmelding/discipline/srtdiscipline/prefix"/>
						<xsl:value-of select="melding/key"/>/<xsl:value-of select="bedrijfopdr_volgnr"/></b>
				</td>
			</tr>
			<tr>
				<td width="16%"/>
				<td width="34%"/>
				<td width="16%" align="right">
					<b><xsl:value-of select="//lcl/FAC/bedrijf"/>:</b>
				</td>
				<td width="34%">
					<xsl:value-of select="uitvoerende/bedrijf/naam"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/contactpersoon"/>:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/contact_persoon"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/telefoon"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/adres"/>:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/post_adres"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/plaats"/>:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/post_plaats"/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/contactpersoon"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="backoffice_contact/naam_full"/>
				</td>
				<td colspan="2"/>
			</tr>
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="backoffice_contact/telefoonnr"/>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/kostenplaats"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="kostenplaats/nr"/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<b><xsl:value-of select="//lcl/FAC/e-mail"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="backoffice_contact/email"/>
				</td>
				<td align="right">
					<b><xsl:value-of select="//lcl/MLD/datum_gereed"/>:</b>
				</td>
				<td align="left">
					<xsl:value-of select="datumgereed/datum"/>
				</td>
			</tr>
			<tr>
				<td colspan="4">
					<hr/>
				</td>
			</tr>
			<tr>
				<td colspan="4" align="center">
					<table width="100%" style="background-color:#EEEEEE;border: 1px solid blue">
						<tr>
							<td>
								<xsl:apply-templates select="melding" mode="include"/>
							</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td colspan="4" height="30px" valign="center">
					<hr/>
				</td>
			</tr>

		</table>
	</xsl:template>

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

</xsl:stylesheet><!-- Stylesheet edited using Stylus Studio - (c) 2004-2007. Progress Software Corporation. All rights reserved. --><!-- 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\ALLI_files\bestelopdr2800_20160114153235.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>
-->