[ https://issues.apache.org/jira/browse/OFBIZ-12717?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marie-Aline Pantais updated OFBIZ-12717: ---------------------------------------- Description: 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() > 0 had to be queryCount() > 0 return error had to be return failure was: Groovy migration Before migration was {{<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>}} ) After migration is {color:#cc7832}if {color}{color:#54a857}({color}from{color:#359ff4}({color}{color:#6a8759}"OrderPaymentPrefAndPayment"{color}{color:#359ff4}) {color}{color:#359ff4} {color}.where{color:#359ff4}({color}{color:#e8ba36}[{color}EntityCondition.{color:#9876aa}makeCondition{color}{color:#5060bb}({color}{color:#6a8759}"orderId"{color}, orderHeader.{color:#6a8759}orderId{color}{color:#5060bb}){color}, EntityCondition.{color:#9876aa}makeCondition{color}{color:#5060bb}({color}{color:#6a8759}"statusId"{color}, EntityOperator.{color:#9876aa}NOT_EQUAL{color}, {color:#6a8759}"PAYMENT_CANCELLED"{color}{color:#5060bb}){color}{color:#e8ba36}]{color}{color:#359ff4}) {color}{color:#359ff4} {color}.queryCount{color:#359ff4}() {color}> {color:#6897bb}1{color}{color:#54a857}) {color}{color:#359ff4}{ {color}{color:#359ff4} {color}{color:#cc7832}return {color}error{color:#359ff4}({color}{color:#e8ba36}"{color}{color:#6a8759}Payment not created for order {color}${color:#5060bb}{{color}orderHeader.{color:#6a8759}orderId{color}{color:#5060bb}}{color}{color:#6a8759}, at least a single payment already exists{color}{color:#e8ba36}"{color}{color:#359ff4}) {color}{color:#359ff4}} {color} {color:#359ff4}queryCount() > 0 had to be queryCount() > 0 return error had to be return failure{color} > 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 > Priority: Major > 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() > 0 had to be queryCount() > 0 > return error had to be return failure > -- This message was sent by Atlassian Jira (v8.20.10#820010)