svn commit: r1835887 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/groovyScripts/rate/RateServices.groovy workeffort/webapp/workeffort/WEB-INF/controller.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1835887 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/groovyScripts/rate/RateServices.groovy workeffort/webapp/workeffort/WEB-INF/controller.xml

akashjain
Author: akashjain
Date: Sat Jul 14 09:02:51 2018
New Revision: 1835887

URL: http://svn.apache.org/viewvc?rev=1835887&view=rev
Log:
Fixed: Not able to expire the rate amount and an error is displayed in Workeffort (OFBIZ-10114)

Thanks, Rubia Elza Joshep and Chandrashekhar Dhakad for your contibution.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy
    ofbiz/ofbiz-framework/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy?rev=1835887&r1=1835886&r2=1835887&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy Sat Jul 14 09:02:51 2018
@@ -34,7 +34,7 @@ def updateRateAmount() {
     if (!newEntity.rateCurrencyUomId) {
         newEntity.rateCurrencyUomId = UtilProperties.getPropertyValue('general.properties', 'currency.uom.id.default')
     }
-    if (!newEntity.fromDate) newEntity.fromDate = UtilDateTime.getDayStart(UtilDateTime.nowTimestamp())
+    if (!newEntity.fromDate) newEntity.fromDate = UtilDateTime.nowTimestamp()
     newEntity.thruDate = null
 
     //Check if the entry is already exist with a different rate else expire the older to create the new one
@@ -48,7 +48,7 @@ def updateRateAmount() {
     if (rateAmountLookedUpValue) {
         updating = (rateAmountLookedUpValue.fromDate.compareTo(newEntity.fromDate) == 0)
         if (rateAmountLookedUpValue.rateAmount != rateAmount) {
-            result = run service: 'expireRateAmount', with: rateAmountLookedUpValue
+            result = run service: 'expireRateAmount', with: rateAmountLookedUpValue.getAllFields()
             if (ServiceUtil.isError(result)) return result
         } else {
             return error(UtilProperties.getMessage('AccountingErrorUiLabels', 'AccountingUpdateRateAmountAlreadyExist', locale))

Modified: ofbiz/ofbiz-framework/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml?rev=1835887&r1=1835886&r2=1835887&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml Sat Jul 14 09:02:51 2018
@@ -178,7 +178,7 @@ under the License.
     </request-map>
     <request-map uri="deleteWorkEffortRate">
         <security https="true" auth="true"/>
-        <event type="service" invoke="deleteRateAmount"/>
+        <event type="service" invoke="expireRateAmount"/>
         <response name="success" type="view" value="EditWorkEffortRates"/>
         <response name="error" type="view" value="EditWorkEffortRates"/>
     </request-map>