rm param 'LINES', add '<ReferenceBuyerOrder />'
This commit is contained in:
@@ -1,55 +1,55 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Message>
|
||||
<XMLDESADV>
|
||||
<XMLDESADVHEADER>
|
||||
<DocumentId>0180001585_00000000001000003539</DocumentId>
|
||||
<DeliveryNote>0180001585</DeliveryNote>
|
||||
<DocumentType>XMLDESADV</DocumentType>
|
||||
<DocumentSubType>DESADV_GI</DocumentSubType>
|
||||
<DocumentDate>2024-01-09T00:00:00.0000000+01:00</DocumentDate>
|
||||
<DeliveryDate>2024-01-10T11:00:00.0000000+01:00</DeliveryDate>
|
||||
<ReferenceSupplierOrder />
|
||||
<ReferenceBuyerOrder />
|
||||
<ReferenceDocument />
|
||||
<AllocationReference />
|
||||
<SenderGLN />
|
||||
<ReceipientGLN />
|
||||
<SupplierGLN />
|
||||
<BuyerGLN />
|
||||
<DeliveryPartyGLN />
|
||||
<UltimateConsignyGLN />
|
||||
<ReturnGLN />
|
||||
<SendFromGLN />
|
||||
<SendToGLN />
|
||||
<DeliveryCurrency />
|
||||
</XMLDESADVHEADER>
|
||||
<XMLDESADV />
|
||||
<XMLPACKAGEGROUP>
|
||||
<NumberOfPackages>1</NumberOfPackages>
|
||||
<PackageCode>33E</PackageCode>
|
||||
</XMLPACKAGEGROUP>
|
||||
<XMLSSCCGROUP>
|
||||
<SSCC>1000003539</SSCC>
|
||||
<PackageCode>33E</PackageCode>
|
||||
<PackageType>BJ</PackageType>
|
||||
<XMLITEMS>
|
||||
<PositionNumber>000010</PositionNumber>
|
||||
<GTIN>2050000024177</GTIN>
|
||||
<DeliveredQuantity>1.000</DeliveredQuantity>
|
||||
<QuantityQualifier>12</QuantityQualifier>
|
||||
<DeliveryPrice />
|
||||
<ReferenceSupplierOrder>5400000531</ReferenceSupplierOrder>
|
||||
<ReferenceBuyerOrder />
|
||||
</XMLITEMS>
|
||||
<XMLITEMS>
|
||||
<PositionNumber>000020</PositionNumber>
|
||||
<GTIN>2050000024184</GTIN>
|
||||
<DeliveredQuantity>1.000</DeliveredQuantity>
|
||||
<QuantityQualifier>12</QuantityQualifier>
|
||||
<DeliveryPrice />
|
||||
<ReferenceSupplierOrder>5400000531</ReferenceSupplierOrder>
|
||||
<ReferenceBuyerOrder />
|
||||
</XMLITEMS>
|
||||
</XMLSSCCGROUP>
|
||||
</XMLDESADV>
|
||||
<XMLDESADV>
|
||||
<XMLDESADVHEADER>
|
||||
<DocumentId>0180001585_00000000001000003539</DocumentId>
|
||||
<DeliveryNote>0180001585</DeliveryNote>
|
||||
<DocumentType>XMLDESADV</DocumentType>
|
||||
<DocumentSubType>DESADV_IBT</DocumentSubType>
|
||||
<DocumentDate>2024-01-09T00:00:00.0000000+01:00</DocumentDate>
|
||||
<DeliveryDate>2024-01-10T11:00:00.0000000+01:00</DeliveryDate>
|
||||
<ReferenceSupplierOrder/>
|
||||
<ReferenceBuyerOrder/>
|
||||
<ReferenceDocument/>
|
||||
<AllocationReference/>
|
||||
<SenderGLN/>
|
||||
<ReceipientGLN/>
|
||||
<SupplierGLN/>
|
||||
<BuyerGLN/>
|
||||
<DeliveryPartyGLN/>
|
||||
<UltimateConsignyGLN/>
|
||||
<ReturnGLN/>
|
||||
<SendFromGLN/>
|
||||
<SendToGLN/>
|
||||
<DeliveryCurrency/>
|
||||
</XMLDESADVHEADER>
|
||||
<XMLDESADV/>
|
||||
<XMLPACKAGEGROUP>
|
||||
<NumberOfPackages>1</NumberOfPackages>
|
||||
<PackageCode>33E</PackageCode>
|
||||
</XMLPACKAGEGROUP>
|
||||
<XMLSSCCGROUP>
|
||||
<SSCC>1000003539</SSCC>
|
||||
<PackageCode>33E</PackageCode>
|
||||
<PackageType>BJ</PackageType>
|
||||
<XMLITEMS>
|
||||
<PositionNumber>000010</PositionNumber>
|
||||
<GTIN>2050000024177</GTIN>
|
||||
<DeliveredQuantity>1.000</DeliveredQuantity>
|
||||
<QuantityQualifier>12</QuantityQualifier>
|
||||
<DeliveryPrice/>
|
||||
<ReferenceSupplierOrder>5400000531</ReferenceSupplierOrder>
|
||||
<ReferenceBuyerOrder/>
|
||||
</XMLITEMS>
|
||||
<XMLITEMS>
|
||||
<PositionNumber>000020</PositionNumber>
|
||||
<GTIN>2050000024184</GTIN>
|
||||
<DeliveredQuantity>1.000</DeliveredQuantity>
|
||||
<QuantityQualifier>12</QuantityQualifier>
|
||||
<DeliveryPrice/>
|
||||
<ReferenceSupplierOrder>5400000531</ReferenceSupplierOrder>
|
||||
<ReferenceBuyerOrder/>
|
||||
</XMLITEMS>
|
||||
</XMLSSCCGROUP>
|
||||
</XMLDESADV>
|
||||
</Message>
|
||||
|
||||
+152
-143
@@ -10,32 +10,36 @@
|
||||
<xsl:strip-space elements="*" />
|
||||
<xsl:template match="/">
|
||||
<Message>
|
||||
<xsl:apply-templates/>
|
||||
<xsl:apply-templates />
|
||||
</Message>
|
||||
</xsl:template>
|
||||
<xsl:template match="/ZFSHDLV/IDOC">
|
||||
|
||||
<xsl:if test="./E1EDL20/E1EDL37">
|
||||
<xsl:call-template name="HandlingUnit" />
|
||||
</xsl:if>
|
||||
<xsl:if test="not(./E1EDL20/E1EDL37)">
|
||||
<xsl:call-template name="WithOutHandlingUnits" />
|
||||
</xsl:if>
|
||||
<xsl:template match="/ZFSHDLV/IDOC">
|
||||
<xsl:if test="./E1EDL20/E1EDL37">
|
||||
<xsl:call-template name="HandlingUnit" />
|
||||
</xsl:if>
|
||||
<xsl:if test="not(./E1EDL20/E1EDL37)">
|
||||
<xsl:call-template name="WithOutHandlingUnits" />
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="Message">
|
||||
<xsl:param name="CASE"/>
|
||||
<xsl:param name="ID"/>
|
||||
<xsl:param name="SSCCID"/>
|
||||
<xsl:param name="LINES" />
|
||||
<xsl:param name="POSITIONS" />
|
||||
<!-- START: local variable declaration -->
|
||||
<xsl:param name="CASE" />
|
||||
<xsl:param name="ID" />
|
||||
<xsl:param name="SSCCID" />
|
||||
<xsl:param name="POSITIONS" />
|
||||
<!-- START: local variable declaration -->
|
||||
<xsl:variable name="PackageCode">
|
||||
<xsl:copy>33E</xsl:copy>
|
||||
<xsl:copy>
|
||||
33E
|
||||
</xsl:copy>
|
||||
</xsl:variable>
|
||||
<xsl:variable name="PackageType">
|
||||
<xsl:copy>BJ</xsl:copy>
|
||||
<xsl:copy>
|
||||
BJ
|
||||
</xsl:copy>
|
||||
</xsl:variable>
|
||||
<!-- END: local variable declaration -->
|
||||
<!-- END: local variable declaration -->
|
||||
<XMLDESADV>
|
||||
<XMLDESADVHEADER>
|
||||
<DocumentId>
|
||||
@@ -47,48 +51,50 @@
|
||||
<DocumentType>
|
||||
<xsl:call-template name="DocumentType">
|
||||
<xsl:with-param name="DocumentType">
|
||||
<xsl:copy>DEV-8311</xsl:copy>
|
||||
<xsl:copy>
|
||||
DEV-8311
|
||||
</xsl:copy>
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</DocumentType>
|
||||
<DocumentSubType>
|
||||
<xsl:call-template name="DocumentSubType">
|
||||
<xsl:with-param name="LFART">
|
||||
<xsl:value-of select="../E1EDL21/LFART"/>
|
||||
<xsl:value-of select="../E1EDL21/LFART" />
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</DocumentSubType>
|
||||
<DocumentDate>
|
||||
<xsl:value-of
|
||||
select="format-dateTime(adjust-dateTime-to-timezone(xs:dateTime(concat(
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,1,4),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,5,2),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,7,2),
|
||||
'T',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,1,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,3,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,5,2)))),
|
||||
'[Y0000]-[M00]-[D00]T[H00]:[m00]:[s00].[f0000000][Z]')" />
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,1,4),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,5,2),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANF,7,2),
|
||||
'T',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,1,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,3,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='015']/NTANZ,5,2)))),
|
||||
'[Y0000]-[M00]-[D00]T[H00]:[m00]:[s00].[f0000000][Z]')" />
|
||||
</DocumentDate>
|
||||
<DeliveryDate>
|
||||
<xsl:value-of
|
||||
select="format-dateTime(adjust-dateTime-to-timezone(xs:dateTime(concat(
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,1,4),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,5,2),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,7,2),
|
||||
'T',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,1,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,3,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,5,2)))),
|
||||
'[Y0000]-[M00]-[D00]T[H00]:[m00]:[s00].[f0000000][Z]')" />
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,1,4),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,5,2),
|
||||
'-',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANF,7,2),
|
||||
'T',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,1,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,3,2),
|
||||
':',
|
||||
substring(/ZFSHDLV/IDOC/E1EDL20/E1EDT13[QUALF='007']/NTANZ,5,2)))),
|
||||
'[Y0000]-[M00]-[D00]T[H00]:[m00]:[s00].[f0000000][Z]')" />
|
||||
</DeliveryDate>
|
||||
<ReferenceSupplierOrder />
|
||||
<ReferenceBuyerOrder />
|
||||
@@ -109,121 +115,124 @@
|
||||
</XMLDESADV>
|
||||
<XMLPACKAGEGROUP>
|
||||
<NumberOfPackages>
|
||||
<xsl:choose>
|
||||
<xsl:when test="format-number(/ZFSHDLV/IDOC/E1EDL20/ANZPK,'#') > 0 ">
|
||||
<xsl:value-of select="format-number(/ZFSHDLV/IDOC/E1EDL20/ANZPK,'#')" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise><xsl:copy-of select="1"/></xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when
|
||||
test="format-number(/ZFSHDLV/IDOC/E1EDL20/ANZPK,'#') > 0 ">
|
||||
<xsl:value-of
|
||||
select="format-number(/ZFSHDLV/IDOC/E1EDL20/ANZPK,'#')" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:copy-of select="1" />
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</NumberOfPackages>
|
||||
<PackageCode>
|
||||
<xsl:value-of select="$PackageCode" />
|
||||
</PackageCode>
|
||||
</XMLPACKAGEGROUP>
|
||||
<XMLSSCCGROUP>
|
||||
<SSCC><xsl:value-of select="$SSCCID" /></SSCC>
|
||||
<PackageCode>
|
||||
<xsl:value-of select="$PackageCode" />
|
||||
</PackageCode>
|
||||
<PackageType>
|
||||
<xsl:value-of select="$PackageType" />
|
||||
</PackageType>
|
||||
<xsl:copy-of select="$POSITIONS"/>
|
||||
<SSCC>
|
||||
<xsl:value-of select="$SSCCID" />
|
||||
</SSCC>
|
||||
<PackageCode>
|
||||
<xsl:value-of select="$PackageCode" />
|
||||
</PackageCode>
|
||||
<PackageType>
|
||||
<xsl:value-of select="$PackageType" />
|
||||
</PackageType>
|
||||
<xsl:copy-of select="$POSITIONS" />
|
||||
</XMLSSCCGROUP>
|
||||
</XMLDESADV>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="WithOutHandlingUnits">
|
||||
<xsl:variable name="POSITIONS">
|
||||
<xsl:for-each select="./E1EDL20/E1EDL24">
|
||||
<XMLITEMS>
|
||||
<PositionNumber>
|
||||
<xsl:value-of select="./POSNR" />
|
||||
</PositionNumber>
|
||||
<GTIN>
|
||||
<xsl:value-of
|
||||
select="./EAN11" />
|
||||
</GTIN>
|
||||
<DeliveredQuantity>
|
||||
<xsl:value-of
|
||||
select="./LGMNG" />
|
||||
</DeliveredQuantity>
|
||||
<QuantityQualifier>
|
||||
<xsl:call-template name="QuantityQualifier">
|
||||
<xsl:with-param name="UoM">
|
||||
<xsl:value-of
|
||||
select="./MEINS" />
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</QuantityQualifier>
|
||||
<DeliveryPrice></DeliveryPrice>
|
||||
<ReferenceSupplierOrder>
|
||||
<xsl:value-of
|
||||
select="./VGBEL" />
|
||||
</ReferenceSupplierOrder>
|
||||
</XMLITEMS>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
|
||||
<xsl:call-template name="Message" >
|
||||
<xsl:with-param name="CASE" select="'NoHandlingUnit'"/>
|
||||
<xsl:with-param name="ID" select="./E1EDL20/VBELN"/>
|
||||
<xsl:with-param name="SSCCID" select="./E1EDL20/VBELN" />
|
||||
<xsl:with-param name="POSITIONS" select="$POSITIONS"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:template name="WithOutHandlingUnits">
|
||||
<xsl:variable name="POSITIONS">
|
||||
<xsl:for-each select="./E1EDL20/E1EDL24">
|
||||
<XMLITEMS>
|
||||
<PositionNumber>
|
||||
<xsl:value-of select="./POSNR" />
|
||||
</PositionNumber>
|
||||
<GTIN>
|
||||
<xsl:value-of select="./EAN11" />
|
||||
</GTIN>
|
||||
<DeliveredQuantity>
|
||||
<xsl:value-of select="./LGMNG" />
|
||||
</DeliveredQuantity>
|
||||
<QuantityQualifier>
|
||||
<xsl:call-template name="QuantityQualifier">
|
||||
<xsl:with-param name="UoM">
|
||||
<xsl:value-of select="./MEINS" />
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</QuantityQualifier>
|
||||
<DeliveryPrice></DeliveryPrice>
|
||||
<ReferenceSupplierOrder>
|
||||
<xsl:value-of select="./VGBEL" />
|
||||
</ReferenceSupplierOrder>
|
||||
<ReferenceBuyerOrder />
|
||||
</XMLITEMS>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:call-template name="Message">
|
||||
<xsl:with-param name="CASE" select="'NoHandlingUnit'" />
|
||||
<xsl:with-param name="ID" select="./E1EDL20/VBELN" />
|
||||
<xsl:with-param name="SSCCID" select="./E1EDL20/VBELN" />
|
||||
<xsl:with-param name="POSITIONS" select="$POSITIONS" />
|
||||
</xsl:call-template>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template name="HandlingUnit">
|
||||
<xsl:for-each select="./E1EDL20/E1EDL37"> <!-- Looping over all E1EDL37 segments and create a new message -->
|
||||
<xsl:variable name="POSITIONS">
|
||||
<xsl:for-each select="./E1EDL44">
|
||||
<xsl:variable name="position" select="./POSNR" />
|
||||
<XMLITEMS>
|
||||
<PositionNumber>
|
||||
<xsl:value-of select="$position" />
|
||||
</PositionNumber>
|
||||
<GTIN>
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/EAN11" />
|
||||
</GTIN>
|
||||
<DeliveredQuantity>
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/LGMNG" />
|
||||
</DeliveredQuantity>
|
||||
<QuantityQualifier>
|
||||
<xsl:call-template name="QuantityQualifier">
|
||||
<xsl:with-param name="UoM">
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/MEINS" />
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</QuantityQualifier>
|
||||
<DeliveryPrice></DeliveryPrice>
|
||||
<ReferenceSupplierOrder>
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/VGBEL" />
|
||||
</ReferenceSupplierOrder>
|
||||
<ReferenceBuyerOrder />
|
||||
<xsl:if test="exists(./E1EPC03)">
|
||||
<xsl:for-each select="./E1EPC03">
|
||||
<XMLEPC>
|
||||
<EPC>
|
||||
<xsl:value-of select="./EPC" />
|
||||
</EPC>
|
||||
</XMLEPC>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
</XMLITEMS>
|
||||
</xsl:for-each>
|
||||
<xsl:for-each select="./E1EDL44">
|
||||
<xsl:variable name="position" select="./POSNR" />
|
||||
<XMLITEMS>
|
||||
<PositionNumber>
|
||||
<xsl:value-of select="$position" />
|
||||
</PositionNumber>
|
||||
<GTIN>
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/EAN11" />
|
||||
</GTIN>
|
||||
<DeliveredQuantity>
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/LGMNG" />
|
||||
</DeliveredQuantity>
|
||||
<QuantityQualifier>
|
||||
<xsl:call-template name="QuantityQualifier">
|
||||
<xsl:with-param name="UoM">
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/MEINS" />
|
||||
</xsl:with-param>
|
||||
</xsl:call-template>
|
||||
</QuantityQualifier>
|
||||
<DeliveryPrice></DeliveryPrice>
|
||||
<ReferenceSupplierOrder>
|
||||
<xsl:value-of
|
||||
select="../../E1EDL24[POSNR = $position]/VGBEL" />
|
||||
</ReferenceSupplierOrder>
|
||||
<ReferenceBuyerOrder />
|
||||
<xsl:if test="exists(./E1EPC03)">
|
||||
<xsl:for-each select="./E1EPC03">
|
||||
<XMLEPC>
|
||||
<EPC>
|
||||
<xsl:value-of select="./EPC" />
|
||||
</EPC>
|
||||
</XMLEPC>
|
||||
</xsl:for-each>
|
||||
</xsl:if>
|
||||
</XMLITEMS>
|
||||
</xsl:for-each>
|
||||
</xsl:variable>
|
||||
<xsl:call-template name="Message" >
|
||||
<xsl:with-param name="CASE" select="'HandlingUnit'"/>
|
||||
<xsl:with-param name="ID" select="concat(../VBELN,'_',./EXIDV)"/>
|
||||
<xsl:with-param name="SSCCID" select="format-number(./EXIDV,'#')" />
|
||||
<xsl:with-param name="POSITIONS" select="$POSITIONS"/>
|
||||
<xsl:call-template name="Message">
|
||||
<xsl:with-param name="CASE" select="'HandlingUnit'" />
|
||||
<xsl:with-param name="ID"
|
||||
select="concat(../VBELN,'_',./EXIDV)" />
|
||||
<xsl:with-param name="SSCCID"
|
||||
select="format-number(./EXIDV,'#')" />
|
||||
<xsl:with-param name="POSITIONS" select="$POSITIONS" />
|
||||
</xsl:call-template>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
Reference in New Issue
Block a user