/*
================================================================================
档案代号:cxb_file
档案名称:成本月结档
档案目的:
上游档案:
下游档案:
============.========================.==========================================
*/
create table cxb_file
(
cxb01       varchar2(40) NOT NULL,   /*料件编号                               */
cxb02       number(5) NOT NULL,      /*年度                                   */
cxb03       number(5) NOT NULL,      /*期别                                   */
cxb04       date NOT NULL,           /*异动日期                               */
                                     /*单据日期                               */
cxb05       varchar2(8) NOT NULL,    /*异动时间                               */
                                     /*时:分:秒                               */
cxb06       varchar2(16) NOT NULL,   /*异动单号                               */
cxb07       number(5) NOT NULL,      /*项次                                   */
cxb08       number(15,3),            /*期末数量                               */
cxb09       number(20,6),            /*期末金额                               */
cxb091      number(20,6),            /*期末金额-材料                          */
cxb092      number(20,6),            /*期末金额-人工                          */
cxb093      number(20,6),            /*期末金额-制费                          */
cxb094      number(20,6),            /*期末金额-加工                          */
cxb095      number(20,6),            /*期末金额-其他                          */
cxb10       number(15,3),            /*No Use                                 */
cxb11       number(15,3),            /*No Use                                 */
cxb12       varchar2(1),             /*No Use                                 */
cxb010      varchar2(1) DEFAULT '' NOT NULL, /*成本计算类别*/
cxb011      varchar2(40) DEFAULT '' NOT NULL, /*类别代号(批次号/专案号/利润 */
cxb096      number(20,6) DEFAULT '0',/*期末金额-制费三                        */
cxb097      number(20,6) DEFAULT '0',/*期末金额-制费四                        */
cxb098      number(20,6) DEFAULT '0' /*期末金额-制费五                        */
);

create        index cxb_02 on cxb_file (cxb02,cxb03);
create unique index cxb_pk on cxb_file (cxb01,cxb010,cxb011,cxb02,cxb03,cxb04,cxb05,cxb06,cxb07);
alter table cxb_file add  constraint cxb_pk primary key  
(cxb01,cxb010,cxb011,cxb02,cxb03,cxb04,cxb05,cxb06,cxb07) enable validate;
grant select on cxb_file to public;
grant index on cxb_file to public;
grant update on cxb_file to public;
grant delete on cxb_file to public;
grant insert on cxb_file to public;