VLKC#40719 Eerste bestelstromen/Fleurop
svn path=/Website/branches/v2017.1/; revision=35303
This commit is contained in:
171
CUST/VLKC/xsl/cxml.xsl
Normal file
171
CUST/VLKC/xsl/cxml.xsl
Normal file
@@ -0,0 +1,171 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
||||
<xsl:output method="xml" encoding="utf-8"/>
|
||||
|
||||
<xsl:variable name="Rev">
|
||||
<xsl:value-of select="substring(translate('$Revision$', '$ ', ''), 10)"/>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:decimal-format name="european" decimal-separator="." grouping-separator=","/>
|
||||
|
||||
<xsl:param name="mode"/>
|
||||
|
||||
<xsl:template name="substring-after-last">
|
||||
<xsl:param name="string"/>
|
||||
<xsl:param name="delimiter"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($string, $delimiter)">
|
||||
<xsl:call-template name="substring-after-last">
|
||||
<xsl:with-param name="string" select="substring-after ($string, $delimiter)"/>
|
||||
<xsl:with-param name="delimiter" select="$delimiter"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise><xsl:value-of select="$string"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="bestelopdracht">
|
||||
<!--Facilitor custom XSL template for cXML bestelopdracht-->
|
||||
<xsl:variable name="orderdate">
|
||||
<xsl:value-of select="datum/jaar"/>-<xsl:value-of select="datum/maand"/>-<xsl:value-of select="datum/dag"/>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="bt_naam">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(bestelling/kostenplaats/nr)=4 and substring(bestelling/kostenplaats/nr, 1, 1)='1'">Kempen & Co</xsl:when>
|
||||
<xsl:otherwise>F. van Lanschot Bankiers NV</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="bt_mail">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(bestelling/kostenplaats/nr)=4 and substring(bestelling/kostenplaats/nr, 1, 1)='1'">financekco@kempen.nl</xsl:when>
|
||||
<xsl:otherwise>facturen@vanlanschot.com</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
<xsl:element name="cXML">
|
||||
<xsl:attribute name="version">1.2.016</xsl:attribute>
|
||||
<xsl:attribute name="payloadID"><xsl:value-of select="key"/></xsl:attribute>
|
||||
<xsl:attribute name="timestamp"><xsl:value-of select="$orderdate"/>T<xsl:value-of select="datum/tijd"/>:00+01:00</xsl:attribute>
|
||||
<xsl:attribute name="xml:lang">NL</xsl:attribute>
|
||||
<Header>
|
||||
<From>
|
||||
<xsl:element name="Credential">
|
||||
<xsl:attribute name="domain"><xsl:value-of select="/facilitor/header/custId"/></xsl:attribute>
|
||||
<Identity/>
|
||||
</xsl:element>
|
||||
</From>
|
||||
<To>
|
||||
<xsl:element name="Credential">
|
||||
<xsl:attribute name="domain"><xsl:value-of select="bedrijf/naam"/></xsl:attribute>
|
||||
<Identity/>
|
||||
</xsl:element>
|
||||
</To>
|
||||
<Sender>
|
||||
<Credential domain="Facilitor">
|
||||
<Identity/>
|
||||
</Credential>
|
||||
<UserAgent/>
|
||||
</Sender>
|
||||
</Header>
|
||||
<Request>
|
||||
<OrderRequest>
|
||||
<xsl:element name="OrderRequestHeader">
|
||||
<!--xsl:attribute name="orderID"><xsl:value-of select="id"/></xsl:attribute-->
|
||||
<xsl:attribute name="orderID"><xsl:value-of select="concat('B', id)"/></xsl:attribute>
|
||||
<xsl:attribute name="orderDate"><xsl:value-of select="$orderdate"/></xsl:attribute>
|
||||
<Total>
|
||||
<Money currency="EUR"><xsl:value-of select="format-number(sum(bestelopdrachtitem/totaal), '0.00', 'european')"/></Money>
|
||||
</Total>
|
||||
<ShipTo>
|
||||
<xsl:element name="Address">
|
||||
<xsl:choose>
|
||||
<xsl:when test="bedrijf/key='5941'">
|
||||
<!--Leeg voor Fleurop (niet bekend in FACILITOR, maar wel bij Fleurop!-->
|
||||
<xsl:attribute name="addressID"/>
|
||||
<Name xml:lang="NL"/>
|
||||
<PostalAddress>
|
||||
<DeliverTo/>
|
||||
<Street/>
|
||||
<City/>
|
||||
<State/>
|
||||
<PostalCode/>
|
||||
<Country isoCountryCode="NL"/>
|
||||
</PostalAddress>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:attribute name="addressID"/>
|
||||
<Name xml:lang="NL"><xsl:value-of select="afleveradres/naam"/></Name>
|
||||
<PostalAddress>
|
||||
<DeliverTo><xsl:value-of select="bestelling/aanvrager/naam_full"/></DeliverTo>
|
||||
<Street><xsl:value-of select="bestelling/afleveradres/bezoek_adres"/></Street>
|
||||
<City><xsl:value-of select="bestelling/afleveradres/bezoek_plaats"/></City>
|
||||
<State></State>
|
||||
<PostalCode><xsl:value-of select="bestelling/afleveradres/bezoek_postcode"/></PostalCode>
|
||||
<Country isoCountryCode="NL"><xsl:value-of select="bestelling/afleveradres/bezoek_land"/></Country>
|
||||
</PostalAddress>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:element>
|
||||
</ShipTo>
|
||||
<BillTo>
|
||||
<xsl:element name="Address">
|
||||
<xsl:attribute name="addressID"/>
|
||||
<Name xml:lang="NL"><xsl:value-of select="$bt_naam"/></Name>
|
||||
<PostalAddress name="Finance, Reporting & Control">
|
||||
<Street>Postbus 75666</Street>
|
||||
<City>Amsterdam</City>
|
||||
<State/>
|
||||
<PostalCode>1070 AR</PostalCode>
|
||||
<Country isoCountryCode="NL">Nederland</Country>
|
||||
</PostalAddress>
|
||||
<Email><xsl:value-of select="$bt_mail"/></Email>
|
||||
</xsl:element>
|
||||
</BillTo>
|
||||
<Contact>
|
||||
<Name xml:lang="NL"><xsl:value-of select="bestelling/aanvrager/naam_full"/></Name>
|
||||
<Email><xsl:value-of select="bestelling/aanvrager/email"/></Email>
|
||||
</Contact>
|
||||
<Extrinsic name="PO"><xsl:value-of select="bestelopdrachtitem/bestelitem/srtdeel/opmerking"/></Extrinsic>
|
||||
<Extrinsic name="Costcenter"><xsl:value-of select="bestelling/kostenplaats/nr"/></Extrinsic>
|
||||
</xsl:element>
|
||||
<xsl:for-each select="bestelopdrachtitem">
|
||||
<xsl:sort select="srtdeel/omschrijving"/>
|
||||
<xsl:sort select="posnr"/>
|
||||
<xsl:element name="ItemOut">
|
||||
<xsl:attribute name="quantity"><xsl:value-of select="aantal"/></xsl:attribute>
|
||||
<xsl:attribute name="lineNumber"><xsl:value-of select="posnr"/></xsl:attribute>
|
||||
<xsl:attribute name="requestedDeliveryDate"><xsl:value-of select="$orderdate"/></xsl:attribute>
|
||||
<ItemID>
|
||||
<SupplierPartID><xsl:value-of select="bestelitem/srtdeel/artikel_nummer"/></SupplierPartID>
|
||||
</ItemID>
|
||||
<ItemDetail>
|
||||
<UnitPrice>
|
||||
<Money currency="EUR"><xsl:value-of select="format-number(prijs, '0.00', 'european')"/></Money>
|
||||
</UnitPrice>
|
||||
<Description xml:lang="NL"><xsl:value-of select="bestelitem/srtdeel/omschrijving"/></Description>
|
||||
<UnitOfMeasure><xsl:value-of select="bestelitem/srtdeel/eenheid"/></UnitOfMeasure>
|
||||
<Classification domain=""/>
|
||||
</ItemDetail>
|
||||
</xsl:element>
|
||||
</xsl:for-each>
|
||||
</OrderRequest>
|
||||
</Request>
|
||||
</xsl:element>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="facilitor">
|
||||
<xsl:apply-templates select="bestelopdracht"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="/">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$mode='getExtension'">
|
||||
<xsl:element name="format">
|
||||
<xsl:element name="extension">xml</xsl:element>
|
||||
</xsl:element>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:apply-templates select="facilitor"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
Reference in New Issue
Block a user