Only count positive stock for "Total" stats
This commit is contained in:
parent
fd67aed7dd
commit
078ccf6b8a
|
@ -69,7 +69,7 @@ class BalanceMenu(Menu):
|
||||||
self.print_header()
|
self.print_header()
|
||||||
text = ''
|
text = ''
|
||||||
total_value = 0
|
total_value = 0
|
||||||
product_list = self.session.query(Product).all()
|
product_list = self.session.query(Product).filter(Product.stock > 0).all()
|
||||||
for p in product_list:
|
for p in product_list:
|
||||||
total_value += p.stock * p.price
|
total_value += p.stock * p.price
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue