blob: 920d9c4cf7280c07bfc470fc9cc39b6e34b5a888 [file] [log] [blame]
<?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">
<!-- this eca automatically posts the accounting transactions to GL -->
<eca service="createAcctgTransAndEntries" event="commit">
<condition field-name="acctgTransId" operator="is-not-empty"/>
<action service="postAcctgTrans" mode="sync"/>
</eca>
<!-- create the accounting transactions for a sales shipment issuance every time the inventory is issued to the shipment -->
<eca service="createItemIssuance" event="commit">
<condition field-name="orderId" operator="is-not-empty"/>
<condition field-name="inventoryItemId" operator="is-not-empty"/>
<!-- Ignore the inventory shipment if affectAccounting set as false -->
<condition field-name="affectAccounting" operator="equals" value="true" type="Boolean"/>
<action service="createAcctgTransForSalesShipmentIssuance" mode="sync"/>
</eca>
<!-- create an accounting transactions every time an issuance to sales shipment is canceled -->
<eca service="cancelOrderItemIssuanceFromSalesShipment" event="commit">
<condition field-name="canceledQuantity" operator="greater" value="0" type="BigDecimal"/>
<action service="createAcctgTransForCanceledSalesShipmentIssuance" mode="sync"/>
</eca>
<!-- create the accounting transactions for a shipment receipt every time the inventory is received -->
<eca service="createShipmentReceipt" event="commit">
<!-- Ignore the inventory shipment if affectAccounting set as false -->
<condition field-name="affectAccounting" operator="equals" value="true" type="Boolean"/>
<action service="createAcctgTransForShipmentReceipt" mode="sync"/>
</eca>
<!-- work effort related transactions -->
<eca service="assignInventoryToWorkEffort" event="commit">
<action service="createAcctgTransForWorkEffortIssuance" mode="sync"/>
</eca>
<eca service="createWorkEffortInventoryProduced" event="commit">
<action service="createAcctgTransForWorkEffortInventoryProduced" mode="sync"/>
</eca>
<eca service="createCostComponent" event="commit">
<condition field-name="workEffortId" operator="is-not-empty"/>
<condition field-name="costComponentTypeId" operator="not-equals" value="ACTUAL_MAT_COST"/>
<action service="createAcctgTransForWorkEffortCost" mode="sync"/>
</eca>
<eca service="updateInventoryItem" event="commit">
<condition field-name="ownerPartyId" operator="is-not-empty"/>
<condition-field field-name="ownerPartyId" operator="not-equals" to-field-name="oldOwnerPartyId"/>
<action service="createAcctgTransForInventoryItemOwnerChange" mode="sync"/>
</eca>
<!-- creating inventory item detail when unitCost is not empty and receiptId is empty -->
<eca service="createInventoryItemDetail" event="commit">
<condition field-name="unitCost" operator="is-not-empty"/>
<condition field-name="receiptId" operator="is-empty"/>
<action service="createAcctgTransForInventoryItemCostChange" mode="sync"/>
</eca>
<!-- attempt to create AcctgTrans Physical Inventory Variance when Physical InventoryAndVariance is created-->
<eca service="createPhysicalInventoryAndVariance" event="commit">
<condition field-name="physicalInventoryId" operator="is-not-empty"/>
<action service="createAcctgTransForPhysicalInventoryVariance" mode="sync"/>
</eca>
<!--create the accounting transactions when Fixed AssetMaint Issuance issues Inventory for fixed asset maintenance-->
<eca service="createItemIssuance" event="commit">
<condition field-name="fixedAssetId" operator="is-not-empty"/>
<action service="createAcctgTransForFixedAssetMaintIssuance" mode="sync"/>
</eca>
<!-- accounting transactions for Purchase (AP) and Sales Invoices (AR) -->
<eca service="setInvoiceStatus" event="commit">
<condition field-name="invoiceId" operator="is-not-empty"/>
<condition field-name="invoiceTypeId" operator="not-equals" value="CUST_RTN_INVOICE"/>
<condition field-name="statusId" operator="equals" value="INVOICE_READY"/>
<condition field-name="oldStatusId" operator="not-equals" value="INVOICE_READY"/>
<condition field-name="oldStatusId" operator="not-equals" value="INVOICE_PAID"/>
<action service="createAcctgTransForPurchaseInvoice" mode="sync"/>
<action service="createAcctgTransForSalesInvoice" mode="sync"/>
</eca>
<eca service="setInvoiceStatus" event="commit">
<condition field-name="invoiceId" operator="is-not-empty"/>
<condition field-name="invoiceTypeId" operator="equals" value="CUST_RTN_INVOICE"/>
<condition field-name="statusId" operator="equals" value="INVOICE_READY"/>
<condition field-name="oldStatusId" operator="not-equals" value="INVOICE_READY"/>
<condition field-name="oldStatusId" operator="not-equals" value="INVOICE_PAID"/>
<action service="createAcctgTransForCustomerReturnInvoice" mode="sync"/>
</eca>
<eca service="setInvoiceStatus" event="commit">
<condition field-name="invoiceId" operator="is-not-empty"/>
<condition field-name="statusId" operator="equals" value="INVOICE_CANCELLED"/>
<action service="cancelInvoice" mode="sync"/>
</eca>
<!-- accounting transactions for Incoming Payment (AR) -->
<eca service="createPayment" event="commit">
<condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
<action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>
<eca service="setPaymentStatus" event="commit">
<condition field-name="statusId" operator="equals" value="PMNT_RECEIVED"/>
<condition field-name="oldStatusId" operator="not-equals" value="PMNT_RECEIVED"/>
<condition field-name="oldStatusId" operator="not-equals" value="PMNT_CONFIRMED"/>
<action service="createAcctgTransAndEntriesForIncomingPayment" mode="sync"/>
</eca>
<!-- accounting transactions for Outgoing Payment (AP) -->
<eca service="createPayment" event="commit">
<condition field-name="statusId" operator="equals" value="PMNT_SENT"/>
<action service="createAcctgTransAndEntriesForOutgoingPayment" mode="sync"/>
</eca>
<eca service="setPaymentStatus" event="commit">
<condition field-name="statusId" operator="equals" value="PMNT_SENT"/>
<condition field-name="oldStatusId" operator="not-equals" value="PMNT_SENT"/>
<condition field-name="oldStatusId" operator="not-equals" value="PMNT_CONFIRMED"/>
<action service="createAcctgTransAndEntriesForOutgoingPayment" mode="sync"/>
</eca>
<eca service="createPaymentApplication" event="commit">
<condition field-name="invoiceId" operator="is-not-empty"/>
<condition field-name="paymentTypeId" operator="not-equals" value="CUSTOMER_REFUND"/>
<action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/>
</eca>
<eca service="createPaymentApplication" event="commit">
<condition field-name="invoiceId" operator="is-not-empty"/>
<condition field-name="paymentTypeId" operator="equals" value="CUSTOMER_REFUND"/>
<action service="createAcctgTransAndEntriesForCustomerRefundPaymentApplication" mode="sync"/>
</eca>
<!-- set GlReconciliation status after creating GlReconciliation Entries -->
<eca service="createGlReconciliationEntry" event="commit">
<condition field-name="statusId" operator="is-not-empty"/>
<action service="setGlReconciliationStatus" mode="sync"/>
</eca>
<!-- If the accounting transaction that is posted is a depreciation transaction for a fixed asset, update the depreciation amount in the FixedAsset entity -->
<eca service="postAcctgTrans" event="commit">
<condition field-name="verifyOnly" operator="not-equals" value="true"/>
<action service="checkUpdateFixedAssetDepreciation" mode="sync"/>
</eca>
</service-eca>