Describe the bug
On the part detail info page, the average price range calculation is wrong. It happens when in the shopping information, multiple suppliers with different tier quantities are introduced. The current price calculation takes the last tier and averages between the multiple suppliers. Since not all suppliers have similar qty tiers, this can lead to significant price errors.
To Reproduce
Check printscreen. (0.5788(100pcs_tier)+0.488(5000pcs_tier))/2=0.53334
Expected behavior
It should take the largest qty tier price and show that one if no other supplier has the same offer, otherwise calculate the average. (In this case 0.488)
Screenshots
Server Side
- Part-DB Version: 2.12.0
- PHP Version:
- Database Server
Desktop (please complete the following information):
- OS: Debian12
- Browser Chrome
Describe the bug
On the part detail info page, the average price range calculation is wrong. It happens when in the shopping information, multiple suppliers with different tier quantities are introduced. The current price calculation takes the last tier and averages between the multiple suppliers. Since not all suppliers have similar qty tiers, this can lead to significant price errors.
To Reproduce
Check printscreen. (0.5788(100pcs_tier)+0.488(5000pcs_tier))/2=0.53334
Expected behavior
It should take the largest qty tier price and show that one if no other supplier has the same offer, otherwise calculate the average. (In this case 0.488)
Screenshots
Server Side
Desktop (please complete the following information):