Several small enhancements to the ui to link returns with shipments and inventory receipts. Still, a lot of works needs to be done in this area (e.g. manual creation of return shipments, improve the ui, verify the code that creates the invoice for the return, verify the code that apply payments to invoices etc...) git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@669188 13f79535-47bb-0310-9956-ffa450edef68
310 lines
15 KiB
XML
310 lines
15 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
Licensed to the Apache Software Foundation (ASF) under one
|
|
or more contributor license agreements. See the NOTICE file
|
|
distributed with this work for additional information
|
|
regarding copyright ownership. The ASF licenses this file
|
|
to you under the Apache License, Version 2.0 (the
|
|
"License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing,
|
|
software distributed under the License is distributed on an
|
|
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
KIND, either express or implied. See the License for the
|
|
specific language governing permissions and limitations
|
|
under the License.
|
|
-->
|
|
|
|
<service-eca xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/service-eca.xsd">
|
|
<!-- order item status changes -->
|
|
<eca service="storeOrder" event="return">
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
<action service="addSuggestionsToShoppingList" mode="async" persist="true"/>
|
|
</eca>
|
|
<eca service="storeOrder" event="return">
|
|
<condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/>
|
|
<action service="checkCreateDropShipPurchaseOrders" mode="sync" run-as-user="system"/>
|
|
</eca>
|
|
<eca service="storeOrder" event="return">
|
|
<action service="balanceOrderItemsWithNegativeReservations" mode="sync"/>
|
|
</eca>
|
|
<eca service="changeOrderItemStatus" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="ITEM_CANCELLED"/>
|
|
<action service="cancelOrderInventoryReservation" mode="sync"/>
|
|
<action service="recalcShippingTotal" mode="sync"/>
|
|
<action service="recalcTaxTotal" mode="sync"/>
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
<action service="checkOrderItemStatus" mode="sync"/>
|
|
</eca>
|
|
<eca service="changeOrderItemStatus" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="ITEM_COMPLETED"/>
|
|
<action service="checkOrderItemStatus" mode="sync"/>
|
|
</eca>
|
|
<eca service="changeOrderItemStatus" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="ITEM_APPROVED"/>
|
|
<action service="checkOrderItemStatus" mode="sync"/>
|
|
</eca>
|
|
<eca service="changeOrderItemStatus" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="ITEM_APPROVED"/>
|
|
<action service="checkDigitalItemFulfillment" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- order status changes -->
|
|
<eca service="changeOrderStatus" event="commit" run-on-error="false">
|
|
<condition field-name="statusId" operator="equals" value="ORDER_CANCELLED"/>
|
|
<action service="releaseOrderPayments" mode="sync"/>
|
|
</eca>
|
|
<eca service="changeOrderStatus" event="commit" run-on-error="false">
|
|
<condition field-name="statusId" operator="equals" value="ORDER_COMPLETED"/>
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
<action service="sendOrderCompleteNotification" mode="async" persist="true"/>
|
|
</eca>
|
|
|
|
<!-- eBay interface -->
|
|
<!-- if the order has been imported from eBay, set the order status in eBay to completed -->
|
|
<eca service="changeOrderStatus" event="commit" run-on-error="false">
|
|
<condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/>
|
|
<!--
|
|
These fields are not currently available in this context (i.e. they are not returned by
|
|
the changeOrderStatus service; for now the conditions are checked in the service
|
|
<condition field-name="salesChannelEnumId" operator="equals" value="EBAY_SALES_CHANNEL"/>
|
|
<condition field-name="externalId" operator="is-not-empty"/>
|
|
-->
|
|
<condition field-name="statusId" operator="equals" value="ORDER_COMPLETED"/>
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<action service="setEbayOrderToComplete" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- DISABLED FOR NOW
|
|
<eca service="changeOrderStatus" event="commit" run-on-error="false">
|
|
<condition field-name="statusId" operator="equals" value="ORDER_PROCESSING"/>
|
|
<action service="processOrderWf" mode="async" persist="true" />
|
|
</eca>
|
|
-->
|
|
|
|
<!-- This ECA is for content usage subscriptions -->
|
|
<eca service="changeOrderStatus" event="commit" run-on-error="false">
|
|
<condition field-name="statusId" operator="equals" value="ORDER_APPROVED"/>
|
|
<condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/>
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<action service="updateContentSubscriptionByOrder" mode="sync"/>
|
|
<action service="processExtendSubscriptionByOrder" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- order adjustments -->
|
|
<eca service="createOrderAdjustment" event="commit">
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateOrderAdjustment" event="commit">
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
</eca>
|
|
<eca service="deleteOrderAdjustment" event="commit">
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- edit/add order items -->
|
|
<eca service="updateOrderItems" event="commit">
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
<action service="sendOrderChangeNotification" mode="async" persist="true"/>
|
|
</eca>
|
|
<eca service="appendOrderItem" event="commit">
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- cancel order items -->
|
|
<eca service="cancelOrderItem" event="commit">
|
|
<action service="recreateOrderAdjustments" mode="sync"/>
|
|
<action service="resetGrandTotal" mode="sync"/>
|
|
<action service="sendOrderChangeNotification" mode="async" persist="true"/>
|
|
</eca>
|
|
|
|
<!-- order grand total -->
|
|
<!--
|
|
TODO: jacopoc: this is disabled for now, because it was causing problems during
|
|
order checkout under some special circumstances.
|
|
Now the processOrderPayments service is triggered only when updateOrderItems
|
|
and appendOrderItem are run (as it was before rev. 540479); this is a temp fix.
|
|
<eca service="resetGrandTotal" event="return">
|
|
<action service="processOrderPayments" mode="sync"/>
|
|
</eca>
|
|
-->
|
|
<eca service="updateOrderItems" event="return">
|
|
<action service="processOrderPayments" mode="sync"/>
|
|
</eca>
|
|
<eca service="appendOrderItem" event="return">
|
|
<action service="processOrderPayments" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- order confirmation/notification email ECAs -->
|
|
<eca service="sendOrderConfirmation" event="commit">
|
|
<action service="createOrderNotificationLog" mode="sync"/>
|
|
</eca>
|
|
<eca service="sendOrderChangeNotification" event="commit">
|
|
<action service="createOrderNotificationLog" mode="sync"/>
|
|
</eca>
|
|
<eca service="sendOrderCompleteNotification" event="commit">
|
|
<action service="createOrderNotificationLog" mode="sync"/>
|
|
</eca>
|
|
<eca service="sendOrderBackorderNotification" event="commit">
|
|
<action service="createOrderNotificationLog" mode="sync"/>
|
|
</eca>
|
|
<eca service="sendOrderPayRetryNotification" event="commit">
|
|
<action service="createOrderNotificationLog" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- Order Delivery Schedule ECAs -->
|
|
<eca service="createOrderDeliverySchedule" event="commit">
|
|
<action service="sendOrderDeliveryScheduleNotification" mode="async" persist="true"/>
|
|
</eca>
|
|
<eca service="updateOrderDeliverySchedule" event="commit">
|
|
<action service="sendOrderDeliveryScheduleNotification" mode="async" persist="true"/>
|
|
</eca>
|
|
|
|
<!-- Return ECAs -->
|
|
<eca service="updateReturnHeader" event="commit">
|
|
<action service="checkReturnComplete" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateReturnHeader" event="return">
|
|
<condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
|
|
<condition field-name="needsInventoryReceive" operator="equals" value="Y"/>
|
|
<action service="quickReceiveReturn" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateReturnHeader" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
|
|
<condition field-name="currentStatusId" operator="not-equals" value="RETURN_ACCEPTED"/>
|
|
<action service="createShipmentAndItemsForReturn" mode="sync"/>
|
|
<action service="processCrossShipReplacementReturn" mode="sync"/>
|
|
<action service="createTrackingCodeOrderReturns" mode="sync" run-as-user="system"/>
|
|
<action service="sendReturnAcceptNotification" mode="async" persist="true"/>
|
|
</eca>
|
|
<eca service="updateReturnHeader" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="RETURN_RECEIVED"/>
|
|
<condition field-name="currentStatusId" operator="not-equals" value="RETURN_RECEIVED"/>
|
|
<action service="processWaitReplacementReturn" mode="sync"/>
|
|
<action service="processRepairReplacementReturn" mode="sync"/>
|
|
<action service="processCreditReturn" mode="sync"/>
|
|
<action service="processRefundReturn" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateReturnHeader" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="RETURN_COMPLETED"/>
|
|
<condition field-name="currentStatusId" operator="not-equals" value="RETURN_COMPLETED"/>
|
|
<action service="sendReturnCompleteNotification" mode="async" persist="true"/>
|
|
<action service="processSubscriptionReturn" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateReturnHeader" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="RETURN_CANCELLED"/>
|
|
<condition field-name="currentStatusId" operator="not-equals" value="RETURN_CANCELLED"/>
|
|
<action service="cancelReturnItems" mode="sync"/>
|
|
<action service="sendReturnCancelNotification" mode="async" persist="true"/>
|
|
</eca>
|
|
|
|
<eca service="updateReturnItem" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="RETURN_CANCELLED"/>
|
|
<condition field-name="currentStatusId" operator="not-equals" value="RETURN_CANCELLED"/>
|
|
<action service="cancelReplacementOrderItems" mode="sync"/>
|
|
</eca>
|
|
|
|
<eca service="updateReturnStatusFromReceipt" event="global-commit">
|
|
<condition field-name="returnHeaderStatus" operator="equals" value="RETURN_RECEIVED"/>
|
|
<action service="processWaitReplacementReturn" mode="sync"/>
|
|
<action service="processRepairReplacementReturn" mode="sync"/>
|
|
<action service="processCreditReturn" mode="sync"/>
|
|
<action service="processRefundReturn" mode="sync"/>
|
|
</eca>
|
|
|
|
<eca service="processReplacementReturn" event="commit">
|
|
<action service="checkReturnComplete" mode="sync"/>
|
|
</eca>
|
|
<eca service="processCreditReturn" event="commit">
|
|
<action service="checkReturnComplete" mode="sync"/>
|
|
</eca>
|
|
<eca service="processRefundReturn" event="commit">
|
|
<action service="checkReturnComplete" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- ShoppingList ECAs -->
|
|
<eca service="createShoppingList" event="in-validate">
|
|
<condition field-name="shippingMethodString" operator="is-not-empty"/>
|
|
<action service="splitShipmentMethodString" mode="sync" result-to-context="true"/>
|
|
</eca>
|
|
<eca service="updateShoppingList" event="in-validate">
|
|
<condition field-name="shippingMethodString" operator="is-not-empty"/>
|
|
<action service="splitShipmentMethodString" mode="sync" result-to-context="true"/>
|
|
</eca>
|
|
<eca service="createShoppingList" event="in-validate">
|
|
<condition field-name="frequency" operator="is-not-empty"/>
|
|
<action service="createShoppingListRecurrence" mode="sync" result-to-context="true"/>
|
|
</eca>
|
|
<eca service="updateShoppingList" event="in-validate">
|
|
<condition field-name="frequency" operator="is-not-empty"/>
|
|
<action service="createShoppingListRecurrence" mode="sync" result-to-context="true"/>
|
|
</eca>
|
|
|
|
<eca service="createShoppingListItem" event="in-validate">
|
|
<condition field-name="shoppingListId" operator="is-empty"/>
|
|
<action service="createShoppingList" mode="sync" result-to-context="true"/>
|
|
</eca>
|
|
|
|
<eca service="storeOrder" event="commit">
|
|
<action service="updateShoppingListQuantitiesFromOrder" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- CustRequest ECAs -->
|
|
<eca service="createCustRequest" event="commit">
|
|
<condition field-name="communicationEventId" operator="is-not-empty"/>
|
|
<condition field-name="custRequestId" operator="is-not-empty"/>
|
|
<action service="updateCommunicationEvent" mode="sync"/>
|
|
</eca>
|
|
|
|
<eca service="createCustRequest" event="commit">
|
|
<condition field-name="communicationEventId" operator="is-not-empty"/>
|
|
<condition field-name="custRequestId" operator="is-not-empty"/>
|
|
<action service="updateCommunicationEvent" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- Requirement / CustRequestItem association event -->
|
|
<eca service="createRequirement" event="commit">
|
|
<condition field-name="custRequestId" operator="is-not-empty"/>
|
|
<condition field-name="custRequestItemSeqId" operator="is-not-empty"/>
|
|
<action service="associatedRequirementWithRequestItem" mode="sync"/>
|
|
</eca>
|
|
|
|
<eca service="createRequirement" event="commit">
|
|
<condition field-name="productId" operator="is-not-empty"/>
|
|
<condition field-name="requirementTypeId" operator="equals" value="PRODUCT_REQUIREMENT"/>
|
|
<action service="autoAssignRequirementToSupplier" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- Requirement / stock level -->
|
|
<eca service="createItemIssuance" event="invoke">
|
|
<condition field-name="quantity" value="0" operator="greater" type="Double"/>
|
|
<action service="checkCreateStockRequirementQoh" mode="sync" run-as-user="system"/>
|
|
</eca>
|
|
<eca service="updateItemIssuance" event="invoke">
|
|
<condition field-name="quantity" value="0" operator="greater" type="Double"/>
|
|
<action service="checkCreateStockRequirementQoh" mode="sync" run-as-user="system"/>
|
|
</eca>
|
|
<eca service="reserveOrderItemInventory" event="commit">
|
|
<condition field-name="quantity" value="0" operator="greater" type="Double"/>
|
|
<action service="checkCreateStockRequirementAtp" mode="sync" run-as-user="system"/>
|
|
</eca>
|
|
<!-- create the automatic and ATP requirements for sales orders but only if the status changes from created to approved -->
|
|
<eca service="changeOrderStatus" event="commit" run-on-error="false">
|
|
<condition field-name="oldStatusId" operator="equals" value="ORDER_CREATED"/>
|
|
<condition field-name="statusId" operator="equals" value="ORDER_APPROVED"/>
|
|
<condition field-name="orderTypeId" operator="equals" value="SALES_ORDER"/>
|
|
<action service="createAutoRequirementsForOrder" mode="sync"/>
|
|
<action service="createATPRequirementsForOrder" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- WorkEffort -->
|
|
<eca service="createQuoteWorkEffort" event="invoke">
|
|
<condition field-name="workEffortId" operator="is-empty" />
|
|
<action service="createWorkEffort" mode="sync"/>
|
|
</eca>
|
|
</service-eca> |