From 9fc8fe3314038ab2335a2c16373214d34e00fc3a Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 20 Nov 2025 17:16:45 +0300 Subject: [PATCH] feat: balance limit condition --- queries/general.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/queries/general.py b/queries/general.py index 2d28386..168c056 100644 --- a/queries/general.py +++ b/queries/general.py @@ -332,7 +332,8 @@ async def get_stocks_data( sell_from_price > price_recommended, is_paused, fbo_stock > 0 and prefer_fbo_over_fbs, - 45 > company.balance + 45 > company.balance, + price_purchase > company.balance ]) if zero_stock: response.append(base_dict) @@ -344,15 +345,12 @@ async def get_stocks_data( if all([is_mix, slaves_stock > 0]): mix_stock = 0 - balance_limit = price_purchase > company.balance - if balance_limit: - supplier_stock = 0 full_stock = supplier_stock + warehouse_stock if all([not is_mix, not sell_blocks, in_block_value > 1]): full_stock = warehouse_stock - if sell_mixes and (not balance_limit): + if sell_mixes: full_stock += mix_stock if (not sell_mixes) and is_master: full_stock = warehouse_stock