Author: apatel
Date: Sat Aug 11 00:31:49 2007 New Revision: 564842 URL: http://svn.apache.org/viewvc?view=rev&rev=564842 Log: check if orderItems are on back order before sending process shipment and put eca in place (commented by default) call processShipment when inventory is received. Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Modified: ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml?view=diff&rev=564842&r1=564841&r2=564842 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml (original) +++ ofbiz/trunk/specialpurpose/oagis/servicedef/secas.xml Sat Aug 11 00:31:49 2007 @@ -27,13 +27,16 @@ <condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/> <condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/> <action service="oagisProcessShipment" mode="async" persist="true"/> - </eca> - - <eca service="updateReturnHeader" event="commit"> - <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/> - <action service="oagisReceiveDelivery" mode="async" persist="true"/> - </eca> + </eca> + <eca service="updateReturnHeader" event="commit"> + <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/> + <action service="oagisReceiveDelivery" mode="async" persist="true"/> + </eca> + + <eca service="reserveProductInventory" event="global-commit"> + <action service="oagisProcessShipment" mode="sync"/> + </eca> --> <eca service="oagisMessageHandler" event="commit" run-on-error="true"> @@ -41,4 +44,5 @@ <action service="createOagisMsgErrInfosFromErrMapList" mode="sync"/> <action service="oagisSendConfirmBod" mode="sync"/> </eca> + </service-eca> Modified: ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java?view=diff&rev=564842&r1=564841&r2=564842 ============================================================================== --- ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java (original) +++ ofbiz/trunk/specialpurpose/oagis/src/org/ofbiz/oagis/OagisShipmentServices.java Sat Aug 11 00:31:49 2007 @@ -411,6 +411,18 @@ GenericDelegator delegator = ctx.getDelegator(); String orderId = (String) context.get("orderId"); + // Check if order is not on back order before processing shipment + try { + Map checkOrderResp = dispatcher.runSync("checkOrderIsOnBackOrder", UtilMisc.toMap("orderId", orderId)); + if (((Boolean) checkOrderResp.get("isBackOrder")).booleanValue()) { + Debug.logWarning("Order [" + orderId + "] is on back order, cannot Process Shipment", module); + return ServiceUtil.returnSuccess(); + } + } catch (GenericServiceException e) { + Debug.logError(e, module); + return ServiceUtil.returnError(e.getMessage()); + } + String sendToUrl = (String) context.get("sendToUrl"); if (UtilValidate.isEmpty(sendToUrl)) { sendToUrl = UtilProperties.getPropertyValue("oagis.properties", "url.send.processShipment"); |
Free forum by Nabble | Edit this page |