-- Create Table Statement for 'Letter'
DROP TABLE IF EXISTS `LETTER`;
CREATE TABLE `LETTER` (
	ID bigint(20) NOT NULL,
	REF_CODE varchar,
	CREATOR_CODE varchar,
	CREATE_DATE datetime,
	TEMPLATE_CODE varchar,
	STATUS_CL varchar,
	MERCHANT_ACCOUNT_CODE int(11) NOT NULL,
	COLLECTOR_ACCOUNT_CODE int(11),
	NAME varchar,
	CITY varchar,
	STREET1 varchar,
	STREET2 varchar,
	STATE varchar,
	ZIP_CODE varchar,
	EMAIL varchar,
	DUE_DATE datetime,
	IS_STATEMENT tinyint(1),
	CUSTOM_FIELD1 varchar,
	CUSTOM_FIELD2 varchar,
	CUSTOM_FIELD3 varchar,
	CUSTOM_FIELD4 varchar,
	CUSTOM_FIELD5 varchar,
	IS_VISIBLE_EXTERNALLY tinyint(1),
	PROCESSED_DATE datetime,
	LETTER_CODE_FK bigint(20),
	CUSTOMER_ACCOUNT_FK bigint(20),
	PAYMENT_OPTION_FK bigint(20),
	PAYMENT_PLAN_FK bigint(20),
	ACCOUNT_TRANSACTION_FK bigint(20),
	LETTER_DOCUMENT_FK bigint(20),
	ADDRESS_FK bigint(20),
	PRIMARY KEY (ID)
) ENGINE=InnoDB;