details:   https://code.openbravo.com/erp/devel/pi/rev/10a0ffa31546
changeset: 27918:10a0ffa31546
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Mon Nov 16 18:49:39 2015 +0100
summary:   Fixes issue 31318: Landed cost fails when there is 
ReturnMaterialReceipt voided

Voided shipments should be excluded when searching transactions which depend on 
another adjusted transaction.

diffstat:

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

diffs (22 lines):

diff -r 336cbe497bec -r 10a0ffa31546 
src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java
--- a/src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java      Mon Nov 
16 13:39:15 2015 +0100
+++ b/src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java      Mon Nov 
16 18:49:39 2015 +0100
@@ -52,6 +52,7 @@
 import org.openbravo.model.materialmgmt.transaction.InventoryCountLine;
 import org.openbravo.model.materialmgmt.transaction.MaterialTransaction;
 import org.openbravo.model.materialmgmt.transaction.ProductionLine;
+import org.openbravo.model.materialmgmt.transaction.ShipmentInOut;
 import org.openbravo.model.materialmgmt.transaction.ShipmentInOutLine;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -410,8 +411,10 @@
     StringBuffer where = new StringBuffer();
     where.append(" as trx");
     where.append(" join trx." + MaterialTransaction.PROPERTY_GOODSSHIPMENTLINE 
+ " as iol");
+    where.append(" join iol." + ShipmentInOutLine.PROPERTY_SHIPMENTRECEIPT + " 
as io");
     where.append(" join iol." + ShipmentInOutLine.PROPERTY_SALESORDERLINE + " 
as ol");
     where.append(" where ol." + OrderLine.PROPERTY_GOODSSHIPMENTLINE + " = 
:shipment");
+    where.append(" and io." + ShipmentInOut.PROPERTY_DOCUMENTSTATUS + " <> 
'VO'");
     OBQuery<MaterialTransaction> qryTrx = OBDal.getInstance().createQuery(
         MaterialTransaction.class, where.toString());
     qryTrx.setFilterOnReadableOrganization(false);

------------------------------------------------------------------------------
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to