You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "Jacques Le Roux (Jira)" <ji...@apache.org> on 2022/12/04 09:29:00 UTC

[jira] [Closed] (OFBIZ-12717) Eca createPaymentFromOrder failed if payment already exist

     [ https://issues.apache.org/jira/browse/OFBIZ-12717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jacques Le Roux closed OFBIZ-12717.
-----------------------------------
    Fix Version/s: 22.01.01
       Resolution: Fixed

> Eca createPaymentFromOrder failed if payment already exist
> ----------------------------------------------------------
>
>                 Key: OFBIZ-12717
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-12717
>             Project: OFBiz
>          Issue Type: Bug
>          Components: accounting
>    Affects Versions: 22.01.01
>            Reporter: Marie-Aline Pantais
>            Assignee: Jacques Le Roux
>            Priority: Major
>             Fix For: 22.01.01
>
>         Attachments: OFBIZ-12717.patch
>
>
> Groovy migration
> Before migration  was
>  
> {code:java}
> <if-not-empty field="orderPaymentPrefAndPayments">
>   <log level="info" message="Payment not created for order ${orderHeader.orderId}, at least a single payment already exists"/>
>   <return/>
> </if-not-empty> ){code}
>  
> After migration is
>  
> {code:java}
> if (from("OrderPaymentPrefAndPayment")
>         .where([EntityCondition.makeCondition("orderId", orderHeader.orderId),
>                 EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PAYMENT_CANCELLED")])
>         .queryCount() > 1) {
>     return error("Payment not created for order ${orderHeader.orderId}, at least a single payment already exists")
> }
> {code}
> queryCount() > 1 had to be queryCount() > 0
> return error had to be return failure
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)