[ 
https://issues.apache.org/jira/browse/OFBIZ-5414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13838076#comment-13838076
 ] 

Christian Carlow commented on OFBIZ-5414:
-----------------------------------------

The createOrderPaymentApplication is the simple-method responsible for applying 
the payments to invoices. It is triggered by the seca rule for 
createOrderPaymentApplication which is called by receiveOfflinePayment in 
OrderManagerEvents.java when the payment is received.  The 
createOrderPaymentApplication simple-method only gets the first invoiceId in 
the list of OrderItemBilling entity records so it never accounts for the 
existence of multiple invoices.  

The payment form should be changed to use something similar to the 
editPaymentApplications page which provides a list of invoices to which 
payments can be applied.

> Incorrect invoice application behavior when receiving payments for sales 
> orders with multiple invoices
> ------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5414
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5414
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting, order
>    Affects Versions: SVN trunk
>            Reporter: Christian Carlow
>
> Payments are incorrectly applied to the first invoice when received for sales 
> order having multiple invoices.  Once sufficient payment amounts have been 
> received to fulfill the first invoice, the status changes to PAID but 
> payments are still applied afterwards when received causing the total amount 
> due to become negative.
> I think the payment form should be improved to account for multiple invoices.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to