<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxml="urn:schemas-microsoft-com:xslt">
  <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:choose>
              <xsl:when test="statusopdr_key = 10 and statusopdr_key_refiat &gt; 0">
                <xsl:value-of select="//lcl/MLD/hergoedkeuring"/>:&#xA0;
              </xsl:when>
              <xsl:when test="(statusopdr_key = 3 or statusopdr_key = 4) and statusopdr_key_refiat &gt; 0">
                <xsl:value-of select="//lcl/MLD/herfiattering"/>:&#xA0;
              </xsl:when>
            </xsl:choose>
            <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="17%"/>
        <td width="17%"/>
        <td width="16%" align="right">
          <b><xsl:value-of select="//lcl/FAC/bedrijf"/>:</b>
        </td>
        <td width="17%">
          <xsl:value-of select="uitvoerende/bedrijf/naam"/>
        </td>
        <td width="17%">
        </td>
      </tr>
      <tr>
        <td colspan="3"/>
        <td align="right">
          <b><xsl:value-of select="//lcl/FAC/contactpersoon"/>:</b>
        </td>
        <td>
          <xsl:value-of select="contactpersoon/naam_full"/>
        </td>
      </tr>
      <tr>
        <td colspan="3"/>
        <td align="right">
          <b><xsl:value-of select="//lcl/FAC/telefoon"/>:</b>
        </td>
        <td>
          <xsl:value-of select="contactpersoon/telefoon1"/>
        </td>
      </tr>
      <tr>
        <td colspan="3"/>
        <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="3"/>
        <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="3"/>
      </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="left">
        </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="3"/>
        <td align="right">
          <b><xsl:value-of select="//lcl/MLD/datum_verzonden"/>:</b>
        </td>
        <td align="left">
          <xsl:value-of select="datumverzonden/datum"/>
        </td>
      </tr>
      <tr>
        <xsl:choose>
          <xsl:when test="melding/deel/kenmerk[@naam='Leverancier-nr']!=''">
            <td align="right">
              <b>Apparaatnummer:</b>
            </td>
            <td align="left">
              <xsl:value-of select="melding/deel/kenmerk[@naam='Leverancier-nr']"/>
            </td>
            <td align="left">
            </td>
          </xsl:when>
          <xsl:otherwise>
            <td colspan="3"/>
          </xsl:otherwise>
        </xsl:choose>
        <td align="right">
          <b><xsl:value-of select="//lcl/MLD/status"/>:</b>
        </td>
        <td align="left">
          <xsl:value-of select="status"/>
        </td>
      </tr>
      <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>
        <td colspan="6">
          <hr/>
        </td>
      </tr>
      <tr>
        <td colspan="6" 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>
     </table>
  </xsl:template>

</xsl:stylesheet>