diff --git a/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties b/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties index f000641ae0..00c611c072 100644 --- a/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties +++ b/specialpurpose/projectmgr/config/ProjectMgrUiLabels.properties @@ -49,11 +49,13 @@ PageTitleFindPhase=Find Phase PageTitleFindSubProject=Find Sub Project PageTitleFindSubTask=Find Sub Task PageTitleFindTask=Find Task +PageTitleHoursNotYetBilled=Hours not yet billed PageTitleListPartyAssigns=Current Resource Assignments PageTitleListProjectNotes=List Project Notes PageTitleListResources=Resources PageTitleListTaskNotes=List Task Notes PageTitleMyTimesheets=My timesheet list +PageTitleProjectBilling=Project Billing PageTitleProjectInformation=Project Information PageTitleRequestList=Request List PageTitleTasksAfter=Tasks to be executed after the current task @@ -66,6 +68,7 @@ ProjectMgrAddNewTask=Add a new task to one of my projects. ProjectMgrAssignATaskToMe=Assign an existing Task to me. ProjectMgrAssignMyTaskToSomebodyElse=Assign My Task To Somebody Else. ProjectMgrSchedule=Schedule +ProjectMgrBilling=Billing ProjectMgrCompanyName=Ofbiz Company ProjectMgrCompanySubtitle=Project ProjectMgrCopyProject=Copy Project diff --git a/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh b/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh new file mode 100644 index 0000000000..2e912be474 --- /dev/null +++ b/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh @@ -0,0 +1,69 @@ +/* +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.*; +import java.lang.*; +import java.util.Iterator; +import javolution.util.FastMap; +import java.math.BigDecimal; + +import org.ofbiz.entity.*; +import org.ofbiz.base.util.*; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilValidate; +import org.ofbiz.entity.condition.EntityConditionList; +import org.ofbiz.entity.condition.EntityExpr; +import org.ofbiz.entity.condition.EntityOperator; + + +import org.ofbiz.entity.util.*; +import org.ofbiz.base.util.*; +import org.ofbiz.entity.condition.*; +import java.sql.Timestamp; + +projectId = parameters.get("projectId"); + +// get all tasks from the project, get related time entries and checked if not invoiced +List entryList = new LinkedList(); +entries = delegator.findByAnd("ProjectAndPhaseAndTask", UtilMisc.toMap("projectId", projectId), UtilMisc.toList("phaseName", "workEffortName")); +t = entries.iterator(); +while (t.hasNext()) { + entry = t.next(); + entryItems = entry.getRelated("TimeEntry"); + e = entryItems.iterator(); + while (e.hasNext()) { + entryItem = e.next(); + if (entryItem.getString("invoiceId") == null) { + timesheet = entryItem.getRelatedOne("Timesheet"); + if (timesheet.getString("statusId").equals("TIMESHEET_COMPLETED")) { + Map all = FastMap.newInstance(); + all.put("workEffortName", entry.getString("workEffortName")); + all.put("workEffortId", entry.getString("workEffortId")); + all.put("phaseName", entry.getString("phaseName")); + all.put("phaseId", entry.getString("phaseId")); + all.put("partyId", timesheet.getString("partyId")); + all.put("hours", entryItem.getDouble("hours")); + all.put("fromDate", entryItem.getTimestamp("fromDate")); + entryList.add(all); + } + } + } +} +context.put("entryList", entryList); diff --git a/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml b/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml index 20a4931209..cf0e45d1bb 100644 --- a/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml +++ b/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/controller.xml @@ -55,6 +55,10 @@ + + + + @@ -493,6 +497,7 @@ + diff --git a/specialpurpose/projectmgr/widget/Menus.xml b/specialpurpose/projectmgr/widget/Menus.xml index 3821b2e8f8..a80853481c 100644 --- a/specialpurpose/projectmgr/widget/Menus.xml +++ b/specialpurpose/projectmgr/widget/Menus.xml @@ -55,7 +55,8 @@ - + + diff --git a/specialpurpose/projectmgr/widget/ProjectScreens.xml b/specialpurpose/projectmgr/widget/ProjectScreens.xml index 0968663ccf..ae4034d76e 100644 --- a/specialpurpose/projectmgr/widget/ProjectScreens.xml +++ b/specialpurpose/projectmgr/widget/ProjectScreens.xml @@ -131,21 +131,43 @@ under the License. - - - - + + + + - + - - - - - - - + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + diff --git a/specialpurpose/projectmgr/widget/forms/ProjectForms.xml b/specialpurpose/projectmgr/widget/forms/ProjectForms.xml index beacf0e1ba..11467db23a 100644 --- a/specialpurpose/projectmgr/widget/forms/ProjectForms.xml +++ b/specialpurpose/projectmgr/widget/forms/ProjectForms.xml @@ -98,6 +98,16 @@ + +
+ +