<?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="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>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:value-of select="afleveradres/contactpers_fax"/>
								<br/>
								<b>Opdrachtnummer:</b>
								<xsl:value-of select="id"/>
								<br/>
								<b>Orderdatum:</b>
								<xsl:value-of select="datum/datum"/>
								<br/>
								<xsl:comment>
									<b>Gewenste afleverdatum:</b>*leverdatum*</xsl:comment>
							</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>
										<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>
											<td class="result" style="text-align:right">
												<xsl:value-of select="format-number(prijs, '0,00', 'european')"/>
											</td>
											<td class="result" style="text-align:right">
												<xsl:value-of select="format-number(totaal, '0,00', 'european')"/>
											</td>
										</tr>
									</xsl:for-each>
									<tr>
										<td colspan="6"/>
										<td style="text-align:right">
											<b>
												<xsl:value-of select="format-number(sum(bestelopdrachtitem/totaal), '0,00', 'european')"/>
											</b>
										</td>
									</tr>
								</TABLE>
							</TD>
						</TR>
						<tr>
							<td colspan="5" style="text-align:right">Alle bedragen zijn exclusief BTW</td>
						</tr>
						<tr>
              <td colspan="5" style="height:40"/>
            </tr>
            <tr>
              <td colspan="5" style="text-align:center; font-size:9px"><xsl:value-of select="//lcl/BES/order_disclaimer1"/>(<xsl:value-of select="id"/>)<xsl:value-of select="//lcl/BES/order_disclaimer2"/></td>
            </tr>
					</table>
				</TD>
				<TD WIDTH="30" ROWSPAN="30" ID="RECHTERMARGE"/>
			</TR>
		</TABLE>
	</xsl:template>


</xsl:stylesheet>
