details:   https://code.openbravo.com/erp/devel/pi/rev/bee471407691
changeset: 25028:bee471407691
user:      Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com>
date:      Mon Sep 29 12:06:31 2014 -0500
summary:   Fixed bug 27553: Wrong error message shown when reactivating a 
payment.

Payment process was modified to manage the option of reactivating a payment 
whose payment method does not belong to the financial account.
Now a personalized error message is shown.
Transaction process in Transaction tab of the Finantial Account window also was 
modified for the same cause.

details:   https://code.openbravo.com/erp/devel/pi/rev/3d7c11cf422d
changeset: 25029:3d7c11cf422d
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Thu Oct 09 12:42:53 2014 +0200
summary:   Fixed bug 27553: Code review improvements

Message provides more context info, which is specially important when 
reactivating the transaction.

In the case of reactivating a transaction, this validation has been moved close 
to other validations executed before reactivating the transaction.

diffstat:

 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml 
                           |  12 ++++++++
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
     |   9 ++++++
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
 |  15 +++++++++-
 3 files changed, 35 insertions(+), 1 deletions(-)

diffs (80 lines):

diff -r 9e21670a1191 -r 3d7c11cf422d 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
    Thu Sep 04 09:03:27 2014 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
    Thu Oct 09 12:42:53 2014 +0200
@@ -300,6 +300,18 @@
 <!--355244CE61E647E7822FF281159181E4-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--355244CE61E647E7822FF281159181E4--></AD_MESSAGE>
 
+<!--38E9BE48051D46E78609ABC942D0BFA6--><AD_MESSAGE>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  
<AD_MESSAGE_ID><![CDATA[38E9BE48051D46E78609ABC942D0BFA6]]></AD_MESSAGE_ID>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  
<VALUE><![CDATA[APRM_NoPaymentMethod]]></VALUE>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  <MSGTEXT><![CDATA[The Payment Method 
"%s" associated to the Payment no. "%s" is no longer defined in the Financial 
Account "%s"]]></MSGTEXT>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  
<AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--38E9BE48051D46E78609ABC942D0BFA6-->  
<ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--38E9BE48051D46E78609ABC942D0BFA6--></AD_MESSAGE>
+
 <!--406CD43121E34BF2A6AA2EBDB9DC8CF5--><AD_MESSAGE>
 <!--406CD43121E34BF2A6AA2EBDB9DC8CF5-->  
<AD_MESSAGE_ID><![CDATA[406CD43121E34BF2A6AA2EBDB9DC8CF5]]></AD_MESSAGE_ID>
 <!--406CD43121E34BF2A6AA2EBDB9DC8CF5-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 9e21670a1191 -r 3d7c11cf422d 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
     Thu Sep 04 09:03:27 2014 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
     Thu Oct 09 12:42:53 2014 +0200
@@ -738,6 +738,15 @@
           return;
         }
 
+        if (FIN_Utility.invoicePaymentStatus(payment) == null) {
+          msg.setType("Error");
+          msg.setTitle(Utility.messageBD(conProvider, "Error", language));
+          
msg.setMessage(String.format(OBMessageUtils.messageBD("APRM_NoPaymentMethod"), 
payment
+              .getPaymentMethod().getIdentifier(), payment.getDocumentNo(), 
payment.getAccount()
+              .getName()));
+          bundle.setResult(msg);
+          return;
+        }
         // Do not restore paid amounts if the payment is awaiting execution.
         boolean restorePaidAmounts = 
(FIN_Utility.seqnumberpaymentstatus(payment.getStatus())) == (FIN_Utility
             
.seqnumberpaymentstatus(FIN_Utility.invoicePaymentStatus(payment)));
diff -r 9e21670a1191 -r 3d7c11cf422d 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
 Thu Sep 04 09:03:27 2014 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
 Thu Oct 09 12:42:53 2014 +0200
@@ -33,6 +33,7 @@
 import org.openbravo.erpCommon.ad_forms.AcctServer;
 import org.openbravo.erpCommon.utility.OBDateUtils;
 import org.openbravo.erpCommon.utility.OBError;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.common.currency.ConversionRateDoc;
 import 
org.openbravo.model.financialmgmt.accounting.FIN_FinancialAccountAccounting;
@@ -163,6 +164,19 @@
             bundle.setResult(msg);
             return;
           }
+
+          // Payment Method associated to payment not longer in financial 
account
+          final FIN_Payment payment = transaction.getFinPayment();
+          if (payment != null && FIN_Utility.invoicePaymentStatus(payment) == 
null) {
+            msg.setType("Error");
+            msg.setTitle(Utility.messageBD(conProvider, "Error", language));
+            
msg.setMessage(String.format(OBMessageUtils.messageBD("APRM_NoPaymentMethod"), 
payment
+                .getPaymentMethod().getIdentifier(), payment.getDocumentNo(), 
payment.getAccount()
+                .getName()));
+            bundle.setResult(msg);
+            return;
+          }
+
           // Remove conversion rate at document level for the given transaction
           OBContext.setAdminMode();
           try {
@@ -184,7 +198,6 @@
           OBDal.getInstance().save(financialAccount);
           OBDal.getInstance().save(transaction);
           OBDal.getInstance().flush();
-          FIN_Payment payment = transaction.getFinPayment();
           if (payment != null) {
             Boolean invoicePaidold = false;
             for (FIN_PaymentDetail pd : payment.getFINPaymentDetailList()) {

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to