-- 税务明细
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_ER_WHTAXDETAIL')
CREATE TABLE T_ER_WHTAXDETAIL (
                                  FWHDETAILID BIGINT DEFAULT 0 NOT NULL,
                                  FDETAILID BIGINT DEFAULT 0 NOT NULL,
                                  FSEQ INT DEFAULT 0 NOT NULL,
                                  FWHTAXCODE BIGINT DEFAULT 0 NOT NULL,
                                  FWHTAXCATEGORY BIGINT DEFAULT 0 NOT NULL,
                                  FWHTAXRATEBASE BIGINT DEFAULT 0 NOT NULL,
                                  FWHTAXRATEPERCENT DECIMAL(23,10) DEFAULT 0 NOT NULL,
                                  FWHTAXCURRENCY BIGINT DEFAULT 0 NOT NULL,
                                  FWHTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
                                  FWHOFFSETLOGO CHAR(1) DEFAULT '0' NOT NULL,
                                  FWHTAXDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);

EXEC p_AlterPK 'PK_ER_WHTAXDETAIL', 'T_ER_WHTAXDETAIL', 'FWHDETAILID', '1';


