<?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: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:key name="maanden" match="data_row" use="FCLT_F_MAAND"/>

	<xsl:template match="rapport">
		<style>th {
      border: 1px solid #808080;
    }</style>

		<xsl:if test="@view='denb_v_rap_voorraad' and $srtnotificatiecode!='CUST01' and $srtnotificatiecode!='CUST02'">
			<table width="100%" class="DefResultsetTable" border="1" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="15%"/>
					<col width="15%"/>
					<col width="30%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
				</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_CATALOGUS"/>
						<xsl:sort select="ARTIKEL_NR"/>
						<xsl:copy-of select="."/>
					</xsl:for-each>
				</xsl:variable>

				<xsl:for-each select="msxml:node-set($sorted)/data_row">
					<xsl:if test="position() = 1">
						<tr>
							<th class="DefResultsetHeading" style="text-align:left">
								<b>Catalogusnaam</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Artikelnummer</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:left">
								<b>Artikelomschrijving</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Artikel-<br/>prijs</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Min.<br/>voorraad</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Max.<br/>voorraad</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Inkoop<br/>geleverd</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Intern<br/>besteld</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Voorraad</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Inkoop<br/>besteld</b>
							</th>
							<th class="DefResultsetHeading" style="text-align:center">
								<b>Inkoop<br/>gewenst</b>
							</th>
						</tr>
					</xsl:if>

					<tr>
						<td class="DRR" style="text-align:left">
							<xsl:value-of select="FCLT_F_CATALOGUS"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:center">
							<xsl:value-of select="ARTIKEL_NR"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:left">
							<xsl:value-of select="ARTIKEL_OMSCHRIJVING"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:if test="ARTIKEL_PRIJS!=''">
								<xsl:value-of select="format-number(ARTIKEL_PRIJS, '0,00', 'european')"/>
							</xsl:if>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:value-of select="MIN_VOORRAAD"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:value-of select="MAX_VOORRAAD"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:value-of select="INKOOP_GELEVERD"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:value-of select="INTERN_BESTELD"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:value-of select="VOORRAAD"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:value-of select="INKOOP_BESTELD"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
						<td class="DRR" style="text-align:right">
							<xsl:value-of select="INKOOP_GEWENST"/>
							<xsl:if test="$mode != 'excel'">&#xA0;</xsl:if>
						</td>
					</tr>
				</xsl:for-each>
			</table>
		</xsl:if>

		<xsl:if test="@view='denb_v_rap_voorraad' and ($srtnotificatiecode='CUST01' or $srtnotificatiecode='CUST02')">
      Reminder dat onderstaand(e) artikel(en) onder de ingestelde minimale voorraad zitten.<br/><br/>
			<table width="100%" border="1" cellpadding="0" cellspacing="0">
				<colgroup>
					<col width="15%"/>
					<col width="15%"/>
					<col width="30%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
					<col width="5%"/>
				</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="filtered">
					<xsl:for-each select="rapport_data/data_row">
						<xsl:sort select="FCLT_F_CATALOGUS"/>
						<xsl:sort select="ARTIKEL_NR"/>
						<xsl:if test="VOORRAAD &lt; MIN_VOORRAAD and MIN_VOORRAAD &lt; HIDE_F_VOORRAAD_GISTEREN">
							<xsl:copy-of select="."/>
						</xsl:if>
					</xsl:for-each>
				</xsl:variable>

				<xsl:for-each select="msxml:node-set($filtered)/data_row">
					<xsl:if test="position() = 1">
						<tr>
							<td style="text-align:left">
								<b>Catalogusnaam</b>
							</td>
							<td style="text-align:center">
								<b>Artikelnummer</b>
							</td>
							<td style="text-align:left">
								<b>Artikelomschrijving</b>
							</td>
							<td style="text-align:center">
								<b>Artikel-<br/>prijs</b>
							</td>
							<td style="text-align:center">
								<b>Min.<br/>voorraad</b>
							</td>
							<td style="text-align:center">
								<b>Max.<br/>voorraad</b>
							</td>
							<td style="text-align:center">
								<b>Inkoop<br/>geleverd</b>
							</td>
							<td style="text-align:center">
								<b>Intern<br/>besteld</b>
							</td>
							<td style="text-align:center">
								<b>Voorraad</b>
							</td>
							<td style="text-align:center">
								<b>Inkoop<br/>besteld</b>
							</td>
							<td style="text-align:center">
								<b>Inkoop<br/>gewenst</b>
							</td>
						</tr>
					</xsl:if>

					<tr>
						<td style="text-align:left">
							<xsl:value-of select="FCLT_F_CATALOGUS"/>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="ARTIKEL_NR"/>
						</td>
						<td style="text-align:left">
							<xsl:value-of select="ARTIKEL_OMSCHRIJVING"/>
						</td>
						<td style="text-align:center">
							<xsl:if test="ARTIKEL_PRIJS!=''">
								<xsl:value-of select="format-number(ARTIKEL_PRIJS, '0,00', 'european')"/>
							</xsl:if>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="MIN_VOORRAAD"/>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="MAX_VOORRAAD"/>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="INKOOP_GELEVERD"/>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="INTERN_BESTELD"/>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="VOORRAAD"/>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="INKOOP_BESTELD"/>
						</td>
						<td style="text-align:center">
							<xsl:value-of select="INKOOP_GEWENST"/>
						</td>
					</tr>
				</xsl:for-each>
			</table>
		</xsl:if>
	</xsl:template>
</xsl:stylesheet>
