From 1b4f4ade07dd325fe2b0f73ee3af8eb18521597b Mon Sep 17 00:00:00 2001 From: Junian Date: Sat, 10 Oct 2015 00:26:37 +0700 Subject: [PATCH 1/3] =?UTF-8?q?Payment=20information=20associated=20with?= =?UTF-8?q?=20the=20immediately=20preceding=20Entry=20Detail=20Record.=20M?= =?UTF-8?q?ust=20contain=20NACHA=20endorsed=20ANSI=20ASC=20X12=20data=20se?= =?UTF-8?q?gments=20or=20NACHA=20endorsed=20banking=20conventions.=20The?= =?UTF-8?q?=20asterisk=20(=E2=80=9C*=E2=80=9D)=20must=20be=20the=20delimit?= =?UTF-8?q?er=20between=20the=20data=20elements,=20and=20the=20back=20slas?= =?UTF-8?q?h=20(=E2=80=9C\=E2=80=9D)=20must=20be=20the=20terminator=20betw?= =?UTF-8?q?een=20the=20data=20segments.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ach/data_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ach/data_types.py b/ach/data_types.py index 000ab2f..c7da6d9 100644 --- a/ach/data_types.py +++ b/ach/data_types.py @@ -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: From 0c5168943ba8123d848dd6da43ecdd473749727c Mon Sep 17 00:00:00 2001 From: Junian Date: Sat, 10 Oct 2015 02:49:33 +0700 Subject: [PATCH 2/3] added support for CTX transaction --- ach/builder.py | 8 +++++++- ach/data_types.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ach/builder.py b/ach/builder.py index 1a3c70f..e31a437 100644 --- a/ach/builder.py +++ b/ach/builder.py @@ -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) @@ -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): """ diff --git a/ach/data_types.py b/ach/data_types.py index c7da6d9..cfd36ac 100644 --- a/ach/data_types.py +++ b/ach/data_types.py @@ -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: From 6214dda55f012d57754858ae2adeb98489ceaa3c Mon Sep 17 00:00:00 2001 From: Junian Date: Thu, 17 Dec 2015 16:36:13 +0700 Subject: [PATCH 3/3] can use negative sign --- ach/data_types.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ach/data_types.py b/ach/data_types.py index cfd36ac..99e9a75 100644 --- a/ach/data_types.py +++ b/ach/data_types.py @@ -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: