From 8de24d49aef828fa4aac6d1aa503b3ef5c2e2282 Mon Sep 17 00:00:00 2001 From: Hans Bakker Date: Tue, 8 Jan 2008 06:10:48 +0000 Subject: [PATCH] added rateTypeId to weekly timesheet using the default of the partyRate table git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/specialpurpose@609883 13f79535-47bb-0310-9956-ffa450edef68 --- .../script/org/ofbiz/project/ProjectServices.xml | 6 +++++- projectmgr/servicedef/services.xml | 1 + .../WEB-INF/actions/EditWeekTimesheet.bsh | 16 +++++++++++----- projectmgr/widget/CommonScreens.xml | 11 ++++++++++- projectmgr/widget/forms/TimeSheetForms.xml | 7 +++++++ 5 files changed, 34 insertions(+), 7 deletions(-) diff --git a/projectmgr/script/org/ofbiz/project/ProjectServices.xml b/projectmgr/script/org/ofbiz/project/ProjectServices.xml index df625df54..7f1b615e1 100644 --- a/projectmgr/script/org/ofbiz/project/ProjectServices.xml +++ b/projectmgr/script/org/ofbiz/project/ProjectServices.xml @@ -184,6 +184,7 @@ + @@ -236,7 +237,7 @@ - + @@ -899,14 +900,17 @@ + + + diff --git a/projectmgr/servicedef/services.xml b/projectmgr/servicedef/services.xml index 0f37dbb37..97c0dff05 100644 --- a/projectmgr/servicedef/services.xml +++ b/projectmgr/servicedef/services.xml @@ -56,6 +56,7 @@ under the License. + diff --git a/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh b/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh index 5775b3955..6279a094a 100644 --- a/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh +++ b/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh @@ -65,7 +65,13 @@ if (timesheetId != null) { } } // get the user names -context.put("partyNameView", delegator.findByPrimaryKey("PartyNameView", UtilMisc.toMap("partyId", partyId))); +context.put("partyNameView", delegator.findByPrimaryKey("PartyNameView", UtilMisc.toMap("partyId", partyId))); +// get the default rate for this person +rateTypes = EntityUtil.filterByDate(delegator.findByAnd("PartyRate", UtilMisc.toMap("partyId", partyId, "defaultRate", "Y"))); +if (UtilValidate.isNotEmpty(rateTypes)) { + rateType = rateTypes.get(0); + context.put("defaultRateTypeId", rateType.getString("rateTypeId")); +} if (timesheet == null) return; @@ -116,8 +122,8 @@ void retrieveWorkEffortData() { entry.put("phaseId",result.get("phaseId")); entry.put("phaseName",result.get("phaseName")); entry.put("projectId",result.get("projectId")); - entry.put("projectName",result.get("projectName")); - + entry.put("projectName",result.get("projectName")); + } entry.put("total", taskTotal); entry.put("timesheetId", timesheet.get("timesheetId")); @@ -140,7 +146,6 @@ while(te.hasNext()) { retrieveWorkEffortData(); } - entry.put("timesheetId", timesheet.get("timesheetId")); if (timeEntry.get("hours") != null) { dayNumber = (timeEntry.get("fromDate").getTime() - timesheet.getTimestamp("fromDate").getTime()) / (24*60*60*1000); hours = timeEntry.getDouble("hours").doubleValue(); @@ -153,7 +158,8 @@ while(te.hasNext()) { if (dayNumber == 5) day5Total += hours; if (dayNumber == 6) day6Total += hours; taskTotal += hours; - } + } + entry.put("rateTypeId", timeEntry.get("rateTypeId")); lastWorkEffortId = timeEntry.getString("workEffortId"); } diff --git a/projectmgr/widget/CommonScreens.xml b/projectmgr/widget/CommonScreens.xml index c40c25ba2..95683eb08 100644 --- a/projectmgr/widget/CommonScreens.xml +++ b/projectmgr/widget/CommonScreens.xml @@ -237,7 +237,16 @@ under the License. - +
+ + + + + + + + +
diff --git a/projectmgr/widget/forms/TimeSheetForms.xml b/projectmgr/widget/forms/TimeSheetForms.xml index d7ef64cc4..f3774c200 100644 --- a/projectmgr/widget/forms/TimeSheetForms.xml +++ b/projectmgr/widget/forms/TimeSheetForms.xml @@ -37,6 +37,11 @@ + + + + + @@ -240,6 +245,8 @@ + +