COMPILE ROUTINE LOAD_CUSTOMER(Dummy)
ROWDEF (CHARSTR)

DECLARE SUBROUTINE SEND_INFO, SEND_DYN, Utility, msg

$INSERT CUSTOMER_EQU
$INSERT COMPANY_EQU


EQU CRLF$ TO \0D0A\

OPEN 'COMPANY' TO CompanyTable ELSE
	DEBUG
	GOTO Bail
END

OPEN 'CUSTOMER' TO CustomerTable ELSE
	DEBUG
	GOTO Bail
END

debug
SELECT CustomerTable

Done = 0
LOOP
	READNEXT CustNo ELSE Done = 1
UNTIL Done
	READ CompanyRec FROM CompanyTable,CustNo THEN
		READ CustRec FROM CustomerTable,CustNo THEN
		
			CustRec<CUSTOMER_ENTRY_DATE$>			= CompanyRec<COMPANY_ENTRY_DATE$>
			CustRec<CUSTOMER_ENTRY_ID$>				= CompanyRec<COMPANY_ENTRY_ID$>
			
			CustRec<CUSTOMER_ATTENTION$>			= CompanyRec<COMPANY_BILL_TO_ATTN$>
			CustRec<CUSTOMER_COMPANY$>				= CompanyRec<COMPANY_BILL_TO_CO$>
			CustRec<CUSTOMER_ADDR$>					= CompanyRec<COMPANY_BILL_TO_ADDRESS$>
			CustRec<CUSTOMER_CITY$>					= CompanyRec<COMPANY_BILL_TO_CITY$>
			CustRec<CUSTOMER_ST$>					= CompanyRec<COMPANY_BILL_TO_STATE$>
			CustRec<CUSTOMER_ZIP$>					= CompanyRec<COMPANY_BILL_TO_ZIP$>
			
			CustRec<CUSTOMER_COUNTRY$>				= CompanyRec<COMPANY_COUNTRY$>
			CustRec<CUSTOMER_ABBREV$>				= CompanyRec<COMPANY_ABBREV$>
			CustRec<CUSTOMER_PHONE$>				= CompanyRec<COMPANY_PHONES$>
			CustRec<CUSTOMER_PHONE_DESC$>			= CompanyRec<COMPANY_PHONE_TYPES$>
			CustRec<CUSTOMER_INTL_PHONE$>			= CompanyRec<COMPANY_INTL_PHONES$>
			CustRec<CUSTOMER_INTL_PHONE_DESC$>		= CompanyRec<COMPANY_INTL_PHONE_TYPES$>
			CustRec<CUSTOMER_SALES_REP$>			= CompanyRec<COMPANY_SALES_REP$>
			CustRec<CUSTOMER_CARRIER_INFO$>			= CompanyRec<COMPANY_SHIPPER_INFO$>
			CustRec<CUSTOMER_CARRIER_ACCT$>			= CompanyRec<COMPANY_ACCOUNT_NO$>
			CustRec<CUSTOMER_NOTE$>					= CompanyRec<COMPANY_NOTE$>
			CustRec<CUSTOMER_TERMS$>				= CompanyRec<COMPANY_TERMS$>
			CustRec<CUSTOMER_SHIP_EXPORT_TEMP$>		= CompanyRec<COMPANY_SHIPPING_EXPORT_TEMPLATE$>
			CustRec<CUSTOMER_COA_FOLDER$>			= CompanyRec<COMPANY_COA_FOLDER$>
			CustRec<CUSTOMER_VISION_CUST_NO$>		= CompanyRec<COMPANY_CUST_TO$>
			
			WRITE CustRec ON CustomerTable,CustNo ELSE NULL
		
		END
	END
REPEAT




*UNLOCK All

* * * * * * *
Bail:
* * * * * * *

END
