This is an automated email from the ASF dual-hosted git repository.
nmalin pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/release24.09 by this push:
new ce43a0c638 Fixed: Purchase Order approval fails when payment auto
create config is disabled (OFBiz-13335)
ce43a0c638 is described below
commit ce43a0c6381fc7bb4da263c678d560b95a018a17
Author: Nicolas Malin <[email protected]>
AuthorDate: Thu Jan 8 14:34:08 2026 +0100
Fixed: Purchase Order approval fails when payment auto create config is
disabled (OFBiz-13335)
When purchase order should be approved with no payment records generated,
the payment service failed with an error that rollback the process instead
finish as success.
Thanks to Nameet Jain for fixed this issue
---
.../apache/ofbiz/accounting/payment/PaymentServices.groovy | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git
a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/PaymentServices.groovy
b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/PaymentServices.groovy
index 8e536328b7..8a58107cec 100644
---
a/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/PaymentServices.groovy
+++
b/applications/accounting/src/main/groovy/org/apache/ofbiz/accounting/payment/PaymentServices.groovy
@@ -611,16 +611,20 @@ Map createPaymentFromOrder() {
GenericValue orderHeader = from('OrderHeader').where(parameters).queryOne()
if (orderHeader) {
if (orderHeader.orderTypeId == 'PURCHASE_ORDER') {
- String purchaseAutoCreate =
UtilProperties.getPropertyValue('accounting',
'accounting.payment.purchaseorder.autocreate', 'Y')
+ String purchaseAutoCreate =
EntityUtilProperties.getPropertyValue('accounting',
+ 'accounting.payment.purchaseorder.autocreate', 'Y',
delegator)
if (purchaseAutoCreate != 'Y') {
- return error('payment not created from approved order because
config' +
- ' (accounting.payment.salesorder.autocreate) is not
set to Y (accounting.properties)')
+ logInfo('payment not created from approved order because
config' +
+ '(accounting.payment.purchaseorder.autocreate) is not
set to Y (accounting.properties)')
+ return success()
}
} else if (orderHeader.orderTypeId == 'SALES_ORDER') {
- String salesAutoCreate =
UtilProperties.getPropertyValue('accounting',
'accounting.payment.salesorder.autocreate', 'Y')
+ String salesAutoCreate =
EntityUtilProperties.getPropertyValue('accounting',
+ 'accounting.payment.salesorder.autocreate', 'Y', delegator)
if (salesAutoCreate != 'Y') {
- return error('payment not created from approved order because
config' +
+ logInfo('payment not created from approved order because
config' +
' (accounting.payment.salesorder.autocreate) is not
set to Y (accounting.properties)')
+ return success()
}
}