- Adding logic to createInvoicesFromShipments service to deal with creating both purchase invoices for drop shipment orders and sales invoices for the sales order linked to drop shipment orders - a sales invoice is created if the createSalesInvoicesForDropShipments parameter is true. - Adding createSalesInvoiceFromDropShipment service to wrap call to createInvoicesFromShipments, passing the createSalesInvoicesForDropShipments parameter. - Adding SECAs on updateShipment to generate a purchase invoice when a drop shipment is shipped and a sales invoice when a drop shipment is received - Adding quickDropShipOrder service, linked from orderview page, to create a drop shipment and set the shipment status to shipped and then received, in order to trigger the SECAs for drop shipment invoice generation. - Fixed flaw in createInvoiceForOrder service - now pro-rating OrderAdjustments based on OrderItem quantity from the database instead of the passed-in OrderItem, in case the OrderItem quantity has been replaced upstream. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@510664 13f79535-47bb-0310-9956-ffa450edef68
140 lines
7.4 KiB
XML
140 lines
7.4 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://www.ofbiz.org/dtds/service-eca.xsd">
|
|
<!-- if new statusId of a SALES_SHIPMENT is SHIPMENT_PACKED, create invoice -->
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<condition field-name="statusId" operator="equals" value="SHIPMENT_PACKED"/>
|
|
<condition field-name="shipmentTypeId" operator="equals" value="SALES_SHIPMENT"/>
|
|
<action service="createInvoicesFromShipment" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- if new statusId of a PURCHASE_SHIPMENT is PURCH_SHIP_RECEIVED, create invoice -->
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<condition field-name="statusId" operator="equals" value="PURCH_SHIP_RECEIVED"/>
|
|
<condition field-name="shipmentTypeId" operator="equals" value="PURCHASE_SHIPMENT"/>
|
|
<action service="balanceItemIssuancesForShipment" mode="sync"/>
|
|
<action service="createInvoicesFromShipment" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- if new statusId of a DROP_SHIPMENT is PURCH_SHIP_SHIPPED, create purchase invoice -->
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<condition field-name="statusId" operator="equals" value="PURCH_SHIP_SHIPPED"/>
|
|
<condition field-name="shipmentTypeId" operator="equals" value="DROP_SHIPMENT"/>
|
|
<action service="createInvoicesFromShipment" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- if new statusId of a DROP_SHIPMENT is PURCH_SHIP_RECEIVED, create sales invoice -->
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<condition field-name="statusId" operator="equals" value="PURCH_SHIP_RECEIVED"/>
|
|
<condition field-name="shipmentTypeId" operator="equals" value="DROP_SHIPMENT"/>
|
|
<action service="createSalesInvoicesFromDropShipment" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- if new statusId of a SALES_RETURN is PURCH_SHIP_RECEIVED, create a return invoice.
|
|
Note that PURCH_SHIP_RECEIVED now means any received shipment. We determine the
|
|
type of shipment by the shipmentTypeId. -->
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<condition field-name="statusId" operator="equals" value="PURCH_SHIP_RECEIVED"/>
|
|
<condition field-name="shipmentTypeId" operator="equals" value="SALES_RETURN"/>
|
|
<action service="createInvoicesFromReturnShipment" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- if new statusId is SHIPMENT_SCHEDULED, send notification -->
|
|
<eca service="createShipment" event="commit">
|
|
<condition field-name="statusId" operator="equals" value="SHIPMENT_SCHEDULED"/>
|
|
<action service="sendShipmentScheduledNotification" mode="async"/>
|
|
</eca>
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/>
|
|
<condition field-name="statusId" operator="equals" value="SHIPMENT_SCHEDULED"/>
|
|
<action service="sendShipmentScheduledNotification" mode="async"/>
|
|
</eca>
|
|
|
|
<!-- if new originFacilityId or destinationFacilityId, get settings from facilities -->
|
|
<eca service="createShipment" event="commit">
|
|
<condition field-name="originFacilityId" operator="is-not-empty"/>
|
|
<action service="setShipmentSettingsFromFacilities" mode="sync"/>
|
|
</eca>
|
|
<eca service="createShipment" event="commit">
|
|
<condition field-name="destinationFacilityId" operator="is-not-empty"/>
|
|
<action service="setShipmentSettingsFromFacilities" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="originFacilityId" operator="not-equals" to-field-name="oldOriginFacilityId"/>
|
|
<condition field-name="originFacilityId" operator="is-not-empty"/>
|
|
<action service="setShipmentSettingsFromFacilities" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="destinationFacilityId" operator="not-equals" to-field-name="oldDestinationFacilityId"/>
|
|
<condition field-name="destinationFacilityId" operator="is-not-empty"/>
|
|
<action service="setShipmentSettingsFromFacilities" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- if new primaryOrderId, get settings from order -->
|
|
<eca service="createShipment" event="commit">
|
|
<condition field-name="primaryOrderId" operator="is-not-empty"/>
|
|
<action service="setShipmentSettingsFromPrimaryOrder" mode="sync"/>
|
|
</eca>
|
|
<eca service="updateShipment" event="commit">
|
|
<condition-field field-name="primaryOrderId" operator="not-equals" to-field-name="oldPrimaryOrderId"/>
|
|
<condition field-name="primaryOrderId" operator="is-not-empty"/>
|
|
<action service="setShipmentSettingsFromPrimaryOrder" mode="sync"/>
|
|
</eca>
|
|
|
|
<eca service="createShipmentReceipt" event="commit">
|
|
<condition field-name="returnId" operator="is-not-empty"/>
|
|
<action service="checkDecomposeInventoryItem" mode="sync"/>
|
|
<action service="updateReturnStatusFromReceipt" mode="sync"/>
|
|
</eca>
|
|
<eca service="createShipmentReceipt" event="commit">
|
|
<condition field-name="orderId" operator="is-not-empty"/>
|
|
<action service="updateOrderStatusFromReceipt" mode="sync"/>
|
|
</eca>
|
|
<eca service="createShipmentReceipt" event="commit">
|
|
<condition field-name="shipmentId" operator="is-not-empty"/>
|
|
<action service="checkDecomposeInventoryItem" mode="sync"/>
|
|
<action service="updatePurchaseShipmentFromReceipt" mode="sync"/>
|
|
</eca>
|
|
|
|
<eca service="createShipmentPackageContent" event="in-validate">
|
|
<condition field-name="shipmentPackageSeqId" operator="equals" value="New"/>
|
|
<action service="createShipmentPackage" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- picking ecas -->
|
|
<eca service="updatePicklistItem" event="commit">
|
|
<condition-field field-name="itemStatusId" operator="not-equals" to-field-name="oldItemStatusId"/>
|
|
<action service="checkPicklistBinItemStatuses" mode="sync"/>
|
|
</eca>
|
|
|
|
<!-- packing ecas -->
|
|
<eca service="packBulkItems" event="commit">
|
|
<condition field-name="nextPackageSeq" operator="equals" value="0"/>
|
|
<action service="setNextPackageSeq" mode="sync"/>
|
|
</eca>
|
|
</service-eca>
|