Related to bug 28286 LandedCostLineAmt should always be created in the same order
authorAlvaro Ferraz <alvaro.ferraz@openbravo.com>
Fri, 05 Dec 2014 14:11:17 +0100
changeset 25513 cd56a855a806
parent 25512 8c12e7511fd5
child 25514 ca006bb312dd
Related to bug 28286 LandedCostLineAmt should always be created in the same order

The field in the order by clause must appear in the group by clause to prevent fail in Postgresql 8.4
src/org/openbravo/costing/LandedCostDistributionByAmount.java
--- a/src/org/openbravo/costing/LandedCostDistributionByAmount.java	Fri Dec 05 08:33:57 2014 +0100
+++ b/src/org/openbravo/costing/LandedCostDistributionByAmount.java	Fri Dec 05 14:11:17 2014 +0100
@@ -143,7 +143,8 @@
     qry.append("        and lcr." + LCReceipt.PROPERTY_GOODSSHIPMENT + " = iol."
         + ShipmentInOutLine.PROPERTY_SHIPMENTRECEIPT + "))");
     qry.append("   and lcr." + LCReceipt.PROPERTY_LANDEDCOST + ".id = :landedCost");
-    qry.append(" group by lcr.id, iol.id, trx." + MaterialTransaction.PROPERTY_CURRENCY + ".id");
+    qry.append(" group by lcr.id, iol.id, trx." + MaterialTransaction.PROPERTY_CURRENCY
+        + ".id, iol." + ShipmentInOutLine.PROPERTY_LINENO);
     if (doOrderBy) {
       qry.append(" order by iol." + ShipmentInOutLine.PROPERTY_LINENO);
       qry.append(" , sum(tc." + TransactionCost.PROPERTY_COST + ")");