Skip to content

Commit

Permalink
Minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
C4J committed Nov 8, 2023
1 parent 3190d5c commit 99737bf
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 73 deletions.
2 changes: 1 addition & 1 deletion b6Middleware/b6middleware.install4j
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<language id="pl" />
</additionalLanguages>
</languages>
<jreBundles jdkProviderId="Zulu" release="17/17.0.8.1" />
<jreBundles jdkProviderId="Zulu" release="17/17.0.9" />
</application>
<files keepModificationTimes="true" missingFilesStrategy="error" globalExcludeSuffixes="dirClean.ok,.DS_Store">
<mountPoints>
Expand Down
Binary file modified b6Middleware/c4jMiddleware.jar
Binary file not shown.
76 changes: 76 additions & 0 deletions b6Middleware/xslt/S95_PRODDEC_XML_to_C4J_PRODDEC.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:c4j="http://www.commander4j.com"
exclude-result-prefixes="xs" version="2.0">

<xsl:output encoding="UTF-8" indent='yes' method="xml" />
<xsl:strip-space elements="*"/>

<!-- CONFIG DATA -->
<xsl:variable name="HOSTREF"><xsl:value-of select="c4j:getConfigItem('config','HostRef')"/></xsl:variable>
<xsl:variable name="SAPUsername"><xsl:value-of select="c4j:getConfigItem('config','SAPUsername')"/></xsl:variable>

<!-- Local Variables -->

<xsl:variable name="DATENOW" select="current-dateTime()"/>
<xsl:variable name="MESSAGEDATE" select="format-dateTime($DATENOW, '[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01]')"></xsl:variable>
<xsl:variable name="LONG_SSCC" select="/ProductionPerformance/ProductionResponse/SegmentResponse/MaterialProducedActual/MaterialSubLotID"/>
<xsl:variable name="SSCC" select="substring($LONG_SSCC,3,18)"/>

<xsl:template match='ProductionPerformance'>

<ProductionPerformance>
<message>
<hostRef><xsl:value-of select='$HOSTREF' /></hostRef>
<messageRef><xsl:value-of select='/ProductionPerformance/ID' /></messageRef>
<interfaceType>Production Declaration</interfaceType>
<messageInformation>SSCC=<xsl:value-of select='$SSCC' /></messageInformation>
<interfaceDirection>Input</interfaceDirection>
<messageDate><xsl:value-of select='/ProductionPerformance/ProductionResponse/SegmentResponse/MaterialProducedActual/globe_PostingDate'/></messageDate>
<messageData>
<productionDeclaration>
<SSCC><xsl:value-of select='$SSCC' /></SSCC>
<productionQuantity><xsl:value-of select='/ProductionPerformance/ProductionResponse/SegmentResponse/MaterialProducedActual/Quantity/QuantityString' /></productionQuantity>
<productionUOM><xsl:value-of select='/ProductionPerformance/ProductionResponse/SegmentResponse/MaterialProducedActual/Quantity/UnitOfMeasure' /></productionUOM>
<expiryDate><xsl:value-of select='/ProductionPerformance/ProductionResponse/SegmentResponse/MaterialProducedActual/globe_ExpirationDate'/></expiryDate>
<productionDate><xsl:value-of select='/ProductionPerformance/ProductionResponse/SegmentResponse/MaterialProducedActual/globe_ProductionDate'/></productionDate>
<batch><xsl:value-of select='/ProductionPerformance/ProductionResponse/SegmentResponse/MaterialProducedActual/MaterialLotID' /></batch>
<processOrder><xsl:value-of select='/ProductionPerformance/ProductionResponse/ProductionRequestID' /></processOrder>
<confirmed>N</confirmed>
</productionDeclaration>
</messageData>

</message>
</ProductionPerformance>
</xsl:template>

<!-- ================
FUNCTION get config data
================ -->

<xsl:function name="c4j:getConfigItem">
<xsl:param name="type"/>
<xsl:param name="string1"/>

<xsl:variable name="item_info" select="document('configData.xml')/lookup"/>

<xsl:value-of select="$item_info/item[@type=$type][@id=$string1]/value"/>

</xsl:function>

<!-- ================
FUNCTION get reference data
================ -->

<xsl:function name="c4j:getReferenceItem">
<xsl:param name="type"/>
<xsl:param name="string1"/>

<xsl:variable name="item_info" select="document('referenceData.xml')/lookup"/>

<xsl:value-of select="$item_info/item[@type=$type][@id=$string1]/value"/>

</xsl:function>

</xsl:stylesheet>
88 changes: 16 additions & 72 deletions b6Middleware/xslt/UOMData.xml
Original file line number Diff line number Diff line change
@@ -1,89 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<lookup>

<material id="8006038">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
<item type="BasePerPAL"><value>35</value></item>
<item type="BasePerLAG"><value>7</value></item>
<item type="StockUnitPerBase"><value>6</value></item>
</material>

<material id="8009449">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
<item type="BasePerPAL"><value>80</value></item>
<item type="BasePerLAG"><value>16</value></item>
<item type="StockUnitPerBase"><value>5</value></item>
</material>

<material id="8009450">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

<material id="8009451">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

<material id="8009517">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

<material id="8009771">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

<material id="8010120">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
<item type="BasePerPAL"><value>80</value></item>
<item type="BasePerLAG"><value>16</value></item>
<item type="StockUnitPerBase"><value>5</value></item>
</material>

<material id="8010124">
<material id="8009451">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
<item type="BasePerPAL"><value>80</value></item>
<item type="BasePerLAG"><value>16</value></item>
<item type="StockUnitPerBase"><value>5</value></item>
</material>

<material id="8010242">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

<material id="8010243">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

<material id="8011025">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

<material id="8011026">
<item type="BaseUnitofMeasure"><value>BOX</value></item>
<item type="BasePerPAL"><value>64</value></item>
<item type="BasePerLAG"><value>8</value></item>
<item type="StockUnitPerBase"><value>4</value></item>
</material>

</lookup>

0 comments on commit 99737bf

Please sign in to comment.