[TELE-694] no postage fees if send by mail fix

This commit is contained in:
Daniel Muyshond 2020-10-06 15:38:35 +02:00
parent 606a88e649
commit 7d970bf325
1 changed files with 4 additions and 4 deletions

View File

@ -63,10 +63,10 @@ class ExtraFees(BaseResource):
for basket_item in data['data']:
try:
nb_documents += int(basket_item['request_data']['nb_documents'])
# Check if the item in send by mail and if so there is no postage_fee
destination = basket_item["request_data"]["form_var_destinations_raw"]
if destination and "mail" in destination:
postage_fee = 0
destination = basket_item['request_data']['destination'] # Passed in the workflow webservice
# No postage fees if send by mail
if destination and 'mail' in destination:
postage_fee = Decimal(0)
if Decimal(basket_item['request_data']['postage_fee']) > postage_fee:
postage_fee = Decimal(basket_item['request_data']['postage_fee'])
except KeyError: