database/model/tables/C_ORDERLINE.xml
author Carlos Romero <carlos.romero@openbravo.com>
Tue, 06 Nov 2007 08:33:31 +0000
changeset 0 0247c26f10c6
child 94 4e7ba7b8a4ad
permissions -rw-r--r--
Modified PostgreSQL post script in order to include C_DEBT_PAYMENT_GENERATE modification tules
carlos@0
     1
<?xml version="1.0"?>
carlos@0
     2
<database name="TABLE C_ORDERLINE">
carlos@0
     3
    <table name="C_ORDERLINE" primaryKey="C_ORDERLINE_KEY">
carlos@0
     4
      <column name="C_ORDERLINE_ID" primaryKey="true" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
     5
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
     6
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
     7
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" default="Y" autoIncrement="false"/>
carlos@0
     8
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" default="SYSDATE" autoIncrement="false"/>
carlos@0
     9
      <column name="CREATEDBY" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    10
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" default="SYSDATE" autoIncrement="false"/>
carlos@0
    11
      <column name="UPDATEDBY" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    12
      <column name="C_ORDER_ID" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    13
      <column name="LINE" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    14
      <column name="C_BPARTNER_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    15
      <column name="C_BPARTNER_LOCATION_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    16
      <column name="DATEORDERED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false"/>
carlos@0
    17
      <column name="DATEPROMISED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false"/>
carlos@0
    18
      <column name="DATEDELIVERED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false"/>
carlos@0
    19
      <column name="DATEINVOICED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false"/>
carlos@0
    20
      <column name="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="2000" autoIncrement="false"/>
carlos@0
    21
      <column name="M_PRODUCT_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    22
      <column name="M_WAREHOUSE_ID" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    23
      <column name="DIRECTSHIP" primaryKey="false" required="true" type="CHAR" size="1" default="N" autoIncrement="false"/>
carlos@0
    24
      <column name="C_UOM_ID" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    25
      <column name="QTYORDERED" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    26
      <column name="QTYRESERVED" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    27
      <column name="QTYDELIVERED" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    28
      <column name="QTYINVOICED" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    29
      <column name="M_SHIPPER_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    30
      <column name="C_CURRENCY_ID" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    31
      <column name="PRICELIST" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    32
      <column name="PRICEACTUAL" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    33
      <column name="PRICELIMIT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    34
      <column name="LINENETAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    35
      <column name="DISCOUNT" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false"/>
carlos@0
    36
      <column name="FREIGHTAMT" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    37
      <column name="C_CHARGE_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    38
      <column name="CHARGEAMT" primaryKey="false" required="false" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    39
      <column name="C_TAX_ID" primaryKey="false" required="true" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    40
      <column name="LOT" primaryKey="false" required="false" type="VARCHAR" size="20" autoIncrement="false"/>
carlos@0
    41
      <column name="SERNO" primaryKey="false" required="false" type="VARCHAR" size="20" autoIncrement="false"/>
carlos@0
    42
      <column name="S_RESOURCEASSIGNMENT_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    43
      <column name="REF_ORDERLINE_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    44
      <column name="M_ATTRIBUTESETINSTANCE_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    45
      <column name="ISDESCRIPTION" primaryKey="false" required="true" type="CHAR" size="1" default="N" autoIncrement="false"/>
carlos@0
    46
      <column name="QUANTITYORDER" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false"/>
carlos@0
    47
      <column name="M_PRODUCT_UOM_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    48
      <column name="LASTPRICESO" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false"/>
carlos@0
    49
      <column name="M_OFFER_ID" primaryKey="false" required="false" type="DECIMAL" size="10,0" autoIncrement="false"/>
carlos@0
    50
      <column name="PRICESTD" primaryKey="false" required="true" type="DECIMAL" default="0" autoIncrement="false"/>
carlos@0
    51
      <check name="C_ORDERLINE_ISACTIVE_CHECK" condition="IsActive in ('Y','N')"/> 
carlos@0
    52
      <check name="C_ORDERLINE_DIRECTSHIP_CHECK" condition="DirectShip in ('Y','N')"/> 
carlos@0
    53
      <check name="C_ORDERLINE_CHECK1" condition="((QUANTITYORDER IS NULL AND M_PRODUCT_UOM_ID IS NULL) OR (QUANTITYORDER IS NOT NULL AND M_PRODUCT_UOM_ID IS NOT NULL))"/>
carlos@0
    54
      <check name="C_ORDERLINE_CHECK2" condition="LineNetAmt=0 OR C_Tax_ID IS NOT NULL"/>
carlos@0
    55
      <foreign-key foreignTable="AD_CLIENT" name="ADCLIENT_CORDERLINE">
carlos@0
    56
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
carlos@0
    57
      </foreign-key>
carlos@0
    58
      <foreign-key foreignTable="AD_ORG" name="ADORG_CORDERLINE">
carlos@0
    59
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
carlos@0
    60
      </foreign-key>
carlos@0
    61
      <foreign-key foreignTable="C_BPARTNER" name="CBPARTNER_SOLINE">
carlos@0
    62
        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
carlos@0
    63
      </foreign-key>
carlos@0
    64
      <foreign-key foreignTable="C_BPARTNER_LOCATION" name="CBPARTNERLOCATION_SOLINE">
carlos@0
    65
        <reference local="C_BPARTNER_LOCATION_ID" foreign="C_BPARTNER_LOCATION_ID"/>
carlos@0
    66
      </foreign-key>
carlos@0
    67
      <foreign-key foreignTable="C_CHARGE" name="CCHARGE_CORDERLINE">
carlos@0
    68
        <reference local="C_CHARGE_ID" foreign="C_CHARGE_ID"/>
carlos@0
    69
      </foreign-key>
carlos@0
    70
      <foreign-key foreignTable="C_CURRENCY" name="CCURRENCY_CORDERLINE">
carlos@0
    71
        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
carlos@0
    72
      </foreign-key>
carlos@0
    73
      <foreign-key foreignTable="C_ORDER" name="CORDER_CORDERLINE">
carlos@0
    74
        <reference local="C_ORDER_ID" foreign="C_ORDER_ID"/>
carlos@0
    75
      </foreign-key>
carlos@0
    76
      <foreign-key foreignTable="C_ORDERLINE" name="C_ORDERLINE_SOPOREF">
carlos@0
    77
        <reference local="REF_ORDERLINE_ID" foreign="C_ORDERLINE_ID"/>
carlos@0
    78
      </foreign-key>
carlos@0
    79
      <foreign-key foreignTable="C_TAX" name="CTAX_CORDERLINE">
carlos@0
    80
        <reference local="C_TAX_ID" foreign="C_TAX_ID"/>
carlos@0
    81
      </foreign-key>
carlos@0
    82
      <foreign-key foreignTable="C_UOM" name="CUOM_CORDERLINE">
carlos@0
    83
        <reference local="C_UOM_ID" foreign="C_UOM_ID"/>
carlos@0
    84
      </foreign-key>
carlos@0
    85
      <foreign-key foreignTable="M_ATTRIBUTESETINSTANCE" name="MATTRSETINST_CORDERLINE">
carlos@0
    86
        <reference local="M_ATTRIBUTESETINSTANCE_ID" foreign="M_ATTRIBUTESETINSTANCE_ID"/>
carlos@0
    87
      </foreign-key>
carlos@0
    88
      <foreign-key foreignTable="M_OFFER" name="MOFFER_CORDERLINE">
carlos@0
    89
        <reference local="M_OFFER_ID" foreign="M_OFFER_ID"/>
carlos@0
    90
      </foreign-key>
carlos@0
    91
      <foreign-key foreignTable="M_PRODUCT" name="MPRODUCT_CORDERLINE">
carlos@0
    92
        <reference local="M_PRODUCT_ID" foreign="M_PRODUCT_ID"/>
carlos@0
    93
      </foreign-key>
carlos@0
    94
      <foreign-key foreignTable="M_PRODUCT_UOM" name="MPRODUCTOUMID_CORDERLINE">
carlos@0
    95
        <reference local="M_PRODUCT_UOM_ID" foreign="M_PRODUCT_UOM_ID"/>
carlos@0
    96
      </foreign-key>
carlos@0
    97
      <foreign-key foreignTable="M_SHIPPER" name="MSHIPPER_CORDERLINE">
carlos@0
    98
        <reference local="M_SHIPPER_ID" foreign="M_SHIPPER_ID"/>
carlos@0
    99
      </foreign-key>
carlos@0
   100
      <foreign-key foreignTable="M_WAREHOUSE" name="MWAREHOUSE_CORDERLINE">
carlos@0
   101
        <reference local="M_WAREHOUSE_ID" foreign="M_WAREHOUSE_ID"/>
carlos@0
   102
      </foreign-key>
carlos@0
   103
      <foreign-key foreignTable="S_RESOURCEASSIGNMENT" name="SRESOURCEASSIGN_CORDERLINE">
carlos@0
   104
        <reference local="S_RESOURCEASSIGNMENT_ID" foreign="S_RESOURCEASSIGNMENT_ID"/>
carlos@0
   105
      </foreign-key>
carlos@0
   106
      <index name="C_ORDERLINE_ORDER">
carlos@0
   107
        <index-column name="C_ORDER_ID"/>
carlos@0
   108
      </index>
carlos@0
   109
      <index name="C_ORDERLINE_PRODUCT">
carlos@0
   110
        <index-column name="M_PRODUCT_ID"/>
carlos@0
   111
      </index>
carlos@0
   112
    </table>
carlos@0
   113
</database>