Files
2024-11-07 15:17:18 +01:00

109 lines
5.1 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!-- 22.12.2023 DEV-8311 SAP sends delivery advices to stores MAPPING: SOURCE
- SAP ZFSHDLV TARGET - syspro internal Format -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs">
<xsl:output method="xml" omit-xml-declaration="no"
indent="yes" />
<xsl:strip-space elements="*" />
<xsl:template match="/XMLRECADV[XMLRECADVHEADER/DocumentSubType = 'RECADV_GI']" name="GOODS_RECEIPT">
<xsl:variable name="Location"><xsl:value-of select="./XMLRECADVHEADER/UltimateConsignyGLN"/></xsl:variable>
<xsl:variable name="Separator"><xsl:value-of select="'_'"/></xsl:variable>
<DELVRY07>
<IDOC>
<xsl:attribute name="BEGIN"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:call-template name="EDI_DC40-8309">
<xsl:with-param name="sendFromGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendFromGLN"/>
</xsl:with-param>
<xsl:with-param name="sendToGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendToGLN"/>
</xsl:with-param>
</xsl:call-template>
<E1EDL20 >
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:choose>
<xsl:when test="contains(./XMLRECADVHEADER/ReferenceDocument,'_')">
<!--<TRAID><xsl:value-of select="format-number(substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator),'0000000000')"/></TRAID>-->
<VBELN><xsl:value-of select="format-number(substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator),'0000000000')"/></VBELN>
</xsl:when>
<xsl:otherwise>
<!--<TRAID><xsl:value-of select="format-number(./XMLRECADVHEADER/ReferenceDocument,'0000000000')"/></TRAID>-->
<VBELN><xsl:value-of select="format-number(./XMLRECADVHEADER/ReferenceDocument,'0000000000')"/></VBELN>
</xsl:otherwise>
</xsl:choose>
<E1EDL18>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<QUALF><xsl:call-template name="Qualifier-8309"/></QUALF>
</E1EDL18>
<!-- Source has deep structure of SSCC-Group with Items / therefore using -->
<!-- <xsl:for-each select="./*/XMLRECADVITEMS">
<E1EDL24>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<POSNR><xsl:value-of select="position()"/></POSNR>
<WERKS><xsl:value-of select="$Location"/></WERKS>
<LIFIMG> <xsl:value-of select="OriginalQuantity"/></LIFIMG>
<EAN11> <xsl:value-of select="./GTIN"/></EAN11>
<POSEX> <xsl:value-of select="./PositionNumber"/></POSEX>
</E1EDL24>
</xsl:for-each> -->
</E1EDL20>
</IDOC>
</DELVRY07>
</xsl:template>
<xsl:template match="/XMLRECADV[XMLRECADVHEADER/DocumentSubType = 'RECADV_IBT']">
<xsl:variable name="Location"><xsl:value-of select="./XMLRECADVHEADER/UltimateConsignyGLN"/></xsl:variable>
<xsl:variable name="Separator"><xsl:value-of select="'_'"/></xsl:variable>
<DELVRY07>
<IDOC>
<xsl:attribute name="BEGIN"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:call-template name="EDI_DC40-8309">
<xsl:with-param name="sendFromGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendFromGLN"/>
</xsl:with-param>
<xsl:with-param name="sendToGLN">
<xsl:value-of select="./XMLRECADVHEADER/SendToGLN"/>
</xsl:with-param>
</xsl:call-template>
<E1EDL20 >
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<xsl:choose>
<xsl:when test="contains(./XMLRECADVHEADER/ReferenceDocument,'_')">
<!--<VBELN><xsl:value-of select="substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator)"/></VBELN>-->
<TRAID><xsl:value-of select="substring-before(./XMLRECADVHEADER/ReferenceDocument,$Separator)"/></TRAID>
</xsl:when>
<xsl:otherwise>
<!--<VBELN><xsl:value-of select="./XMLRECADVHEADER/ReferenceDocument"/></VBELN>-->
<TRAID><xsl:value-of select="./XMLRECADVHEADER/ReferenceDocument"/></TRAID>
</xsl:otherwise>
</xsl:choose>
<E1EDL18>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<QUALF><xsl:call-template name="Qualifier-8309"/></QUALF>
</E1EDL18>
<!-- Source has deep structure of SSCC-Group with Items / therefore using *-->
<xsl:for-each select="./*/XMLRECADVITEMS">
<!--<E1EDL24>
<xsl:attribute name="SEGMENT"><xsl:copy-of select="1"/> </xsl:attribute>
<POSNR><xsl:value-of select="position()"/></POSNR>
<WERKS><xsl:value-of select="$Location"/></WERKS>
<LIFIMG> <xsl:value-of select="OriginalQuantity"/></LIFIMG>
<EAN11> <xsl:value-of select="./GTIN"/></EAN11>
<POSEX> <xsl:value-of select="./PositionNumber"/></POSEX>
</E1EDL24>-->
</xsl:for-each>
</E1EDL20>
</IDOC>
</DELVRY07>
</xsl:template>
<xsl:include href="./valueMaps.xsl" />
</xsl:stylesheet>