summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Muyshond <daniel.muyshond@gmail.com>2020-10-06 13:38:35 (GMT)
committerDaniel Muyshond <daniel.muyshond@gmail.com>2020-10-06 13:38:35 (GMT)
commit7d970bf325dffd4a335570bb2941c1b479057ba7 (patch)
treeadc2735255175904b284250933893cd616da444c
parent606a88e649e9051b4e71280831682abc6f0eaa95 (diff)
downloadpasserelle-imio-extra-fees-7d970bf325dffd4a335570bb2941c1b479057ba7.zip
passerelle-imio-extra-fees-7d970bf325dffd4a335570bb2941c1b479057ba7.tar.gz
passerelle-imio-extra-fees-7d970bf325dffd4a335570bb2941c1b479057ba7.tar.bz2
[TELE-694] no postage fees if send by mail fix
-rw-r--r--passerelle_imio_extra_fees/models.py8
1 files 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: