MARX#48947: Koppeling REMS <--> Mareon
svn path=/Website/branches/v2017.2/; revision=36007
This commit is contained in:
168
CUST/MARX/xsl/REMS_GetOpdrachten.xsl
Normal file
168
CUST/MARX/xsl/REMS_GetOpdrachten.xsl
Normal file
@@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:s="http://www.w3.org/2003/05/soap-envelope"
|
||||
xmlns:b="http://schemas.datacontract.org/2004/07/SG.Services.Repositories"
|
||||
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
|
||||
version="1.0">
|
||||
<xsl:output method="text" encoding="UTF-8"/>
|
||||
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:apply-templates select="ServiceOpdracht"/>
|
||||
</xsl:template>
|
||||
<!-- REMS specials -->
|
||||
<!-- REMS stuurt kennelijk(?) geen meldingnummer mee, of kent geen melding->opdracht (1:n) structuur, dus 1 melding met n opdrachten, we hanteren (voorlopig) 1-1 relatie: 1 melding->1opdracht, oftewel externe meldingnr = extern opdrachtnr -->
|
||||
<!-- Dus mld_melding_externnr = mld_opdr_externnr = mld_opdr_ordernr -->
|
||||
<!-- b:companyId (prs_afdeling_externnr) en b:purchOrderCompanyId (mld_opdr_po_companyid)worden niet meegestuurd, we hanteren hier de waarde (default) 1 voor beide, oftewel de opdrachtgever van opdracht = waar de factuur verstuurt moet worden -->
|
||||
<!-- Mobiel telefoonnummer wordt uit telefoonnummer2 gehaald, hier ontbreekt wel semantiek, want is dit wel mobiel nummer? -->
|
||||
<!-- b:objectDescription blijft leeg, kan niet worden bepaald, is geen punt verder -->
|
||||
<!-- We gaan er eerst maar eens vanuit dat alles op VHE-nivo wordt gemeld, later evt uitbreiden naar complex of subcomplex nivo -->
|
||||
<!-- Datum velden Opdrachtdatum en Plandatum (en Opleverdatum?) zijn atypische XML date/time velden, ook nog eens niet consistent -->
|
||||
<!-- Normaal is datumnotatie YYYY-MM-DDThh:mm:ss Daarom gaan we deze voor dit moment even hard invullen op 2017-12-31, tzt vervangen door juiste datumvelden -->
|
||||
<!-- Er zijn geen eenheden in de opdrachtregels, iets als M of M2 of STUKS of iets dergelijks, daarom hier HARD op STUK gezet -->
|
||||
<!-- Prijs bestaat niey, aantal ook niet, die hard op 1 gezet -->
|
||||
<!-- Er is geen BTW percentage, hier maar op HARD op 'Hoog' zetten -->
|
||||
|
||||
<xsl:template match="ServiceOpdracht">exec_code;ax_supplier_id;mld_melding_externnr;mld_melding_omschrijving;prs_afdeling_externnr;mld_opdr_po_companyid;mld_opdr_opzichter;mld_melding_cust_name;mld_melding_cust_straat;mld_melding_cust_huisnr;mld_melding_cust_huisnr2;mld_melding_cust_postcode;mld_melding_cust_plaats;mld_melding_cust_telefoonnr;mld_melding_cust_mobielnr;mld_melding_cust_email;mld_melding_cust_object_omschr;complexnummer;pandnummer;VGEnummer;mld_melding_memo;mld_opdr_externnr;mld_opdr_ordernr;mld_opdr_datumbegin;mld_opdr_datum_plan;mld_opdr_einddatum;mld_opdr_mat_linenr;mld_opdr_mat_code;mld_opdr_mat_naam;mld_opdr_mat_eenheidcode;mld_opdr_mat_eenheid;mld_opdr_mat_prijs;mld_opdr_mat_aantal;mld_opdr_mat_btwperc;mld_opdr_mat_totaal
|
||||
<xsl:for-each select="_OpdrachtUitvoerder/Opdracht">1;<xsl:value-of select="../Uitvoerder/Code_Uitvoerder"/>;<xsl:call-template name="REMS_TaskId"/>;<xsl:call-template name="REMS_Opdracht_Omschrijving"/>;<xsl:value-of select="../../header/ERP_id"/>;<xsl:value-of select="../../header/ERP_id"/>;;<xsl:call-template name="REMS_Opdracht_Contactpersoon"/>;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="Opdracht_Locatie/Opdracht_straat"/></xsl:call-template>;<xsl:value-of select="Opdracht_Locatie/Opdracht_huisnummer"/>;<xsl:value-of select="Opdracht_Locatie/Opdracht_volgletter"/>;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="Opdracht_Locatie/Opdracht_postcode"/></xsl:call-template>;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="Opdracht_Locatie/Opdracht_plaats"/></xsl:call-template>;<xsl:call-template name="REMS_Opdracht_Contactpersoon_Tel1"/>;<xsl:call-template name="REMS_Opdracht_Contactpersoon_Tel2"/>;<xsl:call-template name="REMS_Opdracht_Contactpersoon_Email"/>;;<xsl:value-of select="../Gebouwenboom/Codes/Complex/Beheercode_volledig"/>;<xsl:value-of select="../Gebouwenboom/Codes/Subcomplex/Beheercode_volledig"/>;<xsl:value-of select="../Gebouwenboom/Codes/VHE/Beheercode_volledig"/>;<xsl:call-template name="REMS_Opdracht_Memo"/>;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="Opdrachtnummer"/></xsl:call-template>;<xsl:call-template name="REMS_TaskId"/>;<xsl:value-of select="translate(Opdrachtdatum,'zZ','')"/>;<xsl:value-of select="translate(Plandatum,'zZ','')"/>;<xsl:value-of select="translate(Opleverdatum,'zZ','')"/>;;;;;;;;;
|
||||
2;<xsl:value-of select="../Uitvoerder/Code_Uitvoerder"/>;<xsl:call-template name="REMS_TaskId"/>;;<xsl:value-of select="../../header/ERP_id"/>;<xsl:value-of select="../../header/ERP_id"/>;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="../Opzichter/OpzichterInfo/Opzichtergegevens/Naam"/></xsl:call-template>;;;;;;;;;;;<xsl:value-of select="../Gebouwenboom/Codes/Complex/Beheercode_volledig"/>;<xsl:value-of select="../Gebouwenboom/Codes/Subcomplex/Beheercode_volledig"/>;<xsl:value-of select="../Gebouwenboom/Codes/VHE/Beheercode_volledig"/>;;<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="Opdrachtnummer"/></xsl:call-template>;<xsl:call-template name="REMS_TaskId"/>;;;;;;;;;;;; </xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="vrije_tekst_limiet">
|
||||
<xsl:param name="p_string"/>
|
||||
<xsl:param name="p_lengte"/>
|
||||
<xsl:call-template name="vrije_tekst"><xsl:with-param name="p_string" select="substring($p_string,1,$p_lengte)"/></xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="vrije_tekst">
|
||||
<xsl:param name="p_string"/>
|
||||
<xsl:variable name="l_string_esc_quotes"><xsl:call-template name="escape_quote"><xsl:with-param name="string" select="$p_string"/></xsl:call-template></xsl:variable>
|
||||
<xsl:variable name="l_string_esc_linebreaks"><xsl:call-template name="escape_linebreaks"><xsl:with-param name="string" select="$l_string_esc_quotes"/></xsl:call-template></xsl:variable>"<xsl:value-of select="$l_string_esc_linebreaks"/>"</xsl:template>
|
||||
|
||||
<xsl:template name="escape_quote">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($string, '"')"><xsl:value-of select="substring-before($string, '"')"/>""<xsl:call-template name="escape_quote">
|
||||
<xsl:with-param name="string" select="substring-after($string, '"')"/></xsl:call-template></xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="escape_linebreaks">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($string, '
')"><xsl:value-of select="substring-before($string, '
')"/>@@<xsl:call-template name="escape_linebreaks">
|
||||
<xsl:with-param name="string" select="substring-after($string, '
')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="REMS_Opdracht_Omschrijving">
|
||||
<xsl:call-template name="vrije_tekst">
|
||||
<xsl:with-param name="p_string"><xsl:value-of select="Opdracht_Omschrijving/Omschrijving_kort"/>@@<xsl:value-of select="Opdracht_Omschrijving/Omschrijving_lang"/></xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="REMS_Opdracht_Memo">
|
||||
<xsl:call-template name="vrije_tekst_limiet">
|
||||
<xsl:with-param name="p_string"><xsl:value-of select="Opdracht_Omschrijving/Werkomschrijving"/>@@<xsl:value-of select="Opdracht_Omschrijving/Opmerking_bon"/></xsl:with-param>
|
||||
<xsl:with-param name="p_lengte">3000</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="REMS_Opdracht_Contactpersoon">
|
||||
<xsl:call-template name="coalesce">
|
||||
<xsl:with-param name="p_str1" select="Opdracht_Melder/Opdracht_Melder_Contactpersoon/Naam"/>
|
||||
<xsl:with-param name="p_str2" select="Opdracht_Melder/OpdrachtMelder_Naam"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="REMS_Opdracht_Contactpersoon_Tel1">
|
||||
<xsl:call-template name="coalesce">
|
||||
<xsl:with-param name="p_str1" select="Opdracht_Melder/Opdracht_Melder_Contactpersoon/Telefoon"/>
|
||||
<xsl:with-param name="p_str2" select="Opdracht_Melder/OpdrachtMelder_Telefoon1"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="REMS_Opdracht_Contactpersoon_Tel2">
|
||||
<xsl:call-template name="coalesce">
|
||||
<xsl:with-param name="p_str1" select="Opdracht_Melder/Opdracht_Melder_Contactpersoon/TelefoonMobiel"/>
|
||||
<xsl:with-param name="p_str2" select="Opdracht_Melder/OpdrachtMelder_Telefoon2"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="REMS_Opdracht_Contactpersoon_Email">
|
||||
<xsl:call-template name="coalesce">
|
||||
<xsl:with-param name="p_str1" select="Opdracht_Melder/Opdracht_Melder_Contactpersoon/Email"/>
|
||||
<xsl:with-param name="p_str2" select="Opdracht_Melder/OpdrachtMelder_Email"/>
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="REMS_TaskId">
|
||||
<xsl:value-of select="../../header/ERP_id"/>_<xsl:value-of select="../../header/environment"/>_<xsl:value-of select="Opdrachtnummer"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="coalesce">
|
||||
<xsl:param name="p_str1"/>
|
||||
<xsl:param name="p_str2"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$p_str1 != ''"><xsl:value-of select="$p_str1"/></xsl:when>
|
||||
<xsl:when test="$p_str2 != ''"><xsl:value-of select="$p_str2"/></xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="Materiaal_regel">
|
||||
<xsl:param name="p_linenr"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$p_linenr = ''">-1</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$p_linenr"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="Materiaal_eenheidSidB">
|
||||
<xsl:param name="p_unit"/>
|
||||
<!--
|
||||
<xsl:choose>
|
||||
<xsl:when test="$p_unit = 'cm'">CMT</xsl:when>
|
||||
<xsl:when test="$p_unit = 'dag'">DAY</xsl:when>
|
||||
<xsl:when test="$p_unit = 'gram'">GRM</xsl:when>
|
||||
<xsl:when test="$p_unit = 'uur'">HUR</xsl:when>
|
||||
<xsl:when test="$p_unit = 'kg'">KGM</xsl:when>
|
||||
<xsl:when test="$p_unit = 'l'">LTR</xsl:when>
|
||||
<xsl:when test="$p_unit = 'min'">MIN</xsl:when>
|
||||
<xsl:when test="$p_unit = 'ml'">MLT</xsl:when>
|
||||
<xsl:when test="$p_unit = 'mm'">MMT</xsl:when>
|
||||
<xsl:when test="$p_unit = 'm2'">MTK</xsl:when>
|
||||
<xsl:when test="$p_unit = 'm3'">MTQ</xsl:when>
|
||||
<xsl:when test="$p_unit = 'm1'">MTR</xsl:when>
|
||||
<xsl:when test="$p_unit = 'st.'">PCE</xsl:when>
|
||||
<xsl:when test="$p_unit = 't'">TNE</xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
-->
|
||||
<xsl:value-of select="$p_unit"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="Mareon_btwperc">
|
||||
<xsl:param name="p_btwperc"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$p_btwperc = 'Hoog'">21</xsl:when>
|
||||
<xsl:when test="$p_btwperc = 'Laag'">6</xsl:when>
|
||||
<xsl:when test="$p_btwperc = 'Geen'">0</xsl:when>
|
||||
<xsl:otherwise></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
</xsl:stylesheet><!-- 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="serviceopdracht.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>
|
||||
-->
|
||||
Reference in New Issue
Block a user