Merge branch 'release/1.2' into 'main'

Release/1.2

See merge request r-d-technique/tiers/reflex-wms-connector!1
This commit is contained in:
Cedric RODIER 2023-10-26 12:53:12 +00:00
commit 8ea7fcca53
81 changed files with 2744 additions and 87 deletions

4
HfExpGrpList.ftl Normal file
View File

@ -0,0 +1,4 @@
<#assign ExpiryGroupList = {}/>
<#assign ExpiryGroupList64 = ""/>

View File

@ -1,92 +1,11 @@
# reflex-wms-connector # Reflex Platform Core FTLs
## Getting started These FTL core files aim to translate data flow from Reflex WMS into Reflex platform API.
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
## Add your files You can find more info about those files in the Reflex platform documentation center : https://docs.viz.reflex-platform.com/connectivity/howto/reflex-wms-connector/
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
```
cd existing_repo
git remote add origin https://gitlab.hardis-group.com/r-d-technique/tiers/reflex-wms-connector.git
git branch -M main
git push -uf origin main
```
## Integrate with your tools
- [ ] [Set up project integrations](https://gitlab.hardis-group.com/r-d-technique/tiers/reflex-wms-connector/-/settings/integrations)
## Collaborate with your team
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
## Test and Deploy
Use the built-in continuous integration in GitLab.
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
***
# Editing this README
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
## Suggestions for a good README
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## Name
Choose a self-explaining name for your project.
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
## License
For open source projects, say how it is licensed.
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.

60
RFXtoRP_HfDtlStockLs.ftl Normal file
View File

@ -0,0 +1,60 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#-- sum_elt : nb element in snapshot (optional parameter) -->
<#include "HfRpConfig.ftl">
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign reflexStockPicturesInterface = JsonUtil.jsonToMap(dataRfx)>
<#-- idSnapshot MUST BE UNIQUE regardless of the number of messages in the stock image -->
<#if cloudEventMsg.messageSet??>
<#assign idSnapshot = cloudEventMsg.messageSet />
<#else>
<#assign idSnapshot = cloudEventMsg.id />
</#if>
<#list reflexStockPicturesInterface.detailled_stock_list as stock>
<#if stock.stock_type_code != "200">
<#stop "stock type different from 200">
<#break>
</#if>
</#list>
[
{
<#if sum_elt??>
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorSnapshotCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HfDtlStockLs_ActorSnapshotCompleted.ftl">
<#else>
<#assign apiReflexPlatformID = ApiReflexPlatformID.StockSnapshotted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HfDtlStockLs_StockSnapshotted.ftl">
</#if>
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#stop "event not supported">
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,27 @@
<#include "ReflexUtils.ftl">
[
<#list reflexStockPicturesInterface.detailled_stock_list as stock>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${stock.physical_depot_code}"
},
"Payload": {
<#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) />
"Snapshot": {
"EndDateTime": {
"DateTime": "${generation_date}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"ID": "${stock.physical_depot_code}-${idSnapshot}",
"MessageNb": ${sum_elt}
}
}
}
<#break>
</#list>
]

View File

@ -0,0 +1,38 @@
<#include "ReflexUtils.ftl">
[
<#list reflexStockPicturesInterface.detailled_stock_list as stock>
{
"Header": {
"ProjectID": "${projectRP}"
},
"Payload": {
"ActorID": "${stock.physical_depot_code}",
<#assign generation_date = RfxDateTimetoUTC(stock.generation_date,time_zone_offset_rfx) />
"Snapshot": {
"DateTime": {
"DateTime": "${generation_date}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"ID": "${stock.physical_depot_code}-${idSnapshot}",
"Quantity":
{
"Value" : "${stock.quantity_in_base_lvs!"0"}",
"LVID": "${quantity_in_base_lv_RP_Cst}"
}
},
"Goods": {
"ItemID": "${stock.item_code}",
"LVBranchID": "${stock.item_logistical_variant_code}",
<#assign priority_date = stock.priority_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate" : "${priority_date}",
<#-- Segmentation keys inclusion -->
<#include "RFXtoRP_HfDtlStockLs_StockSnapshotted_SegmentationKeys.ftl">
}
}
}<#sep>,</#sep>
</#list>
]

View File

@ -0,0 +1,42 @@
<#-- use protobuf of class HfDtlStockLs to find Reflex WMS fields names -->
<#--
"SegmentationKeys": [
{
"Key": "Grade",
"Value": { "String" : "${stock.grade_code}"}
},
{
"Key": "Owner",
"Value": { "String" : "${stock.owner_code}"}
},
{
"Key": "BatchNumber",
<#if stock.batch_1 == "">
"Value": { "String" : "no batch"}
<#else>
"Value": { "String" : "${stock.batch_1}"}
</#if>
},
{
"Key": "HeldForSpecificCode",
"Value": { "Bool" : "${stock.held_for_specific_code}"}
},
{
<#assign manufacturing_datetime = RfxDateTimetoUTC(stock.Date_of_manufacture,time_zone_offset_rfx) />
"Key": "ManufacturingDate",
"Value": "Timestamp": {
"AuthorTimeZone": "${time_zone_rfx}",
"DateTime": "${manufacturing_datetime}"
}
}
]
-->
"SegmentationKeys": [ ]

28
RFXtoRP_HfExpGrpList.ftl Normal file
View File

@ -0,0 +1,28 @@
<#-- *********************************************** Parameter global ******************** -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#include "HfExpGrpList.ftl">
<#assign aDateTime = .now>
<#assign Date_Tye_Code_KV = {"010":"PRODUCTION_DATE","020":"PRODUCTION_DATE","030":"BEST_BEFORE_DATE","040":"SELL_BY_DATE","050":"USE_BY_DATE"} >
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#case "D">
<#-- *********************************************** Action = CREATE or UPDATE or DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign file = JsonUtil.jsonToMap(dataRfx)>
<#assign temp = ExpiryGroupList64>
<#list file.expiry_group_list as expiry_group>
<#assign temp = JsonUtil.update(temp,cloudEventMsg.action,expiry_group.exipiry_group_code,Date_Tye_Code_KV[expiry_group.priority_date_type_code])>
</#list>
<#assign output = JsonUtil.print(temp)>
${output}
<#break>
<#default>
<#stop>
</#switch>

19
RFXtoRP_HfGrade.ftl Normal file
View File

@ -0,0 +1,19 @@
<#-- *********************************************** Parameter global ******************** -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#case "D">
<#stop "no generic FTL file available yet for Grades">
<#break>
<#default>
<#stop "event not supported">
</#switch>

19
RFXtoRP_HfLvTypeList.ftl Normal file
View File

@ -0,0 +1,19 @@
<#-- *********************************************** Parameter global ******************** -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#case "D">
<#stop "no generic FTL file available yet for LV types">
<#break>
<#default>
<#stop "event not supported">
</#switch>

19
RFXtoRP_HfOwner.ftl Normal file
View File

@ -0,0 +1,19 @@
<#-- *********************************************** Parameter global ******************** -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#case "D">
<#stop "no generic FTL file available yet for Owners">
<#break>
<#default>
<#stop "event not supported">
</#switch>

33
RFXtoRP_HfRpConfig.ftl Normal file
View File

@ -0,0 +1,33 @@
<#-- ****
Reflex WMS provides some of their environment parameters through the class HfRpConfig
those parameters are stored in FTL file HfRpConfig.ftl for later use in some of the data ftl files
*** -->
<#-- *********************************************** Parameter global ******************** -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign file = JsonUtil.jsonToMap(dataRfx)>
<#include "RFXtoRP_RfxConfigurationRp.ftl">
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#stop "deletion of config not supported">
<#break>
<#default>
<#stop "event not supported">
</#switch>

46
RFXtoRP_HsaCarrier.ftl Normal file
View File

@ -0,0 +1,46 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign carrier = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaCarrier_ActorCreated.ftl">
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************************* -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign carrier = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaCarrier_ActorDeleted.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,51 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${carrier.carrier_code}"
},
"Payload": {
"Name": "${carrier.carrier_designation?json_string}",
"ManagedStock": false,
"IsCarrier": true,
<#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", -->
<#--
<#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">,
-->
"Address":
{
<#-- if Reflex WMS address is structured -->
<#if carrier.carrier_structured_address?? >
"Name": "${carrier.carrier_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data?json_string}",
"PostalCode" : "${carrier.carrier_structured_address.postal_code?json_string}",
"City" : "${carrier.carrier_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${carrier.carrier_structured_address.country_code?json_string}",
"ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code?json_string}",
"State": "${carrier.carrier_structured_address.country_designation?json_string}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${carrier.address.company_name?json_string}",
"StreetAddressOne" : "${carrier.address.address_1?json_string}",
"StreetAddressTwo" : "${carrier.address.address_2?json_string}",
"StreetAddressThree" : "${carrier.address.address_3?json_string}"
</#if>
},
"Phones": ["${carrier.address.telephone?json_string}",
"${carrier.address.other_number?json_string}"
],
"Typology": "TYPOLOGY_CARRIER"
}
}
]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsaCarrier to find Reflex WMS fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,12 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${carrier.carrier_code}"
},
"Payload": {}
}
]

46
RFXtoRP_HsaCons.ftl Normal file
View File

@ -0,0 +1,46 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign actor = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaCons_ActorCreated.ftl">
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign actor = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaCons_ActorDeleted.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,53 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${actor.code}"
},
"Payload": {
"Name": "${actor.designation?json_string}",
"ManagedStock": false,
"IsCarrier": false,
<#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", -->
<#--
<#include "RFXtoRP_HsaCons_ActorCreated_Metadata.ftl">,
-->
"Address":
{
<#-- if Reflex WMS is structured -->
<#if actor.consignee_structured_address??>
"Name": "${actor.consignee_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data?json_string}",
"PostalCode" : "${actor.consignee_structured_address.postal_code?json_string}",
"City" : "${actor.consignee_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${actor.consignee_structured_address.country_code?json_string}",
"ProvinceCode": "${actor.consignee_structured_address.territorial_div_code?json_string}",
"State": "${actor.consignee_structured_address.country_designation?json_string}"
<#-- if Reflex WMS is not structured -->
<#else>
"Name": "${actor.address.company_name?json_string}",
"StreetAddressOne" : "${actor.address.address_1?json_string}",
"StreetAddressTwo" : "${actor.address.address_2?json_string}",
"StreetAddressThree" : "${actor.address.address_3?json_string}"
</#if>
},
"Phones": ["${actor.address.telephone?json_string}",
"${actor.address.other_number?json_string}"
],
"Typology": "TYPOLOGY_UNKNOWN"
}
}
]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsaCons to find Reflex WMS fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,12 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${actor.code}"
},
"Payload": {}
}
]

75
RFXtoRP_HsaIpgMove.ftl Normal file
View File

@ -0,0 +1,75 @@
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign reflexMvtStockInterface = JsonUtil.jsonToMap(dataRfx)>
<#-- exclusion of the cases of an IPG move with quantity = 0 (weight modification) -->
<#if reflexMvtStockInterface.ipg_move_quantity_in_base_lvs != 0>
<#-- IPG moves translated into Stock moves -->
<#if reflexMvtStockInterface.ipg_move_type == "130" ||
reflexMvtStockInterface.ipg_move_type == "200" ||
reflexMvtStockInterface.ipg_move_type == "210" ||
reflexMvtStockInterface.ipg_move_type == "220" ||
reflexMvtStockInterface.ipg_move_type == "230" ||
reflexMvtStockInterface.ipg_move_type == "240" ||
reflexMvtStockInterface.ipg_move_type == "260" ||
reflexMvtStockInterface.ipg_move_type == "290" ||
reflexMvtStockInterface.ipg_move_type == "300" ||
reflexMvtStockInterface.ipg_move_type == "400" ||
reflexMvtStockInterface.ipg_move_type == "410" ||
reflexMvtStockInterface.ipg_move_type == "420"
>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.StockMoved>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaIpgMove_StockMoved.ftl">
}
]
<#else>
<#-- IPG moves translated into goods received (all type of receipt) -->
<#if reflexMvtStockInterface.ipg_move_type == "100" ||
reflexMvtStockInterface.ipg_move_type == "110" ||
reflexMvtStockInterface.ipg_move_type == "120"
>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsReceived>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaIpgMove_GoodsReceived.ftl">
}
]
<#else>
<#-- Case of IPG move type volontarilly ignored-->
<#stop "Move type not supported">
</#if>
</#if>
<#else>
<#-- cases of an IPG move with quantity = 0 (weight modification))-->
<#stop "move ignored quantity = 0">
</#if>
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#stop "event not supported - Case D ">
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,40 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
<#assign receipt_confirmation_datetime = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) />
<#assign priority_date = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc />
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${reflexMvtStockInterface.hd_number}"
},
"Payload": {
"ReceivedContents" :[
{
"DateTime": {
"DateTime": "${receipt_confirmation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"Goods": {
"ItemID": "${reflexMvtStockInterface.item_code}",
"LVBranchID": "${reflexMvtStockInterface.lv_code}",
"PriorityDate": "${priority_date}",
<#-- Goods received Segmentation Keys inclusion -->
<#include "RFXtoRP_HsaIpgMove_GoodsReceived_SegmentationKeys.ftl">
},
"ExecutionflowID": "${reflexMvtStockInterface.receipt_reference}",
"LineID": "${reflexMvtStockInterface.receipt_line_number}",
"ActorID": "${reflexMvtStockInterface.physical_depot_code}",
"Quantity": {
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs}
}
}
]
}
}
]

View File

@ -0,0 +1,39 @@
<#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names -->
<#--
"SegmentationKeys": [
{
"Key": "Grade",
"Value": { "String" : "${reflexMvtStockInterface.grade_code}"}
},
{
"Key": "Owner",
"Value": { "String" : "${reflexMvtStockInterface.owner_code}"}
},
{
"Key": "BatchNumber",
<#if reflexMvtStockInterface.batch_1 == "">
"Value": { "String" : "no batch"}
<#else>
"Value": { "String" : "${reflexMvtStockInterface.batch_1}"}
</#if>
},
{
"Key": "HeldForSpecificCode",
"Value": { "Bool" : "${reflexMvtStockInterface.ipg_specific_code_held}"}
},
{
<#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"Key": "ManufacturingDate",
"Value": "Timestamp": {
"AuthorTimeZone": "${time_zone_rfx}",
"DateTime": "${manufacturing_date}"
}
}
]
-->
"SegmentationKeys": [ ]

View File

@ -0,0 +1,63 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign MoveType_KV = {"130":"STOCK_MOVEMENT_TYPE_PRODUCTION",
"200":"STOCK_MOVEMENT_TYPE_FIX",
"210":"STOCK_MOVEMENT_TYPE_FIX",
"220":"STOCK_MOVEMENT_TYPE_FIX",
"230":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"240":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"260":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"290":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"300":"STOCK_MOVEMENT_TYPE_REQUALIFICATION",
"400":"STOCK_MOVEMENT_TYPE_FIX",
"410":"STOCK_MOVEMENT_TYPE_FIX",
"420":"STOCK_MOVEMENT_TYPE_REQUALIFICATION"}>
<#assign generation_date = RfxDateTimetoUTC(reflexMvtStockInterface.ipg_move_creation_datetime,time_zone_offset_rfx) />
<#assign ipg_priority_datetime = reflexMvtStockInterface.ipg_priority_date?datetime(rfx_date_format_default)?iso_utc />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"Payload": {
"Goods": {
"ItemID": "${reflexMvtStockInterface.item_code}",
"PriorityDate": "${ipg_priority_datetime}",
<#-- Segmentation keys inclusions -->
<#include "RFXtoRP_HsaIpgMove_StockMoved_SegmentationKeys.ftl">,
"LVBranchID": "${reflexMvtStockInterface.lv_code}"
},
"ActorID": "${reflexMvtStockInterface.physical_depot_code}",
"Movement": {
"DateTime": {
"DateTime": "${generation_date}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"Author": "ReflexWMS-${reflexMvtStockInterface.ipg_move_creation_user_code}",
"ExternalMoveRef" : "${reflexMvtStockInterface.ipg_move_year_number} - ${reflexMvtStockInterface.ipg_move_number}",
"Type": "${MoveType_KV[reflexMvtStockInterface.ipg_move_type]!reflexMvtStockInterface.ipg_move_type}",
"Reason": "${reflexMvtStockInterface.miscellaneous_receipts_despatches_code}",
"ExternalInfo" : "${reflexMvtStockInterface.stock_move_reference}",
<#if reflexMvtStockInterface.ipg_move_operation_year_number!= 0>
"OperationReference": "${reflexMvtStockInterface.ipg_move_operation_year_number} - ${reflexMvtStockInterface.ipg_move_operation_number}",
</#if>
"Quantity":
{
"LVID": "${quantity_in_base_lv_RP_Cst}",
<#if reflexMvtStockInterface.move_sign == "+">
"Value": ${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs}
<#else>
"Value": -${reflexMvtStockInterface.ipg_move_quantity_in_base_lvs}
</#if>
}
}
}
}
]

View File

@ -0,0 +1,36 @@
<#-- use protobuf of class HsaIpgMove to find Reflex WMS fields names -->
<#--
"SegmentationKeys": [
{
"Key": "Grade",
"Value": { "String" : "${reflexMvtStockInterface.grade_code}"}
},
{
"Key": "Owner",
"Value": { "String" : "${reflexMvtStockInterface.owner_code}"}
},
{
"Key": "BatchNumber",
<#if reflexMvtStockInterface.batch_1 == "">
"Value": { "String" : "no batch"}
<#else>
"Value": { "String" : "${reflexMvtStockInterface.batch_1}"}
</#if>
},
{
"Key": "HeldForSpecificCode",
"Value": { "Bool" : "${reflexMvtStockInterface.ipg_specific_code_held}"}
},
{
<#assign manufacturing_date = reflexMvtStockInterface.manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"Key": "ManufacturingDate",
"Value": "Timestamp": {
"AuthorTimeZone": "${time_zone_rfx}",
"DateTime": "${manufacturing_date}"
}
}
]
-->
"SegmentationKeys": [ ]

51
RFXtoRP_HsaItm.ftl Normal file
View File

@ -0,0 +1,51 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign item = JsonUtil.jsonToMap(dataRfx)>
[
{
<#if item.logistical_variant_list?? >
<#assign apiReflexPlatformID = ApiReflexPlatformID.ItemCreated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaItm_ItemCreated.ftl">
<#else>
<#stop "no LV for the item">
</#if>
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign item = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ItemDeleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaItm_ItemDeleted.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

45
RFXtoRP_HsaItmLv.ftl Normal file
View File

@ -0,0 +1,45 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign lv = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantUpdated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated.ftl">
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign lv = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ItemLogisticVariantRemoved>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaItmLv_LogisticVariantRemoved.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,14 @@
<#include "HfRpConfig.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${lv.item_code}"
},
"Payload": {
"RemovedLogisticVariantIDs":["${lv.logistical_variant_code}"]
}
}
]

View File

@ -0,0 +1,73 @@
<#include "HfRpConfig.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${lv.item_code}"
},
"Payload": {
"LogisticVariants": [
{
"LVID": "${lv.logistical_variant_code}",
"Name" : "${lv.lv_type_code}",
<#if lv.id_list??>
"Codes": [
<#list lv.id_list as id>
{
"Key": "${id.logistical_variant_ID_type_code}",
"Value": "${id.logistical_variant_ID_code}"
}<#sep>,</#sep>
</#list>
],
</#if>
<#-- LV Metadata inclusion -->
<#include "RFXtoRP_HsaItmLv_LogisticVariantUpdated_Metadata.ftl">,
"IsBaseLogisticVariant": ${lv.base_lv},
<#if lv.base_lv != "true">
"RefLV": "${lv.subpackaging_lv_code}",
</#if>
"QuantityInRefLV": ${lv.quantity_in_subpackaging_lv},
"NetWeight": {
"Value": ${lv.net_weight},
"Unit": "${weight_unit_rfx}"
},
"GrossWeight": {
"Value": ${lv.gross_weight},
"Unit": "${weight_unit_rfx}"
},
"Volume": {
"Value": ${lv.volume},
"Unit": "${volume_unit_rfx}"
},
"Height": {
"Value": ${lv.height},
"Unit": "${length_unit_rfx}"
},
"Width": {
"Value": ${lv.width},
"Unit": "${length_unit_rfx}"
},
"Length": {
"Value": ${lv.depth},
"Unit": "${length_unit_rfx}"
},
<#if lv.packaging_lv == "true">
"BranchIDs": ["${lv.logistical_variant_code}"]
<#else>
"BranchIDs": []
</#if>
}
]
}
}
]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsaItmLv to find Reflex Wms fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,102 @@
<#include "HfRpConfig.ftl">
<#include "HfExpGrpList.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${item.item_code}"
},
"Payload": {
"DescriptionsByLanguage": [{
"ShortDescription": "${item.short_designation?json_string}",
"LongDescription": "${item.designation?json_string}",
"TechnicalDetails": "${item.item_description?json_string}",
"LanguageCodeISO6391": "${text_language_rfx}"
}
],
"ExpiryConstraint": {
"Type": "${ExpiryGroupList[item.expiry_group_code]!"UNKNOWN_DATE"}"
},
<#-- Item metadata inclusion -->
<#include "RFXtoRP_HsaItm_ItemCreated_ItemMetadata.ftl">,
<#-- Item Photo URI could be added here -->
<#--"PhotoURI": " ", -->
<#-- Loop for the Logistical Variants - LV -->
<#if item.logistical_variant_list??>
"LogisticVariants": [
<#list item.logistical_variant_list as logistical_variant>
{
"LVID": "${logistical_variant.logistical_variant_code}",
"Name" : "${logistical_variant.lv_type_code}",
<#if logistical_variant.id_list??>
"Codes": [
<#list logistical_variant.id_list as id>
{
"Key": "${id.logistical_variant_ID_type_code}",
"Value": "${id.logistical_variant_ID_code}"
}<#sep>,</#sep>
</#list>
],
</#if>
<#-- LV Metadata inclusion -->
<#include "RFXtoRP_HsaItm_ItemCreated_LogisticVariantMetadata.ftl">,
"IsBaseLogisticVariant": ${logistical_variant.base_lv},
<#if logistical_variant.base_lv != "true">
"RefLV": "${logistical_variant.subpackaging_lv_code}",
</#if>
"QuantityInRefLV": ${logistical_variant.quantity_in_subpackaging_lv},
"NetWeight": {
"Value": ${logistical_variant.net_weight},
"Unit": "${weight_unit_rfx}"
},
"GrossWeight": {
"Value": ${logistical_variant.gross_weight},
"Unit": "${weight_unit_rfx}"
},
"Volume": {
"Value": ${logistical_variant.volume},
"Unit": "${volume_unit_rfx}"
},
"Height": {
"Value": ${logistical_variant.height},
"Unit": "${length_unit_rfx}"
},
"Width": {
"Value": ${logistical_variant.width},
"Unit": "${length_unit_rfx}"
},
"Length": {
"Value": ${logistical_variant.depth},
"Unit": "${length_unit_rfx}"
},
<#if logistical_variant.packaging_lv == "true">
"BranchIDs": ["${logistical_variant.logistical_variant_code}"]
<#else>
"BranchIDs": []
</#if>
}
<#sep>,</#sep>
</#list>
]
</#if>
<#-- End of LV loop -->
}
}
]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsaItm to find Reflex Wms fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsaItm to find Reflex Wms fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,12 @@
<#include "HfRpConfig.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${item.item_code}"
},
"Payload": {}
}
]

81
RFXtoRP_HsaProStatus.ftl Normal file
View File

@ -0,0 +1,81 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- Action = CREATE or UPDATE -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparationStatusInterface = JsonUtil.jsonToMap(dataRfx) />
[
<#--**Pick batch runned (100) **-->
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "200" >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaProStatus_PreparationExpected.ftl">
}
<#else>
<#-- ** Collection started (300) and Preparation in progress (400)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "300" || preparationStatusInterface.preparation_status_code == "400") >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationStarted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaProStatus_PreparationStarted.ftl">
}
<#else>
<#-- **Preparation to package (500) and preparation completed (550)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && (preparationStatusInterface.preparation_status_code == "500" || preparationStatusInterface.preparation_status_code == "550")>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowPreparationCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaProStatus_PreparationCompleted.ftl">
}
<#else>
<#-- ****Preparation dispatched (600)** -->
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "600" >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowTransportStarted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaProStatus_TransportStarted.ftl">
}
<#else>
<#-- ****Preparation cancelled (650)**** -->
<#if preparationStatusInterface.preparation_status_type == "100" && preparationStatusInterface.preparation_status_code == "650" >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaProStatus_ExecutionflowCancelled.ftl">
}
<#else>
<#stop "Reflex WMS status not supported on Reflex Platform">
</#if>
</#if>
</#if>
</#if>
</#if>
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#stop "event not supported (case D)">
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference}",
"RefDate": {
"DateTime": "${preparation_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {
}
}
]

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference}",
"RefDate": {
"DateTime": "${preparation_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference}",
"RefDate": {
"DateTime": "${preparation_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference}",
"RefDate": {
"DateTime": "${preparation_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(preparationStatusInterface.preparation_status_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${preparationStatusInterface.preparation_order_originator_reference}",
"RefDate": {
"DateTime": "${preparation_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

46
RFXtoRP_HsaSup.ftl Normal file
View File

@ -0,0 +1,46 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign actor = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaSup_ActorCreated.ftl">
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign actor = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsaSup_ActorDeleted.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,50 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${actor.code}"
},
"Payload": {
"Name": "${actor.designation?json_string}",
"ManagedStock": false,
"IsCarrier": false,
<#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", -->
<#--
<#include "RFXtoRP_HsaSup_ActorCreated_Metadata.ftl">,
-->
"Address":
{
<#-- if Reflex WMS address is structured -->
<#if actor.supplier_structured_address?? >
"Name": "${actor.supplier_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data?json_string}",
"PostalCode" : "${actor.supplier_structured_address.postal_code?json_string}",
"City" : "${actor.supplier_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${actor.supplier_structured_address.country_code?json_string}",
"ProvinceCode": "${actor.supplier_structured_address.territorial_div_code?json_string}",
"State": "${actor.supplier_structured_address.country_designation?json_string}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${actor.optional_attributes.company_name?json_string}",
"StreetAddressOne" : "${actor.optional_attributes.address_1?json_string}",
"StreetAddressTwo" : "${actor.optional_attributes.address_2?json_string}",
"StreetAddressThree" : "${actor.optional_attributes.address_3?json_string}"
</#if>
},
"Phones": ["${actor.optional_attributes.telephone?json_string}",
"${actor.optional_attributes.other_number?json_string}"
],
"Typology": "TYPOLOGY_UNKNOWN"
}
}
]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsaSup to find Reflex WMS fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,12 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${actor.code}"
},
"Payload": {}
}
]

46
RFXtoRP_HsrDepot.ftl Normal file
View File

@ -0,0 +1,46 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign depot = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorCreated>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrDepot_ActorCreated.ftl">
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE *************************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign depot = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ActorDeleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrDepot_ActorDeleted.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,50 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${depot.physical_depot_code}"
},
"Payload": {
"Name": "${depot.physical_depot_designation?json_string}",
"ManagedStock": true,
"IsCarrier": false,
<#-- ***Partner ID could be added here *** -->
<#-- "PartnerID": "${}", -->
<#--
<#include "RFXtoRP_HsrDepot_ActorCreated_Metadata.ftl">,
-->
"Address":
{
<#-- if Reflex WMS address is structured -->
<#if depot.physical_depot_structured_address?? >
"Name": "${depot.physical_depot_structured_address.name_or_company?json_string}",
"StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO?json_string}",
"StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data?json_string}",
"PostalCode" : "${depot.physical_depot_structured_address.postal_code?json_string}",
"City" : "${depot.physical_depot_structured_address.post_code_area_name?json_string}",
"CountryCode" : "${depot.physical_depot_structured_address.country_code?json_string}",
"ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code?json_string}",
"State": "${depot.physical_depot_structured_address.country_designation?json_string}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${depot.physical_depot_address.company_name?json_string}",
"StreetAddressOne" : "${depot.physical_depot_address.address_1?json_string}",
"StreetAddressTwo" : "${depot.physical_depot_address.address_2?json_string}",
"StreetAddressThree" : "${depot.physical_depot_address.address_3?json_string}"
</#if>
},
"Phones": ["${depot.physical_depot_address.telephone?json_string}",
"${depot.physical_depot_address.other_number?json_string}"
],
"Typology": "TYPOLOGY_UNKNOWN"
}
}
]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsrDepot to find Reflex WMS fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,12 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${depot.physical_depot_code}"
},
"Payload": {}
}
]

58
RFXtoRP_HsrPrepa.ftl Normal file
View File

@ -0,0 +1,58 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#--<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign preparationOrder = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.GoodsPrepared>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_GoodsPrepared.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.HandlingunitDispatched>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_HandlingUnitDispatched.ftl">
}
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg>
<#if despatched_ipg.consignment_unit_id != "">
,
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.TrackingHULabeled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPrepa_TrackingHuLabelled.ftl">
}
</#if>
</#list>
</#list>
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#stop "event not supported (Case D)">
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,85 @@
<#include "HfRpConfig.ftl">
[
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if despatched_ipg.carton_number != "000000000000000000">
"RefID": "${despatched_ipg.carton_number}"
<#else>
"RefID": "${despatched_ipg.hd_number}"
</#if>
},
"Payload": {
"Information" :{
<#if despatched_ipg.carton_number != "000000000000000000">
"ContainerType": "${despatched_ipg.carton_type_code}"
<#else>
"ContainerType": "${despatched_ipg.hd_type_code}"
</#if>
},
<#-- HU Metadata inclusin inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_HandlingUnitMetadata.ftl">
,
"PreparedContents" :[
{
"Goods": {
"ItemID": "${preparation_line.item_code}",
"LVBranchID": "${preparation_line.item_lv_code}",
<#if (despatched_ipg.ipg_manufacture_date?length != 0) && (despatched_ipg.ipg_manufacture_date?starts_with("00") == false)>
<#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_manufacture_date) /> -->
<#assign priority_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_receipt_date?length != 0) && (despatched_ipg.ipg_receipt_date?starts_with("00")== false)>
<#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_receipt_date) /> -->
<#assign priority_date = despatched_ipg.ipg_receipt_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_best_before_date?length != 0) && (despatched_ipg.ipg_best_before_date?starts_with("00")== false)>
<#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_best_before_date) /> -->
<#assign priority_date = despatched_ipg.ipg_best_before_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_sell_by_date?length != 0) && (despatched_ipg.ipg_sell_by_date?starts_with("00")== false)>
<#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_sell_by_date) /> -->
<#assign priority_date = despatched_ipg.ipg_sell_by_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
<#if (despatched_ipg.ipg_use_by_date?length != 0) && (despatched_ipg.ipg_use_by_date?starts_with("00")== false)>
<#-- <#assign priority_date = JsonUtil.createUTCDateTime(despatched_ipg.ipg_use_by_date) /> -->
<#assign priority_date = despatched_ipg.ipg_use_by_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${priority_date}",
<#else>
"PriorityDate": "error_date",
</#if>
</#if>
</#if>
</#if>
</#if>
<#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrPrepa_GoodsPrepared_SegmentationKeys.ftl">
},
"ExecutionflowID": "${preparation_line.preparation_order_originator_reference}",
"LineID": "${preparation_line.pro_line_number}",
"ActorID": "${preparationOrder.physical_depot_code}",
"Quantity": {
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": ${despatched_ipg.quantity_lvs}
}
}
]
}
}<#sep>,</#sep>
</#list>
<#sep>,</#sep>
</#list>
]

View File

@ -0,0 +1,9 @@
<#-- use protobuf of class HsrPrepa to find Reflex WMS fields names -->
<#--
"MetaData" :[
]
-->
"MetaData": [ ]

View File

@ -0,0 +1,41 @@
<#-- use protobuf of class Hsrprepa to find Reflex WMS fields names -->
<#--
"SegmentationKeys": [
{
"Key": "Grade",
"Value": { "String" : "${preparation_line.grade_code}"}
},
{
"Key": "Owner",
"Value": { "String" : "${preparation_line.owner_code}"}
},
{
"Key": "BatchNumber",
<#if reflexMvtStockInterface.batch_1 == "">
"Value": { "String" : "no batch"}
<#else>
"Value": { "String" : "${despatched_ipg.batch_number}"}
</#if>
},
{
"Key": "HeldForSpecificCode",
<#if despatched_ipg.ipg_held == "true">
"Value": { "Bool" : "True"}
<#else>
"Value": { "Bool" : "False"}
},
{
<#assign manufacturing_date = despatched_ipg.ipg_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"Key": "ManufacturingDate",
"Value": "Timestamp": {
"AuthorTimeZone": "${time_zone_rfx}",
"DateTime": "${manufacturing_date}"
}
}
]
-->
"SegmentationKeys": [ ]

View File

@ -0,0 +1,27 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
<#assign dispatched_datetime = RfxDateTimetoUTC(preparationOrder.stock_despatch_at_preparation_datetime,time_zone_offset_rfx) />
<#list preparationOrder.preparation_line_lst?filter(l ->l.despatched_ipg_list??) as preparation_line>
<#list preparation_line.despatched_ipg_list as despatched_ipg>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
<#if despatched_ipg.carton_number != "000000000000000000">
"RefID": "${despatched_ipg.carton_number}",
<#else>
"RefID": "${despatched_ipg.hd_number}",
</#if>
"RefDate": {
"DateTime": "${dispatched_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": { }
}<#sep>,</#sep>
</#list>
<#sep>,</#sep>
</#list>
]

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${despatched_ipg.consignment_unit_id}"
},
"Payload": {
<#if despatched_ipg.carton_number != "000000000000000000">
"HandlingunitID": "${despatched_ipg.carton_number}"
<#else>
"HandlingunitID": "${despatched_ipg.hd_number}"
</#if>
}
}
]

59
RFXtoRP_HsrPro.ftl Normal file
View File

@ -0,0 +1,59 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#case "U">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign order = JsonUtil.jsonToMap(dataRfx)>
[
{
<#-- check preparation type code (internal order and reservation are ignored) -->
<#if order.preparation_type_code == "010" || order.preparation_type_code == "030">
<#-- Only if preparation order not confirmed -->
<#if order.preparation_order_confirmed == "false" >
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowDetected.ftl">
<#else>
<#stop "preparation order already confirmed">
</#if>
<#else>
<#stop "preparation order type not supported">
</#if>
}
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign order = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrPro_ExecutionflowCancelled.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,19 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign preparation_status_datetime = RfxDateTimetoUTC(order.modification_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${order.originator_reference}",
"RefDate": {
"DateTime": "${preparation_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {
}
}
]

View File

@ -0,0 +1,105 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
<#assign planned_final_delivery_start_datetime = RfxDateTimetoUTC(order.planned_final_delivery_start_datetime,time_zone_offset_rfx) />
<#assign pro_creation_datetime = RfxDateTimetoUTC(order.creation_datetime,time_zone_offset_rfx) />
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${order.originator_reference}",
"RefDate": {
"DateTime": "${pro_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {
"CreationDateTime": {
"DateTime": "${pro_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
<#-- Header Metadata inclusion -->
<#include "RFXtoRP_HsrPro_ExecutionflowDetected_HeaderMetadata.ftl">,
"ShipFrom": {
"ActorID": "${order.physical_depot_code}"
},
"ShipFromAcked": true,
"ShipTo": {
<#if order.address.type_code == "" && order.address.title_code == "" && order.address.first_name == "" && order.address.last_name == "" && order.address.mail_address == "" && order.address.contact_type_code == "" && order.address.mobile_phone_number == "" && order.address.land_line_phone_number == "" && order.address.fax_number == "" && order.address.address_type_code == "" && order.address.name_or_company_name == "" && order.address.additional_address_data_1 == "" && order.address.additional_address_data_2 == "" && order.address.post_code_area_name == "" && order.address.territorial_division_code == "" && order.address.postal_code == "" && order.address.iso_country_code == "">
"ActorID": "${order.end_consignee_code}"
<#else>
"Actor":
{
"Name" : "${order.address.name_or_company_name!""}",
"Address" :
{
"City" : "${order.address.post_code_area_name!""}",
"CountryCode" : "${order.address.iso_country_code!""}",
"PostalCode" : "${order.address.postal_code!""}",
"StreetAddressOne" : "${order.address.street_and_number_and_po_box!""}",
"StreetAddressTwo" : "${order.address.additional_address_data_1!""}",
"StreetAddressThree" : "${order.address.additional_address_data_2!""}"
}
},
"Contact" :
{
"FirstName" : "${order.address.first_name!""}",
"LastName" : "${order.address.last_name!""}",
"Emails" : ["${order.address.mail_address!""}"],
"Phones" : ["${order.address.mobile_phone_number!""}","${order.address.land_line_phone_number!""}", "${order.address.fax_number!""}" ]
}
</#if>
},
<#if order.line_list??>
"Lines" : [
<#list order.line_list as line>
{
<#if (line.originator_reference_line_number!0) != 0>
"LineID": "${line.originator_reference_line_number}",
<#else>
"LineID": "${line.preparation_order_line_number!0}",
</#if>
<#-- Line Metadata inclusion -->
<#include "RFXtoRP_HsrPro_ExecutionflowDetected_LineMetadata.ftl">,
"RequestedContent":
{
"Goods":
{
"ItemID": "${line.item_code!"0"}",
"LVBranchID": "${line.item_lv_code!"0"}",
<#if (line.optional_attributes.forced_priority_date?length != 0) && (line.optional_attributes.forced_priority_date?starts_with("00") == false)>
<#assign forced_priority_date = line.optional_attributes.forced_priority_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${forced_priority_date}",
</#if>
<#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrPro_ExecutionflowDetected_SegmentationKeys.ftl">
},
"Quantity" :
{
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": "${line.base_lv_quantity_to_prepare!0}"
}
}
}<#sep>,</#sep>
</#list>
],
</#if>
"RequestedMilestones" :
{
"RequestedDeliveryDateTime" :
{
"DateTime": "${planned_final_delivery_start_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
}
}
}
]

View File

@ -0,0 +1,14 @@
<#-- use protobuf of class HsrPro to find Reflex Wms fields names -->
<#--
"MetaData": [
{
"Key": "OrderType",
"Value": { "String" : "${order.optional_attributes.reason_code}"}
}
],
-->
"MetaData": [ ]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsrPro to find Reflex Wms fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,23 @@
<#-- use protobuf of class HsrPro to find Reflex WMS fields names -->
<#--
"SegmentationKeys": [
{
"Key": "Grade",
"Value": { "String" : "${line.grade_code_to_prepare}"}
},
{
"Key": "Owner",
"Value": { "String" : "${line.owner_code_to_prepare}"}
},
{
"Key": "BatchNumber",
<#if reflexMvtStockInterface.batch_1 == "">
"Value": { "String" : "no batch"}
<#else>
"Value": { "String" : "${line.batch_1}"}
</#if>
}
]
-->
"SegmentationKeys": [ ]

View File

@ -0,0 +1,94 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign cloudEventMsg = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch cloudEventMsg.action>
<#case "C">
<#-- *********************************************** Action = CREATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
<#if receipt.receipt_type = "030">
<#stop "ignored message because receipt type = transfert">
<#else>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
}
]
</#if>
<#break>
<#case "U">
<#-- *********************************************** Action = UPDATE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[
<#if receipt.receipt_confirmed == "true" >
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ReceiptCompleted>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptCompleted.ftl">
}
<#else>
<#if receipt.receipt_type = "030">
<#stop "ignored message because receipt type = transfert">
<#else>
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowDetected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected.ftl">
},
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowReceiptExpected>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ReceiptExpected.ftl">
}
</#if>
</#if>
]
<#break>
<#case "D">
<#-- *********************************************** Action = DELETE ******************** -->
<#assign dataRfx = JsonUtil.decodeBase64(cloudEventMsg.data) />
<#assign receipt = JsonUtil.jsonToMap(dataRfx)>
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowCancelled>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_HsrReceiptList_ExecutionflowCancelled.ftl">
}
]
<#break>
<#default>
<#stop "event not supported">
</#switch>

View File

@ -0,0 +1,20 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.modification_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${receipt.receipt_reference}",
"RefDate": {
"DateTime": "${receipt_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {
}
}
]

View File

@ -0,0 +1,88 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
[
{
<#assign receipt_datetime = RfxDateTimetoUTC(receipt.receipt_datetime,time_zone_offset_rfx) />
<#assign receipt_creation_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) />
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${receipt.receipt_reference}",
"RefDate": {
"DateTime": "${receipt_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {
"CreationDateTime": {
"DateTime": "${receipt_creation_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
},
<#-- Header Metadata inclusion -->
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_HeaderMetadata.ftl">,
"ShipFrom":
{
"ActorID": "${receipt.original_code}"
},
"ShipTo" :
{
"ActorID": "${receipt.physical_depot_code}"
},
"ShipToAcked": true,
<#if receipt.carrier_informations.carrier_code != "">
"Carrier" : {"ActorID": "${receipt.carrier_informations.carrier_code}"},
</#if>
<#if receipt.line_list??>
"Lines" : [
<#list receipt.line_list as line>
{
"LineID": "${line.receipt_line_number}",
<#-- Line Metadata inclusion -->
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_LineMetadata.ftl">,
"RequestedContent":
{
"Goods":
{
"ItemID": "${line.item_code!"0"}",
"LVBranchID": "${line.item_lv_code!"0"}",
<#if line.line_without_detail??>
<#if (line.line_without_detail.priority_date?length != 0) && (line.line_without_detail.priority_date?starts_with("00") == false)>
<#assign line_without_detail_priority_date = line.line_without_detail.priority_date?datetime(rfx_date_format_default)?iso_utc />
"PriorityDate": "${line_without_detail_priority_date}",
</#if>
<#else>
<#stop "line with detail">
</#if>
<#-- Segmentation Keys inclusion -->
<#include "RFXtoRP_HsrReceiptList_ExecutionflowDetected_SegmentationKeys.ftl">
},
"Quantity" :
{
"LVID": "${quantity_in_base_lv_RP_Cst}",
"Value": "${line.order_quantity_in_lv!0}"
}
}
}
<#sep>,</#sep>
</#list>
],
</#if>
"RequestedMilestones" :
{
"RequestedDeliveryDateTime" :
{
"DateTime": "${receipt_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
}
}
}
]

View File

@ -0,0 +1,14 @@
<#-- use protobuf of class HsrReceiptList to find Reflex Wms fields names -->
<#--
"MetaData": [
{
"Key": "OrderType",
"Value": { "String" : "${order.optional_attributes.reason_code}"}
}
],
-->
"MetaData": [ ]

View File

@ -0,0 +1,4 @@
<#-- use protobuf of class HsrReceiptList to find Reflex Wms fields names -->
"MetaData": [ ]

View File

@ -0,0 +1,41 @@
<#-- use protobuf of class HsrReceiptList to find Reflex WMS fields names -->
<#--
"SegmentationKeys": [
{
"Key": "Grade",
"Value": { "String" : "${line.grade_code}"}
},
{
"Key": "Owner",
"Value": { "String" : "${line.owner_code}"}
},
{
"Key": "BatchNumber",
<#if reflexMvtStockInterface.batch_1 == "">
"Value": { "String" : "no batch"}
<#else>
"Value": { "String" : "${line_without_detail.batch_1}"}
</#if>
},
{
"Key": "HeldForSpecificCode",
<#if line_without_detail.hold_for_specific_code == "true">
"Value": { "Bool" : "True"}
<#else>
"Value": { "Bool" : "False"}
},
{
<#assign manufacturing_date = line_without_detail.ipg_date_of_manufacture_date?datetime(rfx_date_format_default)?iso_utc />
"Key": "ManufacturingDate",
"Value": "Timestamp": {
"AuthorTimeZone": "${time_zone_rfx}",
"DateTime": "${manufacturing_date}"
}
}
]
-->
"SegmentationKeys": [ ]

View File

@ -0,0 +1,19 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.confirmation_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${receipt.receipt_reference}",
"RefDate": {
"DateTime": "${receipt_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {
}
}
]

View File

@ -0,0 +1,21 @@
<#include "HfRpConfig.ftl">
<#include "ReflexUtils.ftl">
<#assign receipt_status_datetime = RfxDateTimetoUTC(receipt.creation_datetime,time_zone_offset_rfx) />
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${receipt.receipt_reference}",
"RefDate": {
"DateTime": "${receipt_status_datetime}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {}
}
]

View File

@ -0,0 +1,43 @@
<#include "HfRpConfig.ftl">
[
<#assign UUID = UUID.randomUUID()>
<#assign strJsonBody = JsonUtil.espaceQuoteInJsonString(restResponseBody)>
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${UUID}",
"RefDate": {
"DateTime": "${aDateTime?iso_utc}",
"AuthorTimeZone": "${time_zone_rfx}"
}
},
"Payload": {
<#assign severity = SeverityLevel.ERROR>
"Severity": "${severity}",
"Namespace": "ReflexIntegration",
"DateTime": {
"DateTime": "${aDateTime?iso_utc}",
"AuthorTimeZone": "${time_zone_rfx}"
},
"TechMessage": {
"Code": "${restResponsetMsg.status}",
"Label": ${strJsonBody}
},
"UserMessage": {
"Code": "${restResponsetMsg.status}",
"Label": ${strJsonBody},
"Params": []
},
"DetailElements": [],
"CorrelationID": "${id.correlationid}",
"ContextPayload": "rfxresponse",
"Type": "RP_EXECUTIONFLOW_EVENT",
"Task": "${id.apiRestReflexID}",
"OriginalID": "${id.refid}",
"StackTrace": ""
}
}
]

View File

@ -0,0 +1,15 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${id.refid}"
},
"Payload": {
"ShipFromAcked": true
}
}
]

View File

@ -0,0 +1,15 @@
[
{
"Header": {
"ProjectID": "${projectRP}"
},
"ID": {
"RefID": "${id.refid}"
},
"Payload": {
"ShipToAcked": true
}
}
]

101
RFXtoRP_RestResponse.ftl Normal file
View File

@ -0,0 +1,101 @@
<#-- **** input parameters ***** -->
<#-- input : Response message from Reflex -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign restResponsetMsg = JsonUtil.jsonToMap(input)>
<#assign id = JsonUtil.jsonToMap(restResponsetMsg.id)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#assign aDateTime = .now>
<#switch id.apiRestReflexID>
<#case "preparation_orders_post">
<#switch restResponsetMsg.status>
<#case 200>
<#case 201>
<#-- *********************************************** ApiRestID = preparation_orders_post ******************** -->
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)>
<#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" >
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipFromAcked>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PrepOrder_ShipFromAcked.ftl">
}
]
<#else>
[
{
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl">
}
]
</#if>
<#break>
<#default>
[
{
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl">
}
]
</#switch>
<#break>
<#case "receipts_post">
<#switch restResponsetMsg.status>
<#case 200>
<#case 201>
<#-- *********************************************** ApiRestID = preparation_orders_post ******************** -->
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign preparationOrderPostResponse = JsonUtil.jsonToMap(restResponseBody)>
<#if preparationOrderPostResponse.status?? && preparationOrderPostResponse.status == "SUCCESS" >
[
{
<#assign apiReflexPlatformID = ApiReflexPlatformID.ExecutionflowShipToAcked>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_Receipt_ShipToAcked.ftl">
}
]
<#else>
[
{
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl">
}
]
</#if>
<#break>
<#default>
[
{
<#assign restResponseBody = JsonUtil.decodeBase64(restResponsetMsg.body) />
<#assign apiReflexPlatformID = ApiReflexPlatformID.PlatformLogCreate>
"apiReflexPlatformID" : "${apiReflexPlatformID}",
"datas" :
<#include "RFXtoRP_PlatformLogCreate.ftl">
}
]
</#switch>
<#break>
<#default>
<#stop>
</#switch>

View File

@ -0,0 +1,36 @@
<#noparse><#-- /!\ Warning the file is generated, if you modify it manually, do not enable automatic update via the pipeline --></#noparse>
<#noparse><#-- Date of last generation : </#noparse>${aDateTime}<#noparse> --></#noparse>
<#noparse>
<#-- if LVID is egal to **quantity_in_base_lv** keyword then LVID is egal to base VL of the item -->
<#assign quantity_in_base_lv_RP_Cst = "**quantity_in_base_lv**" >
<#assign rfx_date_format_default = "yyyy-MM-dd" >
<#assign length_unit_KV_rfx = {"MET":"MILLIMETER","CM":"CENTIMETER","MM":"METER","DM":"DECIMETER","KM":"KILOMETER","MIL":"MILE","YAR":"YARD","INC":"INCH","FT":"FOOT"}>
<#assign weight_unit_KV_rfx = {"GR":"GRAMME","DG":"DECIGRAM","KG":"KILOGRAM","TON":"TONNE","OCE":"ONCE","LTO":"LONG_TON","STO":"SHORT_TON","PND":"POUND"}>
<#assign area_unit_KV_rfx = {"MM²":"SQUARE_MILLIMETER","CM²":"SQUARE_CENTIMETER","DM²":"SQUARE_DECIMETER","":"SQUARE_METER","SQI":"SQUARE_INCH","SQF":"SQUARE_FOOT","SQY":"SQUARE_YARD"}>
<#assign volume_unit_KV_rfx = {"MM³":"CUBIC_MILLIMETER","CM³":"CUBIC_CENTIMETER","DM³":"CUBIC_DECIMETER","":"CUBIC_METER","CI":"CUBIC_INCH","CF":"CUBIC_FOOT","CY":"CUBIC_YARD","ML":"MILLI_LITER","CL":"CENTI_LITER","DL":"DECI_LITER","LIT":"LITER","HL":"HECTO_LITER","FT":"US_FLUID_OUNCE","USG":"US_GAL","PI":"IMPERIAL_PINT","GL":"IMPERIAL_GAL"}>
</#noparse>
<#noparse><#assign length_unit_rfx = length_unit_KV_rfx[</#noparse>"${file.measurement_unit.length}"<#noparse>]!"CENTIMETER"></#noparse>
<#noparse><#assign distance_unit_rfx = length_unit_KV_rfx[</#noparse>"${file.measurement_unit.distance}"<#noparse>]!"CENTIMETER"></#noparse>
<#noparse><#assign transport_distance_unit_rfx = length_unit_KV_rfx[</#noparse>"${file.measurement_unit.transport_distance}"<#noparse>]!"CENTIMETER"></#noparse>
<#noparse><#assign weight_unit_rfx = weight_unit_KV_rfx[</#noparse>"${file.measurement_unit.weight}"<#noparse>]!"KILOGRAM"></#noparse>
<#noparse><#assign area_unit_rfx = area_unit_KV_rfx[</#noparse>"${file.measurement_unit.area}"<#noparse>]!"SQUARE_METER"></#noparse>
<#noparse><#assign volume_unit_rfx = volume_unit_KV_rfx[</#noparse>"${file.measurement_unit.volume}"<#noparse>]!"CUBIC_DECIMETER"></#noparse>
<#noparse><#assign number_of_litres_unit_rfx = volume_unit_KV_rfx[</#noparse>"${file.measurement_unit.litres_number}"<#noparse>]!"CUBIC_DECIMETER"></#noparse>
<#noparse><#assign time_zone_rfx = </#noparse>"${file.author_time_zone!"UTC"}<#noparse>"></#noparse>
<#noparse><#assign time_zone_offset_rfx = </#noparse>"${file.time_zone_offset!"+00:00"}<#noparse>"></#noparse>
<#list file.reflex_platform_project_list?filter(l -> l.name == projectRP) as reflex_platform_project>
<#noparse><#assign text_language_rfx = </#noparse>"${reflex_platform_project.text_language!"en"}<#noparse>"></#noparse>
</#list>

View File

@ -0,0 +1,49 @@
<#-- **** input parameters ***** -->
<#-- input : message RFX -->
<#-- project : projectId in ReflexPlatform -->
<#-- organisation : organisationtId in ReflexPlatform -->
<#assign eventRP = JsonUtil.jsonToMap(input)>
<#assign projectRP = project>
<#assign organisationRP = organisation>
<#-- initialisation map for SegmentationKey and MetaData -->
<#assign Header_MetaData_Map = {} />
<#assign SegmentationKeys_Map = {} />
<#assign Line_MetaData_Map = {} />
<#switch eventRP.event>
<#case "Created">
<#-- *********************************************** Action = CREATE or UPDATE ******************** -->
<#assign executionflow = eventRP.data />
<#-- ******* Header MetaData to maps ******** -->
<#if executionflow.MetaData??>
<#assign Header_MetaData_Map = JsonUtil.sequenceToMap(executionflow.MetaData, "Key", "Value") />
</#if>
[
<#if eventRP.partnerAppRole == "ShipFrom" && executionflow.ShipFrom.ActorID != "" && executionflow.ShipFrom.Actor.IsShipFromConnected?? && executionflow.ShipFrom.Actor.IsShipFromConnected>
{
<#assign apiRestReflexID = ApiRestReflexID.preparation_orders_post>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_PrepOrder.ftl">
}
</#if>
<#if eventRP.partnerAppRole == "ShipTo" && executionflow.ShipTo.ActorID != "" && executionflow.ShipTo.Actor.IsShipToConnected?? && executionflow.ShipTo.Actor.IsShipToConnected>
{
<#assign apiRestReflexID = ApiRestReflexID.receipts_post>
"apiRestReflexID" : "${apiRestReflexID}",
"datas" :
<#include "RPtoRFX_Receipt.ftl">
}
</#if>
]
<#break>
<#default>
<#stop "Event not processed">
</#switch>

84
RPtoRFX_PrepOrder.ftl Normal file
View File

@ -0,0 +1,84 @@
<#include "RPtoRFX_PrepOrder_DefaultHeaderData.ftl">
<#assign aDateTime = .now>
{
"id" : {"refid" : "${executionflow.OrderID}"},
"route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/preparation_orders",
"method" : "POST",
"uri_substitutions": {
"activity_code": "${activity_code}",
"physical_depot_code": "${executionflow.ShipFrom.ActorID}",
"originator_code": "${originator_code}"
},
"payload" :
{
"originator_reference": "${executionflow.OrderID}",
"preparation_type_code": "${preparation_type_code}",
"end_consignee_code": "${executionflow.ShipTo.ActorID!""}",
<#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??>
"requested_delivery_start_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}",
<#else>
"requested_delivery_start_datetime": "${aDateTime?iso_utc}",
</#if>
"requested_delivery_date_type": "${requested_delivery_date_type}",
"consolidated_delivery": "${consolidated_delivery_flag}",
"pick_sequence_code": "${pick_sequence_code}",
"intermediate_consignee": "false",
"protected": "${protected_flag}",
"automatic_generation": "${automatic_generation_flag}",
"optional_attributes": {
"apt_with_end_consignee": "${apt_with_end_consignee_flag}",
"apt_with_intermediate": "false",
"load_grouping": "${load_grouping}"
},
<#if executionflow.ShipTo.ActorID == "">
"address": {
"first_name": "${executionflow.ShipTo.Contact.FirstName!""}",
"last_name" :"${executionflow.ShipTo.Contact.Lastname!""}",
"mail_address": "${executionflow.ShipTo.Actor.Emails[0]!""}",
"mobile_phone_number": "${executionflow.ShipTo.Actor.Phones[0]!""}",
"street_and_number_and_po_box": "${executionflow.ShipTo.Actor.Address.StreetAddressOne?json_string!""}",
"additional_address_data_1": "${executionflow.ShipTo.Actor.Address.StreetAddressTwo?json_string!""}",
"additional_address_data_2": "${executionflow.ShipTo.Actor.Address.StreetAddressThree?json_string!""}",
"postal_code": "${executionflow.ShipTo.Actor.Address.PostalCode!""}",
"iso_country_code": "${executionflow.ShipTo.Actor.Address.CountryCode!""}"
},
</#if>
<#if executionflow.Lines??>
"line_list": [
<#list executionflow.Lines as line>
<#-- ******* line MetaData and Segmentationkeys to maps ******** -->
<#if line.MetaData??>
<#assign Line_MetaData_Map = JsonUtil.sequenceToMap(line.MetaData, "Key", "Value") />
</#if>
<#if line.RequestedContent.Goods.SegmentationKeys??>
<#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") />
</#if>
<#include "RPtoRFX_PrepOrder_DefaultLineData.ftl">
{
"originator_reference_line_number": ${line.LineID?number},
"item_code": "${line.RequestedContent.Goods.ItemID!""}",
"item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}",
"base_lv_quantity_to_prepare": ${line.RequestedMetrics.QuantityInBaseLV.Value!0},
"owner_code_to_prepare" :"${owner_code_to_prepare}",
"grade_code_to_prepare" :"${grade_code_to_prepare}",
"input_order_data": "false",
"batch_1": "${batch_1}",
"any_lv": "false"
<#--
"stock_reservation": "false",
"forced_priority_date_min_lead_time": "false",
"temp_substitution_possible": "false",
"substitution_possible": "false",
"base_lv_quantity": "true",
-->
}<#sep>,</#sep>
</#list>
</#if>
]
}
}

View File

@ -0,0 +1,25 @@
<#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map -->
<#-- How to use MD Header map
Example :
<#assign pick_sequence_code = Header_MetaData_Map["OrderType"]!""/>
-->
<#assign activity_code = "PEN"/>
<#assign originator_code = "50000189"/>
<#assign preparation_type_code = "010"/>
<#assign requested_delivery_date_type = "010"/>
<#assign consolidated_delivery_flag ="false"/>
<#assign pick_sequence_code = ""/>
<#assign protected_flag ="false"/>
<#assign automatic_generation_flag ="false"/>
<#assign apt_with_end_consignee_flag="false"/>
<#assign load_grouping = "DEFAUT"/>

View File

@ -0,0 +1,13 @@
<#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map -->
<#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map -->
<#-- How to use MD or SK map
Example :
<#assign owner_code_to_prepare = SegmentationKeys_Map["Owner"]!""/>
-->
<#assign owner_code_to_prepare = SegmentationKeys_Map["myOwner"]!""/>
<#assign grade_code_to_prepare =""/>
<#assign batch_1 =""/>

74
RPtoRFX_Receipt.ftl Normal file
View File

@ -0,0 +1,74 @@
<#include "RPtoRFX_Receipt_DefaultHeaderData.ftl">
<#assign aDateTime = .now>
{
"id" : {"refid" : "${executionflow.OrderID}"},
"route" : "rest/public/v1/activities/{activity_code}/physical_depots/{physical_depot_code}/originators/{originator_code}/receipts",
"method" : "POST",
"uri_substitutions": {
"activity_code": "${activity_code}",
"physical_depot_code": "${executionflow.ShipTo.ActorID!""}",
"originator_code": "${originator_code}"
},
"payload" :
{
"receipt_reference": "${executionflow.OrderID}",
"receipt_type": "${receipt_type}",
"receipt_reason_code": "${receipt_reason_code}",
"work_mode_code" : "${work_mode_code}",
"original_code" : "${executionflow.ShipFrom.ActorID}",
"carrier_code" : "${executionflow.Carrier.ActorID!""}",
<#if executionflow.RequestedMilestones?? && executionflow.RequestedMilestones.RequestedDeliveryDateTime??>
"receipt_datetime": "${executionflow.RequestedMilestones.RequestedDeliveryDateTime.DateTime}",
<#else>
"receipt_datetime": "${aDateTime?iso_utc}",
</#if>
<#--
"carrier_appointment_made": "false",
"receipt_in_cross_docking": "false",
"dock_occupation_duration": 10,
-->
<#if executionflow.Lines??>
"line_list": [
<#list executionflow.Lines as line>
<#-- ******* line MetaData and Segmentationkeys to maps ******** -->
<#if line.MetaData??>
<#assign Line_MetaData_Map = JsonUtil.sequenceToMap(line.MetaData, "Key", "Value") />
</#if>
<#if line.RequestedContent.Goods.SegmentationKeys??>
<#assign SegmentationKeys_Map = JsonUtil.sequenceToMap(line.RequestedContent.Goods.SegmentationKeys, "Key", "Value") />
</#if>
<#include "RPtoRFX_Receipt_DefaultLineData.ftl">
{
"receipt_reference_line_no": ${line.LineID?number},
"item_code": "${line.RequestedContent.Goods.ItemID!""}",
"item_lv_code": "${line.RequestedContent.Goods.LVBranchID!""}",
"level_1_quantity": ${line.RequestedMetrics.QuantityInBaseLV.Value!0},
"owner_code": "${owner_code}",
"grade_code": "${grade_code}",
"batch_1": "${batch_1!""}",
<#--
"optional_attributes": {
"held_for_check": "false",
"held _for_repacking": "false",
"hold_for_specific_code": "false",
"hold_code": "false"
},
-->
"quality_control_attributes": {
<#--"qcf_to_create_for_receipt_line": "false",-->
"exclude_item_from_inspection": "false"
}
}<#sep>,</#sep>
</#list>
]
</#if>
}
}

View File

@ -0,0 +1,12 @@
<#-- Note : you can use Order Header Metadata, using the define map : Header_MetaData_Map -->
<#-- How to use MD Header map
Example :
<#assign receipt_type = Header_MetaData_Map["OrderType"]!""/>
-->
<#assign activity_code = "PEN"/>
<#assign originator_code = "STANDARD"/>
<#assign receipt_type = "010"/>
<#assign receipt_reason_code = "REC"/>
<#assign work_mode_code = "LPA"/>

View File

@ -0,0 +1,12 @@
<#-- Note : you can use Order Line Metadata, using the define map : Line_MetaData_Map -->
<#-- Note : you can use Order Line Segmentation keys, using the define map : SegmentationKeys_Map -->
<#-- How to use MD or SK map
Example :
<#assign owner_code = SegmentationKeys_Map["Owner"]!""/>
-->
<#assign owner_code = "PEN"/>
<#assign grade_code = "STD"/>
<#assign batch_1 = "STD"/>

9
ReflexUtils.ftl Normal file
View File

@ -0,0 +1,9 @@
<#-- --------------------------------------------------------------------------------------- -->
<#-- Concat reflex timestamp with reflex time zone and format this date in ISO UTC format -->
<#-- --------------------------------------------------------------------------------------- -->
<#function RfxDateTimetoUTC rfxdatetime offset >
<#assign datetimeUTC = JsonUtil.createUTCDateTime(rfxdatetime,time_zone_rfx , "yyyy-MM-dd'T'HH:mm:ss") />
<#return (datetimeUTC)>
</#function>

1
VERSION Normal file
View File

@ -0,0 +1 @@
1.2.5