details:   https://code.openbravo.com/erp/devel/pi/rev/f5b89bd131a9
changeset: 27040:f5b89bd131a9
user:      David Miguelez <david.miguelez <at> openbravo.com>
date:      Fri Jun 26 13:43:05 2015 +0200
summary:   Fixes Issue 30259. When a Transaction is set as Permanent, avoid to 
modify
it's Unitary Cost, since it will not be possible (it is checked later in the 
code)

diffstat:

 src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r b9068c9d09d1 -r f5b89bd131a9 
src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java
--- a/src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java      Fri Jun 
26 13:14:29 2015 +0200
+++ b/src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java      Fri Jun 
26 13:43:05 2015 +0200
@@ -446,6 +446,14 @@
     BigDecimal adjAmt = BigDecimal.ZERO;
     TrxType calTrxType = 
TrxType.getTrxType(costAdjLine.getInventoryTransaction());
 
+    if (costAdjLine.getInventoryTransaction().isCostPermanent() && 
costAdjLine.isUnitCost()) {
+      costAdjLine.setCurrency((Currency) 
OBDal.getInstance().getProxy(Currency.ENTITY_NAME,
+          strCostCurrencyId));
+      costAdjLine.setAdjustmentAmount(adjAmt);
+      OBDal.getInstance().save(costAdjLine);
+      return;
+    }
+
     // Incoming transactions does not modify the calculated cost
     switch (calTrxType) {
     case ShipmentVoid:

------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to