Skip to content

Commit

Permalink
[Fix] ACH file invalid characters sent - Removed special characters e…
Browse files Browse the repository at this point in the history
…xcept space,comma and underscore because these special characters are accepted while creating a file
  • Loading branch information
Vijaiy-Selvaraj authored and Hardik-OSI committed Dec 19, 2022
1 parent 157f0bd commit ec13ce7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions account_banking_ach_base/models/account_payment_order.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import re
from string import ascii_uppercase

from ach.builder import AchFile
Expand Down Expand Up @@ -144,14 +145,14 @@ def generate_ach_file(self):
self.validate_mandates(line)
self.validate_banking(line)
amount = line.amount_currency

partner_name = re.sub(r"[^\w ,]", "", line.partner_id.name)
entries.append(
{
"type": self.get_transaction_type(amount=amount),
"routing_number": line.partner_bank_id.bank_id.routing_number,
"account_number": line.partner_bank_id.acc_number,
"amount": str(amount),
"name": line.partner_id.name,
"name": partner_name,
"addenda": [{"payment_related_info": line.communication}],
}
)
Expand Down

0 comments on commit ec13ce7

Please sign in to comment.