Rename columns (dateacct, doubtfuldebt_amount), format js code
authorMikel Irurita <mikel.irurita@openbravo.com>
Thu, 10 Jan 2013 17:47:11 +0100
changeset 19564 0e5eed990909
parent 19563 cb44af1d5e4e
child 19565 2ffacd79bc39
Rename columns (dateacct, doubtfuldebt_amount), format js code
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js
src-db/database/model/tables/FIN_DOUBTFUL_DEBT.xml
src-db/database/model/tables/FIN_PAYMENT_SCHEDULEDETAIL.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java	Thu Jan 10 13:37:54 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/DoubtFulDebtPickEditLines.java	Thu Jan 10 17:47:11 2013 +0100
@@ -182,7 +182,7 @@
         for (FIN_PaymentScheduleDetail psd : salesInvoicePaymentSchedule
             .getFINPaymentScheduleDetailInvoicePaymentScheduleList()) {
           if (psd.getPaymentDetails() == null && !psd.isCanceled()) {
-            psd.setDebtAmount(psd.getDebtAmount().subtract(dd.getAmount()));
+            psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().subtract(dd.getAmount()));
             OBDal.getInstance().save(psd);
           }
         }
@@ -201,7 +201,8 @@
       if (psd.getPaymentDetails() == null && !psd.isCanceled()) {
         // Pending amount should be greater or equals than the doubtful debt amount
         if (psd.getAmount().compareTo(debtAmount) >= 0) {
-          psd.setDebtAmount(psd.getDebtAmount().add(debtAmount).subtract(oldDebtAmount));
+          psd.setDoubtfulDebtAmount(psd.getDoubtfulDebtAmount().add(debtAmount)
+              .subtract(oldDebtAmount));
           OBDal.getInstance().save(psd);
         }
       }
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js	Thu Jan 10 13:37:54 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js	Thu Jan 10 17:47:11 2013 +0100
@@ -207,11 +207,11 @@
 };
 
 OB.APRM.selectDoubtfulDebtPickAndEdit = function (grid, record, state) {
-	var percentage = grid.view.parentWindow.views[0].getParentRecord().percentage;
-	if(state){
-	  record.doubtfulDebtAmount = String(new BigDecimal(String(record.outstandingamt)).multiply(new BigDecimal(String(percentage))).divide(new BigDecimal('100')));
-	}else{
-	  record.doubtfulDebtAmount = '0.00';
-	}
+  var percentage = grid.view.parentWindow.views[0].getParentRecord().percentage;
+  if (state) {
+    record.doubtfulDebtAmount = String(new BigDecimal(String(record.outstandingamt)).multiply(new BigDecimal(String(percentage))).divide(new BigDecimal('100')));
+  } else {
+    record.doubtfulDebtAmount = '0.00';
+  }
   return true;
 };
\ No newline at end of file
--- a/src-db/database/model/tables/FIN_DOUBTFUL_DEBT.xml	Thu Jan 10 13:37:54 2013 +0100
+++ b/src-db/database/model/tables/FIN_DOUBTFUL_DEBT.xml	Thu Jan 10 17:47:11 2013 +0100
@@ -53,10 +53,6 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="ACCOUNTINGDATE" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
-        <default/>
-        <onCreateDefault/>
-      </column>
       <column name="AMOUNT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
         <default><![CDATA[0]]></default>
         <onCreateDefault/>
@@ -109,6 +105,17 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="DATEACCT" primaryKey="false" required="true" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="A_ASSET_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <foreign-key foreignTable="A_ASSET" name="FIN_DOUBTFUL_DEBT_ASSET">
+        <reference local="A_ASSET_ID" foreign="A_ASSET_ID"/>
+      </foreign-key>
       <foreign-key foreignTable="C_ACTIVITY" name="FIN_DOUBTFUL_DEBT_C_ACTIVITY">
         <reference local="C_ACTIVITY_ID" foreign="C_ACTIVITY_ID"/>
       </foreign-key>
--- a/src-db/database/model/tables/FIN_PAYMENT_SCHEDULEDETAIL.xml	Thu Jan 10 13:37:54 2013 +0100
+++ b/src-db/database/model/tables/FIN_PAYMENT_SCHEDULEDETAIL.xml	Thu Jan 10 17:47:11 2013 +0100
@@ -81,10 +81,6 @@
         <default/>
         <onCreateDefault/>
       </column>
-      <column name="DEBTAMOUNT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
-        <default><![CDATA[0]]></default>
-        <onCreateDefault/>
-      </column>
       <column name="C_COSTCENTER_ID" primaryKey="false" required="false" type="VARCHAR" size="32" autoIncrement="false">
         <default/>
         <onCreateDefault/>
@@ -97,6 +93,10 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="DOUBTFULDEBT_AMOUNT" primaryKey="false" required="true" type="DECIMAL" autoIncrement="false">
+        <default><![CDATA[0]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="FIN_AD_CLIENT_SCHEDULEDETAIL">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -148,7 +148,6 @@
       <index name="FIN_PYMT_SCHDET_DET_IDX" unique="false">
         <index-column name="FIN_PAYMENT_DETAIL_ID"/>
       </index>
-      <check name="FIN_PAY_SCHE_DETAIL_DEBT_AMT"><![CDATA[DEBTAMOUNT <= AMOUNT]]></check>
       <check name="FIN_PAY_SCHE_DETAIL_ISCANC_CHK"><![CDATA[ISCANCELED IN ('Y', 'N')]]></check>
     </table>
   </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Jan 10 13:37:54 2013 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Jan 10 17:47:11 2013 +0100
@@ -226687,6 +226687,43 @@
 <!--283EA4C588214FF9987F6BEE7F27C9CC-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--283EA4C588214FF9987F6BEE7F27C9CC--></AD_COLUMN>
 
+<!--28CC711032C44D3D81430BF7C6F0EB03--><AD_COLUMN>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_COLUMN_ID><![CDATA[28CC711032C44D3D81430BF7C6F0EB03]]></AD_COLUMN_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <NAME><![CDATA[Asset]]></NAME>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <DESCRIPTION><![CDATA[An item which is owned and exchangeable for cash.]]></DESCRIPTION>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <HELP><![CDATA[Any item of economic value owned by the corporation, especially that which could be converted to cash.]]></HELP>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <COLUMNNAME><![CDATA[A_Asset_ID]]></COLUMNNAME>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_TABLE_ID><![CDATA[30721072789F410E9606D2235CB2A226]]></AD_TABLE_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_REFERENCE_VALUE_ID><![CDATA[444F3B4F45544B9CA45E4035D49C1176]]></AD_REFERENCE_VALUE_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <READONLYLOGIC><![CDATA[@Posted@='Y']]></READONLYLOGIC>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <SEQNO><![CDATA[320]]></SEQNO>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_ELEMENT_ID><![CDATA[1884]]></AD_ELEMENT_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <POSITION><![CDATA[30]]></POSITION>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--28CC711032C44D3D81430BF7C6F0EB03-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--28CC711032C44D3D81430BF7C6F0EB03--></AD_COLUMN>
+
 <!--28F414D20A1D412CB0D9B1FD040CE670--><AD_COLUMN>
 <!--28F414D20A1D412CB0D9B1FD040CE670-->  <AD_COLUMN_ID><![CDATA[28F414D20A1D412CB0D9B1FD040CE670]]></AD_COLUMN_ID>
 <!--28F414D20A1D412CB0D9B1FD040CE670-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -227543,7 +227580,7 @@
 <!--2D56F14A0C524D8F95282389F1A45878-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--2D56F14A0C524D8F95282389F1A45878-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--2D56F14A0C524D8F95282389F1A45878-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
-<!--2D56F14A0C524D8F95282389F1A45878-->  <SQLLOGIC><![CDATA[(SELECT coalesce(sum(psd.debtamount), 0) FROM fin_payment_scheduledetail psd WHERE psd.fin_payment_schedule_invoice = fin_payment_schedule_id and psd.fin_payment_detail_id is null and psd.iscanceled='N')]]></SQLLOGIC>
+<!--2D56F14A0C524D8F95282389F1A45878-->  <SQLLOGIC><![CDATA[(SELECT coalesce(sum(psd.doubtfuldebt_amount), 0) FROM fin_payment_scheduledetail psd WHERE psd.fin_payment_schedule_invoice = fin_payment_schedule_id and psd.fin_payment_detail_id is null and psd.iscanceled='N')]]></SQLLOGIC>
 <!--2D56F14A0C524D8F95282389F1A45878--></AD_COLUMN>
 
 <!--2D699F3974F64AFD8A48DC90748F4DBE--><AD_COLUMN>
@@ -232197,7 +232234,8 @@
 <!--498B93AAE2D44F72AD3819F840298465-->  <HELP><![CDATA[The user defined element displays the optional elements that have been defined for this account combination.]]></HELP>
 <!--498B93AAE2D44F72AD3819F840298465-->  <COLUMNNAME><![CDATA[User2_ID]]></COLUMNNAME>
 <!--498B93AAE2D44F72AD3819F840298465-->  <AD_TABLE_ID><![CDATA[30721072789F410E9606D2235CB2A226]]></AD_TABLE_ID>
-<!--498B93AAE2D44F72AD3819F840298465-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--498B93AAE2D44F72AD3819F840298465-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--498B93AAE2D44F72AD3819F840298465-->  <AD_REFERENCE_VALUE_ID><![CDATA[1850A5390D97470EBB35A3A5F43AB533]]></AD_REFERENCE_VALUE_ID>
 <!--498B93AAE2D44F72AD3819F840298465-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--498B93AAE2D44F72AD3819F840298465-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--498B93AAE2D44F72AD3819F840298465-->  <ISPARENT><![CDATA[N]]></ISPARENT>
@@ -288354,10 +288392,10 @@
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <NAME><![CDATA[DebtAmount]]></NAME>
+<!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <NAME><![CDATA[DoubtfulDebt_Amount]]></NAME>
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <DESCRIPTION><![CDATA[Doubtful Debt Amount]]></DESCRIPTION>
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <HELP><![CDATA[Doubtful Debt Amount]]></HELP>
-<!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <COLUMNNAME><![CDATA[DebtAmount]]></COLUMNNAME>
+<!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <COLUMNNAME><![CDATA[DoubtfulDebt_Amount]]></COLUMNNAME>
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <AD_TABLE_ID><![CDATA[C0233061EA504EFEAB0483E836BBAF31]]></AD_TABLE_ID>
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <AD_REFERENCE_ID><![CDATA[12]]></AD_REFERENCE_ID>
 <!--A5CF4D3408B744808F87A1E1A8F4C2E0-->  <FIELDLENGTH><![CDATA[2]]></FIELDLENGTH>
@@ -295005,8 +295043,8 @@
 <!--B41629F9ED3F442D9610925CFB36FAC2-->  <HELP><![CDATA[Identifier of a project defined within the Project & Service Management module.]]></HELP>
 <!--B41629F9ED3F442D9610925CFB36FAC2-->  <COLUMNNAME><![CDATA[C_Project_ID]]></COLUMNNAME>
 <!--B41629F9ED3F442D9610925CFB36FAC2-->  <AD_TABLE_ID><![CDATA[30721072789F410E9606D2235CB2A226]]></AD_TABLE_ID>
-<!--B41629F9ED3F442D9610925CFB36FAC2-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
-<!--B41629F9ED3F442D9610925CFB36FAC2-->  <AD_REFERENCE_VALUE_ID><![CDATA[141]]></AD_REFERENCE_VALUE_ID>
+<!--B41629F9ED3F442D9610925CFB36FAC2-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--B41629F9ED3F442D9610925CFB36FAC2-->  <AD_REFERENCE_VALUE_ID><![CDATA[FF808181312D569C01312D8FA681005A]]></AD_REFERENCE_VALUE_ID>
 <!--B41629F9ED3F442D9610925CFB36FAC2-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--B41629F9ED3F442D9610925CFB36FAC2-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--B41629F9ED3F442D9610925CFB36FAC2-->  <ISPARENT><![CDATA[N]]></ISPARENT>
@@ -297524,10 +297562,10 @@
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <NAME><![CDATA[AccountingDate]]></NAME>
+<!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <NAME><![CDATA[Accounting Date]]></NAME>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <DESCRIPTION><![CDATA[The date this transaction is recorded for in the general ledger.]]></DESCRIPTION>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <HELP><![CDATA[The date this transaction is recorded on in the general ledger. This date also indicates which accounting period within the fiscal year this transaction will be part of.]]></HELP>
-<!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <COLUMNNAME><![CDATA[AccountingDate]]></COLUMNNAME>
+<!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <COLUMNNAME><![CDATA[DateAcct]]></COLUMNNAME>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <AD_TABLE_ID><![CDATA[30721072789F410E9606D2235CB2A226]]></AD_TABLE_ID>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <FIELDLENGTH><![CDATA[20]]></FIELDLENGTH>
@@ -297547,7 +297585,7 @@
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <POSITION><![CDATA[14]]></POSITION>
+<!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <POSITION><![CDATA[29]]></POSITION>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--BA4CE0755A044CF9A0651F4CD3814ACC-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -299728,7 +299766,8 @@
 <!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <HELP><![CDATA[Division that adds to the cost of an organization. Internal structure for cost allocation.]]></HELP>
 <!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <COLUMNNAME><![CDATA[C_Costcenter_ID]]></COLUMNNAME>
 <!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <AD_TABLE_ID><![CDATA[30721072789F410E9606D2235CB2A226]]></AD_TABLE_ID>
-<!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <AD_REFERENCE_VALUE_ID><![CDATA[DEE6B917B36D4648B2DA729FC2872CF4]]></AD_REFERENCE_VALUE_ID>
 <!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--C1EFF0F3A7284E06BFAD3A39CDB83B4B-->  <ISPARENT><![CDATA[N]]></ISPARENT>
@@ -300182,7 +300221,8 @@
 <!--C4978F8633004EDC9A0B989B28C03DF7-->  <HELP><![CDATA[The user defined element displays the optional elements that have been defined for this account combination.]]></HELP>
 <!--C4978F8633004EDC9A0B989B28C03DF7-->  <COLUMNNAME><![CDATA[User1_ID]]></COLUMNNAME>
 <!--C4978F8633004EDC9A0B989B28C03DF7-->  <AD_TABLE_ID><![CDATA[30721072789F410E9606D2235CB2A226]]></AD_TABLE_ID>
-<!--C4978F8633004EDC9A0B989B28C03DF7-->  <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--C4978F8633004EDC9A0B989B28C03DF7-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--C4978F8633004EDC9A0B989B28C03DF7-->  <AD_REFERENCE_VALUE_ID><![CDATA[0E0D1661E18E4E05A118785A7CF146B8]]></AD_REFERENCE_VALUE_ID>
 <!--C4978F8633004EDC9A0B989B28C03DF7-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
 <!--C4978F8633004EDC9A0B989B28C03DF7-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--C4978F8633004EDC9A0B989B28C03DF7-->  <ISPARENT><![CDATA[N]]></ISPARENT>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Jan 10 13:37:54 2013 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Jan 10 17:47:11 2013 +0100
@@ -21579,18 +21579,6 @@
 <!--3DD52B00A13211DDBEFDAF8E46C6A762-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--3DD52B00A13211DDBEFDAF8E46C6A762--></AD_ELEMENT>
 
-<!--3DE30023894A489F9E09453DF8900B95--><AD_ELEMENT>
-<!--3DE30023894A489F9E09453DF8900B95-->  <AD_ELEMENT_ID><![CDATA[3DE30023894A489F9E09453DF8900B95]]></AD_ELEMENT_ID>
-<!--3DE30023894A489F9E09453DF8900B95-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
-<!--3DE30023894A489F9E09453DF8900B95-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--3DE30023894A489F9E09453DF8900B95-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--3DE30023894A489F9E09453DF8900B95-->  <COLUMNNAME><![CDATA[AccountingDate]]></COLUMNNAME>
-<!--3DE30023894A489F9E09453DF8900B95-->  <NAME><![CDATA[AccountingDate]]></NAME>
-<!--3DE30023894A489F9E09453DF8900B95-->  <PRINTNAME><![CDATA[AccountingDate]]></PRINTNAME>
-<!--3DE30023894A489F9E09453DF8900B95-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--3DE30023894A489F9E09453DF8900B95-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
-<!--3DE30023894A489F9E09453DF8900B95--></AD_ELEMENT>
-
 <!--3E4E749288AE40A2B1692E9B0A2E5DC1--><AD_ELEMENT>
 <!--3E4E749288AE40A2B1692E9B0A2E5DC1-->  <AD_ELEMENT_ID><![CDATA[3E4E749288AE40A2B1692E9B0A2E5DC1]]></AD_ELEMENT_ID>
 <!--3E4E749288AE40A2B1692E9B0A2E5DC1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -28481,7 +28469,7 @@
 <!--A7DFF3B22D044845B4D6BDCD987E7948-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--A7DFF3B22D044845B4D6BDCD987E7948-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A7DFF3B22D044845B4D6BDCD987E7948-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--A7DFF3B22D044845B4D6BDCD987E7948-->  <COLUMNNAME><![CDATA[DebtAmount]]></COLUMNNAME>
+<!--A7DFF3B22D044845B4D6BDCD987E7948-->  <COLUMNNAME><![CDATA[DoubtfulDebt_Amount]]></COLUMNNAME>
 <!--A7DFF3B22D044845B4D6BDCD987E7948-->  <NAME><![CDATA[Doubtful Debt Amount]]></NAME>
 <!--A7DFF3B22D044845B4D6BDCD987E7948-->  <PRINTNAME><![CDATA[Doubtful Debt Amount]]></PRINTNAME>
 <!--A7DFF3B22D044845B4D6BDCD987E7948-->  <DESCRIPTION><![CDATA[Doubtful Debt Amount]]></DESCRIPTION>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Jan 10 13:37:54 2013 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Jan 10 17:47:11 2013 +0100
@@ -247200,6 +247200,36 @@
 <!--C81180C829FD44D48C9D04D09DA96A39-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--C81180C829FD44D48C9D04D09DA96A39--></AD_FIELD>
 
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D--><AD_FIELD>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <AD_FIELD_ID><![CDATA[C84E2B96A9A247D1BCADA9A1BAB4545D]]></AD_FIELD_ID>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <NAME><![CDATA[Asset]]></NAME>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <DESCRIPTION><![CDATA[An item which is owned and exchangeable for cash.]]></DESCRIPTION>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <HELP><![CDATA[Any item of economic value owned by the corporation, especially that which could be converted to cash.]]></HELP>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <AD_TAB_ID><![CDATA[9D859A2A50F44562AFA21AAF2DF91B8A]]></AD_TAB_ID>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <AD_COLUMN_ID><![CDATA[28CC711032C44D3D81430BF7C6F0EB03]]></AD_COLUMN_ID>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <AD_FIELDGROUP_ID><![CDATA[800000]]></AD_FIELDGROUP_ID>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <DISPLAYLOGIC><![CDATA[@ACCT_DIMENSION_DISPLAY@]]></DISPLAYLOGIC>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <SEQNO><![CDATA[2090]]></SEQNO>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C84E2B96A9A247D1BCADA9A1BAB4545D--></AD_FIELD>
+
 <!--C85A38D3DA84411189BA447A9049C778--><AD_FIELD>
 <!--C85A38D3DA84411189BA447A9049C778-->  <AD_FIELD_ID><![CDATA[C85A38D3DA84411189BA447A9049C778]]></AD_FIELD_ID>
 <!--C85A38D3DA84411189BA447A9049C778-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java	Thu Jan 10 13:37:54 2013 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocDoubtfulDebt.java	Thu Jan 10 17:47:11 2013 +0100
@@ -82,6 +82,8 @@
         .getNdDimension().getId() : "");
     FieldProviderFactory.setField(data[0], "cCostcenterId", dd.getCostCenter() != null ? dd
         .getCostCenter().getId() : "");
+    FieldProviderFactory.setField(data[0], "aAssetId", dd.getAsset() != null ? dd.getAsset()
+        .getId() : "");
 
     setObjectFieldProvider(data);