In python I am trying to lookup the relevant price depending on qty from a list of scale prices. For example when getting a quotation request:
Product Qty Price
0 A 6
1 B 301
2 C 1
3 D 200
4 E 48
Price list with scale prices:
Product Scale Qty Scale Price
0 A 1 48
1 A 5 43
2 A 50 38
3 B 1 10
4 B 10 9
5 B 50 7
6 B 100 5
7 B 150 2
8 C 1 300
9 C 2 250
10 C 3 200
11 D 1 5
12 D 100 3
13 D 200 1
14 E 1 100
15 E 10 10
16 E 100 1
Output that I would like:
Product Qty Price
0 A 6 43
1 B 301 2
2 C 1 300
3 D 200 1
4 E 48 10