details:   https://code.openbravo.com/erp/devel/main/rev/76666182f77e
changeset: 15279:76666182f77e
user:      Javier Etxarri <javier.echarri <at> openbravo.com>
date:      Wed Feb 01 09:06:49 2012 +0100
summary:   Issue 19341: The number of Alerts on the menu and Alert Management 
window do not match.
Now, if you have more than 100 alerts, you will see '>100'. If you have less 
than 100, every time you will see the same value in the Alerts of menu and 
Alerts Managemenet window

details:   https://code.openbravo.com/erp/devel/main/rev/d7f87506c261
changeset: 15280:d7f87506c261
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Thu Feb 02 13:04:52 2012 +0100
summary:   Fixes bug 19631: Payment report is not working when filtering by 
dates

details:   https://code.openbravo.com/erp/devel/main/rev/5d21beb5a80f
changeset: 15281:5d21beb5a80f
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Thu Feb 02 14:19:18 2012 +0100
summary:   Fixes bug 19638: Prepaid account must exists to post an invoice, 
even if it hasn't got any prepayment

details:   https://code.openbravo.com/erp/devel/main/rev/99e6717a3cb0
changeset: 15282:99e6717a3cb0
user:      Javier Etxarri <javier.echarri <at> openbravo.com>
date:      Fri Feb 03 10:25:42 2012 +0100
summary:   Fixes issue 19644: Product complete selector does not work properly.
I revert the change because with '===' equals is not working as it is expected.

details:   https://code.openbravo.com/erp/devel/main/rev/2fbd0f5d6438
changeset: 15283:2fbd0f5d6438
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Fri Feb 03 12:44:31 2012 +0100
summary:   fixes bug 19653

details:   https://code.openbravo.com/erp/devel/main/rev/64d4473ba03d
changeset: 15284:64d4473ba03d
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Mon Feb 06 13:14:36 2012 +0100
summary:   fixed bug 19619: Financial Account: Transaction tab does not get 
refreshed

diffstat:

 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml  
                                                    |   2 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java
                       |  20 +++++++--
 
modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java
                              |   2 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
                 |   5 +--
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
      |   5 ++-
 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
 |   9 ++++-
 src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml                          
                                                    |   2 +-
 src/org/openbravo/erpCommon/ad_forms/DocInvoice.java                           
                                                    |  12 ++++--
 8 files changed, 39 insertions(+), 18 deletions(-)

diffs (195 lines):

diff -r 072cd32ef504 -r 64d4473ba03d 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml 
    Fri Feb 03 06:18:45 2012 +0000
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml 
    Mon Feb 06 13:14:36 2012 +0100
@@ -6305,7 +6305,7 @@
 <!--B44BDBCFCEC243179D78A333FA0497A5-->  
<AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--B44BDBCFCEC243179D78A333FA0497A5-->  <POSITION><![CDATA[34]]></POSITION>
 <!--B44BDBCFCEC243179D78A333FA0497A5-->  
<ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
-<!--B44BDBCFCEC243179D78A333FA0497A5-->  <ISAUTOSAVE><![CDATA[N]]></ISAUTOSAVE>
+<!--B44BDBCFCEC243179D78A333FA0497A5-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--B44BDBCFCEC243179D78A333FA0497A5-->  
<VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
 <!--B44BDBCFCEC243179D78A333FA0497A5-->  
<IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
 <!--B44BDBCFCEC243179D78A333FA0497A5--></AD_COLUMN>
diff -r 072cd32ef504 -r 64d4473ba03d 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java
      Fri Feb 03 06:18:45 2012 +0000
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java
      Mon Feb 06 13:14:36 2012 +0100
@@ -35,6 +35,7 @@
 import org.codehaus.jettison.json.JSONArray;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.process.FIN_AddPayment;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
@@ -44,6 +45,7 @@
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.data.FieldProvider;
 import org.openbravo.erpCommon.utility.ComboTableData;
@@ -562,19 +564,19 @@
   private HashMap<String, BigDecimal> calculateAmounts(BigDecimal 
recordAmount, Set<String> psdSet) {
     BigDecimal remainingAmount = recordAmount;
     HashMap<String, BigDecimal> recordsAmounts = new HashMap<String, 
BigDecimal>();
-    for (String psdId : psdSet) {
-      FIN_PaymentScheduleDetail paymentScheduleDetail = 
OBDal.getInstance().get(
-          FIN_PaymentScheduleDetail.class, psdId);
+    // PSD needs to be properly ordered to ensure negative amounts are 
processed first
+    List<FIN_PaymentScheduleDetail> psds = 
getOrderedPaymentScheduleDetails(psdSet);
+    for (FIN_PaymentScheduleDetail paymentScheduleDetail : psds) {
       BigDecimal outstandingAmount = paymentScheduleDetail.getAmount();
       // Manage negative amounts
       if ((remainingAmount.compareTo(BigDecimal.ZERO) > 0 && remainingAmount
           .compareTo(outstandingAmount) >= 0)
           || ((remainingAmount.compareTo(BigDecimal.ZERO) == -1 && 
outstandingAmount
               .compareTo(BigDecimal.ZERO) == -1) && 
(remainingAmount.compareTo(outstandingAmount) <= 0))) {
-        recordsAmounts.put(psdId, outstandingAmount);
+        recordsAmounts.put(paymentScheduleDetail.getId(), outstandingAmount);
         remainingAmount = remainingAmount.subtract(outstandingAmount);
       } else {
-        recordsAmounts.put(psdId, remainingAmount);
+        recordsAmounts.put(paymentScheduleDetail.getId(), remainingAmount);
         remainingAmount = BigDecimal.ZERO;
       }
 
@@ -582,6 +584,14 @@
     return recordsAmounts;
   }
 
+  private List<FIN_PaymentScheduleDetail> 
getOrderedPaymentScheduleDetails(Set<String> psdSet) {
+    OBCriteria<FIN_PaymentScheduleDetail> orderedPSDs = 
OBDal.getInstance().createCriteria(
+        FIN_PaymentScheduleDetail.class);
+    orderedPSDs.add(Restrictions.in(FIN_PaymentScheduleDetail.PROPERTY_ID, 
psdSet));
+    orderedPSDs.addOrderBy(FIN_PaymentScheduleDetail.PROPERTY_AMOUNT, true);
+    return orderedPSDs.list();
+  }
+
   public String getServletInfo() {
     return "Servlet that presents the payment proposal";
     // end of getServletInfo() method
diff -r 072cd32ef504 -r 64d4473ba03d 
modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java
--- 
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java
     Fri Feb 03 06:18:45 2012 +0000
+++ 
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/AlertActionHandler.java
     Mon Feb 06 13:14:36 2012 +0100
@@ -88,7 +88,7 @@
       final VariablesSecureApp vars = new VariablesSecureApp(request);
 
       // select the alert rules
-      final String hql = "select e.alertRule from  " + 
AlertRecipient.ENTITY_NAME
+      final String hql = "select distinct(e.alertRule) from  " + 
AlertRecipient.ENTITY_NAME
           + " e where e.alertRule.active = true and (e.userContact.id=? "
           + " or (e.userContact.id = null and e.role.id = ?))";
       final Query qry = OBDal.getInstance().getSession().createQuery(hql);
diff -r 072cd32ef504 -r 64d4473ba03d 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
        Fri Feb 03 06:18:45 2012 +0000
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-grid.js
        Mon Feb 06 13:14:36 2012 +0100
@@ -36,6 +36,7 @@
   editOnFocus: true,
   showCellContextMenus: true,
   selectOnEdit: false,
+  dataPageSize: 100,
  
   // keeps track if we are in objectSelectionMode or in toggleSelectionMode
   // objectSelectionMode = singleRecordSelection === true
@@ -118,10 +119,6 @@
     this.contextMenu = this.getMenuConstructor().create({items: []});
     
     OB.Datasource.get('ADAlert', this, null, true);
-    
-    if (OB.AlertManager && OB.AlertManager.lastData && 
isc.is.Array(OB.AlertManager.lastData.data)){
-        this.dataPageSize = OB.AlertManager.lastData.data.length;
-    }
 
     this.Super('initWidget', arguments);
   },
diff -r 072cd32ef504 -r 64d4473ba03d 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
     Fri Feb 03 06:18:45 2012 +0000
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-management-view.js
     Mon Feb 06 13:14:36 2012 +0100
@@ -165,8 +165,11 @@
   
   setTotalRows: function(totalRows, status) {
     if (OB.AlertManagement.sections[status]) {
+      if(OB.AlertManagement.grids[status] && 
OB.AlertManagement.grids[status].dataPageSize < totalRows){
+        totalRows = '>'+ OB.AlertManagement.grids[status].dataPageSize;
+      }
       OB.AlertManagement.sections[status].getSectionHeader()
-          .setTitle(OB.I18N.getLabel('OBUIAPP_AlertSectionHeader', 
[OB.AlertManagement.translatedStatus[status], totalRows]));
+      .setTitle(OB.I18N.getLabel('OBUIAPP_AlertSectionHeader', 
[OB.AlertManagement.translatedStatus[status], totalRows]));
     }
   },
   
diff -r 072cd32ef504 -r 64d4473ba03d 
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
--- 
a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
        Fri Feb 03 06:18:45 2012 +0000
+++ 
b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
        Mon Feb 06 13:14:36 2012 +0100
@@ -385,7 +385,14 @@
       hsqlScript.append(FIN_PaymentSchedule.PROPERTY_ID);
       final Session session = OBDal.getInstance().getSession();
       final Query query = session.createQuery(hsqlScript.toString());
-
+      int pos = 0;
+      for (final Object param : parameters) {
+        if (param instanceof BaseOBObject) {
+          query.setEntity(pos++, param);
+        } else {
+          query.setParameter(pos++, param);
+        }
+      }
       boolean firstMember = true;
       java.util.List<FIN_PaymentScheduleDetail> obqPSDList = new 
ArrayList<FIN_PaymentScheduleDetail>();
       for (Object resultObject : query.list()) {
diff -r 072cd32ef504 -r 64d4473ba03d 
src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml     Fri Feb 03 
06:18:45 2012 +0000
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml     Mon Feb 06 
13:14:36 2012 +0100
@@ -1178,7 +1178,7 @@
 <!--FF8080812E77708D012E7796A94B0017-->  <SORTNO><![CDATA[110]]></SORTNO>
 <!--FF8080812E77708D012E7796A94B0017-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--FF8080812E77708D012E7796A94B0017-->  <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD>
-<!--FF8080812E77708D012E7796A94B0017-->  <DEFAULT_EXPRESSION><![CDATA[if 
(OB.isSalesTransaction() === true) { true } else {false} 
]]></DEFAULT_EXPRESSION>
+<!--FF8080812E77708D012E7796A94B0017-->  <DEFAULT_EXPRESSION><![CDATA[if 
(OB.isSalesTransaction() == true) { true } else {false} ]]></DEFAULT_EXPRESSION>
 <!--FF8080812E77708D012E7796A94B0017-->  
<SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
 <!--FF8080812E77708D012E7796A94B0017--></OBUISEL_SELECTOR_FIELD>
 
diff -r 072cd32ef504 -r 64d4473ba03d 
src/org/openbravo/erpCommon/ad_forms/DocInvoice.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java      Fri Feb 03 
06:18:45 2012 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/DocInvoice.java      Mon Feb 06 
13:14:36 2012 +0100
@@ -305,7 +305,8 @@
           fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as, 
true, false, conn),
               this.C_Currency_ID, m_payments[i].Amount, "", 
Fact_Acct_Group_ID, nextSeqNo(SeqNo),
               DocumentType, conn);
-          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+              && new BigDecimal(m_payments[i].PrepaidAmount).compareTo(ZERO) 
!= 0) {
             fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, 
as, true, true, conn),
                 this.C_Currency_ID, m_payments[i].PrepaidAmount, "", 
Fact_Acct_Group_ID,
                 nextSeqNo(SeqNo), DocumentType, conn);
@@ -406,7 +407,8 @@
               nextSeqNo(SeqNo), DocumentType, conn);
           // Pre-payment: Probably not needed as at this point we can not 
generate pre-payments
           // against ARC. Amount is negated
-          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+              && prepaidAmount.compareTo(ZERO) != 0) {
             fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, 
as, true, true, conn),
                 this.C_Currency_ID, "", prepaidAmount.negate().toString(), 
Fact_Acct_Group_ID,
                 nextSeqNo(SeqNo), DocumentType, conn);
@@ -493,7 +495,8 @@
           fact.createLine(m_payments[i], getAccountBPartner(C_BPartner_ID, as, 
false, false, conn),
               this.C_Currency_ID, "", m_payments[i].Amount, 
Fact_Acct_Group_ID, nextSeqNo(SeqNo),
               DocumentType, conn);
-          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+              && new BigDecimal(m_payments[i].PrepaidAmount).compareTo(ZERO) 
!= 0) {
             fact.createLine(m_payments[i],
                 getAccountBPartner(C_BPartner_ID, as, false, true, conn), 
this.C_Currency_ID, "",
                 m_payments[i].PrepaidAmount, Fact_Acct_Group_ID, 
nextSeqNo(SeqNo), DocumentType,
@@ -597,7 +600,8 @@
               nextSeqNo(SeqNo), DocumentType, conn);
           // Pre-payment: Probably not needed as at this point we can not 
generate pre-payments
           // against APC. Amount is negated
-          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)) {
+          if (m_payments[i].C_Currency_ID_From.equals(as.m_C_Currency_ID)
+              && prepaidAmount.compareTo(ZERO) != 0) {
             fact.createLine(m_payments[i],
                 getAccountBPartner(C_BPartner_ID, as, false, true, conn), 
this.C_Currency_ID,
                 prepaidAmount.negate().toString(), "", Fact_Acct_Group_ID, 
nextSeqNo(SeqNo),

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to