/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
--维修报账单
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_APPLY_REPAIR')
 CREATE TABLE T_FA_APPLY_REPAIR (
FID BIGINT DEFAULT 0 NOT NULL,
FBILLNO VARCHAR(100) DEFAULT ' ' NOT NULL,
FBILLSTATUS CHAR(1) DEFAULT 'A' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FAUDITORID BIGINT DEFAULT 0 NOT NULL,
FAUDITDATE DATETIME,
FMODIFYTIME DATETIME,
FCREATETIME DATETIME,
FAPPLIERID BIGINT DEFAULT 0 NOT NULL,
FAPPLIERORGID BIGINT DEFAULT 0 NOT NULL,
FAPPLYDATE DATETIME,
FREASON NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FREASON_TAG NCLOB,
FAPPLIERDEPTID BIGINT DEFAULT 0 NOT NULL,
FASSETORGID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FINSTRUCTION NVARCHAR(2000) DEFAULT ' ' NOT NULL,
FINSTRUCTION_TAG NCLOB,
FCURRENCYID BIGINT DEFAULT 1 NOT NULL,
FEBALLAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREPAIRALLAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL
);
--维修报账单分录
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_APPLY_REPAIR_ENTRY')
 CREATE TABLE T_FA_APPLY_REPAIR_ENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FREALCARDID BIGINT DEFAULT 0 NOT NULL,
FDAMAGETYPE VARCHAR(20) DEFAULT ' ' NOT NULL,
FGUARANTEEPERIOD CHAR(1) DEFAULT '0' NOT NULL,
FREPAIRRESULT VARCHAR(20) DEFAULT ' ' NOT NULL,
FEBURDENAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FCBURDENAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FREPAIRAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FORIGINALVAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNETWORTH DECIMAL(23,10) DEFAULT 0 NOT NULL,
FNETAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPREUSINGAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDEPREDAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FACCUMDEPRE DECIMAL(23,10) DEFAULT 0 NOT NULL,
FDECVAL DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPRERESIDUALVAL DECIMAL(23,10) DEFAULT 0 NOT NULL
);


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