Same problem, different approach....
I'm no longer trying to use the price from a po, I'm trying to get it from a price list with quantity breaks. Here's what my data looks like...
1/2012 <<<group 1 (date, month)>>>
FLG9906 <<<group 2 (part number)>>>
PPAP025997 01/27/2012 22.00 $24.94 $0.57 $59.40 <<<group 3 (job number)>>>
<<<details>>> 2.70 59.40
<<<details>>> 2.70 59.40
2/2012 <<<group 1 (date, month)>>>
02250146-15F <<<group 2 (part number)>>>
PPAP026013 02/16/2012 61.00 $709.37 $1.66 0.00 <<<group 3 (job number)>>>
<<<details>>> 0.00 1.00 10.00 0.00 0.00
<<<details>>> 0.00 2.00 5.70 0.00 0.00
<<<details>>> 0.00 5.00 4.50 0.00 0.00
<<<details>>> 0.00 10.00 3.48 0.00 0.00
<<<details>>> 0.00 25.00 3.20 0.00 0.00
<<<details>>> 0.00 50.00 2.85 2.85 173.85
<<<details>>> 0.00 100.00 2.53 0.00 0.00
In the first example the numbers in group 3 are the production QTY (22), mfgcost ($0.57), totalmfgcost ($24.94) and estpurchcost ($59.40). The data in the details for it is the base unit price, which is for parts without any qty breaks. When that is the case I'm able to get the estpurchcost.
In the second example the base unit price is 0.00 because we have qty breaks. You can see the quantity and corresponding price. The 4th column is a formula to select the proper price based on the job qty. Which it does. For a 61 pc job it selected 2.85. Then in the 5th column is the formula to figure the estpurchcost, it also works. The problem is I don't want to show the details but just 1 line per part number. When I move the formulas the the group header/footer it only shows the the top or bottom value, usually 0.
I'm also using the formula that selects the proper price to create a numbervar, it look like this...
shared numbervar n1 :=
if
{jobhead.prodqty} >= {vendpbrk.breakqty}
and
{jobhead.prodqty} < next ({vendpbrk.breakqty})
then
{vendpbrk.pricemodifier}
else if
isnull ({vendpbrk.pricemodifier})
then
{vendpart.baseunitprice};
I then use that var in the estpurchcost like this...
shared numbervar n1;
if
{vendpart.baseunitprice}<>0
then
{jobhead.prodqty}*{vendpart.baseunitprice}
else
n1*{jobhead.prodqty}
How can I get the selected values from these formulas to display on the group header?
Hope this makes sense.