From 92d1356c0eaa25a90e14e86fc4ed4089e60bb08c Mon Sep 17 00:00:00 2001 From: zman Date: Fri, 14 Feb 2025 23:32:20 -0500 Subject: [PATCH] 5 --- app/services/pricing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/services/pricing.py b/app/services/pricing.py index 6ca9b8e..4eb5fb1 100644 --- a/app/services/pricing.py +++ b/app/services/pricing.py @@ -130,7 +130,7 @@ class PricingService: elif tcg_market_price < 0.25: new_price = 0.25 elif tcg_low < 5 or tcg_low_shipping < 5: - new_price = round(tcg_low+((tcg_market_price-tcg_low)/2), 2) + new_price = round(tcg_low+((abs(tcg_market_price-tcg_low))/2), 2) elif tcg_low_shipping > 20: new_price = round(tcg_low_shipping * 1.0125, 2) else: @@ -138,6 +138,8 @@ class PricingService: # if new price is less than half of market price, set to 90% market if new_price < (tcg_market_price / 2): new_price = round(tcg_market_price * 0.85, 2) + if new_price < 0.25: + new_price = 0.25 row['new_price'] = new_price return row