[OFBIZ-4516] Commit fixes bug in Invoice cancel process. Martin Kreidenweis, Thanks for reporting and providing fix patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1189601 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Anil Patel
2011-10-27 04:14:06 +00:00
parent b2b1ce7f61
commit 7f1e47817e
3 changed files with 29 additions and 0 deletions
@@ -720,6 +720,25 @@ under the License.
</iterate>
</simple-method>
<simple-method method-name="resetOrderItemBillingAndOrderAdjustmentBillingOnCancelInvoice"
short-description="Reset OrderItemBilling and OrderAdjustmentBilling records on cancel invoice, so it is isn't considered invoiced any more by createInvoiceForOrder service">
<entity-and entity-name="OrderItemBilling" list="orderItemBillings">
<field-map field-name="invoiceId" from-field="parameters.invoiceId"/>
</entity-and>
<iterate entry="orderItemBilling" list="orderItemBillings">
<set field="orderItemBilling.quantity" value="0" type="BigDecimal"/>
<store-value value-field="orderItemBilling"/>
</iterate>
<entity-and entity-name="OrderAdjustmentBilling" list="orderAdjustmentBillings">
<field-map field-name="invoiceId" from-field="parameters.invoiceId"/>
</entity-and>
<iterate entry="orderAdjustmentBilling" list="orderAdjustmentBillings">
<set field="orderAdjustmentBilling.amount" value="0" type="BigDecimal"/>
<store-value value-field="orderAdjustmentBilling"/>
</iterate>
</simple-method>
<simple-method method-name="massChangeInvoiceStatus" short-description="Service set status of Invoices in bulk.">
<iterate list="parameters.invoiceIds" entry="invoiceId">
<set field="setInvoiceStatusMap.invoiceId" from-field="invoiceId"/>
@@ -32,6 +32,10 @@ under the License.
<action service="removeInvoiceItemAssocOnCancelInvoice" mode="sync"/>
</eca>
<eca service="cancelInvoice" event="commit">
<action service="resetOrderItemBillingAndOrderAdjustmentBillingOnCancelInvoice" mode="sync"/>
</eca>
<eca service="setInvoiceStatus" event="commit">
<condition operator="equals" field-name="statusId" value="INVOICE_APPROVED"/>
<condition operator="not-equals" field-name="oldStatusId" value="INVOICE_APPROVED"/>
@@ -363,6 +363,12 @@ under the License.
<attribute name="invoiceId" type="String" mode="IN" optional="false"/>
</service>
<service name="resetOrderItemBillingAndOrderAdjustmentBillingOnCancelInvoice" engine="simple"
location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="resetOrderItemBillingAndOrderAdjustmentBillingOnCancelInvoice" auth="true">
<description>Reset OrderItemBilling and OrderAdjustmentBilling records on cancel invoice, so it is isn't considered invoiced any more by createInvoiceForOrder service</description>
<attribute name="invoiceId" type="String" mode="IN" optional="false"/>
</service>
<service name="massChangeInvoiceStatus" engine="simple"
location="component://accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml" invoke="massChangeInvoiceStatus" auth="true">
<description>Set status of invoices in bulk.</description>