Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

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

Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

David Garrett-3
In my progress toward VAT/GST implementation, I have hit an unexpected
promotion problem where an item adjustment seems to become an
orderAdjustment.
 
Is this expected behaviour or a recent problem. What is the expected
behaviour? I would have expected it to have been an adjustment associated
with the item and displayed with the item as an item adjustment.
 
I am using the current SVN - no changes.
 
How to reproduce:
=============
1. From ecommerce add a GZ-1005 to the cart.
2. View Cart ... all OK. 1 x M$ .NIT gizmo added. Unit Price $2,799.99
Adjustments ($560.00)
Item Total $2,239.99
 
Plus 2 promotional, free products
 
3. Do a quick checkout COD and get to checkoutreview .... the promotions are
all shown as order level promotions.
 
 
Interestingly ... With the following steps the checkoutreview is later shown
correctly
 
4. Cick "View Cart"
5. "Quick Checkout" ... COD and get to checkoutreview
 
... Promotions are CORRECTLY shown as item adjustments. That is stange!
 
 
Does anyone have a quick answer as to why I see this?
 
Thanks
David G
Reply | Threaded
Open this post in threaded view
|

RE: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

David Garrett
 
In my progress toward VAT/GST implementation, I have hit an unexpected
promotion problem where an item adjustment seems to become an
orderAdjustment.
 
Is this expected behaviour or a recent problem. What is the expected
behaviour? I would have expected it to have been an adjustment associated
with the item and displayed with the item as an item adjustment.
 
I am using the current SVN - no changes.
 
How to reproduce:
=============
1. From ecommerce add a GZ-1005 to the cart.
2. View Cart ... all OK. 1 x M$ .NIT gizmo added. Unit Price $2,799.99
Adjustments ($560.00)
Item Total $2,239.99
 
Plus 2 promotional, free products
 
3. Do a quick checkout COD and get to checkoutreview .... the promotions are
all shown as order level promotions.
 
 
Interestingly ... With the following steps the checkoutreview is later shown
correctly
 
4. Cick "View Cart"
5. "Quick Checkout" ... COD and get to checkoutreview
 
... Promotions are CORRECTLY shown as item adjustments. That is stange!
 
 
Does anyone have a quick answer as to why I see this?
 
Thanks
David G
Reply | Threaded
Open this post in threaded view
|

RE: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

cjhowe
It may simply be a display issue.  If the pattern is
the same as much of the other entities that have
SeqId, the only thing that differentiates the two in
the data model is whether the adjustment contains a
SeqId.  Meaning it ends up in the same place with an
"order level" adjustment having null for the
orderItemSeqId. Why not complete the order and see
what ends up in OrderAdjustment entity.

--- David Garrett <[hidden email]>
wrote:

>  
> In my progress toward VAT/GST implementation, I have
> hit an unexpected
> promotion problem where an item adjustment seems to
> become an
> orderAdjustment.
>  
> Is this expected behaviour or a recent problem. What
> is the expected
> behaviour? I would have expected it to have been an
> adjustment associated
> with the item and displayed with the item as an item
> adjustment.
>  
> I am using the current SVN - no changes.
>  
> How to reproduce:
> =============
> 1. From ecommerce add a GZ-1005 to the cart.
> 2. View Cart ... all OK. 1 x M$ .NIT gizmo added.
> Unit Price $2,799.99
> Adjustments ($560.00)
> Item Total $2,239.99
>  
> Plus 2 promotional, free products
>  
> 3. Do a quick checkout COD and get to checkoutreview
> .... the promotions are
> all shown as order level promotions.
>  
>  
> Interestingly ... With the following steps the
> checkoutreview is later shown
> correctly
>  
> 4. Cick "View Cart"
> 5. "Quick Checkout" ... COD and get to
> checkoutreview
>  
> ... Promotions are CORRECTLY shown as item
> adjustments. That is stange!
>  
>  
> Does anyone have a quick answer as to why I see
> this?
>  
> Thanks
> David G
>

Reply | Threaded
Open this post in threaded view
|

RE: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

David Garrett
Thanks Chris,

The order does end up correctly in the DB and it uses the same
cart.makeAllAdjustments() call to set the SeqId

The issue though, that I am trying to resolve, is why (for me) the FIRST
time it displays in checkout review the promotions are not shown against the
orderItem BUT the 2nd time they are correct.

I was wondering does everyone else see the problem or is it just me?

The key code is as follows ...

Checkoutreview.bsh:
orderAdjustments = cart.makeAllAdjustments();
    .... In cart.makeAllAdjustments() "theoretically" the SeqId should be
added
    .... I know tax adjustments are not added here
OrderReadHelper orh = new OrderReadHelper(orderAdjustments, orderItems); ...
Temp orh created
context.put("localOrderReadHelper", orh);

Checkoutreview.ftl:
<div class="tabletext"><@ofbizCurrency
amount=localOrderReadHelper.getOrderItemAdjustmentsTotal(orderItem)
isoCode=currencyUomId/></div>

Does anyone else see it fail first and then work on second view?

Thanks
David G

-----Original Message-----
From: Chris Howe [mailto:[hidden email]]
Sent: Friday, 3 November 2006 1:05 AM
To: [hidden email]
Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on
checkoutreview

It may simply be a display issue.  If the pattern is the same as much of the
other entities that have SeqId, the only thing that differentiates the two
in the data model is whether the adjustment contains a SeqId.  Meaning it
ends up in the same place with an "order level" adjustment having null for
the orderItemSeqId. Why not complete the order and see what ends up in
OrderAdjustment entity.

--- David Garrett <[hidden email]>
wrote:

>  
> In my progress toward VAT/GST implementation, I have hit an unexpected
> promotion problem where an item adjustment seems to become an
> orderAdjustment.
>  
> Is this expected behaviour or a recent problem. What is the expected
> behaviour? I would have expected it to have been an adjustment
> associated with the item and displayed with the item as an item
> adjustment.
>  
> I am using the current SVN - no changes.
>  
> How to reproduce:
> =============
> 1. From ecommerce add a GZ-1005 to the cart.
> 2. View Cart ... all OK. 1 x M$ .NIT gizmo added.
> Unit Price $2,799.99
> Adjustments ($560.00)
> Item Total $2,239.99
>  
> Plus 2 promotional, free products
>  
> 3. Do a quick checkout COD and get to checkoutreview .... the
> promotions are all shown as order level promotions.
>  
>  
> Interestingly ... With the following steps the checkoutreview is later
> shown correctly
>  
> 4. Cick "View Cart"
> 5. "Quick Checkout" ... COD and get to checkoutreview
>  
> ... Promotions are CORRECTLY shown as item adjustments. That is
> stange!
>  
>  
> Does anyone have a quick answer as to why I see this?
>  
> Thanks
> David G
>



Reply | Threaded
Open this post in threaded view
|

RE: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

David Garrett
Problem solved: ... This looks to have been around for some time.

Solution
Ensure cart.makeOrderItems() is called BEFORE cart.makeAllAdjustments()


In checkoutreview.bsh: reorder so that cart.makeOrderItems() is called
first:

orderItems = cart.makeOrderItems(); // ... Item.orderItemSeqId is SET here
context.put("orderItems", orderItems);

orderAdjustments = cart.makeAllAdjustments(); // ... Item.orderItemSeqId is
USED here
context.put("orderAdjustments", orderAdjustments);

 

-----Original Message-----
From: David Garrett [mailto:[hidden email]]
Sent: Friday, 3 November 2006 7:28 AM
To: [hidden email]
Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on
checkoutreview

Thanks Chris,

The order does end up correctly in the DB and it uses the same
cart.makeAllAdjustments() call to set the SeqId

The issue though, that I am trying to resolve, is why (for me) the FIRST
time it displays in checkout review the promotions are not shown against the
orderItem BUT the 2nd time they are correct.

I was wondering does everyone else see the problem or is it just me?

The key code is as follows ...

Checkoutreview.bsh:
orderAdjustments = cart.makeAllAdjustments();
    .... In cart.makeAllAdjustments() "theoretically" the SeqId should be
added
    .... I know tax adjustments are not added here OrderReadHelper orh = new
OrderReadHelper(orderAdjustments, orderItems); ...
Temp orh created
context.put("localOrderReadHelper", orh);

Checkoutreview.ftl:
<div class="tabletext"><@ofbizCurrency
amount=localOrderReadHelper.getOrderItemAdjustmentsTotal(orderItem)
isoCode=currencyUomId/></div>

Does anyone else see it fail first and then work on second view?

Thanks
David G

-----Original Message-----
From: Chris Howe [mailto:[hidden email]]
Sent: Friday, 3 November 2006 1:05 AM
To: [hidden email]
Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on
checkoutreview

It may simply be a display issue.  If the pattern is the same as much of the
other entities that have SeqId, the only thing that differentiates the two
in the data model is whether the adjustment contains a SeqId.  Meaning it
ends up in the same place with an "order level" adjustment having null for
the orderItemSeqId. Why not complete the order and see what ends up in
OrderAdjustment entity.

--- David Garrett <[hidden email]>
wrote:

>  
> In my progress toward VAT/GST implementation, I have hit an unexpected
> promotion problem where an item adjustment seems to become an
> orderAdjustment.
>  
> Is this expected behaviour or a recent problem. What is the expected
> behaviour? I would have expected it to have been an adjustment
> associated with the item and displayed with the item as an item
> adjustment.
>  
> I am using the current SVN - no changes.
>  
> How to reproduce:
> =============
> 1. From ecommerce add a GZ-1005 to the cart.
> 2. View Cart ... all OK. 1 x M$ .NIT gizmo added.
> Unit Price $2,799.99
> Adjustments ($560.00)
> Item Total $2,239.99
>  
> Plus 2 promotional, free products
>  
> 3. Do a quick checkout COD and get to checkoutreview .... the
> promotions are all shown as order level promotions.
>  
>  
> Interestingly ... With the following steps the checkoutreview is later
> shown correctly
>  
> 4. Cick "View Cart"
> 5. "Quick Checkout" ... COD and get to checkoutreview
>  
> ... Promotions are CORRECTLY shown as item adjustments. That is
> stange!
>  
>  
> Does anyone have a quick answer as to why I see this?
>  
> Thanks
> David G
>





Reply | Threaded
Open this post in threaded view
|

Re: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

Jacques Le Roux
Administrator
David,

Did you make a patch for this, a Jira issue ?

Thanks

Jacques

----- Original Message -----
From: "David Garrett" <[hidden email]>
To: <[hidden email]>
Sent: Friday, November 03, 2006 12:00 AM
Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview


> Problem solved: ... This looks to have been around for some time.
>
> Solution
> Ensure cart.makeOrderItems() is called BEFORE cart.makeAllAdjustments()
>
>
> In checkoutreview.bsh: reorder so that cart.makeOrderItems() is called
> first:
>
> orderItems = cart.makeOrderItems(); // ... Item.orderItemSeqId is SET here
> context.put("orderItems", orderItems);
>
> orderAdjustments = cart.makeAllAdjustments(); // ... Item.orderItemSeqId is
> USED here
> context.put("orderAdjustments", orderAdjustments);
>
>  
>
> -----Original Message-----
> From: David Garrett [mailto:[hidden email]]
> Sent: Friday, 3 November 2006 7:28 AM
> To: [hidden email]
> Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on
> checkoutreview
>
> Thanks Chris,
>
> The order does end up correctly in the DB and it uses the same
> cart.makeAllAdjustments() call to set the SeqId
>
> The issue though, that I am trying to resolve, is why (for me) the FIRST
> time it displays in checkout review the promotions are not shown against the
> orderItem BUT the 2nd time they are correct.
>
> I was wondering does everyone else see the problem or is it just me?
>
> The key code is as follows ...
>
> Checkoutreview.bsh:
> orderAdjustments = cart.makeAllAdjustments();
>     .... In cart.makeAllAdjustments() "theoretically" the SeqId should be
> added
>     .... I know tax adjustments are not added here OrderReadHelper orh = new
> OrderReadHelper(orderAdjustments, orderItems); ...
> Temp orh created
> context.put("localOrderReadHelper", orh);
>
> Checkoutreview.ftl:
> <div class="tabletext"><@ofbizCurrency
> amount=localOrderReadHelper.getOrderItemAdjustmentsTotal(orderItem)
> isoCode=currencyUomId/></div>
>
> Does anyone else see it fail first and then work on second view?
>
> Thanks
> David G
>
> -----Original Message-----
> From: Chris Howe [mailto:[hidden email]]
> Sent: Friday, 3 November 2006 1:05 AM
> To: [hidden email]
> Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on
> checkoutreview
>
> It may simply be a display issue.  If the pattern is the same as much of the
> other entities that have SeqId, the only thing that differentiates the two
> in the data model is whether the adjustment contains a SeqId.  Meaning it
> ends up in the same place with an "order level" adjustment having null for
> the orderItemSeqId. Why not complete the order and see what ends up in
> OrderAdjustment entity.
>
> --- David Garrett <[hidden email]>
> wrote:
>
> >  
> > In my progress toward VAT/GST implementation, I have hit an unexpected
> > promotion problem where an item adjustment seems to become an
> > orderAdjustment.
> >  
> > Is this expected behaviour or a recent problem. What is the expected
> > behaviour? I would have expected it to have been an adjustment
> > associated with the item and displayed with the item as an item
> > adjustment.
> >  
> > I am using the current SVN - no changes.
> >  
> > How to reproduce:
> > =============
> > 1. From ecommerce add a GZ-1005 to the cart.
> > 2. View Cart ... all OK. 1 x M$ .NIT gizmo added.
> > Unit Price $2,799.99
> > Adjustments ($560.00)
> > Item Total $2,239.99
> >  
> > Plus 2 promotional, free products
> >  
> > 3. Do a quick checkout COD and get to checkoutreview .... the
> > promotions are all shown as order level promotions.
> >  
> >  
> > Interestingly ... With the following steps the checkoutreview is later
> > shown correctly
> >  
> > 4. Cick "View Cart"
> > 5. "Quick Checkout" ... COD and get to checkoutreview
> >  
> > ... Promotions are CORRECTLY shown as item adjustments. That is
> > stange!
> >  
> >  
> > Does anyone have a quick answer as to why I see this?
> >  
> > Thanks
> > David G
> >
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview

Jacques Le Roux
Administrator
David,

Sorry, forget it : it was fixed by https://issues.apache.org/jira/browse/OFBIZ-396

Jacques

From: "Jacques Le Roux" <[hidden email]>

> David,
>
> Did you make a patch for this, a Jira issue ?
>
> Thanks
>
> Jacques
>
> ----- Original Message -----
> From: "David Garrett" <[hidden email]>
> To: <[hidden email]>
> Sent: Friday, November 03, 2006 12:00 AM
> Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on checkoutreview
>
>
> > Problem solved: ... This looks to have been around for some time.
> >
> > Solution
> > Ensure cart.makeOrderItems() is called BEFORE cart.makeAllAdjustments()
> >
> >
> > In checkoutreview.bsh: reorder so that cart.makeOrderItems() is called
> > first:
> >
> > orderItems = cart.makeOrderItems(); // ... Item.orderItemSeqId is SET here
> > context.put("orderItems", orderItems);
> >
> > orderAdjustments = cart.makeAllAdjustments(); // ... Item.orderItemSeqId is
> > USED here
> > context.put("orderAdjustments", orderAdjustments);
> >
> >  
> >
> > -----Original Message-----
> > From: David Garrett [mailto:[hidden email]]
> > Sent: Friday, 3 November 2006 7:28 AM
> > To: [hidden email]
> > Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on
> > checkoutreview
> >
> > Thanks Chris,
> >
> > The order does end up correctly in the DB and it uses the same
> > cart.makeAllAdjustments() call to set the SeqId
> >
> > The issue though, that I am trying to resolve, is why (for me) the FIRST
> > time it displays in checkout review the promotions are not shown against the
> > orderItem BUT the 2nd time they are correct.
> >
> > I was wondering does everyone else see the problem or is it just me?
> >
> > The key code is as follows ...
> >
> > Checkoutreview.bsh:
> > orderAdjustments = cart.makeAllAdjustments();
> >     .... In cart.makeAllAdjustments() "theoretically" the SeqId should be
> > added
> >     .... I know tax adjustments are not added here OrderReadHelper orh = new
> > OrderReadHelper(orderAdjustments, orderItems); ...
> > Temp orh created
> > context.put("localOrderReadHelper", orh);
> >
> > Checkoutreview.ftl:
> > <div class="tabletext"><@ofbizCurrency
> > amount=localOrderReadHelper.getOrderItemAdjustmentsTotal(orderItem)
> > isoCode=currencyUomId/></div>
> >
> > Does anyone else see it fail first and then work on second view?
> >
> > Thanks
> > David G
> >
> > -----Original Message-----
> > From: Chris Howe [mailto:[hidden email]]
> > Sent: Friday, 3 November 2006 1:05 AM
> > To: [hidden email]
> > Subject: RE: Promotion - Unexpected behaviour - orderItem adjustments on
> > checkoutreview
> >
> > It may simply be a display issue.  If the pattern is the same as much of the
> > other entities that have SeqId, the only thing that differentiates the two
> > in the data model is whether the adjustment contains a SeqId.  Meaning it
> > ends up in the same place with an "order level" adjustment having null for
> > the orderItemSeqId. Why not complete the order and see what ends up in
> > OrderAdjustment entity.
> >
> > --- David Garrett <[hidden email]>
> > wrote:
> >
> > >  
> > > In my progress toward VAT/GST implementation, I have hit an unexpected
> > > promotion problem where an item adjustment seems to become an
> > > orderAdjustment.
> > >  
> > > Is this expected behaviour or a recent problem. What is the expected
> > > behaviour? I would have expected it to have been an adjustment
> > > associated with the item and displayed with the item as an item
> > > adjustment.
> > >  
> > > I am using the current SVN - no changes.
> > >  
> > > How to reproduce:
> > > =============
> > > 1. From ecommerce add a GZ-1005 to the cart.
> > > 2. View Cart ... all OK. 1 x M$ .NIT gizmo added.
> > > Unit Price $2,799.99
> > > Adjustments ($560.00)
> > > Item Total $2,239.99
> > >  
> > > Plus 2 promotional, free products
> > >  
> > > 3. Do a quick checkout COD and get to checkoutreview .... the
> > > promotions are all shown as order level promotions.
> > >  
> > >  
> > > Interestingly ... With the following steps the checkoutreview is later
> > > shown correctly
> > >  
> > > 4. Cick "View Cart"
> > > 5. "Quick Checkout" ... COD and get to checkoutreview
> > >  
> > > ... Promotions are CORRECTLY shown as item adjustments. That is
> > > stange!
> > >  
> > >  
> > > Does anyone have a quick answer as to why I see this?
> > >  
> > > Thanks
> > > David G
> > >
> >
> >
> >
> >