Test for SSCC length, needs to be 20.

master
bleeson 2025-11-14 06:53:34 -08:00
parent 42ab26abbf
commit 08513850e5
1 changed files with 4 additions and 0 deletions

View File

@ -91,6 +91,9 @@ STASH_GS1 = '0776520'
def sscc_check(sscc):#TODO recurse through pallets and packages def sscc_check(sscc):#TODO recurse through pallets and packages
if len(sscc) != 20:
pprint.pprint(f'{sscc} is not the correct length of an SSCC (20)')
else:
stashtea_gs1 = '0776520' stashtea_gs1 = '0776520'
application_id = sscc[:2] application_id = sscc[:2]
extension = sscc[2] extension = sscc[2]
@ -250,6 +253,7 @@ def main():
ASN_DIRECTORY.mkdir(parents=True, exist_ok=True) ASN_DIRECTORY.mkdir(parents=True, exist_ok=True)
with yamamotoyama.get_connection() as database: with yamamotoyama.get_connection() as database:
for file_path in ASN_DIRECTORY.glob(SOURCE_FILENAME_GLOB): for file_path in ASN_DIRECTORY.glob(SOURCE_FILENAME_GLOB):
pprint.pprint(file_path)
convert(file_path, database) convert(file_path, database)