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 25638 3a0b18f1e0bb
parent 25637 7441045bf9fd
child 25639 816b718112f1
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	Mon Dec 01 16:49:43 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 + ")");