src-db/database/model/tables/C_INVOICE.xml
author Atul Gaware <atul.gaware@openbravo.com>
Tue, 12 Feb 2019 01:28:47 +0530
changeset 35442 018aa4e83090
parent 34905 fd033d0b5bc1
child 35504 add8fb4f0291
permissions -rw-r--r--
Fixes Issue 40119:Set two new columns in C_Invoice as nullable and do not
set a default value

** Remove NOT NULL constraint for columns CREATEFROMORDERS, CREATEFROMINOUTS
** Avoid setting DEFAULT value N for above columns.
** Remove check constraint either Y or N for above columns.
<?xml version="1.0"?>
  <database name="TABLE C_INVOICE">
    <table name="C_INVOICE" primaryKey="C_INVOICE_KEY">
      <column name="C_INVOICE_ID" primaryKey="true" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_CLIENT_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_ORG_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISACTIVE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="CREATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UPDATED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default><![CDATA[SYSDATE]]></default>
        <onCreateDefault/>
      </column>
      <column name="UPDATEDBY" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISSOTRX" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="DOCUMENTNO" primaryKey="false" required="true" type="NVARCHAR" size="30" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DOCSTATUS" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DOCACTION" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PROCESSING" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PROCESSED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="POSTED" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="C_DOCTYPE_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_DOCTYPETARGET_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_ORDER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DESCRIPTION" primaryKey="false" required="false" type="NVARCHAR" size="255" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISPRINTED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="SALESREP_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DATEINVOICED" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DATEPRINTED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DATEACCT" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_BPARTNER_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_BPARTNER_LOCATION_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="POREFERENCE" primaryKey="false" required="false" type="NVARCHAR" size="20" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISDISCOUNTPRINTED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[Y]]></default>
        <onCreateDefault/>
      </column>
      <column name="DATEORDERED" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_CURRENCY_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PAYMENTRULE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_PAYMENTTERM_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_CHARGE_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CHARGEAMT" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <column name="TOTALLINES" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <column name="GRANDTOTAL" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault/>
      </column>
      <column name="M_PRICELIST_ID" primaryKey="false" required="true" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISTAXINCLUDED" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="C_CAMPAIGN_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_PROJECT_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_ACTIVITY_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CREATEFROM" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="GENERATETO" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="AD_USER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="COPYFROM" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISSELFSERVICE" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="AD_ORGTRX_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="USER1_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="USER2_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="WITHHOLDINGAMOUNT" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="TAXDATE" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_WITHHOLDING_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISPAID" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault><![CDATA['N']]></onCreateDefault>
      </column>
      <column name="TOTALPAID" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault><![CDATA[0]]></onCreateDefault>
      </column>
      <column name="OUTSTANDINGAMT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault><![CDATA[0]]></onCreateDefault>
      </column>
      <column name="DAYSTILLDUE" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault><![CDATA[0]]></onCreateDefault>
      </column>
      <column name="DUEAMT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault><![CDATA[0]]></onCreateDefault>
      </column>
      <column name="LASTCALCULATEDONDATE" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="UPDATEPAYMENTMONITOR" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault><![CDATA['N']]></onCreateDefault>
      </column>
      <column name="FIN_PAYMENTMETHOD_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="FIN_PAYMENT_PRIORITY_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="FINALSETTLEMENT" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="DAYSOUTSTANDING" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="PERCENTAGEOVERDUE" primaryKey="false" required="false" type="DECIMAL" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="C_COSTCENTER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CALCULATE_PROMOTIONS" primaryKey="false" required="false" type="VARCHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="A_ASSET_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="ISCASHVAT" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
        <default><![CDATA[N]]></default>
        <onCreateDefault/>
      </column>
      <column name="PREPAYMENTAMT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
        <default><![CDATA[0]]></default>
        <onCreateDefault><![CDATA[0]]></onCreateDefault>
      </column>
      <column name="CREATEFROMORDERS" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <column name="CREATEFROMINOUTS" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
        <default/>
        <onCreateDefault/>
      </column>
      <foreign-key foreignTable="C_BPARTNER_LOCATION" name="C_BPLOCATION_CINVOICE">
        <reference local="C_BPARTNER_LOCATION_ID" foreign="C_BPARTNER_LOCATION_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_CLIENT" name="C_INVOICE_AD_CLIENT">
        <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="C_INVOICE_AD_ORG">
        <reference local="AD_ORG_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_ORG" name="C_INVOICE_AD_ORGTRX">
        <reference local="AD_ORGTRX_ID" foreign="AD_ORG_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_USER" name="C_INVOICE_AD_USER">
        <reference local="AD_USER_ID" foreign="AD_USER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="A_ASSET" name="C_INVOICE_ASSET">
        <reference local="A_ASSET_ID" foreign="A_ASSET_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_ACTIVITY" name="C_INVOICE_C_ACTIVITY">
        <reference local="C_ACTIVITY_ID" foreign="C_ACTIVITY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_BPARTNER" name="C_INVOICE_C_BPARTNER">
        <reference local="C_BPARTNER_ID" foreign="C_BPARTNER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_CAMPAIGN" name="C_INVOICE_C_CAMPAIGN">
        <reference local="C_CAMPAIGN_ID" foreign="C_CAMPAIGN_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_CHARGE" name="C_INVOICE_C_CHARGE">
        <reference local="C_CHARGE_ID" foreign="C_CHARGE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_CURRENCY" name="C_INVOICE_C_CURRENCY">
        <reference local="C_CURRENCY_ID" foreign="C_CURRENCY_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_DOCTYPE" name="C_INVOICE_C_DOCTYPE">
        <reference local="C_DOCTYPE_ID" foreign="C_DOCTYPE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_DOCTYPE" name="C_INVOICE_C_DOCTYPETARGET">
        <reference local="C_DOCTYPETARGET_ID" foreign="C_DOCTYPE_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_ORDER" name="C_INVOICE_C_ORDER">
        <reference local="C_ORDER_ID" foreign="C_ORDER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_PAYMENTTERM" name="C_INVOICE_C_PAYMENTTERM">
        <reference local="C_PAYMENTTERM_ID" foreign="C_PAYMENTTERM_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_PROJECT" name="C_INVOICE_C_PROJECT">
        <reference local="C_PROJECT_ID" foreign="C_PROJECT_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_WITHHOLDING" name="C_INVOICE_C_WITHHOLDING">
        <reference local="C_WITHHOLDING_ID" foreign="C_WITHHOLDING_ID"/>
      </foreign-key>
      <foreign-key foreignTable="C_COSTCENTER" name="C_INVOICE_COSTCENTER">
        <reference local="C_COSTCENTER_ID" foreign="C_COSTCENTER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="FIN_PAYMENTMETHOD" name="C_INVOICE_FIN_PAYMENTMETHOD">
        <reference local="FIN_PAYMENTMETHOD_ID" foreign="FIN_PAYMENTMETHOD_ID"/>
      </foreign-key>
      <foreign-key foreignTable="M_PRICELIST" name="C_INVOICE_M_PRICELIST">
        <reference local="M_PRICELIST_ID" foreign="M_PRICELIST_ID"/>
      </foreign-key>
      <foreign-key foreignTable="AD_USER" name="C_INVOICE_SALESREP">
        <reference local="SALESREP_ID" foreign="AD_USER_ID"/>
      </foreign-key>
      <foreign-key foreignTable="USER1" name="C_INVOICE_USER1">
        <reference local="USER1_ID" foreign="USER1_ID"/>
      </foreign-key>
      <foreign-key foreignTable="USER2" name="C_INVOICE_USER2">
        <reference local="USER2_ID" foreign="USER2_ID"/>
      </foreign-key>
      <foreign-key foreignTable="FIN_PAYMENT_PRIORITY" name="FIN_INVOICE_PAYMENT_PRIORITY">
        <reference local="FIN_PAYMENT_PRIORITY_ID" foreign="FIN_PAYMENT_PRIORITY_ID"/>
      </foreign-key>
      <index name="C_INVOICE_AD_USER" unique="false">
        <index-column name="AD_USER_ID"/>
        <whereClause><![CDATA[AD_USER_ID IS NOT NULL]]></whereClause>
      </index>
      <index name="C_INVOICE_BPARTNER" unique="false">
        <index-column name="C_BPARTNER_ID"/>
      </index>
      <index name="C_INVOICE_CLIENT_ORG_DATE_DOC" unique="false">
        <index-column name="AD_CLIENT_ID"/>
        <index-column name="AD_ORG_ID"/>
        <index-column name="DATEINVOICED"/>
        <index-column name="DOCUMENTNO"/>
      </index>
      <index name="C_INVOICE_DOCNO" unique="false">
        <index-column name="DOCUMENTNO"/>
      </index>
      <index name="C_INVOICE_ORDER" unique="false">
        <index-column name="C_ORDER_ID"/>
        <whereClause><![CDATA[C_ORDER_ID IS NOT NULL]]></whereClause>
      </index>
      <index name="C_INVOICE_PAID" unique="false">
        <index-column name="ISPAID"/>
      </index>
      <index name="C_INVOICE_POSTED" unique="false">
        <index-column name="POSTED"/>
      </index>
      <index name="C_INVOICE_SALESREP" unique="false">
        <index-column name="SALESREP_ID"/>
        <whereClause><![CDATA[SALESREP_ID IS NOT NULL]]></whereClause>
      </index>
      <index name="C_INVOICE_UPDATED" unique="false">
        <index-column name="UPDATED"/>
      </index>
      <check name="C_INVOICE_CREATEFROM_CHECK"><![CDATA[CREATEFROM IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_GENERATETO_CHECK"><![CDATA[GENERATETO IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_ISACTIVE_CHECK"><![CDATA[ISACTIVE IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_ISCASHVAT_CH"><![CDATA[ISCASHVAT IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_ISDISCOUNTPRINTE_CHK"><![CDATA[ISDISCOUNTPRINTED IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_ISPRINTED_CHECK"><![CDATA[ISPRINTED IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_ISSOTRX_CHECK"><![CDATA[ISSOTRX IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_ISTAXINCLUDED_CHECK"><![CDATA[ISTAXINCLUDED IN ('Y', 'N')]]></check>
      <check name="C_INVOICE_PROCESSED_CHECK"><![CDATA[PROCESSED IN ('Y', 'N')]]></check>
    </table>
  </database>