[jira] [Commented] (OFBIZ-5205) method-name="deleteRateAmount" used for delete rate amount but method definiton is wrong because this method definition is used for create rateamount

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OFBIZ-5205) method-name="deleteRateAmount" used for delete rate amount but method definiton is wrong because this method definition is used for create rateamount

Nicolas Malin (Jira)

    [ https://issues.apache.org/jira/browse/OFBIZ-5205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13670049#comment-13670049 ]

Dhiraj Gupta commented on OFBIZ-5205:
-------------------------------------

Hi Paul,
Thanks for your comments,but this method "deleteRateAmount" is called  in service method "deleteEmplPositionTypeRate"
This service method is used for deleting the record from entity "EmplPositionTypeRate" as well as rate amount  entity.

<simple-method method-name="deleteEmplPositionTypeRate" short-description="Delete EmplPositionTypeRate">
        <entity-one entity-name="EmplPositionTypeRate" value-field="lookedUpValue"/>
        <now-timestamp field="lookedUpValue.thruDate"/>
        <remove-value value-field="lookedUpValue"/>
       <set-service-fields service-name="deleteRateAmount" map="parameters" to-map="delRateAmount"/>
        <set field="delRateAmount.fromDate" from-field="parameters.rateAmountFromDate" type="Timestamp"/>
        <call-service service-name="deleteRateAmount" in-map-name="delRateAmount"/>
    </simple-method>
one more things that  service"updateEmplPositionTypeRate" is called for creating the record
 


 <service name="updateEmplPositionTypeRate" engine="simple" default-entity-name="EmplPositionTypeRate"
             location="component://humanres/script/org/ofbiz/humanres/HumanResServices.xml" invoke="updateEmplPositionTypeRate" auth="true">
        <description>Update Valid EmplPositionTypeRate</description>
        <permission-service service-name="humanResManagerPermission" main-action="UPDATE"/>
        <auto-attributes include="pk" mode="IN" optional="false"/>
        <auto-attributes include="nonpk" mode="IN" optional="true"/>
        <attribute name="rateAmount" type="BigDecimal" 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>

and this service method "updateEmplPositionTypeRate" is used for creating the recoed in  entity "EmplPositionTypeRate" as well as in entity "RateAmount"
 <simple-method method-name="updateEmplPositionTypeRate" short-description="Update/create EmplPositionTypeRate">
        <entity-one entity-name="EmplPositionTypeRate" value-field="lookedUpValue"/>
      <!--  check if already exist is so expire current record -->
        <entity-and entity-name="EmplPositionTypeRate" list="emplPositionTypeRates" filter-by-date="true">
            <field-map field-name="emplPositionTypeId" from-field="parameters.emplPositionTypeId"/>
            <field-map field-name="rateTypeId" from-field="parameters.rateTypeId"/>
        </entity-and>
       <if-not-empty field="emplPositionTypeRates">
            <first-from-list entry="emplPositionTypeRate" list="emplPositionTypeRates"/>
            <now-timestamp field="emplPositionTypeRate.thruDate"/>
            <store-value value-field="emplPositionTypeRate"/>
        </if-not-empty>
           <make-value value-field="newEntity" entity-name="EmplPositionTypeRate"/>
        <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"/>
         <create-value value-field="newEntity"/>
    <if-not-empty field="parameters.rateAmount">
            <set-service-fields service-name="updateRateAmount" map="parameters" to-map="updRate"/>
            <call-service service-name="updateRateAmount" in-map-name="updRate"/>
        </if-not-empty>
    </simple-method>
but this service method is creating a record  only in entity  "RateAmount" but not in entity "EmplPositionTypeRate"
please check it




               

>   method-name="deleteRateAmount"  used for  delete rate amount but method definiton is wrong because this method  definition is used for create rateamount
> ----------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-5205
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-5205
>             Project: OFBiz
>          Issue Type: Test
>          Components: accounting, humanres
>    Affects Versions: Release 10.04, Release Branch 11.04, SVN trunk, Release 11.04.01, Release Branch 12.04
>            Reporter: Dhiraj Gupta
>
>  Hi all,
> The deleteRateAmount  service is used for update/create a rate amount value
> not for delete rate amount please fix this bug.
> <service name="deleteRateAmount" default-entity-name="RateAmount" engine="simple" auth="true"
>         location="component://accounting/script/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>
>  <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="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-field="rateAmount"/>
> <if-not-empty field="rateAmount">
>             <now-timestamp field="rateAmount.thruDate"/>
>             <store-value value-field="rateAmount"/>
>             <else>
>                 <add-error><fail-message message="could not find record to be deleted"/></add-error>
>             </else>
>         </if-not-empty>
> </simple-method>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira