Author: deepak
Date: Tue May 16 17:36:32 2017
New Revision: 1795344
URL: http://svn.apache.org/viewvc?rev=1795344&view=rev
Log:
Improved: Inconsistent String Comparisons, Applied plugins groovy patch from
jira issue. (OFBIZ-9254)
I found an inconsistency in the code for string comparison
statusId.equals("PRUN_COMPLETED") whereas it should be written as
"PRUN_COMPLETED".equals(statusId) cause the former can throw
NullPointerException if the variable found to be NULL.
Thanks Devanshu Vyas for your contribution.
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/catalog/MiniProductSummary.groovy
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/HtmlAreaPrep.groovy
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/PermPrep.groovy
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/BillSettings.groovy
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/OrderStatus.groovy
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/PaymentInformation.groovy
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/QuickAnonCustSettings.groovy
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/ShipSettings.groovy
ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/EditWeekTimesheet.groovy
ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/GanttChart.groovy
ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectBilling.groovy
ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectIsBillable.groovy
ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/AddResourceTaskParty.groovy
ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditDailyHourReport.groovy
ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditWeekTimesheet.groovy
ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/ProductBilling.groovy
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/catalog/MiniProductSummary.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/catalog/MiniProductSummary.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
---
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/catalog/MiniProductSummary.groovy
(original)
+++
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/catalog/MiniProductSummary.groovy
Tue May 16 17:36:32 2017
@@ -55,7 +55,7 @@ if (miniProduct && productStoreId && pro
// returns: isSale, price, orderItemPriceInfos
context.priceResult = priceResult
// Check if Price has to be displayed with tax
- if (productStore.get("showPricesWithVatTax").equals("Y")) {
+ if ("Y".equals(productStore.get("showPricesWithVatTax"))) {
Map priceMap = runService('calcTaxForDisplay', ["basePrice":
priceResult.get("price"), "locale": locale, "productId": optProductId,
"productStoreId": productStoreId])
context.price = priceMap.get("priceWithTax")
} else {
@@ -68,7 +68,7 @@ if (miniProduct && productStoreId && pro
if (configWrapper) {
configWrapper.setDefaultConfig()
// Check if Config Price has to be displayed with tax
- if (productStore.get("showPricesWithVatTax").equals("Y")) {
+ if ("Y".equals(productStore.get("showPricesWithVatTax"))) {
BigDecimal totalPriceNoTax = configWrapper.getTotalPrice()
Map totalPriceMap = runService('calcTaxForDisplay',
["basePrice": totalPriceNoTax, "locale": locale, "productId": optProductId,
"productStoreId": productStoreId])
context.totalPrice = totalPriceMap.get("priceWithTax")
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/HtmlAreaPrep.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/HtmlAreaPrep.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/HtmlAreaPrep.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/HtmlAreaPrep.groovy
Tue May 16 17:36:32 2017
@@ -36,6 +36,6 @@ import javax.servlet.http.*
contentIdTo = parameters.contentIdTo
-if (!contentIdTo || !contentIdTo.equals("TEMPLATE_MASTER")) {
+if (!contentIdTo || !"TEMPLATE_MASTER".equals(contentIdTo)) {
context.dynamicPrimaryHTMLField = "textData"
}
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/PermPrep.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/PermPrep.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/PermPrep.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/forum/PermPrep.groovy Tue
May 16 17:36:32 2017
@@ -69,7 +69,7 @@ if ("add".equals(mode)) {
}
}
-if (permissionType.equals("complex")) {
+if ("complex".equals(permissionType)) {
mapIn = [:]
mapIn.userLogin = userLogin
targetOperationList = StringUtil.split(targetOperation, "|")
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/BillSettings.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/BillSettings.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/BillSettings.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/BillSettings.groovy
Tue May 16 17:36:32 2017
@@ -39,7 +39,7 @@ context.partyId = partyId
// nuke the event messages
request.removeAttribute("_EVENT_MESSAGE_")
-if (partyId && !partyId.equals("_NA_")) {
+if (partyId && !"_NA_".equals(partyId)) {
party = from("Party").where("partyId", partyId).queryOne()
person = party.getRelatedOne("Person", false)
context.party = party
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/OrderStatus.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/OrderStatus.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/OrderStatus.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/OrderStatus.groovy
Tue May 16 17:36:32 2017
@@ -176,7 +176,7 @@ if (orderHeader) {
ritems = oitem.getRelated("ReturnItem", null, null, false)
ritems.each { ritem ->
rh = ritem.getRelatedOne("ReturnHeader", false)
- if (!rh.statusId.equals("RETURN_CANCELLED")) {
+ if (!"RETURN_CANCELLED".equals(rh.statusId)) {
returned += ritem.returnQuantity
}
}
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/PaymentInformation.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/PaymentInformation.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
---
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/PaymentInformation.groovy
(original)
+++
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/PaymentInformation.groovy
Tue May 16 17:36:32 2017
@@ -35,7 +35,7 @@ if (!partyId) {
}
context.partyId = partyId
-if (partyId && !partyId.equals("_NA_")) {
+if (partyId && !"_NA_".equals(partyId)) {
party = from("Party").where("partyId", partyId).queryOne()
person = party.getRelatedOne("Person", false)
context.party = party
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/QuickAnonCustSettings.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/QuickAnonCustSettings.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
---
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/QuickAnonCustSettings.groovy
(original)
+++
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/QuickAnonCustSettings.groovy
Tue May 16 17:36:32 2017
@@ -89,7 +89,7 @@ context.cart = cart
// nuke the event messages
request.removeAttribute("_EVENT_MESSAGE_")
-if (cartPartyId && !cartPartyId.equals("_NA_")) {
+if (cartPartyId && !"_NA_".equals(cartPartyId)) {
cartParty = from("Party").where("partyId", cartPartyId).queryOne()
if (cartParty) {
cartPerson = cartParty.getRelatedOne("Person", false)
Modified:
ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/ShipSettings.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/ShipSettings.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/ShipSettings.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/ecommerce/groovyScripts/order/ShipSettings.groovy
Tue May 16 17:36:32 2017
@@ -31,7 +31,7 @@ context.cart = cart
// nuke the event messages
request.removeAttribute("_EVENT_MESSAGE_")
-if (partyId && !partyId.equals("_NA_")) {
+if (partyId && !"_NA_".equals(partyId)) {
party = from("Party").where("partyId", partyId).queryOne()
person = party.getRelatedOne("Person", false)
context.party = party
Modified:
ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/EditWeekTimesheet.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/EditWeekTimesheet.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/EditWeekTimesheet.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/EditWeekTimesheet.groovy
Tue May 16 17:36:32 2017
@@ -145,13 +145,13 @@ while (te.hasNext()) {
dayNumber = "d" + (timeEntry.fromDate.getTime() -
timesheet.fromDate.getTime()) / (24*60*60*1000)
hours = timeEntry.hours.doubleValue()
entry.put(String.valueOf(dayNumber), hours)
- if (dayNumber.equals("d0")) day0Total += hours
- if (dayNumber.equals("d1")) day1Total += hours
- if (dayNumber.equals("d2")) day2Total += hours
- if (dayNumber.equals("d3")) day3Total += hours
- if (dayNumber.equals("d4")) day4Total += hours
- if (dayNumber.equals("d5")) day5Total += hours
- if (dayNumber.equals("d6")) day6Total += hours
+ if ("d0".equals(dayNumber)) day0Total += hours
+ if ("d1".equals(dayNumber)) day1Total += hours
+ if ("d2".equals(dayNumber)) day2Total += hours
+ if ("d3".equals(dayNumber)) day3Total += hours
+ if ("d4".equals(dayNumber)) day4Total += hours
+ if ("d5".equals(dayNumber)) day5Total += hours
+ if ("d6".equals(dayNumber)) day6Total += hours
taskTotal += hours
}
entry.rateTypeId = timeEntry.rateTypeId
@@ -163,7 +163,7 @@ if (timeEntry) {
}
// add empty lines if timesheet not completed
-if (!timesheet.statusId.equals("TIMESHEET_COMPLETED")) {
+if (!"TIMESHEET_COMPLETED".equals(timesheet.statusId)) {
for (c=0; c < 3; c++) { // add empty lines
entries.add(["timesheetId" : timesheet.timesheetId])
}
Modified: ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/GanttChart.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/GanttChart.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/GanttChart.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/GanttChart.groovy Tue
May 16 17:36:32 2017
@@ -73,13 +73,13 @@ if (phases) {
taskInfo = resultTaskInfo.taskInfo
taskInfo.taskNr = task.workEffortId
taskInfo.phaseNr = phase.phaseId
- if (taskInfo.plannedHours &&
!taskInfo.currentStatusId.equals("PTS_COMPLETED") && taskInfo.plannedHours >
taskInfo.actualHours) {
+ if (taskInfo.plannedHours &&
!"PTS_COMPLETED".equals(taskInfo.currentStatusId) && taskInfo.plannedHours >
taskInfo.actualHours) {
taskInfo.resource = taskInfo.plannedHours + " Hrs"
} else {
taskInfo.resource = taskInfo.actualHours + " Hrs"
}
Double duration = resultTaskInfo.plannedHours
- if (taskInfo.currentStatusId.equals("PTS_COMPLETED")) {
+ if ("PTS_COMPLETED".equals(taskInfo.currentStatusId)) {
taskInfo.completion = 100
} else {
if (taskInfo.actualHours && taskInfo.plannedHours) {
Modified:
ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectBilling.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectBilling.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectBilling.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectBilling.groovy
Tue May 16 17:36:32 2017
@@ -40,7 +40,7 @@ entryIterator = from("ProjectPhaseTaskAn
.queryIterator()
while (entryItem = entryIterator.next()) {
invoice = entryItem.getRelatedOne("Invoice", false)
- if (invoice.getString("statusId").equals("INVOICE_IN_PROCESS")) {
+ if ("INVOICE_IN_PROCESS".equals(invoice.getString("statusId"))) {
context.partyIdFrom = invoice.partyIdFrom
context.partyId = invoice.partyId
context.invoiceId = invoice.invoiceId
Modified:
ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectIsBillable.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectIsBillable.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectIsBillable.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/projectmgr/groovyScripts/ProjectIsBillable.groovy
Tue May 16 17:36:32 2017
@@ -22,10 +22,10 @@ projectMembers = from("WorkEffortPartyAs
toPartyId = null
fromPartyId = null
projectMembers.each {member ->
- if (member.roleTypeId.equals("INTERNAL_ORGANIZATIO")) {
+ if ("INTERNAL_ORGANIZATIO".equals(member.roleTypeId)) {
fromPartyId = member.partyId
}
- if (member.roleTypeId.equals("CLIENT_BILLING")) {
+ if ("CLIENT_BILLING".equals(member.roleTypeId)) {
toPartyId = member.partyId
}
if (fromPartyId && toPartyId && fromPartyId.equals(toPartyId)) {
Modified:
ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/AddResourceTaskParty.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/AddResourceTaskParty.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/AddResourceTaskParty.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/AddResourceTaskParty.groovy
Tue May 16 17:36:32 2017
@@ -46,7 +46,7 @@ userLoginId = userLogin.partyId
} else {
custRequestTypeId = projectAndTaskMap.custRequestTypeId
backlogStatusId = projectAndTaskMap.backlogStatusId
- if (custRequestTypeId.equals("RF_SCRUM_MEETINGS") &&
backlogStatusId.equals("CRQ_REVIEWED")) {
+ if ("RF_SCRUM_MEETINGS".equals(custRequestTypeId) &&
"CRQ_REVIEWED".equals(backlogStatusId)) {
projectSprintBacklogAndTaskList.add(projectAndTaskMap)
}
}
Modified:
ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditDailyHourReport.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditDailyHourReport.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditDailyHourReport.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditDailyHourReport.groovy
Tue May 16 17:36:32 2017
@@ -182,26 +182,26 @@ while (te.hasNext()) {
dayNumber = "d" + (timeEntry.fromDate.getTime() -
timesheet.fromDate.getTime()) / (24*60*60*1000)
hours = timeEntry.hours.doubleValue()
entry.put(String.valueOf(dayNumber), hours)
- if (dayNumber.equals("d0")) day0Total += hours
- if (dayNumber.equals("d1")) day1Total += hours
- if (dayNumber.equals("d2")) day2Total += hours
- if (dayNumber.equals("d3")) day3Total += hours
- if (dayNumber.equals("d4")) day4Total += hours
- if (dayNumber.equals("d5")) day5Total += hours
- if (dayNumber.equals("d6")) day6Total += hours
+ if ("d0".equals(dayNumber)) day0Total += hours
+ if ("d1".equals(dayNumber)) day1Total += hours
+ if ("d2".equals(dayNumber)) day2Total += hours
+ if ("d3".equals(dayNumber)) day3Total += hours
+ if ("d4".equals(dayNumber)) day4Total += hours
+ if ("d5".equals(dayNumber)) day5Total += hours
+ if ("d6".equals(dayNumber)) day6Total += hours
taskTotal += hours
}
if (timeEntry.planHours) {
dayNumber = "pd" + (timeEntry.fromDate.getTime() -
timesheet.fromDate.getTime()) / (24*60*60*1000)
planHours = timeEntry.planHours.doubleValue()
entry.put(String.valueOf(dayNumber), planHours)
- if (dayNumber.equals("pd0")) pDay0Total += planHours
- if (dayNumber.equals("pd1")) pDay1Total += planHours
- if (dayNumber.equals("pd2")) pDay2Total += planHours
- if (dayNumber.equals("pd3")) pDay3Total += planHours
- if (dayNumber.equals("pd4")) pDay4Total += planHours
- if (dayNumber.equals("pd5")) pDay5Total += planHours
- if (dayNumber.equals("pd6")) pDay6Total += planHours
+ if ("pd0".equals(dayNumber)) pDay0Total += planHours
+ if ("pd1".equals(dayNumber)) pDay1Total += planHours
+ if ("pd2".equals(dayNumber)) pDay2Total += planHours
+ if ("pd3".equals(dayNumber)) pDay3Total += planHours
+ if ("pd4".equals(dayNumber)) pDay4Total += planHours
+ if ("pd5".equals(dayNumber)) pDay5Total += planHours
+ if ("pd6".equals(dayNumber)) pDay6Total += planHours
planTotal += planHours
}
@@ -265,13 +265,13 @@ while ((emplLeaveMap = emplLeave.next())
["userLogin": parameters.userLogin, "partyId":
emplLeaveEntry.partyId, "leaveTypeId": emplLeaveEntry.leaveTypeId, "fromDate":
emplLeaveEntry.fromDate])
leaveHours = resultHours.hours.doubleValue()
leaveEntry.put(String.valueOf(leaveDayNumber), leaveHours)
- if (leaveDayNumber.equals("d0")) day0Total += leaveHours
- if (leaveDayNumber.equals("d1")) day1Total += leaveHours
- if (leaveDayNumber.equals("d2")) day2Total += leaveHours
- if (leaveDayNumber.equals("d3")) day3Total += leaveHours
- if (leaveDayNumber.equals("d4")) day4Total += leaveHours
- if (leaveDayNumber.equals("d5")) day5Total += leaveHours
- if (leaveDayNumber.equals("d6")) day6Total += leaveHours
+ if ("d0".equals(leaveDayNumber)) day0Total += leaveHours
+ if ("d1".equals(leaveDayNumber)) day1Total += leaveHours
+ if ("d2".equals(leaveDayNumber)) day2Total += leaveHours
+ if ("d3".equals(leaveDayNumber)) day3Total += leaveHours
+ if ("d4".equals(leaveDayNumber)) day4Total += leaveHours
+ if ("d5".equals(leaveDayNumber)) day5Total += leaveHours
+ if ("d6".equals(leaveDayNumber)) day6Total += leaveHours
leaveTaskTotal += leaveHours
}
if (resultHours.hours) {
@@ -280,13 +280,13 @@ while ((emplLeaveMap = emplLeave.next())
["userLogin": parameters.userLogin, "partyId":
emplLeaveEntry.partyId, "leaveTypeId": emplLeaveEntry.leaveTypeId, "fromDate":
emplLeaveEntry.fromDate])
leavePlanHours = resultPlanHours.hours.doubleValue()
leaveEntry.put(String.valueOf(leavePlanDay), leavePlanHours)
- if (leavePlanDay.equals("pd0")) pDay0Total += leavePlanHours
- if (leavePlanDay.equals("pd1")) pDay1Total += leavePlanHours
- if (leavePlanDay.equals("pd2")) pDay2Total += leavePlanHours
- if (leavePlanDay.equals("pd3")) pDay3Total += leavePlanHours
- if (leavePlanDay.equals("pd4")) pDay4Total += leavePlanHours
- if (leavePlanDay.equals("pd5")) pDay5Total += leavePlanHours
- if (leavePlanDay.equals("pd6")) pDay6Total += leavePlanHours
+ if ("pd0".equals(leavePlanDay)) pDay0Total += leavePlanHours
+ if ("pd1".equals(leavePlanDay)) pDay1Total += leavePlanHours
+ if ("pd2".equals(leavePlanDay)) pDay2Total += leavePlanHours
+ if ("pd3".equals(leavePlanDay)) pDay3Total += leavePlanHours
+ if ("pd4".equals(leavePlanDay)) pDay4Total += leavePlanHours
+ if ("pd5".equals(leavePlanDay)) pDay5Total += leavePlanHours
+ if ("pd6".equals(leavePlanDay)) pDay6Total += leavePlanHours
leavePlanTotal += leavePlanHours
}
leaveEntry.rateTypeId = "STANDARD"
@@ -303,7 +303,7 @@ if (emplLeaveEntry) {
}
// add empty lines if timesheet not completed
-if (!timesheet.statusId.equals("TIMESHEET_COMPLETED")) {
+if (!"TIMESHEET_COMPLETED".equals(timesheet.statusId)) {
for (c=0; c < 3; c++) { // add empty lines
entries.add(["timesheetId" : timesheet.timesheetId])
}
@@ -393,7 +393,7 @@ userLoginId = userLogin.partyId
if (partyAssignmentTaskMap) {
custRequestTypeId = projectAndTaskMap.custRequestTypeId
backlogStatusId = projectAndTaskMap.backlogStatusId
- if (custRequestTypeId.equals("RF_SCRUM_MEETINGS") &&
backlogStatusId.equals("CRQ_REVIEWED")) {
+ if ("RF_SCRUM_MEETINGS".equals(custRequestTypeId) &&
"CRQ_REVIEWED".equals(backlogStatusId)) {
projectSprintBacklogAndTaskList.add(projectAndTaskMap)
}
} else {
Modified: ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditWeekTimesheet.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditWeekTimesheet.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditWeekTimesheet.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/EditWeekTimesheet.groovy Tue
May 16 17:36:32 2017
@@ -148,13 +148,13 @@ while (te.hasNext()) {
dayNumber = "d" + (timeEntry.fromDate.getTime() -
timesheet.fromDate.getTime()) / (24*60*60*1000)
hours = timeEntry.hours.doubleValue()
entry.put(String.valueOf(dayNumber), hours)
- if (dayNumber.equals("d0")) day0Total += hours
- if (dayNumber.equals("d1")) day1Total += hours
- if (dayNumber.equals("d2")) day2Total += hours
- if (dayNumber.equals("d3")) day3Total += hours
- if (dayNumber.equals("d4")) day4Total += hours
- if (dayNumber.equals("d5")) day5Total += hours
- if (dayNumber.equals("d6")) day6Total += hours
+ if ("d0".equals(dayNumber)) day0Total += hours
+ if ("d1".equals(dayNumber)) day1Total += hours
+ if ("d2".equals(dayNumber)) day2Total += hours
+ if ("d3".equals(dayNumber)) day3Total += hours
+ if ("d4".equals(dayNumber)) day4Total += hours
+ if ("d5".equals(dayNumber)) day5Total += hours
+ if ("d6".equals(dayNumber)) day6Total += hours
taskTotal += hours
}
entry.rateTypeId = timeEntry.rateTypeId
@@ -166,7 +166,7 @@ if (timeEntry) {
}
// add empty lines if timesheet not completed
-if (!timesheet.statusId.equals("TIMESHEET_COMPLETED")) {
+if (!"TIMESHEET_COMPLETED".equals(timesheet.statusId)) {
for (c=0; c < 3; c++) { // add empty lines
entries.add(["timesheetId" : timesheet.timesheetId])
}
Modified: ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/ProductBilling.groovy
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/ProductBilling.groovy?rev=1795344&r1=1795343&r2=1795344&view=diff
==============================================================================
--- ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/ProductBilling.groovy
(original)
+++ ofbiz/ofbiz-plugins/trunk/scrum/groovyScripts/ProductBilling.groovy Tue May
16 17:36:32 2017
@@ -35,7 +35,7 @@ entryExprs =
entryIterator =
from("ProjectSprintBacklogTaskAndTimeEntryTimeSheet").where(entryExprs).orderBy("-fromDate").queryIterator()
while (entryItem = entryIterator.next()) {
invoice = entryItem.getRelatedOne("Invoice", false)
- if (invoice.getString("statusId").equals("INVOICE_IN_PROCESS")) {
+ if ("INVOICE_IN_PROCESS".equals(invoice.getString("statusId"))) {
context.partyIdFrom = invoice.partyIdFrom
context.partyId = invoice.partyId
context.invoiceId = invoice.invoiceId