feat: balance limit condition

This commit is contained in:
2025-11-20 17:16:45 +03:00
parent 767d85e751
commit 9fc8fe3314

View File

@@ -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