From a70d4c7ce6335d9641374bef1470958ceeca9993 Mon Sep 17 00:00:00 2001 From: Luis Felipe Mileo Date: Wed, 18 Nov 2020 17:57:37 -0300 Subject: [PATCH] [FIX] Python3 compatibility --- febraban/cnab240/libs/dac.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/febraban/cnab240/libs/dac.py b/febraban/cnab240/libs/dac.py index 6072a9b..fde4b47 100644 --- a/febraban/cnab240/libs/dac.py +++ b/febraban/cnab240/libs/dac.py @@ -5,15 +5,15 @@ class DAC: @classmethod def calculate(cls, branch, accountNumber, wallet, bankNumber): x1 = branch + accountNumber + wallet + bankNumber - x2 = "12" * (len(x1) / 2) + ("1" if len(x1) % 2 == 1 else "") + x2 = "12" * int(len(x1) / 2) + ("1" if len(x1) % 2 == 1 else "") out = [int(a) * int(b) for (a, b) in zip(x1, x2)] - s = sum(map(lambda x: x/10 + x % 10, out)) + s = sum(map(lambda x: int(x/10 + x % 10), out)) return (10 - s % 10) % 10 @classmethod def calculateTaxDac(cls, productId, segmentId, currency, amount, company, freeField): x1 = productId + segmentId + currency + amount + company + freeField - x2 = "12" * (len(x1) / 2) + ("1" if len(x1) % 2 == 1 else "") + x2 = "12" * int(len(x1) / 2) + ("1" if len(x1) % 2 == 1 else "") out = [int(a) * int(b) for (a, b) in zip(x1, x2)] - s = sum(map(lambda x: x/10 + x % 10, out)) + s = sum(map(lambda x: int(x/10 + x % 10), out)) return (10 - s % 10) % 10