/*
================================================================================
档案代号:omb_file
档案名称:应收帐款单身档
档案目的:
上游档案:
下游档案:
============.========================.==========================================
*/
create table omb_file
(
omb00       varchar2(2),             /*帐款类别                               */
                                     /*帐款类别 (1*:应收帐款  2*:待抵帐款)oma00*/
omb01       varchar2(16) NOT NULL,   /*应收单号/待抵单号                      */
                                     /*应收单号/待抵单号 oma01                */
omb03       number(5) NOT NULL,      /*项次                                   */
omb04       varchar2(40),            /*产品编号                               */
                                     /*产品编号 ima01/ogb04/ohb04             */
omb05       varchar2(4),             /*销售单位                               */
                                     /*销售单位 gfe01/ogb05/ohb05             */
omb06       varchar2(120),           /*品名规格                               */
omb12       number(15,3) NOT NULL,   /*数量                                   */
omb13       number(20,6) NOT NULL,   /*原币单价                               */
omb14       number(20,6) NOT NULL,   /*原币未税金额                           */
omb14t      number(20,6) NOT NULL,   /*原币含税金额                           */
omb15       number(20,6) NOT NULL,   /*本币单价                               */
omb16       number(20,6) NOT NULL,   /*本币未税金额                           */
omb16t      number(20,6) NOT NULL,   /*本币含税金额                           */
omb17       number(20,6),            /*发票单价                               */
omb18       number(20,6),            /*发票未税金额                           */
omb18t      number(20,6),            /*发票含税金额                           */
omb31       varchar2(16),            /*出货单号/销退单号                      */
                                     /*出货单号/销退单号 ogb01/ohb01          */
omb32       number(5),               /*出货项次/销退项次                      */
                                     /*出货项次/销退项次 ogb03/ohb03          */
omb33       varchar2(24),            /*科目编号                               */
                                     /*科目编号 aag01                         */
omb34       number(20,6),            /*原币已冲金额                           */
                                     /*原币已冲金额(for cec)                  */
omb35       number(20,6),            /*本币已冲金额                           */
                                     /*本币已冲金额(for cec)                  */
omb36       number(20,10),           /*重估汇率                               */
omb37       number(20,6),            /*本币未冲金额                           */
omb930      varchar2(10),            /*成本中心                               */
omb331      varchar2(24),            /*第二科目编码                           */
omb40       varchar2(4),             /*理由码                                 */
omb38       varchar2(2),             /*来源类型                               */
                                     /*01-订单,02-出货,03-销退,04-出货返利,05-销退返利,99-其他*/
omb39       varchar2(1),             /*搭赠                                   */
omb41       varchar2(10),            /*专案代号                               */
omb42       varchar2(30),            /*WBS编码                                */
omb43       varchar2(4),             /*活动代号                               */
ombud01     varchar2(255),           /*自订栏位-Textedit                      */
ombud02     varchar2(40),            /*自订栏位-文字                          */
ombud03     varchar2(40),            /*自订栏位-文字                          */
ombud04     varchar2(40),            /*自订栏位-文字                          */
ombud05     varchar2(40),            /*自订栏位-文字                          */
ombud06     varchar2(40),            /*自订栏位-文字                          */
ombud07     number(15,3),            /*自订栏位-数值                          */
ombud08     number(15,3),            /*自订栏位-数值                          */
ombud09     number(15,3),            /*自订栏位-数值                          */
ombud10     number(10),              /*自订栏位-整数                          */
ombud11     number(10),              /*自订栏位-整数                          */
ombud12     number(10),              /*自订栏位-整数                          */
ombud13     date,                    /*自订栏位-日期                          */
ombud14     date,                    /*自订栏位-日期                          */
ombud15     date                     /*自订栏位-日期                          */
);

create        index omb_02 on omb_file (omb31,omb32);
create        index omb_03 on omb_file (omb04);
create unique index omb_pk on omb_file (omb01,omb03);
alter table omb_file add  constraint omb_pk primary key  (omb01,omb03) enable validate;
grant select on omb_file to public;
grant index on omb_file to public;
grant update on omb_file to public;
grant delete on omb_file to public;
grant insert on omb_file to public;