details:   https://code.openbravo.com/erp/devel/pi/rev/644ee93d7081
changeset: 15832:644ee93d7081
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Wed Mar 14 17:46:46 2012 +0100
summary:   Fixes issue 19648: wrong value in Conversion rate.
With the Format.xml changed, wrong value in Conversion rate in Add Payment 
popup.

details:   https://code.openbravo.com/erp/devel/pi/rev/982225822e2f
changeset: 15833:982225822e2f
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Fri Mar 16 14:57:38 2012 +0100
summary:   Fixes issue 19870: in pricelist report price columns have euroInform 
format.
They should have priceInform format.

details:   https://code.openbravo.com/erp/devel/pi/rev/85a9b7d0fc10
changeset: 15834:85a9b7d0fc10
user:      Ioritz Cia <ioritz.cia <at> openbravo.com>
date:      Fri Mar 16 15:13:57 2012 +0100
summary:   Fixes issue 19755: A Return Material Receipt document cannot be 
voided.

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
 |  38 +++++----
 src-db/database/model/functions/M_INOUT_POST.xml                               
                                  |   1 +
 src/org/openbravo/erpCommon/ad_reports/ReportPricelist.xml                     
                                  |   6 +-
 src/org/openbravo/erpCommon/ad_reports/ReportPricelist_Pdf.xml                 
                                  |   2 +-
 4 files changed, 27 insertions(+), 20 deletions(-)

diffs (149 lines):

diff -r 4f886cb144ac -r 85a9b7d0fc10 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
  Fri Mar 16 18:06:53 2012 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddPaymentFromInvoice.java
  Fri Mar 16 15:13:57 2012 +0100
@@ -123,16 +123,16 @@
       String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId", 
"");
       String strPaymentDate = vars.getRequestGlobalVariable("inpPaymentDate", 
"");
       boolean isReceipt = 
vars.getRequiredStringParameter("isReceipt").equals("Y");
-      refreshFinancialAccountCombo(response, strPaymentMethodId, 
strFinancialAccountId, strOrgId,
-          strCurrencyId, isReceipt, strPaymentDate, conversionRatePrecision);
+      refreshFinancialAccountCombo(response, vars, strPaymentMethodId, 
strFinancialAccountId,
+          strOrgId, strCurrencyId, isReceipt, strPaymentDate, 
conversionRatePrecision);
     } else if (vars.commandIn("FILLFINANCIALACCOUNT")) {
       String strFinancialAccountId = 
vars.getRequestGlobalVariable("inpFinancialAccount", "");
       String strOrgId = vars.getRequestGlobalVariable("inpadOrgId", "");
       String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId", 
"");
       String strPaymentDate = vars.getRequestGlobalVariable("inpPaymentDate", 
"");
       boolean isReceipt = 
vars.getRequiredStringParameter("isReceipt").equals("Y");
-      refreshFinancialAccountCombo(response, "", strFinancialAccountId, 
strOrgId, strCurrencyId,
-          isReceipt, strPaymentDate, conversionRatePrecision);
+      refreshFinancialAccountCombo(response, vars, "", strFinancialAccountId, 
strOrgId,
+          strCurrencyId, isReceipt, strPaymentDate, conversionRatePrecision);
 
     } else if (vars.commandIn("FILLPAYMENTMETHOD")) {
       String strPaymentMethodId = 
vars.getRequiredStringParameter("inpPaymentMethod");
@@ -147,8 +147,8 @@
       final String strOrgId = vars.getRequestGlobalVariable("inpadOrgId", "");
       final String strPaymentDate = 
vars.getRequestGlobalVariable("inpPaymentDate", "");
       Organization org = OBDal.getInstance().get(Organization.class, strOrgId);
-      refreshExchangeRate(response, strCurrencyId, 
strFinancialAccountCurrencyId, strPaymentDate,
-          org, conversionRatePrecision);
+      refreshExchangeRate(response, vars, strCurrencyId, 
strFinancialAccountCurrencyId,
+          strPaymentDate, org, conversionRatePrecision);
 
     } else if (vars.commandIn("SAVE") || vars.commandIn("SAVEANDPROCESS")) {
       boolean isReceipt = 
vars.getRequiredStringParameter("isReceipt").equals("Y");
@@ -379,8 +379,9 @@
         xmlDocument.setParameter("financialAccountCurrencyPrecision", 
financialAccountCurrency
             .getStandardPrecision().toString());
       }
-      String exchangeRate = findExchangeRate(paymentCurrency, 
financialAccountCurrency, new Date(),
-          OBDal.getInstance().get(Organization.class, strOrgId), 
conversionRatePrecision);
+      String exchangeRate = findExchangeRate(vars, paymentCurrency, 
financialAccountCurrency,
+          new Date(), OBDal.getInstance().get(Organization.class, strOrgId),
+          conversionRatePrecision);
       xmlDocument.setParameter("exchangeRate", exchangeRate);
 
     } finally {
@@ -468,7 +469,7 @@
 
   }
 
-  private void refreshFinancialAccountCombo(HttpServletResponse response,
+  private void refreshFinancialAccountCombo(HttpServletResponse response, 
VariablesSecureApp vars,
       String strPaymentMethodId, String strFinancialAccountId, String strOrgId,
       String strCurrencyId, boolean isReceipt, String paymentDate, int 
conversionRatePrecision)
       throws IOException, ServletException {
@@ -483,7 +484,7 @@
         .getFinancialAccountCurrency(strFinancialAccountId);
     final Currency paymentCurrency = dao.getObject(Currency.class, 
strCurrencyId);
 
-    String exchangeRate = findExchangeRate(paymentCurrency, 
financialAccountCurrency,
+    String exchangeRate = findExchangeRate(vars, paymentCurrency, 
financialAccountCurrency,
         FIN_Utility.getDate(paymentDate), 
OBDal.getInstance().get(Organization.class, strOrgId),
         conversionRatePrecision);
 
@@ -504,9 +505,9 @@
 
   }
 
-  private void refreshExchangeRate(HttpServletResponse response, String 
strCurrencyId,
-      String strFinancialAccountCurrencyId, String strPaymentDate, 
Organization organization,
-      int conversionRatePrecision) throws IOException, ServletException {
+  private void refreshExchangeRate(HttpServletResponse response, 
VariablesSecureApp vars,
+      String strCurrencyId, String strFinancialAccountCurrencyId, String 
strPaymentDate,
+      Organization organization, int conversionRatePrecision) throws 
IOException, ServletException {
 
     dao = new AdvPaymentMngtDao();
 
@@ -514,7 +515,7 @@
         strFinancialAccountCurrencyId);
     final Currency paymentCurrency = dao.getObject(Currency.class, 
strCurrencyId);
 
-    String exchangeRate = findExchangeRate(paymentCurrency, 
financialAccountCurrency,
+    String exchangeRate = findExchangeRate(vars, paymentCurrency, 
financialAccountCurrency,
         FIN_Utility.getDate(strPaymentDate), organization, 
conversionRatePrecision);
 
     JSONObject msg = new JSONObject();
@@ -529,8 +530,9 @@
     out.close();
   }
 
-  private String findExchangeRate(Currency paymentCurrency, Currency 
financialAccountCurrency,
-      Date paymentDate, Organization organization, int 
conversionRatePrecision) {
+  private String findExchangeRate(VariablesSecureApp vars, Currency 
paymentCurrency,
+      Currency financialAccountCurrency, Date paymentDate, Organization 
organization,
+      int conversionRatePrecision) {
     String exchangeRate = "1";
     if (financialAccountCurrency != null && 
!financialAccountCurrency.equals(paymentCurrency)) {
       final ConversionRate conversionRate = 
FIN_Utility.getConversionRate(paymentCurrency,
@@ -540,6 +542,10 @@
       } else {
         exchangeRate = conversionRate.getMultipleRateBy()
             .setScale(conversionRatePrecision, 
RoundingMode.HALF_UP).toPlainString();
+        String decimal = 
vars.getSessionValue("#decimalSeparator|generalQtyEdition", ".");
+        if (",".equalsIgnoreCase(decimal)) {
+          exchangeRate = exchangeRate.replace(".", ",");
+        }
       }
     }
     return exchangeRate;
diff -r 4f886cb144ac -r 85a9b7d0fc10 
src-db/database/model/functions/M_INOUT_POST.xml
--- a/src-db/database/model/functions/M_INOUT_POST.xml  Fri Mar 16 18:06:53 
2012 +0100
+++ b/src-db/database/model/functions/M_INOUT_POST.xml  Fri Mar 16 15:13:57 
2012 +0100
@@ -217,6 +217,7 @@
       FROM m_inoutline iol JOIN c_orderline ol ON iol.c_orderline_id = 
ol.c_orderline_id
       WHERE iol.m_inout_id = v_record_id
         AND iol.movementqty > 0
+        AND canceled_inoutline_id IS NULL
         AND ol.c_order_discount_id IS NULL;
       IF (v_Count <> 0) THEN
         RAISE_APPLICATION_ERROR(-20000, '@ReturnInOutNegativeQty@');
diff -r 4f886cb144ac -r 85a9b7d0fc10 
src/org/openbravo/erpCommon/ad_reports/ReportPricelist.xml
--- a/src/org/openbravo/erpCommon/ad_reports/ReportPricelist.xml        Fri Mar 
16 18:06:53 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportPricelist.xml        Fri Mar 
16 15:13:57 2012 +0100
@@ -50,9 +50,9 @@
     <FIELD id="fieldCategoryName">categoryName</FIELD>
     <FIELD id="fieldProductName" attribute="onclick" 
replace="yy">mProductId</FIELD>
     <FIELD id="fieldProductName">productName</FIELD>
-    <FIELD id="fieldPricelimit" format="euroInform">pricelimit</FIELD>
-    <FIELD id="fieldPricelist" format="euroInform">pricelist</FIELD>
-    <FIELD id="fieldPricestd" format="euroInform">pricestd</FIELD>
+    <FIELD id="fieldPricelimit" format="priceInform">pricelimit</FIELD>
+    <FIELD id="fieldPricelist" format="priceInform">pricelist</FIELD>
+    <FIELD id="fieldPricestd" format="priceInform">pricestd</FIELD>
     <SUBREPORT id="reportM_PRODUCT_CATEGORYID" 
name="reportM_PRODUCT_CATEGORYID" 
report="org/openbravo/erpCommon/reference/List">
       <ARGUMENT name="parameterListSelected" 
withId="paramM_PRODUCT_CATEGORY_ID"/>
     </SUBREPORT>
diff -r 4f886cb144ac -r 85a9b7d0fc10 
src/org/openbravo/erpCommon/ad_reports/ReportPricelist_Pdf.xml
--- a/src/org/openbravo/erpCommon/ad_reports/ReportPricelist_Pdf.xml    Fri Mar 
16 18:06:53 2012 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportPricelist_Pdf.xml    Fri Mar 
16 15:13:57 2012 +0100
@@ -25,7 +25,7 @@
     <FIELD id="fieldCategoryName" replaceCharacters="fo">categoryName</FIELD>
     <FIELD id="fieldProductName" replaceCharacters="fo">productName</FIELD>
     <FIELD id="fieldUomname" replaceCharacters="fo">uomname</FIELD>
-    <FIELD id="fieldPricestd" format="euroInform">pricestd</FIELD>
+    <FIELD id="fieldPricestd" format="priceInform">pricestd</FIELD>
        <SECTION id="sectionVersion" field="versionName"/>
     <SECTION id="sectionCategory" field="categoryName"/>
     <SECTION id="sectionDetail"/>

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to