Author: mor
Date: Thu Jul 16 06:22:19 2009 New Revision: 794546 URL: http://svn.apache.org/viewvc?rev=794546&view=rev Log: Added an option to mass cancel remaining purchase order items. Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml ofbiz/trunk/applications/order/servicedef/services.xml ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=794546&r1=794545&r2=794546&view=diff ============================================================================== --- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original) +++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Thu Jul 16 06:22:19 2009 @@ -1674,6 +1674,12 @@ <value xml:lang="zh">å·²åæ¶</value> <value xml:lang="zh_CN">å·²åæ¶</value> </property> + <property key="OrderCancelRemainingPOItems"> + <value xml:lang="en">Cancel Remaining PO Items</value> + </property> + <property key="OrderCancelSelectedItems"> + <value xml:lang="en">Cancel Selected Items</value> + </property> <property key="OrderCannotBeChanged"> <value xml:lang="de">(kann nicht geändert werden, ohne den Auftrag zu löschen)</value> <value xml:lang="en">(cannot be changed without clearing order.)</value> @@ -1731,9 +1737,6 @@ <value xml:lang="th">à¸à¸±à¸à¸£à¹à¸à¹à¹à¸à¹à¸à¸£à¹à¸¡à¸à¸±à¸</value> <value xml:lang="zh">è´ç©è½¦æç»ä½¿ç¨ä¿éæ åµ</value> </property> - <property key="OrderCancelSelectedItems"> - <value xml:lang="en">Cancel Selected Items</value> - </property> <property key="OrderCartSummary"> <value xml:lang="cs">Obsah koÅ¡Ãku</value> <value xml:lang="de">Ihr Warenkorb enthält</value> Modified: ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=794546&r1=794545&r2=794546&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services.xml Thu Jul 16 06:22:19 2009 @@ -599,6 +599,10 @@ location="org.ofbiz.order.order.OrderServices" invoke="massCancelOrders" auth="true"> <implements service="massOrderChangeInterface"/> </service> + <service name="massCancelRemainingPurchaseOrderItems" engine="java" transaction-timeout="300" + location="org.ofbiz.order.order.OrderServices" invoke="massCancelRemainingPurchaseOrderItems" auth="true"> + <implements service="massOrderChangeInterface"/> + </service> <service name="massRejectOrders" engine="java" transaction-timeout="300" location="org.ofbiz.order.order.OrderServices" invoke="massRejectOrders" auth="true"> <implements service="massOrderChangeInterface"/> Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java?rev=794546&r1=794545&r2=794546&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderServices.java Thu Jul 16 06:22:19 2009 @@ -4489,6 +4489,42 @@ return ServiceUtil.returnSuccess(); } + public static Map massCancelRemainingPurchaseOrderItems(DispatchContext dctx, Map context) { + LocalDispatcher dispatcher = dctx.getDispatcher(); + GenericValue userLogin = (GenericValue) context.get("userLogin"); + List orderIds = (List) context.get("orderIdList"); + + for (Object orderId : orderIds) { + if (UtilValidate.isEmpty(orderId)) { + continue; + } + Map ctx = FastMap.newInstance(); + ctx.put("orderId", orderId); + ctx.put("userLogin", userLogin); + + Map resp = null; + try { + resp = dispatcher.runSync("cancelRemainingPurchaseOrderItems", ctx); + } catch (GenericServiceException e) { + Debug.logError(e, module); + return ServiceUtil.returnError(e.getMessage()); + } + if (ServiceUtil.isError(resp)) { + return ServiceUtil.returnError("Error cancelRemainingPurchaseOrderItems for order: ", null, null, resp); + } + try { + resp = dispatcher.runSync("checkOrderItemStatus", ctx); + } catch (GenericServiceException e) { + Debug.logError(e, module); + return ServiceUtil.returnError(e.getMessage()); + } + if (ServiceUtil.isError(resp)) { + return ServiceUtil.returnError("Error checkOrderItemStatus for order: ", null, null, resp); + } + } + return ServiceUtil.returnSuccess(); + } + public static Map checkCreateDropShipPurchaseOrders(DispatchContext ctx, Map context) { GenericDelegator delegator = ctx.getDelegator(); LocalDispatcher dispatcher = ctx.getDispatcher(); Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=794546&r1=794545&r2=794546&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Thu Jul 16 06:22:19 2009 @@ -120,6 +120,12 @@ <response name="success" type="request-redirect" value="findorders"/> <response name="error" type="view" value="findorders"/> </request-map> + <request-map uri="massCancelRemainingPurchaseOrderItems"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="massCancelRemainingPurchaseOrderItems"/> + <response name="success" type="request-redirect" value="findorders"/> + <response name="error" type="view" value="findorders"/> + </request-map> <request-map uri="massRejectOrders"> <security https="true" auth="true"/> <event type="service" path="" invoke="massRejectOrders"/> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl?rev=794546&r1=794545&r2=794546&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/order/findOrders.ftl Thu Jul 16 06:22:19 2009 @@ -532,6 +532,7 @@ <option value="<@ofbizUrl>massRejectOrders?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderRejectOrder}</option> <option value="<@ofbizUrl>massPickOrders?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderPickOrders}</option> <option value="<@ofbizUrl>massQuickShipOrders?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderQuickShipEntireOrder}</option> + <option value="<@ofbizUrl>massCancelRemainingPurchaseOrderItems?hideFields=${requestParameters.hideFields?default("N")}${paramList}</@ofbizUrl>">${uiLabelMap.OrderCancelRemainingPOItems}</option> <option value="<@ofbizUrl>massPrintOrders?hideFields=${requestParameters.hideFields?default('N')}${paramList}</@ofbizUrl>">${uiLabelMap.CommonPrint}</option> <option value="<@ofbizUrl>massCreateFileForOrders?hideFields=${requestParameters.hideFields?default('N')}${paramList}</@ofbizUrl>">${uiLabelMap.ContentCreateFile}</option> </select> |
Free forum by Nabble | Edit this page |