PCHD#56753 stylesheet Absoluta.xsl

svn path=/Website/branches/v2019.1/; revision=42758
This commit is contained in:
Sander Schepers
2019-05-28 12:47:54 +00:00
parent 69dd395706
commit 0d870bb4fc

View File

@@ -1,55 +1,146 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:decimal-format name="european" decimal-separator="." grouping-separator=","/>
<xsl:param name="mode"/>
<xsl:template match="bestelopdracht">
<ORDER>
<HEADER>
<TYPE>new</TYPE>
<REFERENCE><xsl:value-of select="id"/></REFERENCE>
<COSTACCOUNT><xsl:value-of select="bestelling/voor/afdeling/kostenplaats/nr"/></COSTACCOUNT>
<COSTCENTER><xsl:value-of select="bestelling/voor/afdeling/kostenplaats/nr"/></COSTCENTER>
<ORDERNUMBER><xsl:value-of select="id"/></ORDERNUMBER>
<SUPPLIER>
<ORDERNUMBER><xsl:value-of select="bestelopdrachtitem/bestelitem/srtdeel/notitie"/></ORDERNUMBER>
</SUPPLIER>
<BUYER>
<ORDEREDBY>
<ORDERBY_NAME><xsl:value-of select="besteller/naam_full"/></ORDERBY_NAME>
<ORDERBY_EMAIL><xsl:value-of select="besteller/email"/></ORDERBY_EMAIL>
<ORDERBY_PHONE><xsl:value-of select="besteller/telefoonnr"/></ORDERBY_PHONE>
</ORDEREDBY>
<INVOICETO>
<INVOICETO_COMPANYNAME>Absoluta</INVOICETO_COMPANYNAME>
<INVOICETO_TITLE></INVOICETO_TITLE>
<INVOICETO_FIRSTNAME></INVOICETO_FIRSTNAME>
<INVOICETO_LASTNAME></INVOICETO_LASTNAME>
<INVOICETO_STREET></INVOICETO_STREET>
<INVOICETO_CITY></INVOICETO_CITY>
<INVOICETO_POSTALCODE></INVOICETO_POSTALCODE>
<INVOICETO_EMAIL></INVOICETO_EMAIL>
</INVOICETO>
</BUYER>
</HEADER>
<PRODUCTS>
<xsl:for-each select="bestelopdrachtitem">
<xsl:sort select="posnr"/>
<ITEM>
<LINENUMBER><xsl:value-of select="posnr"/></LINENUMBER>
<QUANTITY><xsl:value-of select="aantal"/></QUANTITY>
<ITEM_NAME><xsl:value-of select="omschrijving"/></ITEM_NAME>
<IPOID><xsl:value-of select="bestelitem/srtdeel/artikel_nummer"/></IPOID>
</ITEM>
</xsl:for-each>
</PRODUCTS>
</ORDER>
<xsl:comment>Facilitor custom XSL template for cXML bestelopdracht</xsl:comment>
<PurchaseOrder>
<MessageHeader>
<CreationDateTime>
<xsl:value-of select="datum/jaar"/>-<xsl:value-of select="datum/maand"/>-<xsl:value-of select="datum/dag"/>T<xsl:value-of select="datum/tijd"/>:00Z</CreationDateTime>
</MessageHeader>
<PurchaseOrder>
<PurchaseOrderHeader>
<DocumentID>
<ID>
<xsl:value-of select="id"/>
</ID>
</DocumentID>
<EmployeeResponsibleParty>
<NamePerson>
<GivenName>
<xsl:value-of select="bestelling/aanvrager/naam_friendly"/>
</GivenName>
</NamePerson>
<Location>
<Address>
<StreetName>
<xsl:value-of select="afleveradres/bezoek_adres"/>
</StreetName>
<PostalCode>
<xsl:value-of select="afleveradres/bezoek_postcode"/>
</PostalCode>
<CityName>
<xsl:value-of select="afleveradres/bezoek_plaats"/>
</CityName>
<CountryCode>NL</CountryCode>
</Address>
</Location>
<Contact>
<TelephoneCommunication>
<FormatedNumber>
<xsl:value-of select="besteller/telefoonnr"/>
</FormatedNumber>
</TelephoneCommunication>
<EMailAddressCommunication>
<EMailAddressID>
<xsl:value-of select="besteller/email"/>
</EMailAddressID>
</EMailAddressCommunication>
</Contact>
</EmployeeResponsibleParty>
<NetAmount currencyCode="EUR">
<xsl:value-of select="format-number(sum(bestelopdrachtitem/totaal), '0.00', 'european')"/>
</NetAmount>
<Costcenter>
<CostcenterId>
<xsl:value-of select="bestelling/kostenplaats/nr"/>
</CostcenterId>
<Description>
<xsl:value-of select="bestelling/kostenplaats/omschrijving"/>
</Description>
</Costcenter>
</PurchaseOrderHeader>
<xsl:for-each select="bestelopdrachtitem">
<xsl:sort select="posnr"/>
<PurchaseOrderLine>
<LineNumber>
<xsl:value-of select="posnr"/>
</LineNumber>
<Product>
<Item>
<SupplierItemID>
<ID>
<xsl:value-of select="substring-before(bestelitem/srtdeel/artikel_nummer,&quot;/&quot;)"/>
</ID>
</SupplierItemID>
<Description>
<xsl:value-of select="bestelitem/srtdeel/omschrijving"/>
</Description>
</Item>
</Product>
<OrderQuantity unitCode="PCE">
<xsl:value-of select="aantal"/>
</OrderQuantity>
<NetPricePerUnit>
<UnitSalePriceAmount currencyCode="EUR">
<xsl:value-of select="prijs"/>
</UnitSalePriceAmount>
<Quantity unitCode="PCE">
<xsl:value-of select="aantal"/>
</Quantity>
</NetPricePerUnit>
<Prices>
<NetAmount currencyCode="EUR">
<xsl:value-of select="totaal"/>
</NetAmount>
</Prices>
<Delivery>
<DeliveryLocation>
<Name>
<xsl:value-of select="../afleveradres/naam"/>
</Name>
<Address>
<StreetName>
<xsl:value-of select="../afleveradres/bezoek_adres"/>
</StreetName>
<PostalCode>
<xsl:value-of select="../afleveradres/bezoek_postcode"/>
</PostalCode>
<CityName>
<xsl:value-of select="../afleveradres/bezoek_plaats"/>
</CityName>
<CountryCode>NL</CountryCode>
</Address>
</DeliveryLocation>
<DeliveryTimePeriod>
<StartDateTime>
<xsl:value-of select="bestelitem/srtdeel/notitie"/>
</StartDateTime>
<EndDateTime>
<xsl:value-of select="bestelitem/srtdeel/notitie"/>
</EndDateTime>
</DeliveryTimePeriod>
</Delivery>
<OrderLineCharacteristic>
<CharacteristicName>CategoryID</CharacteristicName>
<CharacteristicValue>
<xsl:value-of select="substring-after(bestelitem/srtdeel/artikel_nummer,&quot;/&quot;)"/>
</CharacteristicValue>
</OrderLineCharacteristic>
</PurchaseOrderLine>
</xsl:for-each>
</PurchaseOrder>
</PurchaseOrder>
</xsl:template>
<!-- Inpakken 'bon' in SOAP envelope
PutOrders voegt de tag SOAPEnvelope toe roept vervolgens deze stylesheet aan -->
<xsl:template match="SOAPEnvelope">
@@ -58,8 +149,8 @@
<soap:Body>
<ns1:PurchaseOrderRequest>
<xXml><xsl:copy-of select="./node()"/></xXml>
<cUsername>pch</cUsername>
<cPassword>wrTf69uwGM4cL9ta</cPassword>
<cUsername>info@pch.nl</cUsername>
<cPassword>GCtmnU3L</cPassword>
<bBase64>false</bBase64>
</ns1:PurchaseOrderRequest>
</soap:Body>