details: https://code.openbravo.com/erp/devel/pi/rev/73c19e6fd0cf
changeset: 17493:73c19e6fd0cf
user: David Miguelez <david.miguelez <at> openbravo.com>
date: Tue Jul 17 12:25:10 2012 +0200
summary: Related to Issue 21006: Fixes issues in Costing Utils + Costing
Migration Process
diffstat:
src/org/openbravo/costing/CostingMigrationProcess.java | 12 ------------
src/org/openbravo/costing/CostingUtils.java | 9 +++------
2 files changed, 3 insertions(+), 18 deletions(-)
diffs (67 lines):
diff -r ddabaeb27497 -r 73c19e6fd0cf
src/org/openbravo/costing/CostingMigrationProcess.java
--- a/src/org/openbravo/costing/CostingMigrationProcess.java Tue Jul 17
11:29:28 2012 +0200
+++ b/src/org/openbravo/costing/CostingMigrationProcess.java Tue Jul 17
12:25:10 2012 +0200
@@ -19,7 +19,6 @@
package org.openbravo.costing;
import java.math.BigDecimal;
-import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
@@ -955,15 +954,4 @@
obcClient.add(Restrictions.ne(Client.PROPERTY_ID, "0"));
return obcClient.list();
}
-
- private Date getLastDate() {
- SimpleDateFormat outputFormat = new SimpleDateFormat("dd-MM-yyyy");
- try {
- return outputFormat.parse("31-12-9999");
- } catch (ParseException e) {
- // Error parsing the date.
- log4j.error("Error parsing the date.", e);
- return null;
- }
- }
}
diff -r ddabaeb27497 -r 73c19e6fd0cf src/org/openbravo/costing/CostingUtils.java
--- a/src/org/openbravo/costing/CostingUtils.java Tue Jul 17 11:29:28
2012 +0200
+++ b/src/org/openbravo/costing/CostingUtils.java Tue Jul 17 12:25:10
2012 +0200
@@ -98,8 +98,6 @@
cost = cost.add(FinancialUtils.getConvertedAmount(trxCost.getCost(),
trxCost.getCurrency(),
currency, trxCost.getCostDate(), trxCost.getOrganization(),
FinancialUtils.PRECISION_COSTING));
- } else {
- cost = cost.add(trxCost.getCost());
}
}
return cost;
@@ -300,8 +298,9 @@
}
/**
- * Calculates the stock of the product on the given date and for the given
cost dimensions. It
- * only takes transactions that have its cost calculated.
+ * Calculates the value of the stock of the product on the given date, for
the given cost
+ * dimensions and for the given currency. It only takes transactions that
have its cost
+ * calculated.
*/
public static BigDecimal getCurrentValuedStock(Product product, Organization
org, Date date,
HashMap<CostDimension, BaseOBObject> costDimensions, Currency currency) {
@@ -346,7 +345,6 @@
@SuppressWarnings("unchecked")
List<Object[]> o = trxQry.list();
BigDecimal sum = BigDecimal.ZERO;
- BigDecimal sumNoConv = BigDecimal.ZERO;
if (o.size() == 0) {
return sum;
}
@@ -358,7 +356,6 @@
if (origCur != currency) {
sum = sum.add(FinancialUtils.getConvertedAmount(origAmt, origCur,
currency, convDate, org,
FinancialUtils.PRECISION_COSTING));
- sumNoConv = sumNoConv.add(origAmt);
} else {
sum = sum.add(origAmt);
}
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits