Author: apatel
Date: Thu Oct 27 04:14:06 2011 New Revision: 1189601 URL: http://svn.apache.org/viewvc?rev=1189601&view=rev Log: [OFBIZ-4516] Commit fixes bug in Invoice cancel process. Martin Kreidenweis, Thanks for reporting and providing fix patch. Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml ofbiz/trunk/applications/accounting/servicedef/secas_invoice.xml ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml?rev=1189601&r1=1189600&r2=1189601&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml (original) +++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/invoice/InvoiceServices.xml Thu Oct 27 04:14:06 2011 @@ -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"/> Modified: ofbiz/trunk/applications/accounting/servicedef/secas_invoice.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas_invoice.xml?rev=1189601&r1=1189600&r2=1189601&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/secas_invoice.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/secas_invoice.xml Thu Oct 27 04:14:06 2011 @@ -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"/> Modified: ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml?rev=1189601&r1=1189600&r2=1189601&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_invoice.xml Thu Oct 27 04:14:06 2011 @@ -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> |
Free forum by Nabble | Edit this page |