You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ofbiz.apache.org by "Paul Foxworthy (JIRA)" <ji...@apache.org> on 2013/05/30 02:31:20 UTC

[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

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

Paul Foxworthy commented on OFBIZ-5205:
---------------------------------------

Hi Dhiraj,

I've only had a quick look, but I think the service is doing the right thing.

In general in OFBiz, entities are expired rather than deleted. The service updates the RateAmount to set the thruDate. In other words, it expires the RateAmount. Perhaps the name of the service could be expireRateAmount instead of deleteRateAmount, but I believe the substance of the service is correct.

The fromDate and thruDate is a general pattern in OFBiz discussed in The Data Model Resource Book (see https://cwiki.apache.org/OFBADMIN/ofbiz-related-books.html).

Cheers

Paul Foxworthy

                
>   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