feat: balance limit condition
This commit is contained in:
@@ -332,7 +332,8 @@ async def get_stocks_data(
|
|||||||
sell_from_price > price_recommended,
|
sell_from_price > price_recommended,
|
||||||
is_paused,
|
is_paused,
|
||||||
fbo_stock > 0 and prefer_fbo_over_fbs,
|
fbo_stock > 0 and prefer_fbo_over_fbs,
|
||||||
45 > company.balance
|
45 > company.balance,
|
||||||
|
price_purchase > company.balance
|
||||||
])
|
])
|
||||||
if zero_stock:
|
if zero_stock:
|
||||||
response.append(base_dict)
|
response.append(base_dict)
|
||||||
@@ -344,15 +345,12 @@ async def get_stocks_data(
|
|||||||
|
|
||||||
if all([is_mix, slaves_stock > 0]):
|
if all([is_mix, slaves_stock > 0]):
|
||||||
mix_stock = 0
|
mix_stock = 0
|
||||||
balance_limit = price_purchase > company.balance
|
|
||||||
|
|
||||||
if balance_limit:
|
|
||||||
supplier_stock = 0
|
|
||||||
full_stock = supplier_stock + warehouse_stock
|
full_stock = supplier_stock + warehouse_stock
|
||||||
|
|
||||||
if all([not is_mix, not sell_blocks, in_block_value > 1]):
|
if all([not is_mix, not sell_blocks, in_block_value > 1]):
|
||||||
full_stock = warehouse_stock
|
full_stock = warehouse_stock
|
||||||
if sell_mixes and (not balance_limit):
|
if sell_mixes:
|
||||||
full_stock += mix_stock
|
full_stock += mix_stock
|
||||||
if (not sell_mixes) and is_master:
|
if (not sell_mixes) and is_master:
|
||||||
full_stock = warehouse_stock
|
full_stock = warehouse_stock
|
||||||
|
|||||||
Reference in New Issue
Block a user