Skip to content

Commit

Permalink
Merge pull request #178 from akretion/geodis-edi-volume-if-set
Browse files Browse the repository at this point in the history
[IMP] Geodis : add possibility to add the volume in the EDI file
  • Loading branch information
florian-dacosta authored Oct 23, 2024
2 parents 623289c + 139e2ef commit a3b0d3c
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 a3b0d3c

Please sign in to comment.