Skip to content

Commit

Permalink
[IMP] Geodis : add possibility to add the volume in the EDI file as i…
Browse files Browse the repository at this point in the history
…t may be important for shipments in foreign countries
  • Loading branch information
florian-dacosta committed Jun 25, 2024
1 parent 22adbb0 commit 139e2ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roulier/carriers/geodis_fr/edi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ def _parcel(self):
"required": True,
"coerce": "accents",
},
"volume": {
"type": "float",
"required": False,
"empty": True,
"default": 0,
},
}

def _to_address(self):
Expand Down
4 changes: 4 additions & 0 deletions roulier/carriers/geodis_fr/edi/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def encode_shipment(self, shipment, service, idx):
lines += [
["GID", "%s" % j, ["1", "PC", "21", "6"]],
["MEA", "AAE", "AAD", ["KGM", "%s" % pack["weight"]]],
]
if pack.get("volume"):
lines.append(["MEA", "AAE", "AAW", ["MTQ", "%s" % pack["volume"]]])
lines += [
["PCI", "18"],
["GIN", "BN", pack["barcode"]],
]
Expand Down

0 comments on commit 139e2ef

Please sign in to comment.