You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Christian Carlow <ch...@gmail.com> on 2014/09/19 23:16:58 UTC
Is there a reason CustomTimePeriod Date types are not Timestamp?
Does anyone know why CustomTimePeriod fromDate and thruDate are of type
date instead of timestamp? Because the fields are of type date, it
causes issues when joining the it for date comparison for view-entities.
For example:
<view-entity entity-name="OrderHeaderAndCustomTimePeriod"
package-name="">
<member-entity entity-alias="OH" entity-name="OrderHeader"/>
<member-entity entity-alias="CTP" entity-name="CustomTimePeriod"/>
<alias-all entity-alias="OH"/>
<alias-all entity-alias="CTP"/>
<entity-condition>
<condition-expr field-name="orderDate" entity-alias="OH"
operator="greater-equals" rel-field-name="fromDate" rel-entity-alias="CTP"/>
<condition-expr field-name="orderDate" entity-alias="OH"
operator="less-equals" rel-field-name="thruDate" rel-entity-alias="CTP"/>
</entity-condition>
</view-entity>
The problem occurs when the OrderHeader.orderDate falls on the last day
of the CustomTimePeriod.thruDate because the CustomTimePeriod.thruDate
is converted to Timestamp but with time 00:00:00.000. Changing the
CustomTimePeriod Date types to Timestamp seems like the easiest but I'm
sure Accounting code will have to be changed.
Re: Is there a reason CustomTimePeriod Date types are not Timestamp?
Posted by Jacopo Cappellato <ja...@gmail.com>.
Hi Christian,
this is a known issue and there is already a ticket with some comments in it:
https://issues.apache.org/jira/browse/OFBIZ-5740
Jacopo
On Sep 19, 2014, at 11:16 PM, Christian Carlow <ch...@gmail.com> wrote:
> Does anyone know why CustomTimePeriod fromDate and thruDate are of type date instead of timestamp? Because the fields are of type date, it causes issues when joining the it for date comparison for view-entities.
>
> For example:
> <view-entity entity-name="OrderHeaderAndCustomTimePeriod" package-name="">
> <member-entity entity-alias="OH" entity-name="OrderHeader"/>
> <member-entity entity-alias="CTP" entity-name="CustomTimePeriod"/>
> <alias-all entity-alias="OH"/>
> <alias-all entity-alias="CTP"/>
> <entity-condition>
> <condition-expr field-name="orderDate" entity-alias="OH" operator="greater-equals" rel-field-name="fromDate" rel-entity-alias="CTP"/>
> <condition-expr field-name="orderDate" entity-alias="OH" operator="less-equals" rel-field-name="thruDate" rel-entity-alias="CTP"/>
> </entity-condition>
> </view-entity>
>
> The problem occurs when the OrderHeader.orderDate falls on the last day of the CustomTimePeriod.thruDate because the CustomTimePeriod.thruDate is converted to Timestamp but with time 00:00:00.000. Changing the CustomTimePeriod Date types to Timestamp seems like the easiest but I'm sure Accounting code will have to be changed.