details:   https://code.openbravo.com/erp/devel/pi/rev/2b4515770947
changeset: 22008:2b4515770947
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Thu Feb 06 12:47:30 2014 +0530
summary:   Fixes Issue 0025618: Wrong currency after posting multicurrency 
matched invoices

details:   https://code.openbravo.com/erp/devel/pi/rev/b6dad5dc6d68
changeset: 22009:b6dad5dc6d68
user:      Atul Gaware <atul.gaware <at> openbravo.com>
date:      Mon Feb 10 18:40:25 2014 +0530
summary:   Fixes Issue 25462: Products movement report is not filtering 
correcly by lot

diffstat:

 src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java                  |  15 
+++++----
 src/org/openbravo/erpCommon/ad_reports/ReportProductMovement.java      |   4 +-
 src/org/openbravo/erpCommon/ad_reports/ReportProductMovement_data.xsql |   3 +-
 3 files changed, 12 insertions(+), 10 deletions(-)

diffs (76 lines):

diff -r 62a611060740 -r b6dad5dc6d68 
src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java     Thu Feb 13 
09:07:36 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java     Mon Feb 10 
18:40:25 2014 +0530
@@ -11,7 +11,7 @@
  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
  * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
  * Contributor(s): Openbravo SLU
- * Contributions are Copyright (C) 2001-2013 Openbravo S.L.U.
+ * Contributions are Copyright (C) 2001-2014 Openbravo S.L.U.
  ******************************************************************************
  */
 package org.openbravo.erpCommon.ad_forms;
@@ -366,15 +366,16 @@
     BigDecimal totalLines = BigDecimal.ZERO;
     for (int i = 0; i < p_lines.length; i++) {
       DocLine_Invoice line = (DocLine_Invoice) p_lines[i];
-      BigDecimal lineAmount = bdExpenses.multiply(new 
BigDecimal(line.getAmount())).divide(
-          new BigDecimal(invoiceData[0].linenetamt),
-          OBDal.getInstance().get(Currency.class, 
strInvoiceCurrency).getStandardPrecision()
-              .intValue(), BigDecimal.ROUND_HALF_UP);
+      BigDecimal lineAmount = bdExpensesAcctCurrency.multiply(new 
BigDecimal(line.getAmount()))
+          .divide(
+              new BigDecimal(invoiceData[0].linenetamt),
+              OBDal.getInstance().get(Currency.class, 
strInvoiceCurrency).getStandardPrecision()
+                  .intValue(), BigDecimal.ROUND_HALF_UP);
       if (i == p_lines.length - 1) {
-        lineAmount = bdExpenses.subtract(totalLines);
+        lineAmount = bdExpensesAcctCurrency.subtract(totalLines);
       }
       cr = fact.createLine(line, p.getAccount(ProductInfo.ACCTTYPE_P_Expense, 
as, conn),
-          strInvoiceCurrency, "0", lineAmount.toString(), Fact_Acct_Group_ID, 
nextSeqNo(SeqNo),
+          as.m_C_Currency_ID, "0", lineAmount.toString(), Fact_Acct_Group_ID, 
nextSeqNo(SeqNo),
           DocumentType, conn);
       totalLines = totalLines.add(lineAmount);
     }
diff -r 62a611060740 -r b6dad5dc6d68 
src/org/openbravo/erpCommon/ad_reports/ReportProductMovement.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportProductMovement.java Thu Feb 
13 09:07:36 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportProductMovement.java Mon Feb 
10 18:40:25 2014 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2012 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2014 Openbravo SLU 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -175,7 +175,7 @@
             Utility.getContext(this, vars, "#User_Client", 
"ReportProductMovement"),
             Utility.getContext(this, vars, "#AccessibleOrgTree", 
"ReportProductMovement"),
             strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), 
strcBpartnerId,
-            strmProductId);
+            strmProductId, strmAttributesetinstanceId);
         if (data1 == null || data1.length == 0) {
           discard[1] = "selEliminar2";
           data1 = ReportProductMovementData.set();
diff -r 62a611060740 -r b6dad5dc6d68 
src/org/openbravo/erpCommon/ad_reports/ReportProductMovement_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportProductMovement_data.xsql    
Thu Feb 13 09:07:36 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportProductMovement_data.xsql    
Mon Feb 10 18:40:25 2014 +0530
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2012 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2014 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -104,6 +104,7 @@
     <Parameter name="parDateTo" optional="true" after="AND 1=1"><![CDATA[ AND 
M_TRANSACTION.MOVEMENTDATE < to_date(?)]]></Parameter>
     <Parameter name="cBpartner" optional="true" after="AND 1=1"><![CDATA[ AND 
C_BPARTNER.C_BPARTNER_ID = ?]]></Parameter>
     <Parameter name="mProductId" optional="true" after="AND 1=1"><![CDATA[ AND 
M_PRODUCT.M_PRODUCT_ID = ?]]></Parameter>
+    <Parameter name="mAttributeSetInstanceId" optional="true" after="AND 
1=1"><![CDATA[AND M_TRANSACTION.M_ATTRIBUTESETINSTANCE_ID = ?]]></Parameter>
   </SqlMethod>
 
   <SqlMethod name="selectMovement" type="preparedStatement" return="multiple">

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to