details:   https://code.openbravo.com/erp/devel/pi/rev/06932c2df6ca
changeset: 18006:06932c2df6ca
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Tue Sep 25 08:26:44 2012 +0200
summary:   Fixed bug 21665: Bank Account Format redesign
The Financial Account window and Business Partner | Bank tab have the same 
structure
Show * checkboxes hidden and deprecated. We use a list instead that can be 
easily extended
by modularity.
Added retrocompatibility for modules that use the checkboxes logic
Included oncreatedefault clauses to ensure old clients are properly migrated
Extracted IBAN validator to a db function
Included IBAN validation in Financial Account

details:   https://code.openbravo.com/erp/devel/pi/rev/f80e308e3177
changeset: 18007:f80e308e3177
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Mon Sep 24 13:48:56 2012 +0200
summary:   Related to bug 21665: Exported sampledata before including the new 
changes

details:   https://code.openbravo.com/erp/devel/pi/rev/e4335bcdfc62
changeset: 18008:e4335bcdfc62
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Mon Sep 24 14:03:19 2012 +0200
summary:   Fixed issue 21665: Sampledata includes new changes related to banks

details:   https://code.openbravo.com/erp/devel/pi/rev/84a0b15c82c5
changeset: 18009:84a0b15c82c5
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Tue Sep 25 08:29:41 2012 +0200
summary:   Fixed bug 21665: fixed dbcons due to manual merge

diffstat:

 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml   
                                            |    12 +-
 
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/BusinessPartnerBankAccountHandler.java
 |    87 +
 modules/org.openbravo.v3/src-db/database/configScript.xml                      
                                            |     4 -
 referencedata/sampledata/F_B_International_Group.xml                           
                                            |  2072 +++++----
 referencedata/sampledata/QA_Testing.xml                                        
                                            |   184 +-
 src-db/database/model/functions/C_GET_IBAN_DISPLAYED_ACCOUNT.xml               
                                            |    82 +
 src-db/database/model/tables/C_BP_BANKACCOUNT.xml                              
                                            |    12 +-
 src-db/database/model/tables/FIN_FINANCIAL_ACCOUNT.xml                         
                                            |    21 +-
 src-db/database/model/triggers/C_BP_BANKACCOUNTIBAN_TRG.xml                    
                                            |    83 +-
 src-db/database/model/triggers/FIN_FINANCIAL_ACCOUNT_TRG2.xml                  
                                            |    34 +-
 src-db/database/sourcedata/AD_COLUMN.xml                                       
                                            |   204 +-
 src-db/database/sourcedata/AD_ELEMENT.xml                                      
                                            |    54 +-
 src-db/database/sourcedata/AD_FIELD.xml                                        
                                            |   278 +-
 src-db/database/sourcedata/AD_FIELDGROUP.xml                                   
                                            |     9 +
 src-db/database/sourcedata/AD_MESSAGE.xml                                      
                                            |   112 +-
 src-db/database/sourcedata/AD_REFERENCE.xml                                    
                                            |    12 +
 src-db/database/sourcedata/AD_REF_LIST.xml                                     
                                            |    48 +
 src-db/database/sourcedata/AD_VAL_RULE.xml                                     
                                            |    22 +
 18 files changed, 2161 insertions(+), 1169 deletions(-)

diffs (truncated from 8666 to 300 lines):

diff -r 6e892b588e49 -r 84a0b15c82c5 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml  
    Mon Sep 24 19:26:43 2012 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml  
    Tue Sep 25 08:29:41 2012 +0200
@@ -7820,9 +7820,9 @@
 <!--8420366B8591339CE040007F010023A9-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--8420366B8591339CE040007F010023A9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8420366B8591339CE040007F010023A9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--8420366B8591339CE040007F010023A9-->  <NAME><![CDATA[Account No.]]></NAME>
-<!--8420366B8591339CE040007F010023A9-->  <DESCRIPTION><![CDATA[Account 
Number]]></DESCRIPTION>
-<!--8420366B8591339CE040007F010023A9-->  <HELP><![CDATA[The Account Number 
indicates the Number assigned to this account]]></HELP>
+<!--8420366B8591339CE040007F010023A9-->  <NAME><![CDATA[Displayed 
Account]]></NAME>
+<!--8420366B8591339CE040007F010023A9-->  <DESCRIPTION><![CDATA[Text that will 
identify this bank account]]></DESCRIPTION>
+<!--8420366B8591339CE040007F010023A9-->  <HELP><![CDATA[Text that will 
identify this bank account]]></HELP>
 <!--8420366B8591339CE040007F010023A9-->  
<ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--8420366B8591339CE040007F010023A9-->  
<AD_TAB_ID><![CDATA[5B9941AC1F6A4529A76FCA7CDA0A7D7A]]></AD_TAB_ID>
 <!--8420366B8591339CE040007F010023A9-->  
<AD_COLUMN_ID><![CDATA[828EE0AE80515FA1E040007F010067C7]]></AD_COLUMN_ID>
@@ -8341,9 +8341,9 @@
 <!--8420366B85A3339CE040007F010023A9-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--8420366B85A3339CE040007F010023A9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8420366B85A3339CE040007F010023A9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--8420366B85A3339CE040007F010023A9-->  <NAME><![CDATA[Swift code]]></NAME>
-<!--8420366B85A3339CE040007F010023A9-->  <DESCRIPTION><![CDATA[Swift Code 
(Society of Worldwide Interbank Financial Telecommunications)]]></DESCRIPTION>
-<!--8420366B85A3339CE040007F010023A9-->  <HELP><![CDATA[The SWIFT code is an 
identifier of a Bank]]></HELP>
+<!--8420366B85A3339CE040007F010023A9-->  <NAME><![CDATA[SWIFT Code]]></NAME>
+<!--8420366B85A3339CE040007F010023A9-->  <DESCRIPTION><![CDATA[SWIFT Code 
(Society of Worldwide Interbank Financial Telecommunications)]]></DESCRIPTION>
+<!--8420366B85A3339CE040007F010023A9-->  <HELP><![CDATA[The SWIFT Code is an 
identifier of a Bank]]></HELP>
 <!--8420366B85A3339CE040007F010023A9-->  
<ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--8420366B85A3339CE040007F010023A9-->  
<AD_TAB_ID><![CDATA[5B9941AC1F6A4529A76FCA7CDA0A7D7A]]></AD_TAB_ID>
 <!--8420366B85A3339CE040007F010023A9-->  
<AD_COLUMN_ID><![CDATA[828EE0AE804A5FA1E040007F010067C7]]></AD_COLUMN_ID>
diff -r 6e892b588e49 -r 84a0b15c82c5 
modules/org.openbravo.client.application/src/org/openbravo/client/application/event/BusinessPartnerBankAccountHandler.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/BusinessPartnerBankAccountHandler.java
        Tue Sep 25 08:29:41 2012 +0200
@@ -0,0 +1,87 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2012 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+
+package org.openbravo.client.application.event;
+
+import javax.enterprise.event.Observes;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.log4j.Logger;
+import org.openbravo.base.model.Entity;
+import org.openbravo.base.model.ModelProvider;
+import org.openbravo.base.model.Property;
+import org.openbravo.client.kernel.event.EntityNewEvent;
+import org.openbravo.client.kernel.event.EntityPersistenceEventObserver;
+import org.openbravo.client.kernel.event.EntityUpdateEvent;
+import org.openbravo.model.common.businesspartner.BankAccount;
+
+/**
+ * Adds retrocompatibity to code that uses the Show IBAN/Generic columns 
instead of the new Bank
+ * Account Format list
+ * 
+ * @author openbravo
+ * 
+ */
+public class BusinessPartnerBankAccountHandler extends 
EntityPersistenceEventObserver {
+
+  private static Entity[] entities = { ModelProvider.getInstance().getEntity(
+      BankAccount.ENTITY_NAME) };
+  protected Logger logger = Logger.getLogger(this.getClass());
+
+  @Override
+  protected Entity[] getObservedEntities() {
+    return entities;
+  }
+
+  public void onUpdate(@Observes EntityUpdateEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+
+    final BankAccount bankAccount = (BankAccount) event.getTargetInstance();
+    if (bankAccount != null && 
StringUtils.isBlank(bankAccount.getBankFormat())) {
+      final Boolean showIBAN = bankAccount.isShowIBAN();
+      final Entity bankAccountEntity = ModelProvider.getInstance().getEntity(
+          BankAccount.ENTITY_NAME);
+      final Property bankFormatProperty = bankAccountEntity
+          .getProperty(BankAccount.PROPERTY_BANKFORMAT);
+      event.setCurrentState(bankFormatProperty, showIBAN ? "IBAN" : "GENERIC");
+      logger
+          .info("Automatically populated the Bank Account Format based on the 
Show Generic | Show IBAN info");
+    }
+  }
+
+  public void onSave(@Observes EntityNewEvent event) {
+    if (!isValidEvent(event)) {
+      return;
+    }
+
+    final BankAccount bankAccount = (BankAccount) event.getTargetInstance();
+    if (bankAccount != null && 
StringUtils.isBlank(bankAccount.getBankFormat())) {
+      final Boolean showIBAN = bankAccount.isShowIBAN();
+      final Entity bankAccountEntity = ModelProvider.getInstance().getEntity(
+          BankAccount.ENTITY_NAME);
+      final Property bankFormatProperty = bankAccountEntity
+          .getProperty(BankAccount.PROPERTY_BANKFORMAT);
+      event.setCurrentState(bankFormatProperty, showIBAN ? "IBAN" : "GENERIC");
+      logger
+          .info("Automatically populated the Bank Account Format based on the 
Show Generic | Show IBAN info");
+    }
+  }
+}
diff -r 6e892b588e49 -r 84a0b15c82c5 
modules/org.openbravo.v3/src-db/database/configScript.xml
--- a/modules/org.openbravo.v3/src-db/database/configScript.xml Mon Sep 24 
19:26:43 2012 +0200
+++ b/modules/org.openbravo.v3/src-db/database/configScript.xml Tue Sep 25 
08:29:41 2012 +0200
@@ -1629,10 +1629,6 @@
       <oldValue><![CDATA[Y]]></oldValue>
       <newValue><![CDATA[N]]></newValue>
     </columnDataChange>
-    <columnDataChange tablename="AD_FIELD" columnname="ISDISPLAYED" 
pkRow="1003700002">
-      <oldValue><![CDATA[Y]]></oldValue>
-      <newValue><![CDATA[N]]></newValue>
-    </columnDataChange>
     <columnDataChange tablename="AD_FIELD" columnname="ISDISPLAYED" 
pkRow="1004400024">
       <oldValue><![CDATA[Y]]></oldValue>
       <newValue><![CDATA[N]]></newValue>
diff -r 6e892b588e49 -r 84a0b15c82c5 
referencedata/sampledata/F_B_International_Group.xml
--- a/referencedata/sampledata/F_B_International_Group.xml      Mon Sep 24 
19:26:43 2012 +0200
+++ b/referencedata/sampledata/F_B_International_Group.xml      Tue Sep 25 
08:29:41 2012 +0200
@@ -25988,9 +25988,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2011-12-05T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate>2011-12-05T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="00DFF28676AE4CE49B08790361D86AB4">
     <id>00DFF28676AE4CE49B08790361D86AB4</id>
@@ -26011,9 +26011,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2012-08-21T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>22</daysOverdue>
-    <lastPaymentDate>2012-08-21T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="01EB58DB89354C88956D2FB821353D12">
     <id>01EB58DB89354C88956D2FB821353D12</id>
@@ -26034,9 +26034,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>0</numberOfPayments>
+    <lastPaymentDate xsi:nil="true"/>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate xsi:nil="true"/>
-    <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="02DADE02A2E74E9EBE197711615E3093">
     <id>02DADE02A2E74E9EBE197711615E3093</id>
@@ -26057,9 +26057,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2012-08-21T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>19</daysOverdue>
-    <lastPaymentDate>2012-08-21T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="03DC324703BF47CB9142BE4A19BA2290">
     <id>03DC324703BF47CB9142BE4A19BA2290</id>
@@ -26080,9 +26080,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>0</numberOfPayments>
+    <lastPaymentDate xsi:nil="true"/>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate xsi:nil="true"/>
-    <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="046972E6589B407F9315A4E2D1CEC18A">
     <id>046972E6589B407F9315A4E2D1CEC18A</id>
@@ -26103,9 +26103,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2012-07-23T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>21</daysOverdue>
-    <lastPaymentDate>2012-07-23T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="04E01ACE269A4C42BBEC007A9870DC1C">
     <id>04E01ACE269A4C42BBEC007A9870DC1C</id>
@@ -26126,9 +26126,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2011-09-30T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate>2011-09-30T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="05400BDD211F4DA184D5E6C31D741C1E">
     <id>05400BDD211F4DA184D5E6C31D741C1E</id>
@@ -26149,9 +26149,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2011-09-02T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate>2011-09-02T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="057DA629A37B44B1A1130CD2FEA78108">
     <id>057DA629A37B44B1A1130CD2FEA78108</id>
@@ -26172,9 +26172,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2012-03-02T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate>2012-03-02T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="07C78259A1FF434C9F49297EB5789BF4">
     <id>07C78259A1FF434C9F49297EB5789BF4</id>
@@ -26195,9 +26195,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>0</numberOfPayments>
+    <lastPaymentDate xsi:nil="true"/>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate xsi:nil="true"/>
-    <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="07E75BC94C6548D89255555475E50A59">
     <id>07E75BC94C6548D89255555475E50A59</id>
@@ -26218,9 +26218,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2011-05-31T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate>2011-05-31T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="084A9FE5E0B6470A88033003215D7EAD">
     <id>084A9FE5E0B6470A88033003215D7EAD</id>
@@ -26241,9 +26241,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>0</numberOfPayments>
+    <lastPaymentDate xsi:nil="true"/>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate xsi:nil="true"/>
-    <numberOfPayments>0</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="088B47EA56244FBB87396D39AD22A730">
     <id>088B47EA56244FBB87396D39AD22A730</id>
@@ -26264,9 +26264,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2011-06-17T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>0</daysOverdue>
-    <lastPaymentDate>2011-06-17T00:00:00.0Z</lastPaymentDate>
-    <numberOfPayments>1</numberOfPayments>
   </FIN_Payment_Schedule>
   <FIN_Payment_Schedule id="08C551D9883142A7931AA2D4A3E70B5E">
     <id>08C551D9883142A7931AA2D4A3E70B5E</id>
@@ -26287,9 +26287,9 @@
     <description xsi:nil="true"/>
     <aprmModifPaymentINPlan>false</aprmModifPaymentINPlan>
     <aprmModifPaymentOUTPlan>false</aprmModifPaymentOUTPlan>
+    <numberOfPayments>1</numberOfPayments>
+    <lastPaymentDate>2012-08-21T00:00:00.0Z</lastPaymentDate>
     <daysOverdue>18</daysOverdue>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to