diff --git a/applications/accounting/groovyScripts/payment/PaymentServices.groovy b/applications/accounting/groovyScripts/payment/PaymentServices.groovy index cfa29b8630..b3bade612c 100644 --- a/applications/accounting/groovyScripts/payment/PaymentServices.groovy +++ b/applications/accounting/groovyScripts/payment/PaymentServices.groovy @@ -444,6 +444,28 @@ def cancelCheckRunPayments() { return success() } +def createPaymentGroupAndMember() { + serviceResult = success() + parameters.fromDate = parameters.fromDate ?: UtilDateTime. nowTimestamp() + parameters.paymentGroupName = parameters.paymentGroupName ?: 'Payment Group Name' + + Map result = run service: 'createPaymentGroup', with: parameters + if (ServiceUtil.isError(result)) { + return result + } + String paymentGroupId = result.paymentGroupId + + parameters.paymentIds.each { paymentId -> + result = run service: 'createPaymentGroupMember', with: [paymentGroupId: paymentGroupId, + fromDate : parameters.fromDate, + paymentId : paymentId] + if (ServiceUtil.isError(result)) { + return result + } + } + return success(paymentGroupId: paymentGroupId) +} + def createPaymentAndPaymentGroupForInvoices() { Map result GenericValue paymentMethod = from("PaymentMethod").where("paymentMethodId", parameters.paymentMethodId).queryOne() diff --git a/applications/accounting/minilang/payment/PaymentServices.xml b/applications/accounting/minilang/payment/PaymentServices.xml index d7f112bba5..b5d27d2cc0 100644 --- a/applications/accounting/minilang/payment/PaymentServices.xml +++ b/applications/accounting/minilang/payment/PaymentServices.xml @@ -19,77 +19,8 @@ under the License. --> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -136,26 +67,6 @@ under the License. - - - - - - - - - - - - - - - - - - - - diff --git a/applications/accounting/servicedef/services_payment.xml b/applications/accounting/servicedef/services_payment.xml index c244812b81..96c79fed2b 100644 --- a/applications/accounting/servicedef/services_payment.xml +++ b/applications/accounting/servicedef/services_payment.xml @@ -187,8 +187,8 @@ under the License. - +