perhaps i am missing something, but the description talks about invoice
items and the code change is about orderitems? On Sat, 2011-03-26 at 14:46 +0000, [hidden email] wrote: > Author: jleroux > Date: Sat Mar 26 14:46:46 2011 > New Revision: 1085726 > > URL: http://svn.apache.org/viewvc?rev=1085726&view=rev > Log: > 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); > } > > -- Ofbiz on twitter: http://twitter.com/apache_ofbiz Myself on twitter: http://twitter.com/hansbak Antwebsystems.com: Quality services for competitive rates. |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 The retrieved OrderItems (you see in the patch) are fed into another service that creates InvoiceItems based on them. Regards, René Scheibe On 03/26/2011 04:06 PM, Hans Bakker wrote: > perhaps i am missing something, but the description talks about invoice > items and the code change is about orderitems? > > On Sat, 2011-03-26 at 14:46 +0000, [hidden email] wrote: >> Author: jleroux >> Date: Sat Mar 26 14:46:46 2011 >> New Revision: 1085726 >> >> URL: http://svn.apache.org/viewvc?rev=1085726&view=rev >> Log: >> 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); >> } >> >> > - -- René Scheibe * [hidden email] TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterföhring Geschäftsführer: Henrik Klagges, Gerhard Müller, Christoph Stock Sitz: Unterföhring * Amtsgericht München * HRB 135082 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2OCccACgkQUXs9EHvIuCrK0wCfQHZNHu96sRr1HwpdumJee1kr Jm0An39uoMUh0G8+4NgOzG9od32h/MuL =uoal -----END PGP SIGNATURE----- |
Free forum by Nabble | Edit this page |