it's still not clear (at least to me) what you're trying to achieve...
In your last screen shots the vendor price = 1017.5, but the transport prices are 0? Do I read that correct?
It seems you wish to use that value from the 1st line (of your source) in combination with the values of the next 3 lines (of your source), right? If so, you may want to use an expert routine (instead of an end routine). You have full control there (which you don't in an end routine).