/**Begin C:\Users\rd_xiang_qiu\Desktop\PDM规范\PDM_UPGRADE\pdm1\BOS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_INVOICE') 
 CREATE TABLE T_BAS_INVOICE (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICEDATE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FIMAGENUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FIMAGEPAGE NVARCHAR(10) DEFAULT ' ' NOT NULL,
FINVOICECODE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FINVOICETYPE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FBILLNO VARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLSTATUE CHAR(1) DEFAULT ' ' NOT NULL,
FINVOICENO NVARCHAR(100) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_INVOICEENTRYKEY') 
 CREATE TABLE T_BAS_INVOICEENTRYKEY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINVOICEENTRYKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FINVOICEENTRYVALUE NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FINVOICEENTRYINDEX INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_INVOICEKEY') 
 CREATE TABLE T_BAS_INVOICEKEY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FINVOICEKEY NVARCHAR(100) DEFAULT ' ' NOT NULL,
FINVOICEVALUE NVARCHAR(2000) DEFAULT ' ' NOT NULL
);



/**End C:\Users\rd_xiang_qiu\Desktop\PDM规范\PDM_UPGRADE\pdm1\BOS_table.sql **/
