Commit 0effe366 authored by holivier's avatar holivier

remove modification about employment and payHistory, now it are in OFBiz

parent ae4ae21a
@@ -523,30 +523,32 @@
package-name="org.apache.ofbiz.humanres.employment"
title="Pay History">
<field name="roleTypeIdFrom" type="id"></field>
<field name="roleTypeIdTo" type="id"></field>
<field name="partyIdFrom" type="id"></field>
<field name="partyIdTo" type="id"></field>
+ <field name="emplFromDate" type="date-time"></field>
<field name="fromDate" type="date-time"></field>
<field name="thruDate" type="date-time"></field>
<field name="salaryStepSeqId" type="id"></field>
<field name="payGradeId" type="id"></field>
<field name="periodTypeId" type="id"></field>
<field name="amount" type="currency-amount"></field>
<field name="comments" type="comment"></field>
<prim-key field="roleTypeIdFrom"/>
<prim-key field="roleTypeIdTo"/>
<prim-key field="partyIdFrom"/>
<prim-key field="partyIdTo"/>
+ <prim-key field="emplFromDate"/>
<prim-key field="fromDate"/>
<relation type="one" fk-name="PAY_HIST_EMPLMNT" rel-entity-name="Employment">
<key-map field-name="roleTypeIdFrom"/>
<key-map field-name="roleTypeIdTo"/>
<key-map field-name="partyIdFrom"/>
<key-map field-name="partyIdTo"/>
- <key-map field-name="fromDate"/>
+ <key-map field-name="emplFromDate" rel-field-name="fromDate"/>
</relation>
<relation type="one" fk-name="PAY_HIST_PGRD" rel-entity-name="PayGrade">
<key-map field-name="payGradeId"/>
</relation>
<relation type="one-nofk" fk-name="PAY_HIST_SSTP" rel-entity-name="SalaryStep">
<key-map field-name="salaryStepSeqId"/>
@@ -19,26 +19,61 @@
-->
<simple-methods xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://ofbiz.apache.org/Simple-Method" xsi:schemaLocation="http://ofbiz.apache.org/Simple-Method http://ofbiz.apache.org/dtds/simple-methods.xsd">
<!-- Employment Group -->
- <simple-method method-name="createEmployment" short-description="Create Employment"><!--entity-auto-->
+ <simple-method method-name="createEmployment" short-description="Create Employment">
<make-value entity-name="Employment" value-field="newEntity"/>
<set-pk-fields value-field="newEntity" map="parameters"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<if-empty field="newEntity.fromDate">
<now-timestamp field="nowTimeStamp"/>
<set field="newEntity.fromDate" from-field="nowTimeStamp"/>
</if-empty>
<create-value value-field="newEntity"/>
- <set-service-fields service-name="createPayHistory" map="newEntity" to-map="createPayHistoryMap"/><!--create by seca-->
+ <set-service-fields service-name="createPayHistory" map="parameters" to-map="createPayHistoryMap"/>
+ <set field="createPayHistoryMap.emplFromDate" from="parameters.fromDate"/>
<call-service service-name="createPayHistory" in-map-name="createPayHistoryMap"/>
</simple-method>
+ <simple-method method-name="updatePayHistory" short-description="Update PayHistory, expire current record and create a new">
+ <entity-one entity-name="PayHistory" value-field="lookedOldValue"/>
+ <!-- check if amount or payGrade or salaryStepSeqId change, if Yes so expire current record -->
+ <if>
+ <condition>
+ <and>
+ <if-compare-field to-field="lookedOldValue.amount" operator="equals" field="parameters.amount"/>
+ <if-compare-field to-field="lookedOldValue.payGradeId" operator="equals" field="parameters.payGradeId"/>
+ <if-compare-field to-field="lookedOldValue.salaryStepSeqId" operator="equals" field="parameters.salaryStepSeqId"/>
+ </and>
+ </condition>
+ <then>
+ <!-- just update comment -->
+ <set field="lookedOldValue.comments" from-field="parameters.comments"/>
+ <store-value value-field="lookedOldValue"/>
+ </then>
+ <else>
+ <!-- expire old record and create a new one -->
+ <set-service-fields service-name="expirePayHistory" map="parameters" to-map="expirePayHistoryMap"/>
+ <call-service service-name="expirePayHistory" in-map-name="expirePayHistoryMap"/>
+ <set-service-fields service-name="createPayHistory" map="parameters" to-map="createPayHistoryMap"/>
+ <if-empty field="parameters.changeDate">
+ <now-timestamp field="nowTimeStamp"/>
+ <set field="createPayHistoryMap.fromDate" from-field="nowTimeStamp"/>
+ <else>
+ <set field="createPayHistoryMap.fromDate" from-field="parameters.changeDate"/>
+ </else>
+ </if-empty>
+ <call-service service-name="createPayHistory" in-map-name="createPayHistoryMap"/>
+ </else>
+ </if>
+ <field-to-result field="parameters.emplFromDate" result-name="fromDate"/>
+ </simple-method>
+
<simple-method method-name="createEmplPositionReportingStruct" short-description="Create a Employee Position Reporting Structure">
<make-value entity-name="EmplPositionReportingStruct" value-field="newEntity"/>
<set-pk-fields map="parameters" value-field="newEntity"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
<if-empty field="newEntity.fromDate">
<now-timestamp field="nowTimeStamp"/>
@@ -78,12 +113,24 @@
@@ -78,12 +116,24 @@
<call-service service-name="createPartyRelationship" in-map-name="partyRelationshipCtx"/>
</if-not-empty>
<field-to-result field="partyId"/>
......@@ -87,7 +23,7 @@
<field-map field-name="emplPositionTypeId" from-field="parameters.emplPositionTypeId"/>
<field-map field-name="rateTypeId" from-field="parameters.rateTypeId"/>
</entity-and>
@@ -97,25 +144,33 @@
@@ -97,25 +147,33 @@
<set-pk-fields map="parameters" value-field="newEntity"/>
<if-empty field="newEntity.fromDate"><now-timestamp field="newEntity.fromDate"/></if-empty>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
......@@ -127,7 +63,7 @@
<make-value entity-name="EmplLeave" value-field="newEntity"/>
<set-pk-fields value-field="newEntity" map="parameters"/>
<set-nonpk-fields map="parameters" value-field="newEntity"/>
@@ -192,13 +247,15 @@
@@ -192,13 +250,15 @@
<simple-method method-name="createSalaryStep" short-description="Create a Salary Step">
<make-value entity-name="SalaryStep" value-field="newEntity"/>
......
@@ -151,17 +151,24 @@
<description>Delete a Performance Note</description>
<permission-service service-name="humanResManagerPermission" main-action="DELETE"/>
<auto-attributes mode="IN" include="pk" optional="false"/>
</service>
<!-- Employment Group -->
- <service name="createEmployment" engine="entity-auto" default-entity-name="Employment" invoke="create" auth="true">
- <description>Create Employment</description>
+ <service name="createEmployment" engine="simple" default-entity-name="Employment"
+ location="component://humanres/minilang/HumanResServices.xml" invoke="createEmployment" auth="true">
+ <description>Create Employment and first record in PayHistory</description>
<permission-service service-name="humanResManagerPermission" main-action="CREATE"/>
<auto-attributes mode="IN" include="pk" optional="false"/>
<auto-attributes mode="IN" include="nonpk" optional="true"/>
+ <!-- For PayHistory -->
+ <attribute name="amount" mode="IN" type="BigDecimal" optional="true"/>
+ <attribute name="payGradeId" mode="IN" type="String" optional="true"/>
+ <attribute name="salaryStepSeqId" mode="IN" type="String" optional="true"/>
+ <attribute name="periodTypeId" mode="IN" type="String" optional="true"/>
+ <attribute name="comments" mode="IN" type="String" optional="true"/>
<override type="Timestamp" mode="IN" name="fromDate" optional="true"/>
</service>
<service name="updateEmployment" engine="entity-auto" default-entity-name="Employment" invoke="update" auth="true">
<description>Update an Employment</description>
<permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
@@ -243,17 +250,20 @@
<permission-service service-name="humanResManagerPermission" main-action="CREATE"/>
<auto-attributes mode="IN" include="pk" optional="false"/>
<auto-attributes mode="IN" include="nonpk" optional="true"/>
<override type="Timestamp" mode="IN" name="fromDate" optional="true"/>
</service>
- <service name="updatePayHistory" engine="entity-auto" default-entity-name="PayHistory" invoke="update" auth="true">
+ <service name="updatePayHistory" engine="simple" default-entity-name="PayHistory"
+ location="component://humanres/minilang/HumanResServices.xml" invoke="updatePayHistory" auth="true">
<description>Update Pay History</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"/>
+ <attribute name="changeDate" mode="IN" type="Timestamp" optional="true"/>
+ <attribute name="fromDate" mode="OUT" type="Timestamp"/>
</service>
<service name="deletePayHistory" engine="entity-auto" default-entity-name="PayHistory" invoke="delete" auth="true">
<description>Delete Pay History</description>
<permission-service service-name="humanResManagerPermission" main-action="DELETE"/>
<auto-attributes mode="IN" include="pk" optional="false"/>
@@ -568,21 +578,22 @@
<description>Update Valid EmplPositionTypeRate</description>
<permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
......
@@ -230,12 +230,16 @@
<response name="success" type="view" value="FindEmploymentApps"/>
</request-map>
<request-map uri="ListPayHistories">
<security https="true" auth="true"/>
<response name="success" type="view" value="ListPayHistories"/>
</request-map>
+ <request-map uri="EditPayHistory">
+ <security https="true" auth="true"/>
+ <response name="success" type="view" value="EditPayHistory"/>
+ </request-map>
<request-map uri="updatePayHistory">
<security https="true" auth="true"/>
<event type="service" invoke="updatePayHistory"/>
<response name="success" type="view" value="ListPayHistories"/>
</request-map>
<request-map uri="deletePayHistory">
@@ -729,12 +733,26 @@
</request-map>
<request-map uri="deleteEmplPositionTypeRate">
......@@ -42,20 +25,6 @@
</request-map>
<request-map uri="createAgreementEmploymentAppl">
<security https="true" auth="true"/>
@@ -1143,12 +1161,13 @@
<view-map name="FindEmployments" type="screen" page="component://humanres/widget/EmploymentScreens.xml#FindEmployments"/>
<view-map name="EditEmployment" type="screen" page="component://humanres/widget/EmploymentScreens.xml#EditEmployment"/>
<view-map name="ListEmployments" type="screen" page="component://humanres/widget/EmploymentScreens.xml#ListEmployments"/>
<view-map name="EditPartyBenefits" type="screen" page="component://humanres/widget/EmploymentScreens.xml#EditPartyBenefits"/>
<view-map name="EditPayrollPreferences" type="screen" page="component://humanres/widget/EmploymentScreens.xml#EditPayrollPreferences"/>
<view-map name="ListPayHistories" type="screen" page="component://humanres/widget/EmploymentScreens.xml#ListPayHistories"/>
+ <view-map name="EditPayHistory" type="screen" page="component://humanres/widget/EmploymentScreens.xml#EditPayHistory"/>
<view-map name="EditSalarySteps" type="screen" page="component://humanres/widget/PayGradeScreens.xml#EditSalarySteps"/>
<view-map name="EditUnemploymentClaims" type="screen" page="component://humanres/widget/EmploymentScreens.xml#EditUnemploymentClaims"/>
<view-map name="EditAgreementEmploymentAppls" type="screen" page="component://humanres/widget/EmploymentScreens.xml#EditAgreementEmploymentAppls"/>
<view-map name="FindEmployee" type="screen" page="component://humanres/widget/EmployeeScreens.xml#FindEmployee"/>
<view-map name="NewEmployee" type="screen" page="component://humanres/widget/EmployeeScreens.xml#NewEmployee"/>
@@ -1194,12 +1213,13 @@
<view-map name="EditPerformanceNotes" type="screen" page="component://humanres/widget/EmploymentScreens.xml#EditPerformanceNotes"/>
......
@@ -33,55 +33,58 @@
<menu-item name="PartyResume" title="${uiLabelMap.HumanResPartyResume}"><link target="FindPartyResumes"/></menu-item>
<menu-item name="Leave" title="${uiLabelMap.HumanResEmplLeave}"><link target="FindEmplLeaves"/></menu-item>
<menu-item name="GlobalHRSettings" title="${uiLabelMap.HumanResGlobalHRSettings}" selected-style="selected"><link target="globalHRSettings"/></menu-item>
</menu>
<menu name="EmploymentBar" default-menu-item-name="EditPartyBenefit" default-selected-style="selected"
type="simple" menu-container-style="button-bar tab-bar" selected-menuitem-context-field-name="tabButtonItem">
+ <actions>
+ <set field="emplFromDate" from-field="parameters.emplFromDate" default-value="${parameters.fromDate}"/>
+ </actions>
<menu-item name="EditEmployment" title="${uiLabelMap.HumanResEmployment}">
<link target="EditEmployment" >
<parameter param-name="roleTypeIdFrom"/>
<parameter param-name="roleTypeIdTo"/>
<parameter param-name="partyIdFrom"/>
<parameter param-name="partyIdTo"/>
- <parameter param-name="fromDate"/>
+ <parameter param-name="fromDate" from-field="emplFromDate"/>
</link>
</menu-item>
<menu-item name="EditPartyBenefit" title="${uiLabelMap.HumanResEditPartyBenefit}">
<link target="EditPartyBenefits" >
<parameter param-name="roleTypeIdFrom"/>
<parameter param-name="roleTypeIdTo"/>
<parameter param-name="partyIdFrom"/>
<parameter param-name="partyIdTo"/>
- <parameter param-name="fromDate"/>
+ <parameter param-name="fromDate" from-field="emplFromDate"/>
</link>
</menu-item>
<menu-item name="EditPayrollPreference" title="${uiLabelMap.HumanResEditPayrollPreference}">
<link target="EditPayrollPreferences" >
<parameter param-name="roleTypeIdFrom"/>
<parameter param-name="roleTypeIdTo"/>
<parameter param-name="partyIdFrom"/>
<parameter param-name="partyIdTo"/>
- <parameter param-name="fromDate"/>
+ <parameter param-name="fromDate" from-field="emplFromDate"/>
</link>
</menu-item>
<menu-item name="EditPayHistory" title="${uiLabelMap.HumanResEditPayHistory}">
<link target="ListPayHistories" >
<parameter param-name="roleTypeIdFrom"/>
<parameter param-name="roleTypeIdTo"/>
<parameter param-name="partyIdFrom"/>
<parameter param-name="partyIdTo"/>
- <parameter param-name="fromDate"/>
+ <parameter param-name="fromDate" from-field="emplFromDate"/>
</link>
</menu-item>
<menu-item name="EditUnemploymentClaims" title="${uiLabelMap.HumanResEditUnemploymentClaim}">
<link target="EditUnemploymentClaims" >
<parameter param-name="roleTypeIdFrom"/>
<parameter param-name="roleTypeIdTo"/>
<parameter param-name="partyIdFrom"/>
<parameter param-name="partyIdTo"/>
- <parameter param-name="fromDate"/>
+ <parameter param-name="fromDate" from-field="emplFromDate"/>
</link>
</menu-item>
<menu-item name="EditAgreementEmploymentAppls" title="${uiLabelMap.HumanResAgreementEmploymentAppl}">
<link target="EditAgreementEmploymentAppls">
<parameter param-name="agreementId"/>
<parameter param-name="agreementItemSeqId"/>
@@ -252,17 +255,27 @@
default-menu-item-name="EditEmplPositionType" selected-menuitem-context-field-name="tabButtonItem2">
<menu-item name="EditEmplPositionType" title="${uiLabelMap.HumanResEmplPositionType}">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment