Zero Price - 2.5.1f

Whenever bugs are encountered they are quashed and reported. Here you can see their quashings up close.

Moderators: sureshquest, arulmani, trifon

Zero Price - 2.5.1f

Postby trifon » Fri Mar 18, 2005 10:15 pm

Hello Dear Compiere fans,
It seem that most of Compiere integrators/developers some day strike with the problem named "Product with Zero Price". With this post I would like to describe our("Alpha" Team Bulgarpress) conclusion.

As everyone know Order document consists of OrderLines. Table C_Order contains column M_PriceList_ID.

Class MOrderLine contains field named "m_M_PriceList_ID" which is loaded with value in method "setOrder(MOrder order)". So far so good, class MOrderLine has 3 constructors:
1) public MOrderLine (Properties ctx, int C_OrderLine_ID)
2) public MOrderLine(MOrder order)
3) public MOrderLine (Properties ctx, ResultSet rs)

Constructor number 2 calls method setOrder(order), so if you use this constructor you will have proper value set for m_M_PriceList_ID.
BUT if you use some of other constructors in method beforeSave (boolean newRecord) you will reach line that calls setPrice() and there will be thrown well known exception -- IllegalStateException("setPrice - PriceList unknown!").

We have added new field in class MOrderLine that tracks if m_M_PriceList_ID is set and value is loaded only when it is necessary.

In brief:
Compiere do not load lines appropriately, it forgets to load M_PriceList_ID from parent document.

Hope that his description will help you.

Regards,
Trifon
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia

Postby red1 » Fri Mar 18, 2005 10:49 pm

What Trifon solves here is a bit different to the way i solve it in http://www.red1.org/forum/viewtopic.php?t=26

He seems to explain the right reason; i just try to do it the quick and dirty way :)

With both these views, the user can surely get a better understanding on the inside.
red1
Site Admin
 
Posts: 2760
Joined: Tue Jul 06, 2004 3:01 pm
Location: Kuala Lumpur, Malaysia

Postby trifon » Fri Mar 18, 2005 11:05 pm

But red1 writes much more interesting descriptions then mine. I'm little bit boring.

I believe that with joined effords Compiere could be modified to work better.

Regards,
Trifon
Trifon Trifonov
trifon
Senior
 
Posts: 324
Joined: Thu Dec 23, 2004 11:20 pm
Location: Bulgaria, Sofia


Return to BUGS Galore!

Who is online

Users browsing this forum: No registered users and 1 guest

cron