structured adress on actors

This commit is contained in:
Laure Pascal 2023-09-13 12:06:06 +02:00
parent d81489d59f
commit da36927874
4 changed files with 91 additions and 40 deletions

View File

@ -18,8 +18,12 @@
<#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">, <#include "RFXtoRP_HsaCarrier_ActorCreated_Metadata.ftl">,
--> -->
"Address": "Address":
{ {
<#-- if Reflex WMS address is structured -->
<#if carrier.carrier_structured_address?? >
"Name": "${carrier.carrier_structured_address.name_or_company}", "Name": "${carrier.carrier_structured_address.name_or_company}",
"StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}", "StreetAddressOne" : "${carrier.carrier_structured_address.street_and_PO}",
"StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}", "StreetAddressTwo" : "${carrier.carrier_structured_address.additionnal_data}",
@ -28,7 +32,16 @@
"CountryCode" : "${carrier.carrier_structured_address.country_code}", "CountryCode" : "${carrier.carrier_structured_address.country_code}",
"ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}", "ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code}",
"State": "${carrier.carrier_structured_address.country_designation}" "State": "${carrier.carrier_structured_address.country_designation}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${carrier.address.company_name}",
"StreetAddressOne" : "${carrier.address.address_1}",
"StreetAddressTwo" : "${carrier.address.address_2}",
"StreetAddressThree" : "${carrier.address.address_3}"
</#if>
}, },
"Phones": ["${carrier.address.telephone}", "Phones": ["${carrier.address.telephone}",
"${carrier.address.other_number}" "${carrier.address.other_number}"
], ],

View File

@ -20,6 +20,10 @@
"Address": "Address":
{ {
<#-- if Reflex WMS is structured -->
<#if actor.consignee_structured_address??>
"Name": "${actor.consignee_structured_address.name_or_company}", "Name": "${actor.consignee_structured_address.name_or_company}",
"StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO}", "StreetAddressOne" : "${actor.consignee_structured_address.street_and_PO}",
"StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data}", "StreetAddressTwo" : "${actor.consignee_structured_address.additionnal_data}",
@ -28,7 +32,18 @@
"CountryCode" : "${actor.consignee_structured_address.country_code}", "CountryCode" : "${actor.consignee_structured_address.country_code}",
"ProvinceCode": "${actor.consignee_structured_address.territorial_div_code}", "ProvinceCode": "${actor.consignee_structured_address.territorial_div_code}",
"State": "${actor.consignee_structured_address.country_designation}" "State": "${actor.consignee_structured_address.country_designation}"
<#-- if Reflex WMS is not structured -->
<#else>
"Name": "${actor.address.company_name}",
"StreetAddressOne" : "${actor.address.address_1}",
"StreetAddressTwo" : "${actor.address.address_2}",
"StreetAddressThree" : "${actor.address.address_3}",
</#if>
}, },
"Phones": ["${actor.address.telephone}", "Phones": ["${actor.address.telephone}",
"${actor.address.other_number}" "${actor.address.other_number}"
], ],

View File

@ -20,6 +20,9 @@
"Address": "Address":
{ {
<#-- if Reflex WMS address is structured -->
<#if actor.supplier_structured_address?? >
"Name": "${actor.supplier_structured_address.name_or_company}", "Name": "${actor.supplier_structured_address.name_or_company}",
"StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}", "StreetAddressOne" : "${actor.supplier_structured_address.street_and_PO}",
"StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}", "StreetAddressTwo" : "${actor.supplier_structured_address.additionnal_data}",
@ -28,6 +31,15 @@
"CountryCode" : "${actor.supplier_structured_address.country_code}", "CountryCode" : "${actor.supplier_structured_address.country_code}",
"ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}", "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code}",
"State": "${actor.supplier_structured_address.country_designation}" "State": "${actor.supplier_structured_address.country_designation}"
<#-- if Reflex WMS address is not structured -->
<#else>
"Name": "${actor.optional_attributes.company_name}",
"StreetAddressOne" : "${actor.optional_attributes.address_1}",
"StreetAddressTwo" : "${actor.optional_attributes.address_2}",
"StreetAddressThree" : "${actor.optional_attributes.address_3}"
</#if>
}, },
"Phones": ["${actor.optional_attributes.telephone}", "Phones": ["${actor.optional_attributes.telephone}",
"${actor.optional_attributes.other_number}" "${actor.optional_attributes.other_number}"

View File

@ -20,20 +20,31 @@
"Address": "Address":
{ {
"StreetAddressOne" : "${depot.physical_depot_address.address_1}", <#-- if Reflex WMS address is structured -->
"StreetAddressTwo" : "${depot.physical_depot_address.address_2}", <#if depot.physical_depot_structured_address?? >
<#if depot.physical_depot_address.address_3?length &lt; 10> "Name": "${depot.physical_depot_structured_address.name_or_company}",
"PostalCode" : "${depot.physical_depot_address.address_3?trim}", "StreetAddressOne" : "${depot.physical_depot_structured_address.street_and_PO}",
"StreetAddressTwo" : "${depot.physical_depot_structured_address.additionnal_data}",
"PostalCode" : "${depot.physical_depot_structured_address.postal_code}",
"City" : "${depot.physical_depot_structured_address.post_code_area_name}",
"CountryCode" : "${depot.physical_depot_structured_address.country_code}",
"ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code}",
"State": "${depot.physical_depot_structured_address.country_designation}"
<#-- if Reflex WMS address is not structured -->
<#else> <#else>
"PostalCode" : "${depot.physical_depot_address.address_3?substring(0,9)?trim}", "Name": "${depot.physical-depot_address.company_name}",
"StreetAddressOne" : "${depot.physical-depot_address.address_1}",
"StreetAddressTwo" : "${depot.physical-depot_address.address_2}",
"StreetAddressThree" : "${depot.physical-depot_address.address_3}"
</#if> </#if>
<#if depot.physical_depot_address.address_4?length &lt; 14>
"CountryCode" : "" },
<#else> "Phones": ["${depot.physical-depot_address.telephone}",
"CountryCode" : "${depot.physical_depot_address.address_4?substring(10,13)?trim}" "${depot.physical-depot_address.other_number}"
</#if> ],
} "Typology": "TYPOLOGY_UNKNOWN"
} }
} }
] ]