/**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_INV_ITEM_SETTING') 
 CREATE TABLE T_BDM_INV_ITEM_SETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FACCEPTUPLEVELSHARE CHAR(1) DEFAULT ' ' NOT NULL,
FORGINALBILLNEW CHAR(1) DEFAULT ' ' NOT NULL,
FORIGINALBILLIMPORT CHAR(1) DEFAULT ' ' NOT NULL,
FAPIINVOICE CHAR(1) DEFAULT ' ' NOT NULL,
FBATCHINVOICE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATER BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_ISSUE_INV_SETTTTING') 
 CREATE TABLE T_BDM_ISSUE_INV_SETTTTING (
FID BIGINT DEFAULT 0 NOT NULL,
FORG BIGINT DEFAULT 0 NOT NULL,
FISSUEINVOICEORDER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FERRCONTINUE CHAR(1) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_SCANINVOICE_SETTING') 
 CREATE TABLE T_BDM_SCANINVOICE_SETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICETYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEQINFONO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEQINFOTAXNO NVARCHAR(50) DEFAULT ' ' NOT NULL,
FGOODSNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FGOODSCODE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTAXRATE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPRICE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDEFAULTGOODS CHAR(1) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(230) DEFAULT ' ' NOT NULL,
FUPDATEDATE DATETIME,
FDRAWER NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_SYSTEM_SETTING') 
 CREATE TABLE T_BDM_SYSTEM_SETTING (
FID BIGINT DEFAULT 0 NOT NULL,
FQRCODEDAY BIGINT DEFAULT 0 NOT NULL,
FTAXNO NVARCHAR(50) DEFAULT ' ' NOT NULL
);



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