Author: hansbak
Date: Thu Aug 28 23:57:38 2008 New Revision: 690128 URL: http://svn.apache.org/viewvc?rev=690128&view=rev Log: add optional parameter currency to getTimeEntryRate service and if party not found on timeentry get the party from the timesheet 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=690128&r1=690127&r2=690128&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 Thu Aug 28 23:57:38 2008 @@ -242,14 +242,22 @@ </if-not-empty> </if-not-empty> - <!-- no rateAmount yet, try PartyRate --> + <!-- no rateAmount yet, try PartyRate if partyId not provided try the timesheet--> <if-empty field="rateAmount"> - <property-to-field field-name="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/> + <if-empty field="timeEntry.partyId"> + <get-related-one value-name="timeEntry" relation-name="Timesheet" to-value-name="timesheet"/> + <if-not-empty field="timesheet"> + <set field="timeEntry.partyId" from-field="timesheet.partyId"/> + </if-not-empty> + </if-empty> + <if-empty field="parameters.currencyUomId"> + <property-to-field field-name="parameters.currencyUomId" resource="general" property="currency.uom.id.default" default="USD"/> + </if-empty> <entity-condition entity-name="PartyRate" list-name="partyRateList"> <condition-list combine="and"> <condition-expr field-name="partyId" env-name="timeEntry.partyId"/> <condition-expr field-name="rateTypeId" env-name="timeEntry.rateTypeId"/> - <condition-expr field-name="currencyUomId" env-name="timeEntry.defaultCurrencyUomId"/> + <condition-expr field-name="currencyUomId" env-name="parameters.currencyUomId"/> </condition-list> <order-by field-name="-fromDate"/> </entity-condition> Modified: ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml?rev=690128&r1=690127&r2=690128&view=diff ============================================================================== --- ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml (original) +++ ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml Thu Aug 28 23:57:38 2008 @@ -139,7 +139,8 @@ location="org/ofbiz/workeffort/timesheet/TimesheetServices.xml" invoke="getTimeEntryRate"> <description>Creates TimeEntry</description> <auto-attributes include="pk" mode="IN" optional="false"/> - <attribute name="rateAmount" type="Double" mode="OUT" optional="true"></attribute> + <attribute name="currencyUomId" mode="IN" type="String" optional="true"/> + <attribute name="rateAmount" type="Double" mode="OUT" optional="true"/> </service> <!-- PartyRate Services --> |
Free forum by Nabble | Edit this page |