From 7d970bf325dffd4a335570bb2941c1b479057ba7 Mon Sep 17 00:00:00 2001 From: Daniel Muyshond Date: Tue, 6 Oct 2020 15:38:35 +0200 Subject: [PATCH] [TELE-694] no postage fees if send by mail fix --- passerelle_imio_extra_fees/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/passerelle_imio_extra_fees/models.py b/passerelle_imio_extra_fees/models.py index a63582f..668df2f 100644 --- a/passerelle_imio_extra_fees/models.py +++ b/passerelle_imio_extra_fees/models.py @@ -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: