This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new a17b77e  Fixed: Create return is not working on demo trunk 
(OFBIZ-12282)
a17b77e is described below

commit a17b77ea28ea4dacdb782061db3a6ad2add4055c
Author: Jacques Le Roux <[email protected]>
AuthorDate: Thu Sep 30 15:25:09 2021 +0200

    Fixed: Create return is not working on demo trunk (OFBIZ-12282)
    
    Weirdly (I guess I did not save) this syntax did not work 1st time I tried 
it
---
 applications/order/groovyScripts/order/OrderReturnServices.groovy | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/applications/order/groovyScripts/order/OrderReturnServices.groovy 
b/applications/order/groovyScripts/order/OrderReturnServices.groovy
index 5ecdac3..ac7e414 100644
--- a/applications/order/groovyScripts/order/OrderReturnServices.groovy
+++ b/applications/order/groovyScripts/order/OrderReturnServices.groovy
@@ -95,16 +95,13 @@ def createReturnHeader() {
                                                                             
userLogin: systemLogin]
     GenericValue partyAcctgPreference = serviceResult.partyAccountingPreference
 
-    if (partyAcctgPreference) {
-        if ("Y" == partyAcctgPreference.useInvoiceIdForReturns) {
+    if (partyAcctgPreference && "Y" == 
partyAcctgPreference.useInvoiceIdForReturns) {
             Map serviceResultInvoice = run service: "getNextInvoiceId", with: 
[partyId: parameters.toPartyId]
             newEntity.returnId = serviceResultInvoice.invoiceId
-        } else {
-            newEntity.returnId = delegator.getNextSeqId("ReturnHeader")
-        }
     } else {
         newEntity.returnId = delegator.getNextSeqId("ReturnHeader")
     }
+
     result.returnId = newEntity.returnId
 
     boolean hasCreatePermission = security.hasEntityPermission("ORDERMGR", 
"_CREATE", parameters.userLogin)

Reply via email to