ofbiz-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hans...@apache.org
Subject svn commit: r609883 - in /ofbiz/trunk/specialpurpose/projectmgr: script/org/ofbiz/project/ProjectServices.xml servicedef/services.xml webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh widget/CommonScreens.xml widget/forms/TimeSheetForms.xml
Date Tue, 08 Jan 2008 06:10:49 GMT
Author: hansbak
Date: Mon Jan  7 22:10:48 2008
New Revision: 609883

URL: http://svn.apache.org/viewvc?rev=609883&view=rev
Log:
added rateTypeId to weekly timesheet using the default of the partyRate table

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
    ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml

Modified: ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml?rev=609883&r1=609882&r2=609883&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml Mon
Jan  7 22:10:48 2008
@@ -184,6 +184,7 @@
     </simple-method>        
     
     <simple-method method-name="updateTimeEntryByWorkeffort" short-description="Update
workeffort by workeffort and timesheetId ">
+        <log level="always" message="=====start:==rateType: ${parameters.rateTypeId}"></log>
         <if-empty field-name="parameters.workEffortId">
             <return/>
         </if-empty>
@@ -236,7 +237,7 @@
         </if-empty>
         
         <get-related value-name="timesheet" relation-name="TimeEntry" list-name="timeEntries"/>
-        
+
         <!-- update existing entries -->
         <set field="hours" value="0" type="Double"/>
         <if-not-empty field-name="timeEntries">
@@ -899,14 +900,17 @@
                 <call-service service-name="deleteTimeEntry" in-map-name="teDelMap"/>
                 <else>
                     <clear-field field-name="teUpdMap"/>
+                    <log level="always" message="=====updtimeentry: ${parameters.rateTypeId}"></log>
                     <set field="teUpdMap.hours" from-field="hours"/>
                     <set field="teUpdMap.timeEntryId" from-field="timeEntry.timeEntryId"/>
+                    <set field="teUpdMap.rateTypeId" from-field="parameters.rateTypeId"/>
                     <call-service service-name="updateTimeEntry" in-map-name="teUpdMap"/>
                 </else>
             </if-compare>
             <else>
                 <if-compare field-name="hours" operator="not-equals" value="0">
                     <set-service-fields service-name="createTimeEntry" map-name="parameters"
to-map-name="teCreMap"/>
+                    <set field="teCreMap.rateTypeId" from-field="parameters.rateTypeId"/>
                     <set field="teCreMap.hours" from-field="hours"/>
                     <set field="teCreMap.fromDate" from-field="fromDate"/>
                     <call-service service-name="createTimeEntry" in-map-name="teCreMap"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml?rev=609883&r1=609882&r2=609883&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/servicedef/services.xml Mon Jan  7 22:10:48 2008
@@ -56,6 +56,7 @@
         <attribute name="timesheetId" type="String" mode="INOUT" optional="true"/>
         <attribute name="workEffortId" type="String" mode="INOUT" optional="true"/><!--
when empty will be ignored -->
         <attribute name="fromDate" type="Timestamp" mode="INOUT" optional="true"/>
+        <attribute name="rateTypeId" type="String" mode="IN" optional="true"/>
         <attribute name="roleTypeId" type="String" mode="IN" optional="true"/>
         <attribute name="hoursDay0" type="Double" mode="IN" optional="true"/>
         <attribute name="hoursDay1" type="Double" mode="IN" optional="true"/>

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh?rev=609883&r1=609882&r2=609883&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
(original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/EditWeekTimesheet.bsh
Mon Jan  7 22:10:48 2008
@@ -65,7 +65,13 @@
         }
 }
 // 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 @@
 	            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 @@
     	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 @@
         if (dayNumber == 5) day5Total += hours;
         if (dayNumber == 6) day6Total += hours;
         taskTotal += hours;
-    } 
+    }
+    entry.put("rateTypeId", timeEntry.get("rateTypeId"));
     lastWorkEffortId = timeEntry.getString("workEffortId");
 }
 

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml?rev=609883&r1=609882&r2=609883&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/CommonScreens.xml Mon Jan  7 22:10:48 2008
@@ -237,7 +237,16 @@
                             <widgets>
                                 <!--include-menu name="TimesheetTabBar" location="component://projectmgr/widget/Menus.xml"/-->
                                 <include-menu name="TimesheetSubTabBar" location="component://projectmgr/widget/Menus.xml"/>
-                                <container><label style="head1">${uiLabelMap.TimesheetTimesheetId}:
${timesheetId} ${uiLabelMap.CommonFrom}: ${partyName.firstName} ${partyName.middleName} ${partyName.lastName}
${partyName.groupName} [${timesheet.partyId}]</label></container>
+                                <section>
+                                    <condition>
+                                        <not>
+                                            <if-empty field-name="timesheet"/>
+                                        </not>
+                                    </condition>
+                                    <widgets>
+                                        <container><label style="head1">${uiLabelMap.TimesheetTimesheetId}:
${timesheetId} ${uiLabelMap.CommonFrom}: ${partyName.firstName} ${partyName.middleName} ${partyName.lastName}
${partyName.groupName} [${timesheet.partyId}]</label></container>
+                                    </widgets>
+                                </section>
                                 <decorator-section-include name="body"/>
                             </widgets>
                             <fail-widgets>

Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml?rev=609883&r1=609882&r2=609883&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml Mon Jan  7 22:10:48
2008
@@ -37,6 +37,11 @@
             </drop-down>
         </field>
         <field name="checkComplete"><check/></field>
+        <field name="rateTypeId">
+            <drop-down allow-empty="false" no-current-selected-key="${defaultRateTypeId}">
+                <entity-options entity-name="RateType" description="${description}"/>
+            </drop-down>
+        </field>
         <field name="0" parameter-name="hoursDay0" title="Sun"><text size="5"/></field>
         <field name="1" parameter-name="hoursDay1" title="Mon"><text size="5"/></field>
         <field name="2" parameter-name="hoursDay2" title="Tue"><text size="5"/></field>
@@ -240,6 +245,8 @@
         <field name="projectName" title="${uiLabelMap.ProjectMgrProjectName}">
             <hyperlink target="projectView?projectId=${projectId} " description="${projectName}"/>
         </field>
+        <field name="checkComplete"><display/></field>
+        <field name="rateTypeId"><display-entity entity-name="RateType" description="${description}"/></field>
         <field name="0" parameter-name="hoursDay0" title="Sun"><display/></field>
         <field name="1" parameter-name="hoursDay1" title="Mon"><display/></field>
         <field name="2" parameter-name="hoursDay2" title="Tue"><display/></field>



Mime
View raw message