Skip to content

Commit

Permalink
Merge pull request #171 from akretion/dpd-parcel-ref
Browse files Browse the repository at this point in the history
[IMP] Send parcel ref for DPD if no better reference
  • Loading branch information
florian-dacosta authored Apr 3, 2024
2 parents 6ad56e4 + e041ef5 commit 9e47aff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions roulier/carriers/dpd_fr_soap/encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ def transform_input_to_carrier_webservice(self, data):
data["service"]["shippingDate"] = data["service"]["shippingDate"].strftime(
"%d/%m/%Y"
)
# dpd is configure with manage_multi_label = False, so always only 1 pack
if (
data["parcels"]
and data["parcels"][0]["reference"]
and not data["service"]["reference2"]
):
data["service"]["reference2"] = data["parcels"][0]["reference"]

def reduce_address(address):
"""Concat some fields.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,9 @@
<car:referencenumber>{{ service.reference1 }}</car:referencenumber>
<car:reference2>{{ service.reference2 }}</car:reference2>
<car:reference3>{{ service.reference3 }}</car:reference3>
<car:refnrasbarcode>{{ 'true' if service.reference2 else 'false'}}</car:refnrasbarcode>
<car:referenceInBarcode>
<car:type>Reference2</car:type>
</car:referenceInBarcode>
</car:request>
</car:CreateShipmentWithLabels{{ '' if legacy else 'Bc'}}>

0 comments on commit 9e47aff

Please sign in to comment.