<?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="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/discipline/srtdiscipline/prefix"/>
						<xsl:value-of select="melding/key"/>/<xsl:value-of select="bedrijfopdr_volgnr"/></b>
					<xsl:if test="geprint = 1">(kopie)</xsl:if>
				</td>
			</tr>
			<tr>
				<td width="16%"/>
				<td width="34%"/>
				<td width="16%" align="right">
					<b>Bedrijf:</b>
				</td>
				<td width="34%">
					<xsl:value-of select="uitvoerende/bedrijf/naam"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Contactpersoon:</b>
				</td>
				<td>
					<xsl:value-of select="contactpersoon/naam_full"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Telefoon:</b>
				</td>
				<td>
					<xsl:value-of select="contactpersoon/telefoon1"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Adres:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/post_adres"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Plaats:</b>
				</td>
				<td>
					<xsl:value-of select="uitvoerende/bedrijf/post_plaats"/>
				</td>
			</tr>
			<tr>
				<td align="right">
					<b>Contactpersoon:</b>
				</td>
				<td align="left">
					<xsl:value-of select="backoffice_contact/naam_full"/>
				</td>
				<td colspan="2"/>
			</tr>
			<tr>
				<td align="right">
					<b>Telefoon:</b>
				</td>
				<td align="left">
					<xsl:value-of select="backoffice_contact/telefoonnr"/>
				</td>
				<td align="right">
					<b>Kostenplaats:</b>
				</td>
				<td align="left">
					<xsl:value-of select="kostenplaats/nr"/>
				</td>
			</tr>
			<xsl:if test="melding/kenmerk[@naam='Ordernr']!=''">
				<tr>
					<td colspan="2"/>
					<td align="right">
						<b>Ordernr:</b>
					</td>
					<td align="left">
						<xsl:value-of select="melding/kenmerk[@naam='Ordernr']"/>
					</td>
				</tr>
			</xsl:if>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Datum gereed:</b>
				</td>
				<td align="left">
					<xsl:value-of select="datumgereed/datum"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Datum verzonden:</b>
				</td>
				<td align="left">
					<xsl:value-of select="datumverzonden/datum"/>
				</td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Status:</b>
				</td>
				<td align="left">
					<xsl:value-of select="status"/>
				</td>
			</tr>
			<tr>
				<td align="right" valign="top">
					<b>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>
				<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>
			<xsl:variable name="arbeid" select="uren*uurloon"/>
			<tr>
				<td align="right">
					<b>Uren:</b>
				</td>
				<td>
					<xsl:value-of select="uren"/>
					<b>&#xA0;à&#xA0;</b>&#x20AC;&#xA0;<xsl:value-of select="format-number(uurloon, '0,00', 'european')"/></td>
				<td align="right">
					<b>Arbeid:</b>
				</td>
				<td style="width:1in;text-align:right">&#x20AC;&#xA0;<xsl:value-of select="format-number($arbeid, '0,00', 'european')"/></td>
			</tr>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Materiaal:</b>
				</td>
				<td style="width:1in;text-align:right">&#x20AC;&#xA0;<xsl:value-of select="format-number(materiaal, '0,00', 'european')"/></td>
			</tr>
			<xsl:variable name="correctie0" select="$arbeid + materiaal"/>
			<xsl:variable name="correctie" select="kosten - $correctie0"/>
			<xsl:if test="$correctie!=0">
				<tr>
					<td colspan="2"/>
					<td align="right">
						<b>Correctie:</b>
					</td>
					<td style="width:1in;text-align:right">&#x20AC;&#xA0;<xsl:value-of select="format-number($correctie, '0,00', 'european')"/></td>
				</tr>
			</xsl:if>
			<tr>
				<td colspan="2"/>
				<td align="right">
					<b>Totaal:</b>
				</td>
				<td style="width:1in;text-align:right">
					<b>&#x20AC;&#xA0;<xsl:value-of select="format-number(kosten, '0,00', 'european')"/></b>
				</td>
			</tr>
		</table>
	</xsl:template>
	<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 class="label">Ingevoerd door</td>
							<td class="value">:
								<xsl:value-of select="invoerder/naam_full"/>
							</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>
						<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>
						<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">
    <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><xsl:value-of select="//lcl/BES/factuur_aan"/>:</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">
                <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><xsl:value-of select="//lcl/FAC/contactgegevens"/>:</b>
              </td>
              <td/>
              <td colspan="2">
                <b/>
              </td>
            </tr>
            <tr>
              <td colspan="2" style="vertical-align:top">
                <b><xsl:value-of select="//lcl/BES/besteller"/>: </b>
                <xsl:value-of select="bestelling/aanvrager/naam_full"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/e-mail"/>: </b>
                <xsl:value-of select="bestelling/aanvrager/email"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/telefoon"/>: </b>
                <xsl:value-of select="bestelling/aanvrager/telefoonnr"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/kostenplaats"/>: </b>
                <xsl:value-of select="bestelling/kostenplaats/nr"/>
                <br/>
                <b><xsl:value-of select="//lcl/FAC/werkplek"/>: </b>
                <xsl:value-of select="bestelling/plaats"/>
              </td>
              <td/>
              <td colspan="2" style="vertical-align:top">
              <!-- 761 = bestelcatalogus Kantoorartikelen (Lyreco). Lyereco klantnummer per afleverplaats -->
              <xsl:if test="bestelopdrachtitem/bestelitem/srtdeel/srtgroep/discipline/key=761"> 
                <b>Klantnummer: </b>
                <xsl:choose>
                <xsl:when test="afleveradres/bezoek_plaats='Diemen'">
                3555781
                </xsl:when>
                <xsl:when test="afleveradres/bezoek_plaats='Arnhem'">
                3555783
                </xsl:when>
                <xsl:when test="afleveradres/bezoek_plaats='Eindhoven'">
                3555785
                </xsl:when>
                <xsl:when test="afleveradres/bezoek_plaats='Den Haag'">
                3555788
                </xsl:when>                
                <xsl:otherwise>
                Voor dit afleveradres bestaat geen seperaat klantnr
                </xsl:otherwise>
                </xsl:choose>
                <br/>
              </xsl:if>  
                <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">
                <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[@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(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="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>
<!-- Stylus Studio meta-information - (c) 2004-2006. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\reportsCache\CONNbestelling19895.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>
-->