Author: hansbak
Date: Fri Dec 28 00:11:05 2007 New Revision: 607185 URL: http://svn.apache.org/viewvc?rev=607185&view=rev Log: add the possbility to create a weekly timesheet for ANY week, and a new service to set the status of a timesheet back to in process to be able to correct errors Modified: ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml Modified: ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml?rev=607185&r1=607184&r2=607185&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml (original) +++ ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml Fri Dec 28 00:11:05 2007 @@ -41,14 +41,25 @@ <set-nonpk-fields map-name="parameters" value-name="timesheet"/> <store-value value-name="timesheet"/> </simple-method> + <simple-method method-name="updateTimesheetToInProcess" short-description="Updates the Timesheet status back to in process to be able to correct errors"> + <entity-one entity-name="Timesheet" value-name="timesheet"/> + <set field="timesheet.statusId" value="TIMESHEET_IN_PROCESS"/> + <store-value value-name="timesheet"/> + </simple-method> <simple-method method-name="deleteTimesheet" short-description="Delete Timesheet"> <call-simple-method method-name="checkTimesheetStatus"/> <remove-value value-name="timesheet"/> </simple-method> - <simple-method method-name="createTimesheetForThisWeek" short-description="Create Timesheet For This Week"> + <simple-method method-name="createTimesheetForThisWeek" short-description="Create Timesheet For This Week of no date provided, otherwise for a specific week"> <check-permission permission="WORKEFFORTMGR" action="_CREATE"><fail-message message="You do not have permission to perform this operation: ${methodShortDescription}."/></check-permission> <check-errors/> - <now-timestamp-to-env env-name="nowTimestamp"/> + <if-empty field-name="parameters.requiredDate"> + <now-timestamp-to-env env-name="nowTimestamp"/> + <else> + <set field="nowTimestamp" from-field="parameters.requiredDate"/> + </else> + </if-empty> + <log level="always" message="===========creating a timesheet for ${nowTimestamp}"/> <set-service-fields service-name="createTimesheet" map-name="parameters" to-map-name="createTimesheetParams"/> <call-class-method class-name="org.ofbiz.base.util.UtilDateTime" method-name="getWeekStart" ret-field-name="createTimesheetParams.fromDate"> <field field-name="nowTimestamp" type="java.sql.Timestamp"/> Modified: ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml?rev=607185&r1=607184&r2=607185&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml (original) +++ ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml Fri Dec 28 00:11:05 2007 @@ -31,6 +31,11 @@ <auto-attributes include="pk" mode="OUT" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"/> </service> + <service name="updateTimesheetToInProcess" default-entity-name="Timesheet" engine="simple" auth="true" + location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="updateTimesheetToInProcess"> + <description>Updates the Timesheet status back to in process to be able to correct errors</description> + <auto-attributes include="pk" mode="IN" optional="false"/> + </service> <service name="updateTimesheet" default-entity-name="Timesheet" engine="simple" auth="true" location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="updateTimesheet"> <description>Updates Timesheet</description> @@ -53,12 +58,13 @@ </service> <service name="createTimesheetForThisWeek" default-entity-name="Timesheet" engine="simple" auth="true" location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="createTimesheetForThisWeek"> - <description>Creates Timesheet</description> + <description>Creates Timesheet for this week if no required date specified.</description> <auto-attributes include="pk" mode="OUT" optional="false"/> <auto-attributes include="nonpk" mode="IN" optional="true"> <exclude field-name="fromDate"/> <exclude field-name="thruDate"/> </auto-attributes> + <attribute name="requiredDate" type="Timestamp" mode="IN" optional="true"/> </service> <service name="addTimesheetToInvoice" default-entity-name="Timesheet" engine="simple" auth="true" location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="addTimesheetToInvoice"> |
Free forum by Nabble | Edit this page |