Jump to content
Sign in to follow this  
madman411

Quantity overwrite issue

Recommended Posts

madman411    2

Hi All

I'm running into a bit of a calculation dead end.

I have an "order" table displayed in a portal where my users can create orders. The user can add a group of records (a kit) from the inventory table. The first related record is a "master" record which shows a description title and a subtotal (see attached image) and where I would like the user to be able to adjust the quantity for the overall group of records. When initiated the script assigns these related records a GroupID which is currently set as a self join (OrderLine::GroupID = OrderLineKit::GroupID). The system calculates accurately if the master record quantity is set to 1, but if the user increases this quantity to two or higher I'm getting the numbers overlapping (stacked fields) and then the user can't manually adjust any of the other quantities without some strange results due to my current calculation. Some grouped records are added with pre-existing quantity amounts which need to be doubled/tripled, etc, if the user increases the master quantity, however the user should still be able to manually change any quantities.

The quantity field is where it's driving me crazy. I have the following fields that are stacked:

Qty (calc field, hidden on master record row)
KitQty (hidden on all portal rows except for the master record row)
QtyOR (quantity override, hidden on master record row)

When the group of records is added it populates the quantities in the QtyOR field. Currently my Qty field has the following calculation:

If ( isEmpty ( OrderLineKit::KitQty ) ; QtyOR ; QtyOR * OrderLineKit::KitQty )


I know my script is missing criteria which is giving me these issues. I hope I explained myself well enough for people to understand. The below image shows an example group of records with the master quantity set to two. The prices and such update properly, but there's an overwrite issue (Qty and QtyOR data displayed on far right for example purposes).

Screen Shot 2016-04-27 at 11.49.24 AM.png

Aside from this problem my system works just as expected. I'm so close to wrapping up this part of my database!

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.