description in product price

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

description in product price

Harmeet Bedi
ProductPrice provide product to pricing information. It has tagging
facilities through ProductPricePurpose and ProductPriceType.

A problem we are facing is that we have customer requirements to store a
comment with price.
 It seems like a general and useful thing.

Attached is a diff on /applications/product/entitydef/entitymodel.xml
that adds a single comment column to ProductPrice. Would you consider
this patch or suggest some better way of adding a comment to
ProductPrice information.

thanks,
Harmeet

Index: entitymodel.xml
===================================================================
--- entitymodel.xml (revision 2227)
+++ entitymodel.xml (working copy)
@@ -2109,6 +2109,7 @@
       <prim-key field="currencyUomId"/>
       <prim-key field="productStoreGroupId"/>
       <prim-key field="fromDate"/>
+      <prim-key field="comment" type="comment"/>
       <relation type="one" fk-name="PROD_PRICE_PROD" rel-entity-name="Product">
         <key-map field-name="productId"/>
       </relation>
Reply | Threaded
Open this post in threaded view
|

Re: description in product price

Ashish Vijaywargiya
Hello Harmeet,

I don't see any problem in adding this field.
Let's see what other has to say in one or two days.

If nobody object on it then I will commit it soon.


On Thu, Aug 7, 2008 at 1:02 AM, Harmeet Bedi <[hidden email]> wrote:

> ProductPrice provide product to pricing information. It has tagging
> facilities through ProductPricePurpose and ProductPriceType.
>
> A problem we are facing is that we have customer requirements to store a
> comment with price.
> It seems like a general and useful thing.
>
> Attached is a diff on /applications/product/entitydef/entitymodel.xml that
> adds a single comment column to ProductPrice. Would you consider this patch
> or suggest some better way of adding a comment to ProductPrice information.
>
> thanks,
> Harmeet
>
> Index: entitymodel.xml
> ===================================================================
> --- entitymodel.xml     (revision 2227)
> +++ entitymodel.xml     (working copy)
> @@ -2109,6 +2109,7 @@
>       <prim-key field="currencyUomId"/>
>       <prim-key field="productStoreGroupId"/>
>       <prim-key field="fromDate"/>
> +      <prim-key field="comment" type="comment"/>
>       <relation type="one" fk-name="PROD_PRICE_PROD"
> rel-entity-name="Product">
>         <key-map field-name="productId"/>
>       </relation>
>
>


--
Ashish Vijaywargiya
Indore (M.P), India
http://en.wikipedia.org/wiki/Indore
Reply | Threaded
Open this post in threaded view
|

Re: description in product price

BJ Freeman
when it comes to comments, to be able to enter different comments as
time goes on, like why the price change.
so a one to many would be nice to have.
where the comments have their own dates.

Ashish Vijaywargiya sent the following on 8/6/2008 9:21 PM:

> Hello Harmeet,
>
> I don't see any problem in adding this field.
> Let's see what other has to say in one or two days.
>
> If nobody object on it then I will commit it soon.
>
>
> On Thu, Aug 7, 2008 at 1:02 AM, Harmeet Bedi <[hidden email]> wrote:
>
>> ProductPrice provide product to pricing information. It has tagging
>> facilities through ProductPricePurpose and ProductPriceType.
>>
>> A problem we are facing is that we have customer requirements to store a
>> comment with price.
>> It seems like a general and useful thing.
>>
>> Attached is a diff on /applications/product/entitydef/entitymodel.xml that
>> adds a single comment column to ProductPrice. Would you consider this patch
>> or suggest some better way of adding a comment to ProductPrice information.
>>
>> thanks,
>> Harmeet
>>
>> Index: entitymodel.xml
>> ===================================================================
>> --- entitymodel.xml     (revision 2227)
>> +++ entitymodel.xml     (working copy)
>> @@ -2109,6 +2109,7 @@
>>       <prim-key field="currencyUomId"/>
>>       <prim-key field="productStoreGroupId"/>
>>       <prim-key field="fromDate"/>
>> +      <prim-key field="comment" type="comment"/>
>>       <relation type="one" fk-name="PROD_PRICE_PROD"
>> rel-entity-name="Product">
>>         <key-map field-name="productId"/>
>>       </relation>
>>
>>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: description in product price

Harmeet Bedi
I was only after a comment on ProductPrice. A comment on
ProductPriceChange would be nice as well.

Ways i can think of to do this..

A)
add to  ProductPrice and ProductPriceChange the following
        <field name="comments" type="comment"></field>
(my earlier patch had a mistake prim-key instead of field)
One advantage is that this is simple and ProductPriceChange already has
date information.

B)
Another more generalized mechanism may be to add a NoteData reference to
ProductPrice and ProductPriceChange
Attaching patch for this.
I feel this is less simple, but useful and contains date and party
information within NoteData.

C) Another alternative could be to create new association tables
e.g. ProductPriceNoteAssoc and ProductPriceChangeNoteAssoc
These could however not work well for only ProductPrice as there is no
single surrogate primary key.
 Advantage would be multiple assoication of note, possibly by different
parties. I cannot however think of a business use case where multiple
parties will need to leave note on ProductPrice or ProductPriceChange.


I would prefer (A) or (B).
reason is that while (C) is nice, it does not seem to easily give
note/comment on ProductPrice due to composite primary key on ProductPrice.

thoughts ? preferences ?
Harmeet

On 8/7/08 12:42 AM, BJ Freeman wrote:

> when it comes to comments, to be able to enter different comments as
> time goes on, like why the price change.
> so a one to many would be nice to have.
> where the comments have their own dates.
>
> Ashish Vijaywargiya sent the following on 8/6/2008 9:21 PM:
>  
>> Hello Harmeet,
>>
>> I don't see any problem in adding this field.
>> Let's see what other has to say in one or two days.
>>
>> If nobody object on it then I will commit it soon.
>>
>>
>> On Thu, Aug 7, 2008 at 1:02 AM, Harmeet Bedi <[hidden email]> wrote:
>>
>>    
>>> ProductPrice provide product to pricing information. It has tagging
>>> facilities through ProductPricePurpose and ProductPriceType.
>>>
>>> A problem we are facing is that we have customer requirements to store a
>>> comment with price.
>>> It seems like a general and useful thing.
>>>
>>> Attached is a diff on /applications/product/entitydef/entitymodel.xml that
>>> adds a single comment column to ProductPrice. Would you consider this patch
>>> or suggest some better way of adding a comment to ProductPrice information.
>>>
>>> thanks,
>>> Harmeet
>>>
>>> Index: entitymodel.xml
>>> ===================================================================
>>> --- entitymodel.xml     (revision 2227)
>>> +++ entitymodel.xml     (working copy)
>>> @@ -2109,6 +2109,7 @@
>>>       <prim-key field="currencyUomId"/>
>>>       <prim-key field="productStoreGroupId"/>
>>>       <prim-key field="fromDate"/>
>>> +      <prim-key field="comment" type="comment"/>
>>>       <relation type="one" fk-name="PROD_PRICE_PROD"
>>> rel-entity-name="Product">
>>>         <key-map field-name="productId"/>
>>>       </relation>
>>>
>>>
>>>      
>>    
>
>  

Index: entitymodel.xml
===================================================================
--- entitymodel.xml (revision 2227)
+++ entitymodel.xml (working copy)
@@ -2103,12 +2103,16 @@
       <field name="createdByUserLogin" type="id-vlong"></field>
       <field name="lastModifiedDate" type="date-time"></field>
       <field name="lastModifiedByUserLogin" type="id-vlong"></field>
+      <field name="noteId" type="id-ne"></field>
       <prim-key field="productId"/>
       <prim-key field="productPriceTypeId"/>
       <prim-key field="productPricePurposeId"/>
       <prim-key field="currencyUomId"/>
       <prim-key field="productStoreGroupId"/>
       <prim-key field="fromDate"/>
+      <relation type="one" fk-name="PROD_PRICE_NOTE" rel-entity-name="NoteData">
+        <key-map field-name="noteId"/>
+      </relation>
       <relation type="one" fk-name="PROD_PRICE_PROD" rel-entity-name="Product">
         <key-map field-name="productId"/>
       </relation>
@@ -2193,7 +2197,11 @@
       <field name="oldPrice" type="currency-amount"></field>
       <field name="changedDate" type="date-time"></field>
       <field name="changedByUserLogin" type="id-vlong"></field>
+      <field name="noteId" type="id-ne"></field>
       <prim-key field="productPriceChangeId"/>
+      <relation type="one" fk-name="PROD_PRCHNG_NOTE" rel-entity-name="NoteData">
+        <key-map field-name="noteId"/>
+      </relation>
       <relation type="one-nofk" rel-entity-name="ProductPrice">
         <key-map field-name="productId"/>
         <key-map field-name="productPriceTypeId"/>
Reply | Threaded
Open this post in threaded view
|

Re: description in product price

Jacques Le Roux
Administrator
I was to write a comment about the prim-key mistake, but it's ok then.
I prefer B.

Could you please create a Jira for this, mainly for history reason
http://docs.ofbiz.org/display/OFBADMIN/OFBiz+Contributors+Best+Practices

Thanks

Jacques

----- Original Message -----
From: "Harmeet Bedi" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, August 07, 2008 7:49 AM
Subject: Re: description in product price


>I was only after a comment on ProductPrice. A comment on
> ProductPriceChange would be nice as well.
>
> Ways i can think of to do this..
>
> A)
> add to  ProductPrice and ProductPriceChange the following
>        <field name="comments" type="comment"></field>
> (my earlier patch had a mistake prim-key instead of field)
> One advantage is that this is simple and ProductPriceChange already has
> date information.
>
> B)
> Another more generalized mechanism may be to add a NoteData reference to
> ProductPrice and ProductPriceChange
> Attaching patch for this.
> I feel this is less simple, but useful and contains date and party
> information within NoteData.
>
> C) Another alternative could be to create new association tables
> e.g. ProductPriceNoteAssoc and ProductPriceChangeNoteAssoc
> These could however not work well for only ProductPrice as there is no
> single surrogate primary key.
> Advantage would be multiple assoication of note, possibly by different
> parties. I cannot however think of a business use case where multiple
> parties will need to leave note on ProductPrice or ProductPriceChange.
>
>
> I would prefer (A) or (B).
> reason is that while (C) is nice, it does not seem to easily give
> note/comment on ProductPrice due to composite primary key on ProductPrice.
>
> thoughts ? preferences ?
> Harmeet
>
> On 8/7/08 12:42 AM, BJ Freeman wrote:
>> when it comes to comments, to be able to enter different comments as
>> time goes on, like why the price change.
>> so a one to many would be nice to have.
>> where the comments have their own dates.
>>
>> Ashish Vijaywargiya sent the following on 8/6/2008 9:21 PM:
>>  
>>> Hello Harmeet,
>>>
>>> I don't see any problem in adding this field.
>>> Let's see what other has to say in one or two days.
>>>
>>> If nobody object on it then I will commit it soon.
>>>
>>>
>>> On Thu, Aug 7, 2008 at 1:02 AM, Harmeet Bedi <[hidden email]> wrote:
>>>
>>>    
>>>> ProductPrice provide product to pricing information. It has tagging
>>>> facilities through ProductPricePurpose and ProductPriceType.
>>>>
>>>> A problem we are facing is that we have customer requirements to store a
>>>> comment with price.
>>>> It seems like a general and useful thing.
>>>>
>>>> Attached is a diff on /applications/product/entitydef/entitymodel.xml that
>>>> adds a single comment column to ProductPrice. Would you consider this patch
>>>> or suggest some better way of adding a comment to ProductPrice information.
>>>>
>>>> thanks,
>>>> Harmeet
>>>>
>>>> Index: entitymodel.xml
>>>> ===================================================================
>>>> --- entitymodel.xml     (revision 2227)
>>>> +++ entitymodel.xml     (working copy)
>>>> @@ -2109,6 +2109,7 @@
>>>>       <prim-key field="currencyUomId"/>
>>>>       <prim-key field="productStoreGroupId"/>
>>>>       <prim-key field="fromDate"/>
>>>> +      <prim-key field="comment" type="comment"/>
>>>>       <relation type="one" fk-name="PROD_PRICE_PROD"
>>>> rel-entity-name="Product">
>>>>         <key-map field-name="productId"/>
>>>>       </relation>
>>>>
>>>>
>>>>      
>>>    
>>
>>  
>
>


--------------------------------------------------------------------------------


> Index: entitymodel.xml
> ===================================================================
> --- entitymodel.xml (revision 2227)
> +++ entitymodel.xml (working copy)
> @@ -2103,12 +2103,16 @@
>       <field name="createdByUserLogin" type="id-vlong"></field>
>       <field name="lastModifiedDate" type="date-time"></field>
>       <field name="lastModifiedByUserLogin" type="id-vlong"></field>
> +      <field name="noteId" type="id-ne"></field>
>       <prim-key field="productId"/>
>       <prim-key field="productPriceTypeId"/>
>       <prim-key field="productPricePurposeId"/>
>       <prim-key field="currencyUomId"/>
>       <prim-key field="productStoreGroupId"/>
>       <prim-key field="fromDate"/>
> +      <relation type="one" fk-name="PROD_PRICE_NOTE" rel-entity-name="NoteData">
> +        <key-map field-name="noteId"/>
> +      </relation>
>       <relation type="one" fk-name="PROD_PRICE_PROD" rel-entity-name="Product">
>         <key-map field-name="productId"/>
>       </relation>
> @@ -2193,7 +2197,11 @@
>       <field name="oldPrice" type="currency-amount"></field>
>       <field name="changedDate" type="date-time"></field>
>       <field name="changedByUserLogin" type="id-vlong"></field>
> +      <field name="noteId" type="id-ne"></field>
>       <prim-key field="productPriceChangeId"/>
> +      <relation type="one" fk-name="PROD_PRCHNG_NOTE" rel-entity-name="NoteData">
> +        <key-map field-name="noteId"/>
> +      </relation>
>       <relation type="one-nofk" rel-entity-name="ProductPrice">
>         <key-map field-name="productId"/>
>         <key-map field-name="productPriceTypeId"/>
>