lifeson
02-19-2008, 04:28 AM
I am having trouble with this part of code which is part of a larger project
My loop doesn't work :wot
It should lookat each row from sheet TblQuoteLine and then for any entity type 2's use the entity ID as a lookup key on sheet TblPackMat and return any matching MATID' to sheet QuoteDetail
I have sorted out adding entity type 1's apart from checking if there are any duplicates
The other issue is going to be totalling all the Mats ordered.
each pack can contain many mats of any quantity but a pack could alos be ordered more than once!
e.g
Pack 100 may contain:
MATID 1 qty = 1
MATID 2 qty = 1
MATID 3 qty = 12
pack 200 may contain
MATID 1 qty 2
pack 200 is added twice to the quote
therfore the final outcome should be
MATID 1 total qty = 5 (1 from pack 100, 4 from pack 200)
MATID 2 total qty = 1
MATID 3 total qty = 12
I've seperated the two stages - adding type 1 and adding type 2 making it easier for me to understand
My loop doesn't work :wot
It should lookat each row from sheet TblQuoteLine and then for any entity type 2's use the entity ID as a lookup key on sheet TblPackMat and return any matching MATID' to sheet QuoteDetail
I have sorted out adding entity type 1's apart from checking if there are any duplicates
The other issue is going to be totalling all the Mats ordered.
each pack can contain many mats of any quantity but a pack could alos be ordered more than once!
e.g
Pack 100 may contain:
MATID 1 qty = 1
MATID 2 qty = 1
MATID 3 qty = 12
pack 200 may contain
MATID 1 qty 2
pack 200 is added twice to the quote
therfore the final outcome should be
MATID 1 total qty = 5 (1 from pack 100, 4 from pack 200)
MATID 2 total qty = 1
MATID 3 total qty = 12
I've seperated the two stages - adding type 1 and adding type 2 making it easier for me to understand