Author: mrisaliti
Date: Tue Feb 19 12:31:25 2008
New Revision: 629216
URL:
http://svn.apache.org/viewvc?rev=629216&view=revLog:
Create a new service to storeQuote in a single transaction like storeOrder (Part of issue OFBIZ-1657)
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java?rev=629216&r1=629215&r2=629216&view=diff==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/quote/QuoteServices.java Tue Feb 19 12:31:25 2008
@@ -34,9 +34,9 @@
import org.ofbiz.entity.GenericEntityException;
import org.ofbiz.entity.GenericValue;
import org.ofbiz.service.DispatchContext;
+import org.ofbiz.service.GenericServiceException;
import org.ofbiz.service.LocalDispatcher;
import org.ofbiz.service.ServiceUtil;
-import org.ofbiz.service.GenericServiceException;
public class QuoteServices {
@@ -159,7 +159,10 @@
quoteIn.put("validThruDate", validThruDate);
quoteIn.put("quoteName", quoteName);
quoteIn.put("description", description);
- quoteIn.put("userLogin", userLogin);
+ if (userLogin != null) {
+ quoteIn.put("userLogin", userLogin);
+ }
+
// create Quote
Map quoteOut = dispatcher.runSync("createQuote", quoteIn);
@@ -174,7 +177,8 @@
while (quoteIt.hasNext()) {
GenericValue quoteItem = (GenericValue)quoteIt.next();
quoteItem.set("quoteId", quoteId);
- Map quoteItemIn = UtilMisc.toMap(quoteItem);
+ quoteItem.set("quoteUnitPrice", null);
+ Map quoteItemIn = quoteItem.getAllFields();
quoteItemIn.put("userLogin", userLogin);
dispatcher.runSync("createQuoteItem", quoteItemIn);
@@ -187,7 +191,7 @@
while (quoteAttrIt.hasNext()) {
GenericValue quoteAttr = (GenericValue)quoteAttrIt.next();
quoteAttr.set("quoteId", quoteId);
- Map quoteAttrIn = UtilMisc.toMap(quoteAttr);
+ Map quoteAttrIn = quoteAttr.getAllFields();
quoteAttrIn.put("userLogin", userLogin);
dispatcher.runSync("createQuoteAttribute", quoteAttrIn);