nan = None
CD_file_format ={'IT': {'HD': {'Col List': ['RECORD_INDICATOR', 'CLIENT', 'STREAM_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[CLIENT]}|{data[STREAM_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CLIENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STREAM_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'IT': {'Col List': ['RECORD_INDICATOR', 'ACTION_INDICATOR', 'PRODUCT', 'DESCRIPTION', 'EXTRA_DESCRIPTION', 'BRAND/PRODUCT GROUP', 'MOQ', 'BARCODE_1 ( Unit)', 'BARCODE_2 ( Inner )', 'BARCODE_3 ( Outer )', 'INNER CARTON QTY', 'OUTER CARTON QTY', 'UNIT LENGTH', 'UNIT WIDTH ', 'UNIT HEIGHT', 'UNIT WEIGHT'], 'template': '{data[RECORD_INDICATOR]}|{data[ACTION_INDICATOR]}|{data[PRODUCT]}|{data[DESCRIPTION]}|{data[EXTRA_DESCRIPTION]}|{data[BRAND/PRODUCT GROUP]}|{data[MOQ]}|{data[BARCODE_1 ( Unit)]}|{data[BARCODE_2 ( Inner )]}|{data[BARCODE_3 ( Outer )]}|{data[INNER CARTON QTY]}|{data[OUTER CARTON QTY]}|{data[UNIT LENGTH]}|{data[UNIT WIDTH ]}|{data[UNIT HEIGHT]}|{data[UNIT WEIGHT]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ACTION_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PRODUCT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'DESCRIPTION': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'EXTRA_DESCRIPTION': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'BRAND/PRODUCT GROUP': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'MOQ': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'BARCODE_1 ( Unit)': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'BARCODE_2 ( Inner )': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'BARCODE_3 ( Outer )': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'INNER CARTON QTY': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'OUTER CARTON QTY': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'UNIT LENGTH': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'UNIT WIDTH ': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'UNIT HEIGHT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'UNIT WEIGHT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}}, 'OR': {'HD': {'Col List': ['RECORD_INDICATOR', 'CLIENT', 'STREAM_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[CLIENT]}|{data[STREAM_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CLIENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STREAM_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'OR1': {'Col List': ['RECORD_INDICATOR', 'ACTION_INDICATOR', 'CUST_ORDER_NUMBER', 'ORDER_DATE', 'E_T_D', 'VENDOR_ORD_NO', 'SHIP_TO_NAME', 'SHIP_TO_ADDRESS_1_1', 'SHIP_TO_ADDRESS_1_2', 'AREA', 'STATE', 'POSTCODE', 'COUNTRY', 'ORDER_TYPE', 'CARRIER_CODE', 'PHONE_NO', 'EMAIL_ADDRESS'], 'template': '{data[RECORD_INDICATOR]}|{data[ACTION_INDICATOR]}|{data[CUST_ORDER_NUMBER]}|{data[ORDER_DATE]}|{data[E_T_D]}|{data[VENDOR_ORD_NO]}|{data[SHIP_TO_NAME]}|{data[SHIP_TO_ADDRESS_1_1]}|{data[SHIP_TO_ADDRESS_1_2]}|{data[AREA]}|{data[STATE]}|{data[POSTCODE]}|{data[COUNTRY]}|{data[ORDER_TYPE]}|{data[CARRIER_CODE]}|{data[PHONE_NO]}|{data[EMAIL_ADDRESS]}', 'mapping': {'RECORD_INDICATOR': {'Processing': ['data[ci]="OR1"'], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ACTION_INDICATOR': {'Processing': ['data[ci]="A"'], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CUST_ORDER_NUMBER': {'Processing': ["data[ci]={var}['id']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ORDER_DATE': {'Processing': ['data[ci]=str(datetime.strptime({var}[\'date\'],\'%Y-%m-%dT%H:%M:%S.%fZ\').replace(tzinfo=from_zone).astimezone(to_zone).strftime("%Y%m%d"))'], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'E_T_D': {'Processing': ['data[ci]=""'], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'VENDOR_ORD_NO': {'Processing': ["data[ci]={var}['order_number']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SHIP_TO_NAME': {'Processing': ["if {var}['order_source']=='shopify':\n     if {var}['contact_name']:\n          data[ci]={var}['contact_name']\n     else:\n          data[ci]={var}['customer_name']\nelse:\n     data[ci]={var}['customer_name']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SHIP_TO_ADDRESS_1_1': {'Processing': ["data[ci]={var}['address']['line_1']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SHIP_TO_ADDRESS_1_2': {'Processing': ['line2 = {var}[\'address\'][\'line_2\']\nline3 = {var}[\'address\'][\'line_3\']\nif bool(line2) and (line3):\n     data[ci]=" ".join([{var}[\'address\'][\'line_2\'],{var}[\'address\'][\'line_3\']])\nelif bool(line2):\n     data[ci]={var}[\'address\'][\'line_2\']\nelif bool(line3):\n     data[ci]={var}[\'address\'][\'line_3\']\nelse:\n     data[ci]=""'], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'AREA': {'Processing': ["address_error = checkAddressForError({var})\nif 'City Error' in address_error.keys():\n     data[ci] = 'Error'\n     error['OR']= 'Error in Address'\n     error['send_to_CD'] = False\n     error['address_error'] = address_error\n     error['City data received']={var}['address']['city']\nelse:\n     data[ci]={var}['address']['city']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STATE': {'Processing': ["address_error = checkAddressForError({var})\nif 'Aust State Error' in address_error.keys() :\n     data[ci] = 'Error'\n     error['OR']= 'Error in Address'\n     error['send_to_CD'] = False\n     error['address_error'] = address_error\n     error['State data received']={var}['address']['state']\nelse:\n     data[ci]={var}['address']['state'].upper()"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'POSTCODE': {'Processing': ["address_error = checkAddressForError({var})\nif 'Aust Postcode Error' in address_error.keys():\n    data[ci] = 'Error'\n    error['OR']= 'Error in Address'\n    error['send_to_CD'] = False\n    error['address_error'] = address_error\n    error['Postcode data received'] ={var}['address']['postcode']\nelse:\n     data[ci]={var}['address']['postcode']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'COUNTRY': {'Processing': ["if {var}['address']['country'] in cc_codes_pd['Alpha-2 code'].to_list() :\n     data[ci]=cc_codes_pd.index[cc_codes_pd['Alpha-2 code'] == {var}['address']['country']].to_list()[0]\nelse:\n     data[ci]= {var}['address']['country']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ORDER_TYPE': {'Processing': ["if {var}['warehouse'] == 'eCommerce Warehouse' :\n     if 'eCommerce' in {var}['channel']:\n          data[ci] = 'eCommerce - online'\n     elif 'Wholesale' in {var}['channel']:\n          data[ci] = 'eCommerce - reorder'\n     else:\n          data[ci] = 'Error'\n          error['OR'] = 'Error in determining ORDER_TYPE 1'\n          error['send_to_CD'] = False\n          error['extra_info'] = {var}['channel'] + ', ' + {var}['warehouse']\nelif {var}['warehouse'] == 'Wholesale Warehouse':\n     data[ci] = {var}['channel']\nelse:\n     data[ci] = 'Error'\n     error['OR'] = 'Order not for Cross Docks - Australia'\n     error['send_to_CD'] = False\n     error['extra_info'] = {var}['channel'] + ', ' + {var}['warehouse']     \n   "], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CARRIER_CODE': {'Processing': ['method = {var}[\'shipping_method\']\nif (\'DHL\' in method): #the latter to cater for errors seen from Shopify / shipping app\n     data[ci]=\'EM001\'\nelif \'Standard\' in method:\n     if \'signature\' in {var}[\'customer_note\'].lower():\n          data[ci]=\'CD004\'\n     else:\n          data[ci]=\'CD003\'\nelif \'Express\' in method:\n     data[ci] = \'CD020\'\nelif len(method) == 0:\n     data[ci] = \'CD001\'\nelif method == \'Shipping\' : #this is error case from Shopify or "Shipping App"\n     data[ci]=\'EM001\'\n     error[\'OR\']= \'Error in Carrier Coding\'\n     error[\'send_to_CD\'] = True\nelse:\n     data[ci] = \'Error\'\n     error[\'OR\']= \'Error in Carrier Coding\'\n     error[\'send_to_CD\'] = False\n'], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PHONE_NO': {'Processing': ["data[ci]={var}['contact_phone']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'EMAIL_ADDRESS': {'Processing': ["data[ci]={var}['contact_email']"], 'Loops': [0.0], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'OR2': {'Col List': ['RECORD_INDICATOR', 'ACTION_INDICATOR', 'CUST_ORDER_NUMBER', 'PRODUCT', 'QUANTITY_ORDERED', 'LINE_NUMBER', 'BATCH NUMBER', 'STOCK STATUS'], 'template': '{data[RECORD_INDICATOR]}|{data[ACTION_INDICATOR]}|{data[CUST_ORDER_NUMBER]}|{data[PRODUCT]}|{data[QUANTITY_ORDERED]}|{data[LINE_NUMBER]}|{data[BATCH NUMBER]}|{data[STOCK STATUS]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ACTION_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CUST_ORDER_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PRODUCT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'QUANTITY_ORDERED': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'LINE_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'BATCH NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STOCK STATUS': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'OR4': {'Col List': ['RECORD_INDICATOR', 'ACTION_INDICATOR', 'CUST_ORDER_NUMBER', 'LINE_NUMBER', 'ORDER_NOTE'], 'template': '{data[RECORD_INDICATOR]}|{data[ACTION_INDICATOR]}|{data[CUST_ORDER_NUMBER]}|{data[LINE_NUMBER]}|{data[ORDER_NOTE]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ACTION_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CUST_ORDER_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'LINE_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ORDER_NOTE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}}, 'PC': {'HD': {'Col List': ['RECORD_INDICATOR', 'CLIENT', 'STREAM_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[CLIENT]}|{data[STREAM_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CLIENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STREAM_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'OS1': {'Col List': ['RECORD_INDICATOR', 'CUST_ORDER_NUMBER', 'IFAC_CUSTOMER_NO', 'ETD', 'ORDER_DATE', 'SHIP_TO_NAME', 'SHIP_TO_ADDRESS_1_1', 'SHIP_TO_ADDRESS_1_2', 'AREA', 'STATE', 'POSTCODE', 'DELIVERY_DESC1', 'VENDOR_ORD_NO', 'SERVICE_LEVEL', 'ASN', 'INVOICE_NUMBER', 'TOTAL ITEMS', 'FREIGHT_CHARGE', 'CONSIGNMENT_NUMBER'], 'template': '{data[RECORD_INDICATOR]}|{data[CUST_ORDER_NUMBER]}|{data[IFAC_CUSTOMER_NO]}|{data[ETD]}|{data[ORDER_DATE]}|{data[SHIP_TO_NAME]}|{data[SHIP_TO_ADDRESS_1_1]}|{data[SHIP_TO_ADDRESS_1_2]}|{data[AREA]}|{data[STATE]}|{data[POSTCODE]}|{data[DELIVERY_DESC1]}|{data[VENDOR_ORD_NO]}|{data[SERVICE_LEVEL]}|{data[ASN]}|{data[INVOICE_NUMBER]}|{data[TOTAL ITEMS]}|{data[FREIGHT_CHARGE]}|{data[CONSIGNMENT_NUMBER]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CUST_ORDER_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'IFAC_CUSTOMER_NO': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ETD': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ORDER_DATE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SHIP_TO_NAME': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SHIP_TO_ADDRESS_1_1': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SHIP_TO_ADDRESS_1_2': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'AREA': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STATE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'POSTCODE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'DELIVERY_DESC1': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'VENDOR_ORD_NO': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SERVICE_LEVEL': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ASN': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'INVOICE_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'TOTAL ITEMS': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'FREIGHT_CHARGE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CONSIGNMENT_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'OS2': {'Col List': ['RECORD_INDICATOR', 'PRODUCT', 'QUANTITY_SHIPPED', 'PACK_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[PRODUCT]}|{data[QUANTITY_SHIPPED]}|{data[PACK_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PRODUCT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'QUANTITY_SHIPPED': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PACK_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}}, 'SA': {'HD': {'Col List': ['RECORD_INDICATOR', 'CLIENT', 'STREAM_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[CLIENT]}|{data[STREAM_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CLIENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STREAM_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'SA': {'Col List': ['CONST', 'DATE_RECEIVED', 'PRODUCT', 'QUANTITY', 'REASON_CODE', 'SA_COMMENT', 'CONSIGNMENT NO.', 'TRANSACTION_TYPE', 'ORDER_NO', 'STOCK_STATUS'], 'template': '{data[CONST]}|{data[DATE_RECEIVED]}|{data[PRODUCT]}|{data[QUANTITY]}|{data[REASON_CODE]}|{data[SA_COMMENT]}|{data[CONSIGNMENT NO.]}|{data[TRANSACTION_TYPE]}|{data[ORDER_NO]}|{data[STOCK_STATUS]}', 'mapping': {'CONST': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'DATE_RECEIVED': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PRODUCT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'QUANTITY': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'REASON_CODE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'SA_COMMENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CONSIGNMENT NO.': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'TRANSACTION_TYPE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ORDER_NO': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STOCK_STATUS': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}}, 'PT': {'HD': {'Col List': ['RECORD_INDICATOR', 'CLIENT', 'STREAM_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[CLIENT]}|{data[STREAM_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CLIENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STREAM_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'PT1': {'Col List': ['RECORD_INDICATOR', 'ACTION_INDICATOR', 'CUST_ORDER_NUMBER', 'CONTAINER_NUMBER', 'ARRIVAL_DATE', 'CONTAINER_TYPE', 'TOTAL_CARTONS'], 'template': '{data[RECORD_INDICATOR]}|{data[ACTION_INDICATOR]}|{data[CUST_ORDER_NUMBER]}|{data[CONTAINER_NUMBER]}|{data[ARRIVAL_DATE]}|{data[CONTAINER_TYPE]}|{data[TOTAL_CARTONS]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ACTION_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CUST_ORDER_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CONTAINER_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ARRIVAL_DATE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CONTAINER_TYPE': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'TOTAL_CARTONS': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'PT2': {'Col List': ['RECORD_INDICATOR', 'ACTION_INDICATOR', 'CUST_ORDER_NUMBER', 'PRODUCT', 'QUANTITY_ORDERED', 'LINE_NUMBER', 'BATCH NUMBER', 'CARTON PACK_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[ACTION_INDICATOR]}|{data[CUST_ORDER_NUMBER]}|{data[PRODUCT]}|{data[QUANTITY_ORDERED]}|{data[LINE_NUMBER]}|{data[BATCH NUMBER]}|{data[CARTON PACK_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ACTION_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CUST_ORDER_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PRODUCT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'QUANTITY_ORDERED': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'LINE_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'BATCH NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CARTON PACK_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}}, 'TP': {'HD': {'Col List': ['RECORD_INDICATOR', 'CLIENT', 'STREAM_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[CLIENT]}|{data[STREAM_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CLIENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STREAM_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'TP': {'Col List': ['RECORD_INDICATOR', 'PURCHASE_ORD_NUMBER', 'LINE_NUMBER', 'PRODUCT', 'TOTAL_QUANTITY_REC'], 'template': '{data[RECORD_INDICATOR]}|{data[PURCHASE_ORD_NUMBER]}|{data[LINE_NUMBER]}|{data[PRODUCT]}|{data[TOTAL_QUANTITY_REC]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PURCHASE_ORD_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'LINE_NUMBER': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'PRODUCT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'TOTAL_QUANTITY_REC': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}}, 'MO': {'HD': {'Col List': ['RECORD_INDICATOR', 'CLIENT', 'STREAM_ID'], 'template': '{data[RECORD_INDICATOR]}|{data[CLIENT]}|{data[STREAM_ID]}', 'mapping': {'RECORD_INDICATOR': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'CLIENT': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'STREAM_ID': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}, 'MO': {'Col List': ['CONST', 'ORDER_NO', 'ACKNOWLEDGEMENT_FLAG'], 'template': '{data[CONST]}|{data[ORDER_NO]}|{data[ACKNOWLEDGEMENT_FLAG]}', 'mapping': {'CONST': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ORDER_NO': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}, 'ACKNOWLEDGEMENT_FLAG': {'Processing': [nan], 'Loops': [nan], 'Loop_Len1': [nan], 'Loop_Len2': [nan]}}}}}
