/**Begin D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_TERMINAL') 
 CREATE TABLE T_BDM_TERMINAL (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FTERMINALCODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICETYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FDEVNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICECOUNT BIGINT DEFAULT 0 NOT NULL,
FONCEBUYLIMIT BIGINT DEFAULT 0 NOT NULL,
FSURPLUSCOUNT BIGINT DEFAULT 0 NOT NULL,
FMAXCOUNT BIGINT DEFAULT 0 NOT NULL,
FMONTHBUYLIMIT BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_TERMINAL_INVOICE') 
 CREATE TABLE T_BDM_TERMINAL_INVOICE (
FID BIGINT DEFAULT 0 NOT NULL,
FSTARTNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICECODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTERMINALCODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FENDNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSURPLUS BIGINT DEFAULT 0 NOT NULL,
FINVOICECOUNT BIGINT DEFAULT 0 NOT NULL
);



/**End D:\d_desk\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
