From 57c9e7faa86ebcbb3d9053b10c335c123416ebc2 Mon Sep 17 00:00:00 2001 From: Florian da Costa Date: Thu, 4 Jul 2024 19:07:53 +0200 Subject: [PATCH] [IMP] Allow to specify contract condition for Geodis EDI (Particulierr / Entreprise) --- roulier/carriers/geodis_fr/edi/api.py | 7 +++++++ roulier/carriers/geodis_fr/edi/encoder.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roulier/carriers/geodis_fr/edi/api.py b/roulier/carriers/geodis_fr/edi/api.py index af2c369..5a40955 100644 --- a/roulier/carriers/geodis_fr/edi/api.py +++ b/roulier/carriers/geodis_fr/edi/api.py @@ -125,6 +125,13 @@ def _shipments(self): "required": False, # 'description': """7085 : Notify recipient by M(ail), S(ms), P(=M+S)""" }, + # Contract and condition : particular/pro + # when empty it is kind of computed by geodis sytem depending on option + "contractCondition": { + "type": "string", + "required": False, + "allowed": ["P", "E"], + }, "shippingId": { "type": "string", "default": "", diff --git a/roulier/carriers/geodis_fr/edi/encoder.py b/roulier/carriers/geodis_fr/edi/encoder.py index 37d9e92..ba2163b 100644 --- a/roulier/carriers/geodis_fr/edi/encoder.py +++ b/roulier/carriers/geodis_fr/edi/encoder.py @@ -28,7 +28,7 @@ def encode_shipment(self, shipment, service, idx): ["CNI", "%s" % idx, shipment["shippingId"]], [ "TSR", - "2", # 4065 + shipment.get("contractCondition", ""), [shipment["product"], "", "", shipment["productOption"]], # 7273 shipment["productPriority"], # 4219 shipment["notifications"], # 7085 : M, S, P