Author: jleroux
Date: Sat Mar 26 14:46:46 2011
New Revision: 1085726
URL:
http://svn.apache.org/viewvc?rev=1085726&view=revLog:
A patch from Rene Scheibe "Invoice items should be sorted."
https://issues.apache.org/jira/browse/OFBIZ-4230 - OFBIZ-4230
When creating an invoice via the service "createInvoiceForOrderAllItems" the order items are currently just fetched from the database without any sorting. This can result in a different sorting of invoice items vs. order items. Or when creating a new invoice due to a changed order the sorting between invoices can be different.
Sorts invoice items (in case they are derived from OrderItems) by "orderItemSeqId".
Modified:
ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=1085726&r1=1085725&r2=1085726&view=diff==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Sat Mar 26 14:46:46 2011
@@ -115,7 +115,7 @@ public class InvoiceServices {
LocalDispatcher dispatcher = dctx.getDispatcher();
Locale locale = (Locale) context.get("locale");
try {
- List<GenericValue> orderItems = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", (String) context.get("orderId")));
+ List<GenericValue> orderItems = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", (String) context.get("orderId")), UtilMisc.toList("orderItemSeqId"));
if (orderItems.size() > 0) {
context.put("billItems", orderItems);
}