From 9ee9743b81b4713fdd161aa82a5b6dfbd5bb7158 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Tue, 6 Aug 2024 10:54:28 +0200 Subject: [PATCH] Code ico controle --- RFXtoRP_HsaCarrier_ActorCreated.ftl | 7 ++++++- RFXtoRP_HsaCons_ActorCreated.ftl | 6 +++++- RFXtoRP_HsaSup_ActorCreated.ftl | 6 +++++- RFXtoRP_HsrDepot_ActorCreated.ftl | 6 +++++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/RFXtoRP_HsaCarrier_ActorCreated.ftl b/RFXtoRP_HsaCarrier_ActorCreated.ftl index b0f2fe5..44922a3 100644 --- a/RFXtoRP_HsaCarrier_ActorCreated.ftl +++ b/RFXtoRP_HsaCarrier_ActorCreated.ftl @@ -29,7 +29,12 @@ "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}", + <#assign isCountryCode = isCountryCode(preparation_line.countryCode) /> + <#if isCountryCode> + "CountryCode" : "${carrier.carrier_structured_address.country_code?json_string}", + <#else> + "CountryCode" : "", + "ProvinceCode": "${carrier.carrier_structured_address.territorial_div_code?json_string}", "State": "${carrier.carrier_structured_address.country_designation?json_string}" diff --git a/RFXtoRP_HsaCons_ActorCreated.ftl b/RFXtoRP_HsaCons_ActorCreated.ftl index 9c29965..23998f4 100644 --- a/RFXtoRP_HsaCons_ActorCreated.ftl +++ b/RFXtoRP_HsaCons_ActorCreated.ftl @@ -29,7 +29,11 @@ "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}", + <#if isCountryCode> + "CountryCode" : "${actor.consignee_structured_address.country_code?json_string}", + <#else> + "CountryCode" : "", + "ProvinceCode": "${actor.consignee_structured_address.territorial_div_code?json_string}", "State": "${actor.consignee_structured_address.country_designation?json_string}" diff --git a/RFXtoRP_HsaSup_ActorCreated.ftl b/RFXtoRP_HsaSup_ActorCreated.ftl index bc3719a..7b5f47b 100644 --- a/RFXtoRP_HsaSup_ActorCreated.ftl +++ b/RFXtoRP_HsaSup_ActorCreated.ftl @@ -28,7 +28,11 @@ "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}", + <#if isCountryCode> + "CountryCode" : "${actor.supplier_structured_address.country_code?json_string}", + <#else> + "CountryCode" : "", + "ProvinceCode": "${actor.supplier_structured_address.territorial_div_code?json_string}", "State": "${actor.supplier_structured_address.country_designation?json_string}" diff --git a/RFXtoRP_HsrDepot_ActorCreated.ftl b/RFXtoRP_HsrDepot_ActorCreated.ftl index 3d66640..1eb3941 100644 --- a/RFXtoRP_HsrDepot_ActorCreated.ftl +++ b/RFXtoRP_HsrDepot_ActorCreated.ftl @@ -28,7 +28,11 @@ "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}", + <#if isCountryCode> + "CountryCode" : "${depot.physical_depot_structured_address.country_code?json_string}", + <#else> + "CountryCode" : "", + "ProvinceCode": "${depot.physical_depot_structured_address.territorial_div_code?json_string}", "State": "${depot.physical_depot_structured_address.country_designation?json_string}"