Changes to email only 947 based on newly arrived file from Shandex
parent
39199aaaaf
commit
777776b5f0
30
edi_947.py
30
edi_947.py
|
@ -104,11 +104,11 @@ def main():
|
|||
"""
|
||||
for edi_filename in X12_DIRECTORY.iterdir():
|
||||
if SHANDEX_947_FILENAME_RE.match(edi_filename.name):
|
||||
pprint.pprint(edi_filename.name)
|
||||
#pprint.pprint(edi_filename.name)
|
||||
process_file(edi_filename)
|
||||
# file moved to 997 processing folder to be sent later
|
||||
shutil.move(edi_filename, EDI_997_DIRECTORY / edi_filename.name)
|
||||
combine_zscs()
|
||||
#combine_zscs()
|
||||
|
||||
|
||||
def gmail_authenticate():
|
||||
|
@ -177,9 +177,9 @@ def tokens_from_edi_file(
|
|||
fields = record.split("*")
|
||||
if fields[0] in {
|
||||
"ISA",
|
||||
"GS"
|
||||
"GS",
|
||||
"ST",
|
||||
"N1",
|
||||
"N9",
|
||||
"SE",
|
||||
"GE",
|
||||
"IEA"
|
||||
|
@ -232,16 +232,17 @@ def process_file(edi_filename: pathlib.Path):
|
|||
"""
|
||||
warehouse_stockchange = StockChange()
|
||||
vcrlin = 0
|
||||
status = ''
|
||||
qty = ''
|
||||
uom = ''
|
||||
gtin = ''
|
||||
lot = ''
|
||||
license_plate = ''
|
||||
control_number = ''
|
||||
reason = ''
|
||||
bucket = ''
|
||||
product = ''
|
||||
for fields in tokens_from_edi_file(edi_filename):
|
||||
status = ''
|
||||
qty = ''
|
||||
uom = ''
|
||||
gtin = ''
|
||||
lot = ''
|
||||
license_plate = ''
|
||||
control_number = ''
|
||||
reason = ''
|
||||
bucket = ''
|
||||
if fields[0] == "G62":
|
||||
iptdat = fields[2]
|
||||
warehouse_stockchange.header.iptdat = datetime.datetime.strptime(
|
||||
|
@ -263,7 +264,8 @@ def process_file(edi_filename: pathlib.Path):
|
|||
reason = fields[2]
|
||||
elif fields[1] == 'ZZ':
|
||||
bucket = fields[2]
|
||||
stock_movement_alert(product, qty, lot, status, license_plate, control_number, reason, bucket)
|
||||
elif fields[1] == 'LT':
|
||||
stock_movement_alert(product, qty, lot, status, license_plate, control_number, reason, bucket)
|
||||
#Per John Pena 9/2025, don't perform imports, only notify
|
||||
# if status in EMAIL_ONLY_CODES:
|
||||
# continue
|
||||
|
|
Loading…
Reference in New Issue