Payment capture is now triggered when invoice status is moved to Ready status. This event is removed from createInvoiceForOrder service. This work in following manner.
(Modified notes from Jacopo on dev list)
a) if ProductStore.autoApproveInvoice = Y then the invoice will be automatically moved to the ready status, this will trigger the capturePaymentsByInvoice service 
   and everything will work as now.
b) if ProductStore.autoApproveInvoice = N then the invoice will stay in the in-process status and payments will not be captured.

Redesigned the ECA rules as

updateShipment --> PICKED: trigger createInvoicesFromShipment (invoice in status IN PROCESS is created)
ProductStore.autoApproveInvoice = Y: calls setInvoiceStatus to move the invoice status to READY. setInvoiceStatus trigger capturePaymentsByInvoice.
updateShipment --> PACKED: trigger createInvoicesFromShipment and setInvoicesToReadyFromShipment. The former creates invoice(s) for missing ones and the latter moves the 
status of invoice to READY using setInvoiceStatus service. The setInvoiceStatus trigger capturePaymentsByInvoice.

Patch applied from OFBIZ-2740 (https://issues.apache.org/jira/browse/OFBIZ-2740)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@795809 13f79535-47bb-0310-9956-ffa450edef68
4 files changed