/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_PRINTINGSCHEME_L') 
 CREATE TABLE T_BAS_PRINTINGSCHEME_L (
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_PRINTINGSCHEME') 
 CREATE TABLE T_BAS_PRINTINGSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FBILLFORMID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FDEFAULTTEMPLATE NVARCHAR(36) DEFAULT ' ',
FDEFAULTPRINTER NVARCHAR(36) DEFAULT ' ',
FISPREFERENCE CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID INT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL,
FMODIFIERID INT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME DEFAULT GETDATE(),
FFORBIDSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FFORBIDERID INT DEFAULT 0 NOT NULL,
FFORBIDDATE DATETIME,
FAPPROVEDATE DATETIME,
FAPPROVERID INT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BAS_PRINTINGCONDITION') 
 CREATE TABLE T_BAS_PRINTINGCONDITION (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID NVARCHAR(36) DEFAULT ' ' NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFILTERTYPE NVARCHAR(36) DEFAULT ' ',
FFILTERNAME NVARCHAR(100) DEFAULT ' ',
FISCHECK CHAR(1) DEFAULT '1',
FFILTERTEMPLATEID NVARCHAR(36) DEFAULT ' ',
FFILTERCONDITION NCLOB
);

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_table.sql **/
