src-db/database/model/tables/C_ORDERLINE.xml
author Víctor Martínez Romanos <victor.martinez@openbravo.com>
Mon, 20 Apr 2009 11:40:40 +0200
changeset 3593 35434a3a8037
parent 3491 0342347da77f
child 3638 db44a8f264fe
permissions -rw-r--r--
Fixed issue 8176: Added discounts to purchase/sales orders
carlos@0
     1
<?xml version="1.0"?>
adrian@94
     2
  <database name="TABLE C_ORDERLINE">
carlos@0
     3
    <table name="C_ORDERLINE" primaryKey="C_ORDERLINE_KEY">
juanpablo@1605
     4
      <column name="C_ORDERLINE_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
     5
        <default/>
antonio@735
     6
        <onCreateDefault/>
antonio@735
     7
      </column>
juanpablo@1605
     8
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
     9
        <default/>
antonio@735
    10
        <onCreateDefault/>
antonio@735
    11
      </column>
juanpablo@1605
    12
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    13
        <default/>
antonio@735
    14
        <onCreateDefault/>
antonio@735
    15
      </column>
antonio@735
    16
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
antonio@735
    17
        <default><![CDATA[Y]]></default>
antonio@735
    18
        <onCreateDefault/>
antonio@735
    19
      </column>
antonio@735
    20
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    21
        <default><![CDATA[SYSDATE]]></default>
antonio@735
    22
        <onCreateDefault/>
antonio@735
    23
      </column>
juanpablo@1605
    24
      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    25
        <default/>
antonio@735
    26
        <onCreateDefault/>
antonio@735
    27
      </column>
antonio@735
    28
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    29
        <default><![CDATA[SYSDATE]]></default>
antonio@735
    30
        <onCreateDefault/>
antonio@735
    31
      </column>
juanpablo@1605
    32
      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    33
        <default/>
antonio@735
    34
        <onCreateDefault/>
antonio@735
    35
      </column>
juanpablo@1605
    36
      <column name="C_ORDER_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    37
        <default/>
antonio@735
    38
        <onCreateDefault/>
antonio@735
    39
      </column>
antonio@735
    40
      <column name="LINE" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false">
antonio@735
    41
        <default/>
antonio@735
    42
        <onCreateDefault/>
antonio@735
    43
      </column>
juanpablo@1605
    44
      <column name="C_BPARTNER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    45
        <default/>
antonio@735
    46
        <onCreateDefault/>
antonio@735
    47
      </column>
juanpablo@1605
    48
      <column name="C_BPARTNER_LOCATION_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    49
        <default/>
antonio@735
    50
        <onCreateDefault/>
antonio@735
    51
      </column>
antonio@735
    52
      <column name="DATEORDERED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    53
        <default/>
antonio@735
    54
        <onCreateDefault/>
antonio@735
    55
      </column>
antonio@735
    56
      <column name="DATEPROMISED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    57
        <default/>
antonio@735
    58
        <onCreateDefault/>
antonio@735
    59
      </column>
antonio@735
    60
      <column name="DATEDELIVERED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    61
        <default/>
antonio@735
    62
        <onCreateDefault/>
antonio@735
    63
      </column>
antonio@735
    64
      <column name="DATEINVOICED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
antonio@735
    65
        <default/>
antonio@735
    66
        <onCreateDefault/>
antonio@735
    67
      </column>
antonio@735
    68
      <column name="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="2000" autoIncrement="false">
antonio@735
    69
        <default/>
antonio@735
    70
        <onCreateDefault/>
antonio@735
    71
      </column>
juanpablo@1605
    72
      <column name="M_PRODUCT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    73
        <default/>
antonio@735
    74
        <onCreateDefault/>
antonio@735
    75
      </column>
juanpablo@1605
    76
      <column name="M_WAREHOUSE_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    77
        <default/>
antonio@735
    78
        <onCreateDefault/>
antonio@735
    79
      </column>
antonio@735
    80
      <column name="DIRECTSHIP" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
antonio@735
    81
        <default><![CDATA[N]]></default>
antonio@735
    82
        <onCreateDefault/>
antonio@735
    83
      </column>
juanpablo@1605
    84
      <column name="C_UOM_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
    85
        <default/>
antonio@735
    86
        <onCreateDefault/>
antonio@735
    87
      </column>
antonio@735
    88
      <column name="QTYORDERED" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
    89
        <default><![CDATA[0]]></default>
antonio@735
    90
        <onCreateDefault/>
antonio@735
    91
      </column>
antonio@735
    92
      <column name="QTYRESERVED" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
    93
        <default><![CDATA[0]]></default>
antonio@735
    94
        <onCreateDefault/>
antonio@735
    95
      </column>
antonio@735
    96
      <column name="QTYDELIVERED" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
    97
        <default><![CDATA[0]]></default>
antonio@735
    98
        <onCreateDefault/>
antonio@735
    99
      </column>
antonio@735
   100
      <column name="QTYINVOICED" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
   101
        <default><![CDATA[0]]></default>
antonio@735
   102
        <onCreateDefault/>
antonio@735
   103
      </column>
juanpablo@1605
   104
      <column name="M_SHIPPER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   105
        <default/>
antonio@735
   106
        <onCreateDefault/>
antonio@735
   107
      </column>
juanpablo@1605
   108
      <column name="C_CURRENCY_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   109
        <default/>
antonio@735
   110
        <onCreateDefault/>
antonio@735
   111
      </column>
antonio@735
   112
      <column name="PRICELIST" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
   113
        <default><![CDATA[0]]></default>
antonio@735
   114
        <onCreateDefault/>
antonio@735
   115
      </column>
antonio@735
   116
      <column name="PRICEACTUAL" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
   117
        <default><![CDATA[0]]></default>
antonio@735
   118
        <onCreateDefault/>
antonio@735
   119
      </column>
antonio@735
   120
      <column name="PRICELIMIT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
   121
        <default><![CDATA[0]]></default>
antonio@735
   122
        <onCreateDefault/>
antonio@735
   123
      </column>
antonio@735
   124
      <column name="LINENETAMT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
   125
        <default><![CDATA[0]]></default>
antonio@735
   126
        <onCreateDefault/>
antonio@735
   127
      </column>
antonio@735
   128
      <column name="DISCOUNT" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
antonio@735
   129
        <default/>
antonio@735
   130
        <onCreateDefault/>
antonio@735
   131
      </column>
antonio@735
   132
      <column name="FREIGHTAMT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
   133
        <default><![CDATA[0]]></default>
antonio@735
   134
        <onCreateDefault/>
antonio@735
   135
      </column>
juanpablo@1605
   136
      <column name="C_CHARGE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   137
        <default/>
antonio@735
   138
        <onCreateDefault/>
antonio@735
   139
      </column>
antonio@735
   140
      <column name="CHARGEAMT" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
antonio@735
   141
        <default><![CDATA[0]]></default>
antonio@735
   142
        <onCreateDefault/>
antonio@735
   143
      </column>
juanpablo@1605
   144
      <column name="C_TAX_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   145
        <default/>
antonio@735
   146
        <onCreateDefault/>
antonio@735
   147
      </column>
juanpablo@1605
   148
      <column name="S_RESOURCEASSIGNMENT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   149
        <default/>
antonio@735
   150
        <onCreateDefault/>
antonio@735
   151
      </column>
juanpablo@1605
   152
      <column name="REF_ORDERLINE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   153
        <default/>
antonio@735
   154
        <onCreateDefault/>
antonio@735
   155
      </column>
juanpablo@1605
   156
      <column name="M_ATTRIBUTESETINSTANCE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   157
        <default/>
antonio@735
   158
        <onCreateDefault/>
antonio@735
   159
      </column>
antonio@735
   160
      <column name="ISDESCRIPTION" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
antonio@735
   161
        <default><![CDATA[N]]></default>
antonio@735
   162
        <onCreateDefault/>
antonio@735
   163
      </column>
antonio@735
   164
      <column name="QUANTITYORDER" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
antonio@735
   165
        <default/>
antonio@735
   166
        <onCreateDefault/>
antonio@735
   167
      </column>
juanpablo@1605
   168
      <column name="M_PRODUCT_UOM_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   169
        <default/>
antonio@735
   170
        <onCreateDefault/>
antonio@735
   171
      </column>
juanpablo@1605
   172
      <column name="M_OFFER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
antonio@735
   173
        <default/>
antonio@735
   174
        <onCreateDefault/>
antonio@735
   175
      </column>
antonio@735
   176
      <column name="PRICESTD" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
antonio@735
   177
        <default><![CDATA[0]]></default>
antonio@735
   178
        <onCreateDefault/>
antonio@735
   179
      </column>
gorka@3491
   180
      <column name="CANCELPRICEAD" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
gorka@3491
   181
        <default/>
gorka@3491
   182
        <onCreateDefault/>
gorka@3491
   183
      </column>
victor@3593
   184
      <column name="C_ORDER_DISCOUNT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
victor@3593
   185
        <default/>
victor@3593
   186
        <onCreateDefault/>
victor@3593
   187
      </column>
carlos@0
   188
      <foreign-key foreignTable="AD_CLIENT" name="ADCLIENT_CORDERLINE">
carlos@0
   189
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
carlos@0
   190
      </foreign-key>
carlos@0
   191
      <foreign-key foreignTable="AD_ORG" name="ADORG_CORDERLINE">
carlos@0
   192
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
carlos@0
   193
      </foreign-key>
antonio@410
   194
      <foreign-key foreignTable="C_ORDERLINE" name="C_ORDERLINE_SOPOREF">
antonio@410
   195
        <reference local="REF_ORDERLINE_ID" foreign="C_ORDERLINE_ID"/>
adrian@170
   196
      </foreign-key>
carlos@0
   197
      <foreign-key foreignTable="C_BPARTNER" name="CBPARTNER_SOLINE">
carlos@0
   198
        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
carlos@0
   199
      </foreign-key>
antonio@410
   200
      <foreign-key foreignTable="C_BPARTNER_LOCATION" name="CBPARTNERLOCATION_SOLINE">
antonio@410
   201
        <reference local="C_BPARTNER_LOCATION_ID" foreign="C_BPARTNER_LOCATION_ID"/>
antonio@410
   202
      </foreign-key>
carlos@0
   203
      <foreign-key foreignTable="C_CHARGE" name="CCHARGE_CORDERLINE">
carlos@0
   204
        <reference local="C_CHARGE_ID" foreign="C_CHARGE_ID"/>
carlos@0
   205
      </foreign-key>
carlos@0
   206
      <foreign-key foreignTable="C_CURRENCY" name="CCURRENCY_CORDERLINE">
carlos@0
   207
        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
carlos@0
   208
      </foreign-key>
victor@3593
   209
      <foreign-key foreignTable="C_ORDER_DISCOUNT" name="CINORDERLINE_FK_DISCORDER">
victor@3593
   210
        <reference local="C_ORDER_DISCOUNT_ID" foreign="C_ORDER_DISCOUNT_ID"/>
victor@3593
   211
      </foreign-key>
carlos@0
   212
      <foreign-key foreignTable="C_ORDER" name="CORDER_CORDERLINE">
carlos@0
   213
        <reference local="C_ORDER_ID" foreign="C_ORDER_ID"/>
carlos@0
   214
      </foreign-key>
carlos@0
   215
      <foreign-key foreignTable="C_TAX" name="CTAX_CORDERLINE">
carlos@0
   216
        <reference local="C_TAX_ID" foreign="C_TAX_ID"/>
carlos@0
   217
      </foreign-key>
carlos@0
   218
      <foreign-key foreignTable="C_UOM" name="CUOM_CORDERLINE">
carlos@0
   219
        <reference local="C_UOM_ID" foreign="C_UOM_ID"/>
carlos@0
   220
      </foreign-key>
carlos@0
   221
      <foreign-key foreignTable="M_ATTRIBUTESETINSTANCE" name="MATTRSETINST_CORDERLINE">
carlos@0
   222
        <reference local="M_ATTRIBUTESETINSTANCE_ID" foreign="M_ATTRIBUTESETINSTANCE_ID"/>
carlos@0
   223
      </foreign-key>
carlos@0
   224
      <foreign-key foreignTable="M_OFFER" name="MOFFER_CORDERLINE">
carlos@0
   225
        <reference local="M_OFFER_ID" foreign="M_OFFER_ID"/>
carlos@0
   226
      </foreign-key>
antonio@410
   227
      <foreign-key foreignTable="M_PRODUCT" name="MPRODUCT_CORDERLINE">
antonio@410
   228
        <reference local="M_PRODUCT_ID" foreign="M_PRODUCT_ID"/>
antonio@410
   229
      </foreign-key>
gorkaion@238
   230
      <foreign-key foreignTable="M_PRODUCT_UOM" name="MPRODUCTOUMID_CORDERLINE">
gorkaion@238
   231
        <reference local="M_PRODUCT_UOM_ID" foreign="M_PRODUCT_UOM_ID"/>
gorkaion@238
   232
      </foreign-key>
carlos@0
   233
      <foreign-key foreignTable="M_SHIPPER" name="MSHIPPER_CORDERLINE">
carlos@0
   234
        <reference local="M_SHIPPER_ID" foreign="M_SHIPPER_ID"/>
carlos@0
   235
      </foreign-key>
carlos@0
   236
      <foreign-key foreignTable="M_WAREHOUSE" name="MWAREHOUSE_CORDERLINE">
carlos@0
   237
        <reference local="M_WAREHOUSE_ID" foreign="M_WAREHOUSE_ID"/>
carlos@0
   238
      </foreign-key>
carlos@0
   239
      <foreign-key foreignTable="S_RESOURCEASSIGNMENT" name="SRESOURCEASSIGN_CORDERLINE">
carlos@0
   240
        <reference local="S_RESOURCEASSIGNMENT_ID" foreign="S_RESOURCEASSIGNMENT_ID"/>
carlos@0
   241
      </foreign-key>
adrian@94
   242
      <index name="C_ORDERLINE_ORDER" unique="false">
carlos@0
   243
        <index-column name="C_ORDER_ID"/>
carlos@0
   244
      </index>
adrian@94
   245
      <index name="C_ORDERLINE_PRODUCT" unique="false">
carlos@0
   246
        <index-column name="M_PRODUCT_ID"/>
carlos@0
   247
      </index>
ivan@258
   248
      <check name="C_ORDERLINE_CHECK1"><![CDATA[((QUANTITYORDER IS NULL) AND (M_PRODUCT_UOM_ID IS NULL)) OR ((QUANTITYORDER IS NOT NULL) AND (M_PRODUCT_UOM_ID IS NOT NULL))]]></check>
ivan@258
   249
      <check name="C_ORDERLINE_CHECK2"><![CDATA[(LINENETAMT = 0) OR (C_TAX_ID IS NOT NULL)]]></check>
ivan@258
   250
      <check name="C_ORDERLINE_DIRECTSHIP_CHECK"><![CDATA[DIRECTSHIP IN ('Y', 'N')]]></check>
ivan@258
   251
      <check name="C_ORDERLINE_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
carlos@0
   252
    </table>
adrian@94
   253
  </database>