You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2008/12/23 08:26:56 UTC

svn commit: r728894 [1/2] - in /ofbiz/trunk: applications/accounting/ applications/accounting/config/ applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/rate/ applications/accounting/ser...

Author: hansbak
Date: Mon Dec 22 23:26:55 2008
New Revision: 728894

URL: http://svn.apache.org/viewvc?rev=728894&view=rev
Log:
Rate refactoring, now can have a base rate with diffrent currencies which can be overridden on a party or workeffort level. see   OFBIZ-2037 for more info

Added:
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml   (with props)
    ofbiz/trunk/applications/accounting/servicedef/services_rate.xml   (with props)
    ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml   (with props)
    ofbiz/trunk/applications/workeffort/entitydef/entitymodel_old.xml   (with props)
Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
    ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    ofbiz/trunk/applications/accounting/entitydef/entitymodel_old.xml
    ofbiz/trunk/applications/accounting/ofbiz-component.xml
    ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml
    ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsForms.xml
    ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml
    ofbiz/trunk/applications/accounting/widget/Menus.xml
    ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml
    ofbiz/trunk/applications/humanres/ofbiz-component.xml
    ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/HumanResServices.xml
    ofbiz/trunk/applications/humanres/servicedef/services.xml
    ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/controller.xml
    ofbiz/trunk/applications/humanres/widget/forms/GlobalHRSettingForms.xml
    ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
    ofbiz/trunk/applications/workeffort/data/WorkEffortTypeData.xml
    ofbiz/trunk/applications/workeffort/entitydef/entitymodel.xml
    ofbiz/trunk/applications/workeffort/entitydef/entitymodel_view.xml
    ofbiz/trunk/applications/workeffort/ofbiz-component.xml
    ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/RateServices.xml
    ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/timesheet/TimesheetServices.xml
    ofbiz/trunk/applications/workeffort/script/org/ofbiz/workeffort/workeffort/WorkEffortSimpleServices.xml
    ofbiz/trunk/applications/workeffort/servicedef/services_timesheet.xml
    ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/controller.xml
    ofbiz/trunk/applications/workeffort/widget/WorkEffortForms.xml
    ofbiz/trunk/applications/workeffort/widget/WorkEffortMenus.xml
    ofbiz/trunk/applications/workeffort/widget/WorkEffortScreens.xml
    ofbiz/trunk/specialpurpose/projectmgr/script/org/ofbiz/project/ProjectServices.xml
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectBilling.groovy
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/hoursNotYetBilled.bsh
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/TimeSheetForms.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Mon Dec 22 23:26:55 2008
@@ -5986,6 +5986,9 @@
         <value xml:lang="nl">Aantal</value>
         <value xml:lang="th">จำนวน</value>
     </property>
+    <property key="AccountingRates">
+        <value xml:lang="en">Rates</value>
+    </property>
     <property key="AccountingReceivePayment">
         <value xml:lang="ar">تسلم التسديد</value>
         <value xml:lang="de">Zahlung erhalten</value>
@@ -6758,6 +6761,9 @@
         <value xml:lang="th">Security Error : To Update a Payment you must either be the to or from party or have the PAY_INFO_UPDATE or PAY_INFO_ADMIN permissions.</value>
         <value xml:lang="zh">安全错误:要更新支付,你必须是支付方或接收方会员,或者具有PAY_INFO_UPDATE或PAY_INFO_ADMIN权限。</value>
     </property>
+    <property key="AccountingUpdateRateAmount">
+        <value xml:lang="en">Update Rate amount</value>
+    </property>
     <property key="AccountingUseAccount">
         <value xml:lang="cs">Použít účet</value>
         <value xml:lang="de">Konto benutzen</value>

Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Mon Dec 22 23:26:55 2008
@@ -742,6 +742,23 @@
     <TaxAuthorityRateType taxAuthorityRateTypeId="EXPORT_TAX" description="Export Tax"/>
     <TaxAuthorityRateType taxAuthorityRateTypeId="IMPORT_TAX" description="Import Tax"/>
     
+    <!-- Rate Types -->
+    <RateType rateTypeId="STANDARD" description="Standard Rate"/>
+    <RateType rateTypeId="DISCOUNTED" description="Discounted Rate"/>
+    <RateType rateTypeId="OVERTIME" description="Overtime Rate"/>
+    <RateType rateTypeId="AVERAGE_PAY_RATE" description="Average Pay Rate"/>
+    <RateType rateTypeId="HIGH_PAY_RATE" description="Highest Pay Rate"/>
+    <RateType rateTypeId="LOW_PAY_RATE" description="Lowest Pay Rate"/>
+    <!-- rate periods -->
+    <PeriodType description="Rate amount per Hour" periodTypeId="RATE_HOUR" periodLength="1" uomId="TF_hr"/>
+    <PeriodType description="Rate amount per Week" periodTypeId="RATE_WEEK" periodLength="1" uomId="TF_wk"/>
+    <PeriodType description="Rate amount per month" periodTypeId="RATE_MONTH" periodLength="1" uomId="TF_mon"/>
+    <PeriodType description="Rate amount per Quarter" periodTypeId="RATE_QUARTER" periodLength="3" uomId="TF_mon"/>
+    
+    <!-- create 'Not Applicable'  records-->
+    <WorkEffort workEffortId="_NA_"/>
+    <EmplPositionType emplPositionTypeId="_NA_"/>
+    
     <!-- Points of Title Transfer -->
     <EnumerationType description="Points of Title Transfer" enumTypeId="PTSOFTTFR" hasTable="N" parentTypeId=""/>
     <Enumeration description="Desination" enumCode="DEST" enumId="POTT_DEST" sequenceId="01" enumTypeId="PTSOFTTFR"/>

Modified: ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/DemoOrganizationData.xml Mon Dec 22 23:26:55 2008
@@ -62,4 +62,10 @@
     <PartyRole partyId="TESTING" roleTypeId="INTERNAL_ORGANIZATIO"/>
     <PartyRole partyId="TESTING" roleTypeId="_NA_"/>
     <PartyRelationship partyIdFrom="Company" partyIdTo="TESTING" partyRelationshipTypeId="GROUP_ROLLUP" roleTypeIdFrom="_NA_" roleTypeIdTo="_NA_" fromDate="2001-05-13 00:00:00.000"/>
+    
+    <!-- demo rates -->
+    <RateAmount organizationPartyId="Company" rateTypeId="STANDARD" rateCurrencyUomId="USD" periodTypeId="RATE_HOUR" workEffortId="_NA_" partyId="_NA_" emplPositionTypeId="_NA_" fromDate="2000-01-01 00:00:00.000" rateAmount="95.0" />
+    <RateAmount organizationPartyId="Company" rateTypeId="DISCOUNTED" rateCurrencyUomId="USD" periodTypeId="RATE_HOUR" workEffortId="_NA_" partyId="_NA_" emplPositionTypeId="_NA_" fromDate="2000-01-01 00:00:00.000" rateAmount="55.0"/>
+    <RateAmount organizationPartyId="Company" rateTypeId="OVERTIME" rateCurrencyUomId="USD" periodTypeId="RATE_HOUR" workEffortId="_NA_" partyId="_NA_" emplPositionTypeId="_NA_" fromDate="2000-01-01 00:00:00.000" rateAmount="125.0"/>
+    
 </entity-engine-xml>

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Mon Dec 22 23:26:55 2008
@@ -39,6 +39,7 @@
     <!--  - org.ofbiz.accounting.ledger -->
     <!--  - org.ofbiz.accounting.payment -->
     <!--  - org.ofbiz.accounting.tax -->
+    <!--  - org.ofbiz.accounting.rate -->
     <!-- ========================================================= -->
 
 
@@ -3209,5 +3210,102 @@
         <view-link entity-alias="ATE" rel-entity-alias="ATR">
             <key-map field-name="acctgTransId"/>
         </view-link>
-     </view-entity>
+    </view-entity>
+
+  <entity entity-name="RateType" package-name="org.ofbiz.accounting.rate"
+    title="Rate Type Entity">
+    <field name="rateTypeId" type="id-ne"></field>
+    <field name="description" type="description"></field>
+    <prim-key field="rateTypeId"/>
+  </entity>
+
+  <entity entity-name="RateAmount" package-name="org.ofbiz.accounting.rate">
+      <field name="rateTypeId" type="id-ne"/>
+      <field name="rateCurrencyUomId" type="id-ne"/>
+      <field name="periodTypeId" type="id-ne"/>
+      <field name="workEffortId" type="id"/>
+      <field name="partyId" type="id"/>
+      <field name="emplPositionTypeId" type="id"/>
+      <field name="fromDate" type="date-time"><description>Describes when a rate amount will be valid. If null, valid immediately.</description></field>
+      <field name="thruDate" type="date-time"><description>Describes when a rate amount will be valid untl. If null, valid indefinitly.</description></field>
+      <field name="rateAmount" type="currency-amount"/>
+      <prim-key field="rateTypeId"/>
+      <prim-key field="rateCurrencyUomId"/>
+      <prim-key field="periodTypeId"/>
+      <prim-key field="partyId"/>
+      <prim-key field="workEffortId"/>
+      <prim-key field="emplPositionTypeId"/>
+      <prim-key field="fromDate"/>
+      <relation type="one" fk-name="RATE_AMOUNT_RT" rel-entity-name="RateType">
+        <key-map field-name="rateTypeId"/>
+      </relation>
+      <relation type="one" fk-name="RATE_AMOUNT_RCT" rel-entity-name="Uom">
+        <key-map field-name="rateCurrencyUomId" rel-field-name="uomId"/>
+      </relation>
+      <relation type="one" fk-name="RATE_AMOUNT_WE" rel-entity-name="WorkEffort">
+        <key-map field-name="workEffortId"/>
+      </relation>
+      <relation type="one" fk-name="RATE_AMOUNT_PTY" rel-entity-name="Party">
+        <key-map field-name="partyId"/>
+      </relation>
+      <relation type="one" fk-name="RATE_AMOUNT_EPT" rel-entity-name="EmplPositionType">
+        <key-map field-name="emplPositionTypeId"/>
+      </relation>
+      <relation type="one" fk-name="RATE_AMOUNT_PT" rel-entity-name="PeriodType">
+        <key-map field-name="periodTypeId"/>
+      </relation>
+  </entity>
+
+  <view-entity entity-name="RateAmountAndRelations" package-name="org.ofbiz.accounting.rate">
+    <member-entity entity-alias="RA" entity-name="RateAmount"/>
+    <member-entity entity-alias="RT" entity-name="RateType"/>
+    <member-entity entity-alias="PT" entity-name="PeriodType"/>
+    <member-entity entity-alias="PN" entity-name="PartyNameView"/>
+    <member-entity entity-alias="WE" entity-name="WorkEffort"/>
+    <member-entity entity-alias="EPT" entity-name="EmplPositionType"/>
+    <alias-all entity-alias="RA"/>
+    <alias entity-alias="RT" name="rateDescription" field="description"/>
+    <alias entity-alias="PT" name="periodDescription" field="description"/>
+    <alias entity-alias="PN" name="firstName"/>
+    <alias entity-alias="PN" name="middleName"/>
+    <alias entity-alias="PN" name="lastName"/>
+    <alias entity-alias="PN" name="groupName"/>
+    <alias entity-alias="EPT" name="employeePositionDescription" field="description"/>
+    <alias entity-alias="WE" name="workEffortName"/>
+    <view-link entity-alias="RA" rel-entity-alias="RT">
+      <key-map field-name="rateTypeId"/>
+    </view-link>
+    <view-link entity-alias="RA" rel-entity-alias="PT">
+      <key-map field-name="periodTypeId"/>
+    </view-link>
+    <view-link entity-alias="RA" rel-entity-alias="PN" rel-optional="true">
+      <key-map field-name="partyId"/>
+    </view-link>
+    <view-link entity-alias="RA" rel-entity-alias="WE" rel-optional="true">
+      <key-map field-name="workEffortId"/>
+    </view-link>
+    <view-link entity-alias="RA" rel-entity-alias="EPT" rel-optional="true">
+      <key-map field-name="emplPositionTypeId"/>
+    </view-link>
+  </view-entity>
+
+  <entity entity-name="PartyRate" package-name="org.ofbiz.accounting.rate"
+    title="Party Rate Entity" table-name="PARTY_RATE_NEW">
+    <field name="partyId" type="id-ne"/>
+    <field name="rateTypeId" type="id-ne"/>
+    <field name="defaultRate" type="indicator"/>
+    <field name="percentageUsed" type="floating-point"><description>The percentage of the actual hours registered in timeEntries, used for the task and invoice actuals, if the field is null 100% will be used</description></field>
+    <field name="fromDate" type="date-time"/>
+    <field name="thruDate" type="date-time"/>
+    <prim-key field="partyId"/>
+    <prim-key field="rateTypeId"/>
+    <prim-key field="fromDate"/>
+    <relation type="one" fk-name="PRTY_RATE_PRTY" rel-entity-name="Party">
+      <key-map field-name="partyId"/>
+    </relation>
+    <relation type="one" fk-name="PRTY_RATE_RTTP" rel-entity-name="RateType">
+      <key-map field-name="rateTypeId"/>
+    </relation>
+  </entity>
+  
 </entitymodel>

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel_old.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel_old.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel_old.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel_old.xml Mon Dec 22 23:26:55 2008
@@ -30,8 +30,8 @@
     <version>1.0</version>
     <!-- ========================================================= -->
     <!-- ======================== Data Model ===================== -->
-    <!-- The modules in this file are as follows:                  -->
-    <!--  - org.ofbiz.accounting.payment -->
+    <!-- The modules in this file are as follows:          -->
+    <!--  org.ofbiz.accounting.payment -->
     <!-- ========================================================= -->
 
 
@@ -73,4 +73,28 @@
           <key-map field-name="surveyResponseId"/>
       </relation>
     </entity>
+    <entity entity-name="OldPartyRate" table-name="PARTY_RATE"
+            package-name="org.ofbiz.workeffort.timesheet"
+            title="Party Rate Entity">
+      <field name="partyId" type="id-ne"></field>
+      <field name="rateTypeId" type="id-ne"></field>
+      <field name="currencyUomId" type="id-ne"/>
+      <field name="defaultRate" type="indicator"></field>
+      <field name="fromDate" type="date-time"></field>
+      <field name="thruDate" type="date-time"></field>
+      <field name="rate" type="currency-amount"></field>
+      <prim-key field="partyId"/>
+      <prim-key field="rateTypeId"/>
+      <prim-key field="currencyUomId"/>
+      <prim-key field="fromDate"/>
+      <relation type="one" fk-name="OPRTY_RTE_PRTY" rel-entity-name="Party">
+            <key-map field-name="partyId"/>
+          </relation>
+      <relation type="one" fk-name="OPRTY_RTE_RTTP" rel-entity-name="RateType">
+            <key-map field-name="rateTypeId"/>
+          </relation>
+      <relation type="one" fk-name="OPARTY_RATE_CUOM" title="Currency" rel-entity-name="Uom">
+            <key-map field-name="currencyUomId" rel-field-name="uomId"/>
+          </relation>
+    </entity>
 </entitymodel>
\ No newline at end of file

Modified: ofbiz/trunk/applications/accounting/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/ofbiz-component.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/accounting/ofbiz-component.xml Mon Dec 22 23:26:55 2008
@@ -56,6 +56,7 @@
     <service-resource type="model" loader="main" location="servicedef/services_payment.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_paymentmethod.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_tax.xml"/>
+    <service-resource type="model" loader="main" location="servicedef/services_rate.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_cost.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services_olap.xml"/>
     

Added: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml?rev=728894&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml (added)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml Mon Dec 22 23:26:55 2008
@@ -0,0 +1,384 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/simple-methods.xsd">
+
+    <simple-method method-name="updateRateAmount" short-description="update/create a rate amount value">
+        <set value="_CREATE" field="securityAction"/>
+        <check-permission permission="ACCOUNTING" action="${securityAction}"><fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/></check-permission>
+        <check-errors/>
+
+        <!-- set defaults -->
+        <if-empty field="parameters.rateCurrencyUomId">
+            <property-to-field resource="general.properties" property="currency.uom.id.default" field-name="parameters.rateCurrencyUomId"/>
+        </if-empty>
+        <if-empty field="parameters.periodTypeId">
+            <set field="parameters.periodTypeId" value="RATE_HOUR"/>
+        </if-empty>
+        <if-empty field="parameters.emplPositionTypeId">
+            <set field="parameters.emplPositionTypeId" value="_NA_"/>
+        </if-empty>
+        <if-empty field="parameters.partyId">
+            <set field="parameters.partyId" value="_NA_"/>
+        </if-empty>
+        <if-empty field="parameters.workEffortId">
+            <set field="parameters.workEffortId" value="_NA_"/>
+        </if-empty>
+        
+        <!-- try to find existing value -->
+        <entity-and entity-name="RateAmount" list-name="rateAmounts" filter-by-date="true">
+            <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+            <field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
+            <field-map field-name="rateCurrencyUomId" env-name="parameters.rateCurrencyUomId"/>
+            <field-map field-name="emplPositionTypeId" env-name="parameters.emplPositionTypeId"/>
+            <field-map field-name="partyId" env-name="parameters.partyId"/>
+            <field-map field-name="periodTypeId" env-name="parameters.periodTypeId"/>
+        </entity-and>
+
+        <!-- end existing value -->
+        <if-not-empty field="rateAmounts">
+            <first-from-list entry-name="rateAmount" list-name="rateAmounts"/>
+            <if-compare-field field="rateAmount.rateAmount" operator="not-equals" to-field="parameters.rateAmount">
+                <set-service-fields service-name="deleteRateAmount" map-name="rateAmount" to-map-name="delRateAmount"/>
+                <call-service service-name="deleteRateAmount" in-map-name="delRateAmount"/>
+            </if-compare-field>
+        </if-not-empty>
+
+        <make-value entity-name="RateAmount" value-name="newEntity"/>
+        <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+        <now-timestamp-to-env env-name="newEntity.fromDate"/>
+        <clear-field field-name="newEntity.thruDate"/>
+        <create-value value-name="newEntity"/>
+    </simple-method>   
+
+    <simple-method method-name="deleteRateAmount" short-description="update/create a rate amount value">
+        <set value="_CREATE" field="securityAction"/>
+        <check-permission permission="ACCOUNTING" action="${securityAction}"><fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/></check-permission>
+        <check-errors/>
+        
+        <!-- set defaults -->
+        <if-empty field="parameters.rateCurrencyUomId">
+            <property-to-field resource="general.properties" property="currency.uom.id.default" field-name="parameters.rateCurrencyUomId"/>
+        </if-empty>
+        <if-empty field="parameters.periodTypeId">
+            <set field="parameters.periodTypeId" value="RATE_HOUR"/>
+        </if-empty>
+        <if-empty field="parameters.emplPositionTypeId">
+            <set field="parameters.emplPositionTypeId" value="_NA_"/>
+        </if-empty>
+        <if-empty field="parameters.partyId">
+            <set field="parameters.partyId" value="_NA_"/>
+        </if-empty>
+        <if-empty field="parameters.workEffortId">
+            <set field="parameters.workEffortId" value="_NA_"/>
+        </if-empty>
+
+        <entity-one entity-name="RateAmount" value-name="rateAmount"/>
+
+        <if-not-empty field="rateAmount">
+            <now-timestamp-to-env env-name="rateAmount.thruDate"/>
+            <store-value value-name="rateAmount"/>
+            <else>
+                <add-error><fail-message message="could not find record to be deleted"/></add-error>
+            </else>
+        </if-not-empty>
+
+    </simple-method>
+
+    <simple-method method-name="getRateAmount" short-description="Get the applicable rate amount value">
+        <set value="_READ" field="securityAction"/>
+        <check-permission permission="ACCOUNTING" action="${securityAction}"><fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/></check-permission>
+        <check-errors/>
+        <!-- 
+           Search for the applicable rate from most specific to most general in the RateAmount entity
+           Defaults for periodTypeId is per hour and default currency is the currency in general.properties
+           The order is:
+               1. for specific rateTypeId, workEffortId (workEffort)
+               2. for specific rateTypeId, partyId (party)
+               3. for specific rateTypeId, emplPositionTypeId (emplPositionType)
+               4. for specific rateTypeId (rateType)
+               
+               Then will be checked if the requested periodTypeId and currency can be found, if not isue an error message
+        -->
+        <if-empty field="parameters.rateCurrencyUomId">
+            <property-to-field resource="general.properties" property="currency.uom.id.default" field-name="parameters.rateCurrencyUomId"/>
+        </if-empty>
+        <if-empty field="parameters.periodTypeId">
+            <set field="parameters.periodTypeId" value="RATE_HOUR"/>
+        </if-empty>
+        
+        <if><!-- workeffort level -->
+            <condition>
+                <and>
+                    <not><if-empty field="parameters.workEffortId"/></not>
+                    <if-compare field="parameters.workEffortId" value="_NA_" operator="not-equals"/>
+                </and>           
+            </condition>
+            <then>
+                <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                    <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+                    <field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
+                </entity-and>
+                <if-not-empty field="amounts">
+                    <first-from-list entry-name="amount" list-name="amounts"/>
+                    <if-not-empty field="amount.rateAmount">
+                        <set field="level" value="workEffort"/>
+                    </if-not-empty>
+                </if-not-empty>
+            </then>
+        </if>
+        
+        <if><!-- party level -->
+            <condition>
+                <and>
+                    <if-empty field="level"/>
+                    <not><if-empty field="parameters.partyId"/></not>
+                    <if-compare field="parameters.partyId" value="_NA_" operator="not-equals"/>
+                </and>           
+            </condition>
+            <then>
+                <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                    <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+                    <field-map field-name="partyId" env-name="parameters.partyId"/>
+                </entity-and>
+                <if-not-empty field="amounts">
+                    <first-from-list entry-name="amount" list-name="amounts"/>
+                    <if-not-empty field="amount.rateAmount">
+                        <set field="level" value="party"/>
+                    </if-not-empty>
+                </if-not-empty>
+            </then>
+        </if>
+        
+        <if><!-- emplPositionType level -->
+            <condition>
+                <and>
+                    <if-empty field="level"/>
+                    <not><if-empty field="parameters.emplPositionTypeId"/></not>
+                    <if-compare field="parameters.emplPositionTypeId" value="_NA_" operator="not-equals"/>
+                </and>           
+            </condition>
+            <then>
+                <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                    <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+                    <field-map field-name="emplPositionTypeId" env-name="parameters.emplPositionTypeId"/>
+                </entity-and>
+                <if-not-empty field="amounts">
+                    <first-from-list entry-name="amount" list-name="amounts"/>
+                    <if-not-empty field="amount.rateAmount">
+                        <set field="level" value="emplPositionType"/>
+                    </if-not-empty>
+                </if-not-empty>
+            </then>
+        </if>
+        
+        <if-empty field="level">
+            <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+            </entity-and>
+            <set field="level" value="rateType"/>
+        </if-empty>
+        
+        <if-empty field="amounts">
+            <entity-one entity-name="RateType" value-name="rateType"/>
+            <log level="error" message="A valid rate amount could not be found for rateType: ${rateType.description}"/>
+        </if-empty>
+        <if-compare field="level" value="workEffort" operator="equals">
+            <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+                <field-map field-name="partyId" env-name="parameters.partyId"/>
+                <field-map field-name="workEffortId" env-name="parameters.workEffortId"/>
+                <field-map field-name="periodTypeId" env-name="parameters.periodTypeId"/>
+                <field-map field-name="rateCurrencyUomId" env-name="parameters.rateCurrencyUomId"/>
+            </entity-and>
+            <if-empty field="amounts">
+                <entity-one entity-name="Uom" value-name="currencyUomId">
+                    <field-map field-name="uomId" env-name="parameters.rateCurrencyUomId"/>
+                </entity-one>
+                <entity-one entity-name="PeriodType" value-name="periodType"/>
+                <entity-one entity-name="RateType" value-name="rateType"/>
+                <entity-one entity-name="WorkEffort" value-name="workEffort"/>
+                <entity-one entity-name="PartyNameView" value-name="partyNameView"/>
+                <log level="error" message="A valid rate entry could be found for rateType: ${rateType.description}, workEffort: ${workEffort.workEffortName}, party: ${partyNameView.lastName} ${partyNameView.middleName} ${partyNameView.firstName}${partyNameView.groupName} However.....not for the period: ${period.description} and currency: ${currencyUomId.description}"/>
+            </if-empty>
+        </if-compare>
+        
+        <if-compare field="level" value="party" operator="equals">
+            <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+                <field-map field-name="partyId" env-name="parameters.partyId"/>
+                <field-map field-name="periodTypeId" env-name="parameters.periodTypeId"/>
+                <field-map field-name="rateCurrencyUomId" env-name="parameters.rateCurrencyUomId"/>
+            </entity-and>
+            <if-empty field="amounts">
+                <entity-one entity-name="Uom" value-name="currencyUomId">
+                    <field-map field-name="uomId" env-name="parameters.rateCurrencyUomId"/>
+                </entity-one>
+                <entity-one entity-name="PeriodType" value-name="periodType"/>
+                <entity-one entity-name="RateType" value-name="rateType"/>
+                <entity-one entity-name="PartyNameView" value-name="partyNameView"/>
+                <log level="error" message="A valid rate entry could be found for rateType: ${rateType.description}, party: ${partyNameView.lastName} ${partyNameView.middleName} ${partyNameView.firstName}${partyNameView.groupName} However..... NOT   for the period: ${period.description} and currency: ${currencyUomId.description}"/>
+            </if-empty>
+        </if-compare>
+        
+        <if-compare field="level" value="emplPositionType" operator="equals">
+            <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+                <field-map field-name="emplPositionTypeId" env-name="parameters.emplPositionTypeId"/>
+                <field-map field-name="periodTypeId" env-name="parameters.periodTypeId"/>
+                <field-map field-name="rateCurrencyUomId" env-name="parameters.rateCurrencyUomId"/>
+            </entity-and>
+            <if-empty field="amounts">
+                <entity-one entity-name="Uom" value-name="currencyUomId">
+                    <field-map field-name="uomId" env-name="parameters.rateCurrencyUomId"/>
+                </entity-one>
+                <entity-one entity-name="PeriodType" value-name="periodType"/>
+                <entity-one entity-name="RateType" value-name="rateType"/>
+                <entity-one entity-name="EmplPositionType" value-name="emplPositionType"/>
+                <log level="error" message="A valid rate entry could be found for rateType: ${rateType.description}, emplPositionType: ${emplPositionType.description}.... However.....NOT for the period: ${period.description} and currency: ${currencyUomId.description}"/>
+                <check-errors/>
+            </if-empty>
+        </if-compare>
+        
+        <if-compare field="level" value="rateType" operator="equals">
+            <entity-and entity-name="RateAmount" list-name="amounts" filter-by-date="true">
+                <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+                <field-map field-name="periodTypeId" env-name="parameters.periodTypeId"/>
+                <field-map field-name="rateCurrencyUomId" env-name="parameters.rateCurrencyUomId"/>
+            </entity-and>
+            <if-empty field="amounts">
+                <entity-one entity-name="Uom" value-name="currencyUomId">
+                    <field-map field-name="uomId" env-name="parameters.rateCurrencyUomId"/>
+                </entity-one>
+                <entity-one entity-name="PeriodType" value-name="periodType"/>
+                <entity-one entity-name="RateType" value-name="rateType"/>
+                <entity-one entity-name="PartyNameView" value-name="partyNameView"/>
+                <log level="error" message="A valid rate entry could be found for rateType: ${rateType.description}, However.....NOT for the period: ${period.description} and currency: ${currencyUomId.description}"/>
+                <check-errors/>
+            </if-empty>
+        </if-compare>
+        <if-not-empty field="amounts">
+            <first-from-list entry-name="amount" list-name="amounts"/>
+            <if-empty field="amount.rateAmount">
+                <set field="amount.rateAmount" value="0" type="Double"/>
+            </if-empty>
+            <field-to-result field-name="amount.rateAmount" result-name="rateAmount"/>
+            <field-to-result field-name="amount.periodTypeId" result-name="periodTypeId"/>
+            <field-to-result field-name="amount.rateCurrencyUomId" result-name="rateCurrencyUomId"/>
+            <field-to-result field-name="level"/>
+            <field-to-result field-name="amount.fromDate" result-name="fromDate"/>
+        </if-not-empty>
+        
+    </simple-method>
+        
+    <!-- party rate services -->
+    <simple-method method-name="updatePartyRate" short-description="Update/Create PartyRate">
+        <set value="_CREATE" field="securityAction"/>
+        <check-permission permission="ACCOUNTING" action="${securityAction}"><fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/></check-permission>
+        <check-errors/>
+        
+        <!-- check if already exist is so expire current record -->
+        <entity-and entity-name="PartyRate" list-name="partyRates" filter-by-date="true">
+            <field-map field-name="partyId" env-name="parameters.partyId"/>
+            <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+        </entity-and>
+        <if-not-empty field="partyRates">
+            <first-from-list entry-name="partyRate" list-name="partyRates"/>
+            <now-timestamp-to-env env-name="partyRate.thruDate"/>
+            <store-value value-name="partyRate"/>
+        </if-not-empty>
+
+        <make-value value-name="newEntity" entity-name="PartyRate"/>
+        <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
+        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+        <call-simple-method method-name="checkOtherDefaultRate"/>
+        <create-value value-name="newEntity"/>
+        
+        <if-not-empty field="parameters.rateAmount">
+            <set-service-fields service-name="updateRateAmount" map-name="parameters" to-map-name="updRate"/>
+            <call-service service-name="updateRateAmount" in-map-name="updRate"/>
+        </if-not-empty>
+    </simple-method>
+
+    <simple-method method-name="checkOtherDefaultRate" short-description="remove an other defaultRate flag">
+        <set value="_CREATE" field="securityAction"/>
+        <check-permission permission="ACCOUNTING" action="${securityAction}"><fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/></check-permission>
+        <check-errors/>
+        <if-compare field="newEntity.defaultRate" value="Y" operator="equals">
+            <entity-and entity-name="PartyRate" list-name="rates" filter-by-date="true">
+                <field-map field-name="partyId" env-name="newEntity.partyId"/>
+                <field-map field-name="defaultRate" value="Y"/>
+            </entity-and>
+            <if-not-empty field="rates">
+                <first-from-list entry-name="rate" list-name="rates"/>
+                <set field="rate.defaultRate" value="N"/>
+                <store-value value-name="rate"/>
+            </if-not-empty>
+        </if-compare>
+    </simple-method>
+    <simple-method method-name="deletePartyRate" short-description="Delete PartyRate">
+        <set value="_UPDATE" field="securityAction"/>
+        <check-permission permission="ACCOUNTING" action="${securityAction}"><fail-property resource="AccountingUiLabels" property="AccountingPermissionError"/></check-permission>
+        <check-errors/>
+        
+        <entity-one entity-name="PartyRate" value-name="lookedUpValue"/>
+        <now-timestamp-to-env env-name="lookedUpValue.thruDate"/>
+        <store-value value-name="lookedUpValue"/>
+        
+        <set-service-fields service-name="deleteRateAmount" map-name="parameters" to-map-name="delRateAmount"/>
+        <set field="delRateAmount.fromDate" from-field="parameters.rateAmountFromDate"/>
+        <call-service service-name="deleteRateAmount" in-map-name="delRateAmount"/>        
+    </simple-method>
+
+    <!-- migrate service -->
+    <simple-method method-name="migrateRateFactor" short-description="migrate the several entities which were change in the rate refactor activity">
+        <entity-condition entity-name="OldEmplPositionTypeRate" list-name="posRates"/>
+        <iterate entry-name="posRate" list-name="posRates">
+            <make-value value-name="emplPositionTypeRate" entity-name="EmplPositionTypeRate"/>
+            <set-pk-fields value-name="posRate" map-name="emplPositionTypeRate"/>
+            <set-nonpk-fields value-name="posRate" map-name="emplPositionTypeRate"/>
+            <create-value value-name="emplPositionTypeRate"/>
+            <make-value value-name="rateAmount" entity-name="RateAmount"/>
+            <set-pk-fields value-name="posRate" map-name="rateAmount"/>
+            <set-nonpk-fields value-name="posRate" map-name="rateAmount"/>
+            <set field="rateAmount.workeffortId" value="_NA_"/>
+            <set field="rateAmount.partyId" value="_NA_"/>
+            <property-to-field resource="general.properties" property="currency.uom.id.default" field-name="rateAmount.rateCurrencyUomId"/>
+            <create-value value-name="rateAmount"/>
+        </iterate>        
+        <entity-condition entity-name="OldPartyRate" list-name="partyRates"/>
+        <iterate entry-name="oldPartyRate" list-name="oldPartyRates">
+            <make-value value-name="partyRate" entity-name="PartyRate"/>
+            <set-pk-fields value-name="oldPartyRate" map-name="partyRate"/>            
+            <set-nonpk-fields value-name="oldPartyRate" map-name="partyRate"/>
+            <create-value value-name="partyRate"/>
+            <make-value value-name="rateAmount" entity-name="RateAmount"/>
+            <set-pk-fields value-name="oldPartyRate" map-name="rateAmount"/>
+            <set-nonpk-fields value-name="oldPartyRate" map-name="rateAmount"/>
+            <set field="rateAmount.workeffortId" value="_NA_"/>
+            <set field="rateAmount.emplPositionTypeId" value="_NA_"/>
+            <set field="rateAmount.periodTypeId" value="RATE_HOUR"/>
+            <create-value value-name="rateAmount"/>
+        </iterate>
+    </simple-method>
+</simple-methods>

Propchange: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/rate/RateServices.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/accounting/servicedef/services_admin.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_admin.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_admin.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_admin.xml Mon Dec 22 23:26:55 2008
@@ -24,7 +24,7 @@
     <vendor>OFBiz</vendor>
     <version>1.0</version>
     <service name="createPartyAcctgPreference" default-entity-name="PartyAcctgPreference" engine="simple"
-            location="org/ofbiz/accounting/admin/AcctgAdminServices.xml" invoke="createPartyAcctgPreference" auth="true">
+        location="org/ofbiz/accounting/admin/AcctgAdminServices.xml" invoke="createPartyAcctgPreference" auth="true">
         <description>Create accounting preferences for a party (organization)</description>
         <permission-service service-name="acctgPrefPermissionCheck" main-action="CREATE"/>
         <auto-attributes include="pk" mode="IN" optional="false"/>

Added: ofbiz/trunk/applications/accounting/servicedef/services_rate.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_rate.xml?rev=728894&view=auto
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_rate.xml (added)
+++ ofbiz/trunk/applications/accounting/servicedef/services_rate.xml Mon Dec 22 23:26:55 2008
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
+    <description>Accounting Services: Rate and related services</description>
+    <vendor>OFBiz</vendor>
+    <version>1.0</version>
+
+    <service name="updateRateAmount" default-entity-name="RateAmount" engine="simple" auth="true"
+        location="org/ofbiz/accounting/rate/RateServices.xml" invoke="updateRateAmount">
+        <description>Create/update Rate Amount</description>
+        <auto-attributes include="all" mode="IN" optional="true"/>
+        <override name="rateTypeId" optional="false"/>
+        <override name="rateAmount" optional="false"/>
+    </service>
+    <service name="deleteRateAmount" default-entity-name="RateAmount" engine="simple" auth="true"
+        location="org/ofbiz/accounting/rate/RateServices.xml" invoke="deleteRateAmount">
+        <description>Delete (expire) Rate Amount</description>
+        <auto-attributes include="pk" mode="IN" optional="true"/>
+        <override name="rateTypeId" optional="false"/>
+        <override name="fromDate" optional="false"/>
+    </service>
+    <service name="getRateAmount" default-entity-name="RateAmount" engine="simple" auth="true"
+        location="org/ofbiz/accounting/rate/RateServices.xml" invoke="getRateAmount">
+        <description>Get Rate Amount</description>
+        <auto-attributes include="pk" mode="IN" optional="true"/>
+        <attribute name="level" type="String" mode="OUT" optional="true"/><!-- the level the amount was retrieved from(specific -> general): workEffort, party, emplPositionType, rateType or 'null' if not found-->
+        <attribute name="rateAmount" type="Double" mode="OUT" optional="true"/>
+        <attribute name="periodTypeId" type="String" mode="INOUT" optional="true"/>
+        <attribute name="rateCurrencyUomId" type="String" mode="INOUT" optional="true"/>
+        <attribute name="fromDate" type="Timestamp" mode="OUT" optional="true"/>
+        <override name="rateTypeId" optional="false"/>
+    </service>
+
+    <!-- PartyRate Services -->
+    <service name="updatePartyRate" default-entity-name="PartyRate" engine="simple" auth="true"
+        location="org/ofbiz/accounting/rate/RateServices.xml" invoke="updatePartyRate">
+        <description>Creates PartyRate</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="organizationPartyId" type="String" mode="IN" optional="true"/>
+        <attribute name="rateAmount" type="Double" mode="IN" optional="true"/>
+        <attribute name="rateCurrencyUomId" type="String" mode="IN" optional="true"/>
+        <attribute name="periodTypeId" type="String" mode="IN"/>
+        <override name="fromDate" optional="true"/>
+    </service>
+    <service name="deletePartyRate" default-entity-name="PartyRate" engine="simple" auth="true"
+        location="org/ofbiz/accounting/rate/RateServices.xml" invoke="deletePartyRate">
+        <description>Deletes PartyRate</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <attribute name="rateAmountFromDate" type="Timestamp" mode="IN" optional="true"/><!-- to be able to expire rateamount specific to a party records....-->
+    </service>
+    
+</services>

Propchange: ofbiz/trunk/applications/accounting/servicedef/services_rate.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/accounting/servicedef/services_rate.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/accounting/servicedef/services_rate.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Mon Dec 22 23:26:55 2008
@@ -1395,6 +1395,25 @@
         <response name="success" type="view" value="ViewFXConversions"/>
         <response name="error" type="view" value="ViewFXConversions"/>
     </request-map>
+
+    <request-map uri="viewRateAmounts">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="ViewRateAmounts"/>
+    </request-map>
+
+    <request-map uri="updateRateAmount">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateRateAmount"/>
+        <response name="success" type="view" value="ViewRateAmounts"/>
+        <response name="error" type="view" value="ViewRateAmounts"/>
+    </request-map>
+    
+    <request-map uri="deleteRateAmount">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="deleteRateAmount"/>
+        <response name="success" type="view" value="ViewRateAmounts"/>
+        <response name="error" type="view" value="ViewRateAmounts"/>
+    </request-map>
     
     <request-map uri="editProductGlAccounts">
         <security https="true" auth="true"/>
@@ -2029,6 +2048,7 @@
     <view-map name="ListGlAccountOrganization" type="screen" page="component://accounting/widget/GlSetupScreens.xml#ListGlAccountOrganization"/>
     <view-map name="SetupGlJournals" type="screen" page="component://accounting/widget/GlSetupScreens.xml#SetupGlJournals"/>
     <view-map name="ViewFXConversions" type="screen" page="component://accounting/widget/GlSetupScreens.xml#ViewFXConversions"/>
+    <view-map name="ViewRateAmounts" type="screen" page="component://accounting/widget/GlobalGlAccountsScreens.xml#ViewRateAmounts"/>
     <view-map name="GlAccountTypeDefaults" type="screen" page="component://accounting/widget/GlSetupScreens.xml#GlAccountTypeDefaults"/>
     <view-map name="GlAccountPurInvoice" type="screen" page="component://accounting/widget/GlSetupScreens.xml#GlAccountPurInvoice"/>
     <view-map name="GlAccountSalInvoice" type="screen" page="component://accounting/widget/GlSetupScreens.xml#GlAccountSalInvoice"/>

Modified: ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlSetupForms.xml Mon Dec 22 23:26:55 2008
@@ -325,7 +325,8 @@
         <field name="conversionFactor"><text/></field>
         <field name="submitButton" title="${uiLabelMap.AccountingUpdateFX}"><submit/></field>
     </form>
-
+    
+    
     <form name="ListGlAccountTypeDefaults" type="list" target="" list-name="glAccountTypeDefaults"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <actions>

Modified: ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsForms.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsForms.xml Mon Dec 22 23:26:55 2008
@@ -196,4 +196,67 @@
         <field name="acctgTransEntrySeqId"><display/></field>
         <field name="reconciledAmount"><display/></field>
     </form>
+    <form name="ListRateAmounts" type="list" target="deleteRateAmount" paginate-target="viewRateAmounts"
+        odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <actions>
+            <set field="sortField" from-field="parameters.sortField" default-value="rateTypeId"/>
+            <entity-condition entity-name="RateAmountAndRelations" filter-by-date="true">
+                <order-by field-name="${sortField}"/>
+                <order-by field-name="rateTypeId"/>
+                <order-by field-name="periodTypeId"/>
+            </entity-condition>
+        </actions>
+        <field name="fromDate"><hidden/></field>
+        <field name="rateTypeId"><hidden/></field>
+        <field name="rateCurrencyUomId"><hidden/></field>
+        <field name="rateDescription"><display/></field>
+        <field name="periodTypeId"><display description="${periodDescription}"/></field>
+        <field name="partyId" sort-field="true"><display description="${groupName}${lastName} ${firstName} ${middleName}"/></field>
+        <field name="workEffortId" sort-field="true"><display description="${workEffortName}"/></field>
+        <field name="emplPositionTypeId" sort-field="true"><display description="${employeePositionDescription}"/></field>
+        <field name="rateAmount"><display type="currency" currency="${rateCurrencyUomId}"/></field>
+        <field name="delete"><submit/></field>
+    </form>
+    
+    <form name="updateRateAmount" type="single" target="updateRateAmount" default-service-name="updateRateAmount" 
+        header-row-style="header-row" default-table-style="basic-table">
+        <actions>
+            <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD" />
+        </actions>
+        <field name="rateTypeId">
+            <drop-down>
+                <entity-options entity-name="RateType" description="${description}">
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="periodTypeId" position="2">
+            <drop-down>
+                <entity-options entity-name="PeriodType" description="${description}">
+                    <entity-constraint name="periodTypeId" operator="like" value="RATE_%"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="rateAmount" position="1"><text/></field>
+        <field name="rateCurrencyUomId" position="2">
+            <drop-down allow-empty="true" no-current-selected-key="${defaultCurrencyUomId}">
+                <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom">
+                    <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="abbreviation"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="partyId"><lookup target-form-name="LookupPartyId"></lookup></field>
+        <field name="workEffortId"><lookup target-form-name="LookupWorkEffort"><sub-hyperlink target="ww" description="${workEffortName}"/></lookup></field>
+        <field name="emplPositionTypeId" position="2">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="EmplPositionType" description="${description}">
+                    <entity-constraint name="emplPositionTypeId" operator="not-equals" value="_NA_"/>
+                    <entity-order-by field-name="description"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submitButton" title="${uiLabelMap.AccountingUpdateRateAmount}"><submit/></field>
+    </form>
 </forms>
\ No newline at end of file

Modified: ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/GlobalGlAccountsScreens.xml Mon Dec 22 23:26:55 2008
@@ -411,4 +411,24 @@
             </widgets>
         </section>
     </screen>
+    <screen name="ViewRateAmounts">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
+                <set field="titleProperty" value="AccountingRateAmounts"/>
+                <set field="labelTitleProperty" value="${uiLabelMap.AccountingRateAmounts}"/>
+                <set field="tabButtonItem" value="ViewRateAmounts"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="GlobalGLSettingsDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.AccountingUpdateRateAmount}" navigation-form-name="ListRateAmounts">
+                            <include-form name="updateRateAmount" location="component://accounting/widget/GlobalGlAccountsForms.xml"/>
+                        </screenlet>
+                        <include-form name="ListRateAmounts" location="component://accounting/widget/GlobalGlAccountsForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>
\ No newline at end of file

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Mon Dec 22 23:26:55 2008
@@ -575,6 +575,9 @@
         <menu-item name="InvoiceItemTypes" title="${uiLabelMap.AccountingInvoiceItemType}">
             <link target="editInvoiceItemType"/>
         </menu-item>    
+        <menu-item name="ViewRateAmounts" title="${uiLabelMap.AccountingRates}">
+            <link target="viewRateAmounts"/>
+        </menu-item>
     </menu>
 
     <menu name="AgreementTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">

Modified: ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/humanres/entitydef/entitymodel.xml Mon Dec 22 23:26:55 2008
@@ -753,32 +753,44 @@
         <key-map field-name="responsibilityTypeId"/>
       </relation>
     </entity>
-    <entity entity-name="EmplPositionTypeRate"
-            package-name="org.ofbiz.humanres.position"
-            title="EmplPosition Type Rate Entity">
-        <field name="emplPositionTypeId" type="id-ne"/>
-        <field name="periodTypeId" type="id-ne"/>
-        <field name="payGradeId" type="id"/>
-        <field name="salaryStepSeqId" type="id"/>
-        <field name="rateTypeId" type="id"/>
-        <field name="fromDate" type="date-time"/>
-        <field name="thruDate" type="date-time"/>
-        <field name="rate" type="id"/>
-        <prim-key field="emplPositionTypeId"/>
-        <prim-key field="periodTypeId"/>
-        <prim-key field="fromDate"/>
-        <relation type="one" fk-name="EMPL_PSTPRT_EPTP" rel-entity-name="EmplPositionType">
-            <key-map field-name="emplPositionTypeId"/>
-        </relation>
-        <relation type="one" fk-name="EMPL_PSTPRT_PRDTYP" rel-entity-name="PeriodType">
-            <key-map field-name="periodTypeId"/>
-        </relation>
-        <relation type="one-nofk" fk-name="EMPL_PSTPRT_SSTP" rel-entity-name="SalaryStep">
-            <key-map field-name="salaryStepSeqId"/>
-            <key-map field-name="payGradeId"/>
-        </relation>
-        <relation type="one-nofk" fk-name="EMPL_PSTPRT_RTTYP" rel-entity-name="RateType">
-            <key-map field-name="rateTypeId"/>
-        </relation>
-    </entity>
+  <entity entity-name="EmplPositionTypeRate" table-name="EMPL_POSITION_TYPE_RATE_NEW"
+    package-name="org.ofbiz.humanres.position"
+    title="EmplPosition Type Rate Entity">
+    <field name="emplPositionTypeId" type="id-ne"/>
+    <field name="rateTypeId" type="id-ne"/>
+    <field name="payGradeId" type="id"/>
+    <field name="salaryStepSeqId" type="id"/>
+    <field name="fromDate" type="date-time"/>
+    <field name="thruDate" type="date-time"/>
+    <prim-key field="emplPositionTypeId"/>
+    <prim-key field="rateTypeId"/>
+    <prim-key field="fromDate"/>
+    <relation type="one" fk-name="EMPL_PTPRT_EPTP" rel-entity-name="EmplPositionType">
+      <key-map field-name="emplPositionTypeId"/>
+    </relation>
+    <relation type="one-nofk" fk-name="EMPL_PTPRT_SSTP" rel-entity-name="SalaryStep">
+      <key-map field-name="salaryStepSeqId"/>
+      <key-map field-name="payGradeId"/>
+    </relation>
+    <relation type="one-nofk" fk-name="EMPL_PTPRT_RTTYP" rel-entity-name="RateType">
+      <key-map field-name="rateTypeId"/>
+    </relation>
+  </entity>
+  <view-entity entity-name="EmplPositionTypeRateAndAmount"
+    package-name="org.ofbiz.humanres.position"
+    title="EmplPosition Type Rate Entity and Rate Amount">
+    <member-entity entity-alias="EPTR" entity-name="EmplPositionTypeRate"/>
+    <member-entity entity-alias="RA" entity-name="RateAmount"/>
+    <alias-all entity-alias="EPTR"/>
+    <alias entity-alias="RA" name="rateAmount"/>
+    <alias entity-alias="RA" name="periodTypeId"/>
+    <alias entity-alias="RA" name="rateCurrencyUomId"/>
+    <alias entity-alias="RA" name="rateAmountFromDate" field="fromDate"/>
+    <alias entity-alias="RA" name="rateAmountThruDate" field="thruDate"/>
+    <view-link entity-alias="EPTR" rel-entity-alias="RA">
+      <key-map field-name="emplPositionTypeId"/>
+      <key-map field-name="rateTypeId"/>
+    </view-link>
+  </view-entity>
+
 </entitymodel>
\ No newline at end of file

Added: ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml?rev=728894&view=auto
==============================================================================
--- ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml (added)
+++ ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml Mon Dec 22 23:26:55 2008
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+
+<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd">
+    <title>Entity of an Open For Business Project Component</title>
+    <description>None</description>
+    <copyright>Copyright 2001-2008 The Apache Software Foundation</copyright>
+    <author>None</author>
+    <version>1.0</version>
+
+  <entity entity-name="OldEmplPositionTypeRate" table-name="EMPL_POSITION_TYPE_RATE"
+    package-name="org.ofbiz.humanres.position"
+    title="EmplPosition Type Rate Entity">
+    <field name="emplPositionTypeId" type="id-ne"/>
+    <field name="periodTypeId" type="id-ne"/>
+    <field name="payGradeId" type="id"/>
+    <field name="salaryStepSeqId" type="id"/>
+    <field name="rateTypeId" type="id"/>
+    <field name="fromDate" type="date-time"/>
+    <field name="thruDate" type="date-time"/>
+    <field name="rate" type="id"/>
+    <prim-key field="emplPositionTypeId"/>
+    <prim-key field="periodTypeId"/>
+    <prim-key field="fromDate"/>
+    <relation type="one" fk-name="EMPL_PSTPRT_EPTP" rel-entity-name="EmplPositionType">
+      <key-map field-name="emplPositionTypeId"/>
+    </relation>
+    <relation type="one" fk-name="EMPL_PSTPRT_PRDTYP" rel-entity-name="PeriodType">
+      <key-map field-name="periodTypeId"/>
+    </relation>
+    <relation type="one-nofk" fk-name="EMPL_PSTPRT_SSTP" rel-entity-name="SalaryStep">
+      <key-map field-name="salaryStepSeqId"/>
+      <key-map field-name="payGradeId"/>
+    </relation>
+    <relation type="one-nofk" fk-name="EMPL_PSTPRT_RTTYP" rel-entity-name="RateType">
+      <key-map field-name="rateTypeId"/>
+    </relation>
+  </entity>
+</entitymodel>

Propchange: ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/humanres/entitydef/entitymodel_old.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: ofbiz/trunk/applications/humanres/ofbiz-component.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/ofbiz-component.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/ofbiz-component.xml (original)
+++ ofbiz/trunk/applications/humanres/ofbiz-component.xml Mon Dec 22 23:26:55 2008
@@ -26,6 +26,7 @@
     <classpath type="dir" location="script"/>
     <classpath type="dir" location="config"/>
     <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/>
+    <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_old.xml"/>
     <entity-resource type="data" reader-name="seed" loader="main" location="data/HumanResTypeData.xml"/>
     <entity-resource type="data" reader-name="seed" loader="main" location="data/HumanResSecurityData.xml"/>
     <service-resource type="model" loader="main" location="servicedef/services.xml"/>

Modified: ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/HumanResServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/HumanResServices.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/HumanResServices.xml (original)
+++ ofbiz/trunk/applications/humanres/script/org/ofbiz/humanres/HumanResServices.xml Mon Dec 22 23:26:55 2008
@@ -1,21 +1,21 @@
-<?xml version="1.0" encoding="UTF-8" ?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!--
-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.
+    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.
 -->
 
 <simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
@@ -605,29 +605,39 @@
         <store-value value-name="lookedUpValue"/>
     </simple-method>
     
-    <simple-method method-name="createEmplPositionTypeRate" short-description="Create a PositionType">
-        <make-value entity-name="EmplPositionTypeRate" value-name="newEntity"/>
+    <simple-method method-name="updateEmplPositionTypeRate" short-description="Update/create EmplPositionTypeRate">
+        <entity-one entity-name="EmplPositionTypeRate" value-name="lookedUpValue"/>
+        <!-- check if already exist is so expire current record -->
+        <entity-and entity-name="EmplPositionTypeRate" list-name="emplPositionTypeRates" filter-by-date="true">
+            <field-map field-name="emplPositionTypeId" env-name="parameters.emplPositionTypeId"/>
+            <field-map field-name="rateTypeId" env-name="parameters.rateTypeId"/>
+        </entity-and>
+        <if-not-empty field="emplPositionTypeRates">
+            <first-from-list entry-name="emplPositionTypeRate" list-name="emplPositionTypeRates"/>
+            <now-timestamp-to-env env-name="emplPositionTypeRate.thruDate"/>
+            <store-value value-name="emplPositionTypeRate"/>
+        </if-not-empty>
+        
+        <make-value value-name="newEntity" entity-name="EmplPositionTypeRate"/>
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <if-empty field="newEntity.fromDate"><now-timestamp-to-env env-name="newEntity.fromDate"/></if-empty>
         <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
-        <if-empty field="newEntity.fromDate">
-            <now-timestamp-to-env env-name="nowTimeStamp"/>
-            <set field="newEntity.fromDate" from-field="nowTimeStamp"/>
-        </if-empty>
-        <field-to-result field-name="newEntity.emplPositionTypeId" result-name="emplPositionTypeId"/>
-        <field-to-result field-name="newEntity.periodTypeId" result-name="periodTypeId"/>
-        <field-to-result field-name="newEntity.fromDate" result-name="fromDate"/>
-        <create-value value-name="newEntity"/>        
+        <create-value value-name="newEntity"/>
+        
+        <if-not-empty field="parameters.rateAmount">
+            <set-service-fields service-name="updateRateAmount" map-name="parameters" to-map-name="updRate"/>
+            <call-service service-name="updateRateAmount" in-map-name="updRate"/>
+        </if-not-empty>
     </simple-method>
     
-    <simple-method method-name="updateEmplPositionTypeRate" short-description="Update EmplPositionTypeRate">
+    <simple-method method-name="deleteEmplPositionTypeRate" short-description="Delete EmplPositionTypeRate">
         <entity-one entity-name="EmplPositionTypeRate" value-name="lookedUpValue"/>
-        <set-nonpk-fields value-name="lookedUpValue" map-name="parameters"/>
+        <now-timestamp-to-env env-name="lookedUpValue.thruDate"/>
         <store-value value-name="lookedUpValue"/>
-    </simple-method>
-    
-    <simple-method method-name="deleteEmplPositionTypeRate" short-description="Delete EmplPositionTypeRate">
-        <entity-one entity-name="EmplPositionTypeRate" value-name="lookedUpValue"/>        
-        <remove-value value-name="lookedUpValue"/>
+        
+        <set-service-fields service-name="deleteRateAmount" map-name="parameters" to-map-name="delRateAmount"/>
+        <set field="delRateAmount.fromDate" from-field="parameters.rateAmountFromDate"/>
+        <call-service service-name="deleteRateAmount" in-map-name="delRateAmount"/>        
     </simple-method>
     
     <simple-method method-name="createAgreementEmploymentAppl" short-description="Create Agreement Employment Appl">

Modified: ofbiz/trunk/applications/humanres/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/servicedef/services.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/humanres/servicedef/services.xml Mon Dec 22 23:26:55 2008
@@ -633,21 +633,16 @@
         <auto-attributes mode="IN" include="nonpk" optional="true"/>
     </service>
     
-    <service name="createEmplPositionTypeRate" engine="simple" default-entity-name="EmplPositionTypeRate"
-             location="org/ofbiz/humanres/HumanResServices.xml" invoke="createEmplPositionTypeRate" auth="true">
-        <description>Create Valid EmplPositionTypeRate</description>
-        <permission-service service-name="humanResManagerPermission" main-action="CREATE"/>
-        <auto-attributes mode="INOUT" include="pk" optional="false"/>
-        <auto-attributes mode="IN" include="nonpk" optional="true"/>
-        <override name="fromDate" optional="true"/>
-    </service>
-    
     <service name="updateEmplPositionTypeRate" engine="simple" default-entity-name="EmplPositionTypeRate"
              location="org/ofbiz/humanres/HumanResServices.xml" invoke="updateEmplPositionTypeRate" auth="true">
         <description>Update Valid EmplPositionTypeRate</description>
         <permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
-        <auto-attributes mode="IN" include="pk" optional="false"/>
-        <auto-attributes mode="IN" include="nonpk" optional="true"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="rateAmount" type="Double" mode="IN" optional="true"/>
+        <attribute name="rateCurrencyUomId" type="String" mode="IN" optional="true"/>
+        <attribute name="periodTypeId" type="String" mode="IN"/>
+        <override name="fromDate" optional="true"/>
     </service>
     
     <service name="deleteEmplPositionTypeRate" engine="simple" default-entity-name="EmplPositionTypeRate"
@@ -655,6 +650,7 @@
         <description>Delete Valid EmplPositionTypeRate</description>
         <permission-service service-name="humanResManagerPermission" main-action="DELETE"/>
         <auto-attributes mode="IN" include="pk" optional="false"/>
+        <attribute name="rateAmountFromDate" type="Timestamp" mode="IN" optional="true"/><!-- to be able to expire rateamount specific to a party records....-->
     </service>
     
     <service name="createAgreementEmploymentAppl"  engine="simple" default-entity-name="AgreementEmploymentAppl"

Modified: ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/controller.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/humanres/webapp/humanres/WEB-INF/controller.xml Mon Dec 22 23:26:55 2008
@@ -757,14 +757,9 @@
         <security https="true" auth="true"/>
         <response name="success" type="view" value="EditEmplPositionTypeRates"/>
     </request-map>
-    <request-map uri="createEmplPositionTypeRate">
-        <security https="true" auth="true"/>
-        <event type="service" invoke="createEmplPositionTypeRate"/>
-        <response name="success" type="view" value="EditEmplPositionTypeRates"/>
-    </request-map>
     <request-map uri="updateEmplPositionTypeRate">
         <security https="true" auth="true"/>
-        <event type="service-multi" invoke="updateEmplPositionTypeRate"/>
+        <event type="service" invoke="updateEmplPositionTypeRate"/>
         <response name="success" type="view" value="EditEmplPositionTypeRates"/>
     </request-map>
     <request-map uri="deleteEmplPositionTypeRate">

Modified: ofbiz/trunk/applications/humanres/widget/forms/GlobalHRSettingForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/humanres/widget/forms/GlobalHRSettingForms.xml?rev=728894&r1=728893&r2=728894&view=diff
==============================================================================
--- ofbiz/trunk/applications/humanres/widget/forms/GlobalHRSettingForms.xml (original)
+++ ofbiz/trunk/applications/humanres/widget/forms/GlobalHRSettingForms.xml Mon Dec 22 23:26:55 2008
@@ -114,54 +114,69 @@
         <field name="emplPositionTypeId" use-when="emplPositionType==null" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><text/></field>
         <field name="emplPositionTypeId" use-when="emplPositionType!=null"><display/></field>        
         <field name="description" title="${uiLabelMap.CommonDescription}"><text/></field>        
-        <field name="submitButton" use-when="emplPositionType==null" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>        
-        <field name="submitButton" use-when="emplPositionType!=null" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>        
     </form>
-    <form name="ListEmplPositionTypeRates" type="multi" title="" target="updateEmplPositionTypeRate"
+    <form name="ListEmplPositionTypeRates" type="list" title="" target="deleteEmplPositionTypeRate"
         odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
         <actions>
-            <entity-condition entity-name="EmplPositionTypeRate"><order-by field-name="fromDate"/></entity-condition>
+            <set field="nowDate" value="${bsh:org.ofbiz.base.util.UtilDateTime.nowDateString(&quot;yyyy-MM-dd HH:mm:ss.S&quot;)}" type="String"/>
+            <entity-condition entity-name="EmplPositionTypeRateAndAmount" filter-by-date="true">
+                <condition-list combine="and">
+                    <condition-expr field-name="emplPositionTypeId" env-name="parameters.emplPositionTypeId" operator="equals"/>
+                    <condition-list combine="or">
+                        <condition-expr field-name="rateAmountFromDate" env-name="null" operator="equals"/>
+                        <condition-expr field-name="rateAmountFromDate" env-name="nowDate" operator="less"/>
+                    </condition-list>
+                    <condition-list combine="or">
+                        <condition-expr field-name="rateAmountThruDate" env-name="null" operator="equals"/>
+                        <condition-expr field-name="rateAmountThruDate" env-name="nowDate" operator="greater"/>
+                    </condition-list>
+                </condition-list>
+                <order-by field-name="rateTypeId"/>
+            </entity-condition>
         </actions>
-        <auto-fields-service service-name="updateEmplPositionTypeRate" default-field-type="hidden"/>        
+        <field name="rateCurrencyUomId"><hidden/></field>
         <field name="emplPositionTypeId"><hidden/></field>
+        <field name="fromDate"><hidden/></field>
+        <field name="rateAmountFromDate"><hidden/></field>
+        <field name="rateTypeId"><display-entity entity-name="RateType" description="${description}"/></field>
         <field name="periodTypeId"><display-entity entity-name="PeriodType" description="${description}"/></field>
-        <field name="rateTypeId">
-            <drop-down allow-empty="true" no-current-selected-key="">
-                <entity-options description="${description}" key-field-name="rateTypeId" entity-name="RateType">
-                    <entity-order-by field-name="rateTypeId"/>
-                </entity-options>
-            </drop-down>
-        </field>
-        <field name="payGradeId"><lookup target-form-name="LookupPayGrade"/></field>        
-        <field name="salaryStepSeqId"><lookup target-form-name="LookupSalaryStep"/></field>
-        <field name="fromDate"><display/></field>
-        <field name="deleteLink" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
-            <hyperlink target="deleteEmplPositionTypeRate?emplPositionTypeId=${emplPositionTypeId}&amp;fromDate=${fromDate}" description="${uiLabelMap.CommonDelete}" also-hidden="false"/>
-        </field>
-        <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}"><hidden value="Y"/></field>
-        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit/></field>
+        <field name="payGradeId"><display-entity entity-name="PayGrade" description="${description}"/></field>        
+        <field name="salaryStepSeqId"><display/></field>
+        <field name="rateAmount"><display type="currency" currency="${rateCurrencyUomId}"/></field>
+        <field name="deleteButton" widget-style="buttontext"><submit/></field>
     </form>            
-    <form name="AddEmplPositionTypeRate" type="single" target="createEmplPositionTypeRate" default-map-name="emplPositionTypeRate" paginate-target="EditEmplPositionTypeRates"
+    <form name="AddEmplPositionTypeRate" type="single" target="updateEmplPositionTypeRate" default-map-name="emplPositionTypeRate" paginate-target="EditEmplPositionTypeRates"
         header-row-style="header-row" default-table-style="basic-table">
-        <field name="emplPositionTypeId"><hidden/></field>
-        <field name="rateTypeId">
-            <drop-down allow-empty="true" no-current-selected-key="">
+        <actions>
+            <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD" />
+        </actions>
+        <field name="emplPositionTypeId"><hidden value="${parameters.emplPositionTypeId}"/></field>
+        <field name="rateTypeId"   tooltip="${uiLabelMap.CommonRequired}" widget-style="required">
+            <drop-down>
                 <entity-options description="${description}" key-field-name="rateTypeId" entity-name="RateType">
-                    <entity-order-by field-name="rateTypeId"/>
+                    <entity-order-by field-name="description"/>
                 </entity-options>
             </drop-down>
         </field>
-        <field name="payGradeId"><lookup target-form-name="LookupPayGrade"/></field>        
-        <field name="salaryStepSeqId"><lookup target-form-name="LookupSalaryStep"/></field>  
+        <field name="payGradeId" position="2"><lookup target-form-name="LookupPayGrade"/></field>        
         <field name="periodTypeId" tooltip="${uiLabelMap.CommonRequired}" widget-style="required">
-            <drop-down allow-empty="false">
+            <drop-down allow-empty="false" no-current-selected-key="RATE_MONTH">
                 <entity-options description="${description}" key-field-name="periodTypeId" entity-name="PeriodType">
                     <entity-order-by field-name="periodTypeId"/>
                 </entity-options>
             </drop-down>
         </field>
-        <field name="rate" title="${uiLabelMap.FormFieldTitle_conversionFactor}"><text/></field>
-        <field name="fromDate" tooltip="${uiLabelMap.CommonRequired}" widget-style="required"><date-time/></field>
+        <field name="salaryStepSeqId" position="2"><lookup target-form-name="LookupSalaryStep"/></field>  
+        <field name="rateAmount"><text/></field>
+        <field name="rateCurrencyUomId" position="2">
+            <drop-down allow-empty="true" no-current-selected-key="${defaultCurrencyUomId}">
+                <entity-options key-field-name="uomId" description="${abbreviation} - ${description}" entity-name="Uom">
+                    <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="abbreviation"/>
+                </entity-options>
+            </drop-down>
+        </field>
         <field name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="buttontext"><submit button-type="text-link"/></field>
     </form>
     <form name="ListTerminationReasons" type="multi" title="" target="updateTerminationReason" paginate-target="EditTerminationReasons"