
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_INV_SPLIT_RULE') 
 CREATE TABLE T_BDM_INV_SPLIT_RULE (
FID BIGINT DEFAULT 0 NOT NULL,
FRULENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FRULECODE NVARCHAR(20) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATEDATE DATETIME,
FUPDATEDATE DATETIME,
FORG BIGINT DEFAULT 0 NOT NULL,
FSPLITWITHAMOUNT CHAR(1) DEFAULT ' ' NOT NULL,
FPAPERCOMMONLIMITAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPAPERSPECIALLIMITAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FELECOMMONLIMITAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FELESPECIALLIMITAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FQUANTITYDECIMALLIMIT BIGINT DEFAULT 0 NOT NULL,
FPRICEDECIMALLIMIT BIGINT DEFAULT 0 NOT NULL,
FDETAILMERGERULE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FSPLITLISTTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNEGATIVEDETAILRULE CHAR(1) DEFAULT ' ' NOT NULL,
FDETAILSPLITRULE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDETAILQUANTITYSPLITRULE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FINVOICEREMARKRULE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARKSPLITREGEX NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARKAUTODISTINCT CHAR(1) DEFAULT ' ' NOT NULL,
FLISTRULE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FLISTLIMITSPECIAL BIGINT DEFAULT 0 NOT NULL,
FLISTLIMITCOMMON BIGINT DEFAULT 0 NOT NULL,
FLISTLIMITELESPEC BIGINT DEFAULT 0 NOT NULL,
FTOTALTAXAMTCOUNTRULE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDEVLIMITSPLIT CHAR(1) DEFAULT ' ' NOT NULL,
FLISTLIMITELECOMM BIGINT DEFAULT 0 NOT NULL
);