Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ach/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ def add_batch(self, std_ent_cls_code, batch_entries=None,

entry.dfi_acnt_num = record['account_number']
entry.amount = int(round(float(record['amount']) * 100))
entry.ind_name = record['name'].upper()[:22]

if std_ent_cls_code == 'CTX':
entry.recv_cmpy_name = record['company_name'].upper()[:16]
else:
entry.ind_name = record['name'].upper()[:22]

entry.trace_num = self.settings['immediate_dest'][:8] \
+ entry.validate_numeric_field(entry_counter, 7)

Expand Down Expand Up @@ -335,6 +340,7 @@ def __init__(self, entry_detail, addenda_record=[]):

if self.addenda_record:
self.entry_detail.add_rec_ind = 1
self.entry_detail.num_add_recs = len(self.addenda_record)

def render_to_string(self, force_crlf=False):
"""
Expand Down
2 changes: 1 addition & 1 deletion ach/data_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def validate_alpha_numeric_field(self, field, length):
"""
str_length = str(length)

match = re.match(r'([\w,\s]{1,' + str_length + '})', field)
match = re.match(r'([\w,\s,*,\\,.,~,-]{1,' + str_length + '})', field)

if match:
if len(match.group(1)) < length:
Expand Down