[Doubtful Debt] Adding action parameters and messages
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Mon, 14 Jan 2013 12:55:25 +0100
changeset 19568 27ae7d0d932e
parent 19567 b361d0040ff3
child 19569 a2580c51ed45
[Doubtful Debt] Adding action parameters and messages
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtRunProcess.java
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Fri Jan 11 12:06:58 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Mon Jan 14 12:55:25 2013 +0100
@@ -66,6 +66,17 @@
 <!--14EBC11B38634D229D542AAFCEAF4186-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--14EBC11B38634D229D542AAFCEAF4186--></AD_MESSAGE>
 
+<!--167679F2C257479E9129C3C51B8F426D--><AD_MESSAGE>
+<!--167679F2C257479E9129C3C51B8F426D-->  <AD_MESSAGE_ID><![CDATA[167679F2C257479E9129C3C51B8F426D]]></AD_MESSAGE_ID>
+<!--167679F2C257479E9129C3C51B8F426D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--167679F2C257479E9129C3C51B8F426D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--167679F2C257479E9129C3C51B8F426D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--167679F2C257479E9129C3C51B8F426D-->  <VALUE><![CDATA[APRM_NoLines]]></VALUE>
+<!--167679F2C257479E9129C3C51B8F426D-->  <MSGTEXT><![CDATA[There is no doubtful debt to be processed.]]></MSGTEXT>
+<!--167679F2C257479E9129C3C51B8F426D-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--167679F2C257479E9129C3C51B8F426D-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--167679F2C257479E9129C3C51B8F426D--></AD_MESSAGE>
+
 <!--19D77522B7A4470FBA505D39A6AA051C--><AD_MESSAGE>
 <!--19D77522B7A4470FBA505D39A6AA051C-->  <AD_MESSAGE_ID><![CDATA[19D77522B7A4470FBA505D39A6AA051C]]></AD_MESSAGE_ID>
 <!--19D77522B7A4470FBA505D39A6AA051C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -793,6 +804,17 @@
 <!--BC2354325C5D47CEA63A298E73F1CEDB-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--BC2354325C5D47CEA63A298E73F1CEDB--></AD_MESSAGE>
 
+<!--BE7AE60244C34C8AB03616F5A70B45D2--><AD_MESSAGE>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <AD_MESSAGE_ID><![CDATA[BE7AE60244C34C8AB03616F5A70B45D2]]></AD_MESSAGE_ID>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <VALUE><![CDATA[APRM_DoubtfulDebtPaymentExists]]></VALUE>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <MSGTEXT><![CDATA[Doubtful Debt @documentNo@ could not be processed. Payment already exists.]]></MSGTEXT>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--BE7AE60244C34C8AB03616F5A70B45D2-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--BE7AE60244C34C8AB03616F5A70B45D2--></AD_MESSAGE>
+
 <!--C36865A47B99485980CC8B56AAF59057--><AD_MESSAGE>
 <!--C36865A47B99485980CC8B56AAF59057-->  <AD_MESSAGE_ID><![CDATA[C36865A47B99485980CC8B56AAF59057]]></AD_MESSAGE_ID>
 <!--C36865A47B99485980CC8B56AAF59057-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Fri Jan 11 12:06:58 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Mon Jan 14 12:55:25 2013 +0100
@@ -17,6 +17,7 @@
 <!--017312F51139438A9665775E3B5392A1-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--017312F51139438A9665775E3B5392A1-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
 <!--017312F51139438A9665775E3B5392A1-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--017312F51139438A9665775E3B5392A1-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--017312F51139438A9665775E3B5392A1--></AD_PROCESS>
 
 <!--0BDC2164ED3E48539FCEF4D306F29EFD--><AD_PROCESS>
@@ -36,6 +37,7 @@
 <!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <UIPATTERN><![CDATA[S]]></UIPATTERN>
 <!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--0BDC2164ED3E48539FCEF4D306F29EFD--></AD_PROCESS>
 
 <!--12016E2EDE0245B5A36B84CBA144DBDF--><AD_PROCESS>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Fri Jan 11 12:06:58 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Mon Jan 14 12:55:25 2013 +0100
@@ -21,6 +21,27 @@
 <!--1913962D2952412B84B8CDD3BC17026F-->  <AD_ELEMENT_ID><![CDATA[454]]></AD_ELEMENT_ID>
 <!--1913962D2952412B84B8CDD3BC17026F--></AD_PROCESS_PARA>
 
+<!--29603F2454644A24997830BB4F30C6C1--><AD_PROCESS_PARA>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_PROCESS_PARA_ID><![CDATA[29603F2454644A24997830BB4F30C6C1]]></AD_PROCESS_PARA_ID>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--29603F2454644A24997830BB4F30C6C1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--29603F2454644A24997830BB4F30C6C1-->  <NAME><![CDATA[Action]]></NAME>
+<!--29603F2454644A24997830BB4F30C6C1-->  <DESCRIPTION><![CDATA[A drop down list box indicating the next step to take.]]></DESCRIPTION>
+<!--29603F2454644A24997830BB4F30C6C1-->  <HELP><![CDATA[The Action field indicates the Action to be performed for this element.]]></HELP>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_PROCESS_ID><![CDATA[0BDC2164ED3E48539FCEF4D306F29EFD]]></AD_PROCESS_ID>
+<!--29603F2454644A24997830BB4F30C6C1-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_REFERENCE_VALUE_ID><![CDATA[798239EB069F41A9BA8EE040C63DDBBC]]></AD_REFERENCE_VALUE_ID>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_VAL_RULE_ID><![CDATA[3842B167CA6F44239C3357A721E3BA6A]]></AD_VAL_RULE_ID>
+<!--29603F2454644A24997830BB4F30C6C1-->  <COLUMNNAME><![CDATA[action]]></COLUMNNAME>
+<!--29603F2454644A24997830BB4F30C6C1-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--29603F2454644A24997830BB4F30C6C1-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--29603F2454644A24997830BB4F30C6C1-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--29603F2454644A24997830BB4F30C6C1-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--29603F2454644A24997830BB4F30C6C1-->  <AD_ELEMENT_ID><![CDATA[152]]></AD_ELEMENT_ID>
+<!--29603F2454644A24997830BB4F30C6C1--></AD_PROCESS_PARA>
+
 <!--4F5EE1017087464EAD95F3CCA4C5AFA5--><AD_PROCESS_PARA>
 <!--4F5EE1017087464EAD95F3CCA4C5AFA5-->  <AD_PROCESS_PARA_ID><![CDATA[4F5EE1017087464EAD95F3CCA4C5AFA5]]></AD_PROCESS_PARA_ID>
 <!--4F5EE1017087464EAD95F3CCA4C5AFA5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -85,6 +106,27 @@
 <!--800BEB6BDA99409194CADF23988D7B6D-->  <AD_ELEMENT_ID><![CDATA[152]]></AD_ELEMENT_ID>
 <!--800BEB6BDA99409194CADF23988D7B6D--></AD_PROCESS_PARA>
 
+<!--8010E338EDC3449F9D91F1C00AE32968--><AD_PROCESS_PARA>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_PROCESS_PARA_ID><![CDATA[8010E338EDC3449F9D91F1C00AE32968]]></AD_PROCESS_PARA_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <NAME><![CDATA[Action]]></NAME>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <DESCRIPTION><![CDATA[A drop down list box indicating the next step to take.]]></DESCRIPTION>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <HELP><![CDATA[The Action field indicates the Action to be performed for this element.]]></HELP>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_PROCESS_ID><![CDATA[017312F51139438A9665775E3B5392A1]]></AD_PROCESS_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_REFERENCE_ID><![CDATA[17]]></AD_REFERENCE_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_REFERENCE_VALUE_ID><![CDATA[798239EB069F41A9BA8EE040C63DDBBC]]></AD_REFERENCE_VALUE_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_VAL_RULE_ID><![CDATA[3842B167CA6F44239C3357A721E3BA6A]]></AD_VAL_RULE_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <COLUMNNAME><![CDATA[action]]></COLUMNNAME>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--8010E338EDC3449F9D91F1C00AE32968-->  <AD_ELEMENT_ID><![CDATA[152]]></AD_ELEMENT_ID>
+<!--8010E338EDC3449F9D91F1C00AE32968--></AD_PROCESS_PARA>
+
 <!--8A8E1C0D38F144D797698E48F464F97B--><AD_PROCESS_PARA>
 <!--8A8E1C0D38F144D797698E48F464F97B-->  <AD_PROCESS_PARA_ID><![CDATA[8A8E1C0D38F144D797698E48F464F97B]]></AD_PROCESS_PARA_ID>
 <!--8A8E1C0D38F144D797698E48F464F97B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java	Fri Jan 11 12:06:58 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtProcess.java	Mon Jan 14 12:55:25 2013 +0100
@@ -19,6 +19,8 @@
 package org.openbravo.advpaymentmngt.process;
 
 import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.Map;
 
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
@@ -27,6 +29,7 @@
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.financialmgmt.payment.DoubtfulDebt;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule;
@@ -65,8 +68,10 @@
             .compareTo(doubtfulDebt.getAmount()) < 0) {
           msg.setType("Error");
           msg.setTitle(Utility.messageBD(conProvider, "Error", language));
-          msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
-              "@APRM_PaymentExists@"));
+          Map<String, String> parameters = new HashMap<String, String>();
+          parameters.put("documentNo", doubtfulDebt.getDocumentNo());
+          msg.setMessage(Utility.parseTranslation(conProvider, vars, parameters, language,
+              OBMessageUtils.messageBD("APRM_DoubtfulDebtPaymentExists")));
           bundle.setResult(msg);
           return;
         }
@@ -93,8 +98,10 @@
             .compareTo(doubtfulDebt.getAmount()) < 0) {
           msg.setType("Error");
           msg.setTitle(Utility.messageBD(conProvider, "Error", language));
-          msg.setMessage(Utility.parseTranslation(conProvider, vars, language,
-              "@APRM_PaymentExists@"));
+          Map<String, String> parameters = new HashMap<String, String>();
+          parameters.put("documentNo", doubtfulDebt.getDocumentNo());
+          msg.setMessage(Utility.parseTranslation(conProvider, vars, parameters, language,
+              OBMessageUtils.messageBD("APRM_DoubtfulDebtPaymentExists")));
           bundle.setResult(msg);
           return;
         }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtRunProcess.java	Fri Jan 11 12:06:58 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_DoubtfulDebtRunProcess.java	Mon Jan 14 12:55:25 2013 +0100
@@ -70,7 +70,7 @@
         for (DoubtfulDebt ddb : doubtfulDebtRun.getFINDoubtfulDebtList()) {
           if (!ddb.isProcessed()) {
             OBError result = processDoubtfulDebt(vars, conProvider, ddb, strAction);
-            if ("error".equals(result.getType())) {
+            if ("Error".equals(result.getType())) {
               bundle.setResult(result);
               return;
             }