Handle 944s for unsent 943s with email notification.
parent
018dd5c13b
commit
fe5d2968f4
|
@ -90,16 +90,22 @@ def determine_edi_action(edi_filename: pathlib.Path):
|
||||||
transaction = ''
|
transaction = ''
|
||||||
for fields in tokens_from_edi_file(edi_filename):
|
for fields in tokens_from_edi_file(edi_filename):
|
||||||
if fields[0] == "W17":
|
if fields[0] == "W17":
|
||||||
|
if len(fields) == 6:
|
||||||
transaction = fields[5]
|
transaction = fields[5]
|
||||||
break
|
break
|
||||||
pprint.pprint(transaction)
|
elif len(fields) == 5:
|
||||||
|
transaction = fields[4]
|
||||||
|
break
|
||||||
|
|
||||||
if transaction:
|
if transaction:
|
||||||
if transaction.startswith('SHP'):
|
if transaction.startswith('SHP'):
|
||||||
process_intersite_receipt(edi_filename)
|
process_intersite_receipt(edi_filename)
|
||||||
elif transaction.startswith('RA'):
|
elif transaction.startswith('RA'):
|
||||||
process_return(edi_filename)
|
process_return(edi_filename)
|
||||||
# elif transaction.startswith('RA*'):#TODO how are coman pos received
|
# PO is used when Shandex does not receive a 943, will they receive 943s for comans?
|
||||||
# pprint.pprint('return')
|
elif transaction.startswith('PO'):#TODO how are coman pos received
|
||||||
|
simple_email_notification.email_noticication(['bleeson@stashtea.com'],
|
||||||
|
'Unknown Shandex 944',[transaction])
|
||||||
else:
|
else:
|
||||||
raise Exception('Unknown transaction type')
|
raise Exception('Unknown transaction type')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue