Author: lektran
Date: Sat Jun 16 01:54:16 2007
New Revision: 547892
URL:
http://svn.apache.org/viewvc?view=rev&rev=547892Log:
Applied fix from trunk for revision: 545410
Modified:
ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
Modified: ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?view=diff&rev=547892&r1=547891&r2=547892==============================================================================
--- ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original)
+++ ofbiz/branches/release4.0/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Sat Jun 16 01:54:16 2007
@@ -113,6 +113,7 @@
// service to create an invoice for a complete order by the system userid
public static Map createInvoiceForOrderAllItems(DispatchContext dctx, Map context) {
GenericDelegator delegator = dctx.getDelegator();
+ LocalDispatcher dispatcher = dctx.getDispatcher();
try {
List orderItems = delegator.findByAnd("OrderItem", UtilMisc.toMap("orderId", (String) context.get("orderId")));
if (orderItems != null && orderItems.size() > 0) {
@@ -123,13 +124,18 @@
if (userLogin != null) {
context.put("userLogin", userLogin);
}
-
+
+ return dispatcher.runSync("createInvoiceForOrder", context);
+ }
+ catch(GenericServiceException e) {
+ String errMsg = UtilProperties.getMessage(resource,"AccountingEntityDataProblemCreatingInvoiceFromOrderItems",UtilMisc.toMap("reason",e.toString()),(Locale) context.get("locale"));
+ Debug.logError (e, errMsg, module);
+ return ServiceUtil.returnError(errMsg);
} catch (GenericEntityException e) {
String errMsg = UtilProperties.getMessage(resource,"AccountingEntityDataProblemCreatingInvoiceFromOrderItems",UtilMisc.toMap("reason",e.toString()),(Locale) context.get("locale"));
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
- return createInvoiceForOrder(dctx, context);
}
/* Service to create an invoice for an order */