You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2017/07/09 08:57:20 UTC

svn commit: r1801355 - in /ofbiz/ofbiz-framework/trunk/applications/accounting: groovyScripts/agreement/AgreementServices.groovy minilang/test/AutoAcctgAgreementTests.xml servicedef/services_agreement.xml webapp/accounting/WEB-INF/controller.xml

Author: deepak
Date: Sun Jul  9 08:57:20 2017
New Revision: 1801355

URL: http://svn.apache.org/viewvc?rev=1801355&view=rev
Log:
Improved: Remove cancelAgreement service and added expireAgreement entity-auto service. (OFBIZ-9480)

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/agreement/AgreementServices.groovy
    ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoAcctgAgreementTests.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_agreement.xml
    ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/agreement/AgreementServices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/agreement/AgreementServices.groovy?rev=1801355&r1=1801354&r2=1801355&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/agreement/AgreementServices.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/agreement/AgreementServices.groovy Sun Jul  9 08:57:20 2017
@@ -30,23 +30,9 @@
  * under the License.
  */
 
-import org.apache.ofbiz.base.util.UtilDateTime
 import org.apache.ofbiz.service.ServiceUtil
 
 /**
- * Cancel an existing Agreement
- */
-
-def cancelAgreement() {
-    agreement = from('Agreement').where('agreementId', parameters.agreementId).queryOne();
-    if (agreement) {
-        agreement.thruDate = UtilDateTime.nowTimestamp();
-        agreement.store();
-    }
-    return success()
-}
-
-/**
  * Copy an existing Agreement
  */
 
@@ -69,7 +55,7 @@ def copyAgreement() {
             agreementTerms.each { agreementTerm ->
                 Map createAgreementTermInMap = dispatcher.getDispatchContext().makeValidContext('createAgreementTerm', 'IN', agreementTerm)
                 createAgreementTermInMap.agreementId = agreementIdTo
-                result = run service: 'createAgreementTerm', with: createAgreementTermInMap
+                result = run service: 'createAgreementTerm', with: d
             }
         }
         if (parameters.copyAgreementProducts && parameters.copyAgreementProducts == 'Y') {

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoAcctgAgreementTests.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoAcctgAgreementTests.xml?rev=1801355&r1=1801354&r2=1801355&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoAcctgAgreementTests.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/minilang/test/AutoAcctgAgreementTests.xml Sun Jul  9 08:57:20 2017
@@ -26,7 +26,7 @@ under the License.
             <field-map field-name="userLoginId" value="system"/>
         </entity-one>
         <set field="serviceCtx.userLogin" from-field="userLogin"/>
-        <call-service service-name="cancelAgreement" in-map-name="serviceCtx"/>
+        <call-service service-name="expireAgreement" in-map-name="serviceCtx"/>
         <now-timestamp field="nowTimestamp"/>
  
         <entity-one entity-name="Agreement" value-field="agreement">

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_agreement.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_agreement.xml?rev=1801355&r1=1801354&r2=1801355&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_agreement.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/servicedef/services_agreement.xml Sun Jul  9 08:57:20 2017
@@ -38,12 +38,10 @@ under the License.
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
         <override name="textData" allow-html="any"/>
     </service>
-    <service name="cancelAgreement" default-entity-name="Agreement" engine="groovy"
-                location="component://accounting/groovyScripts/agreement/AgreementServices.groovy" invoke="cancelAgreement" auth="true">
-        <description>Cancel an Agreement</description>
+    <service name="expireAgreement" engine="entity-auto" default-entity-name="Agreement" invoke="expire" auth="true">
+        <description>Expire an Agreement</description>
         <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>
-        <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="copyAgreement" default-entity-name="Agreement" engine="groovy"
                 location="component://accounting/groovyScripts/agreement/AgreementServices.groovy" invoke="copyAgreement" auth="true">

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=1801355&r1=1801354&r2=1801355&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sun Jul  9 08:57:20 2017
@@ -1144,7 +1144,7 @@ under the License.
     <request-map uri="FindAgreement"><security https="true" auth="true"/><response name="success" type="view" value="FindAgreement"/></request-map>
     <request-map uri="cancelAgreement">
         <security https="true" auth="true"/>
-        <event type="service" invoke="cancelAgreement"/>
+        <event type="service" invoke="expireAgreement"/>
         <response name="success" type="view" value="FindAgreement"/>
         <response name="error" type="view" value="FindAgreement"/>
     </request-map>