brmbarv3 TODO: Shop.inventory_balance() is computing wrong results

This commit is contained in:
Petr Baudis 2012-09-28 21:49:16 +02:00
parent 7f37f0baad
commit 0ab5e579c7
2 changed files with 5 additions and 0 deletions

View file

@ -32,6 +32,7 @@
- Statistics - Statistics
- Users with debt - Users with debt
- Pretty chart - Pretty chart
- Fix "inventory value" computation
- Advanced inventory management - Advanced inventory management
- Mass quantity/cash corrections ("inventura" mode) - Mass quantity/cash corrections ("inventura" mode)
- Integrated brmbar overflow support - Integrated brmbar overflow support

View file

@ -96,6 +96,10 @@ class Shop:
for inventory in cur: for inventory in cur:
invid = inventory[0] invid = inventory[0]
inv = Account.load(self.db, id = invid) inv = Account.load(self.db, id = invid)
# FIXME: This is not correct as each instance of inventory
# might have been bought for a different price! Therefore,
# we need to replace the command below with a complex SQL
# statement that will... ugh, accounting is hard!
balance += inv.currency.convert(inv.balance(), self.currency) balance += inv.currency.convert(inv.balance(), self.currency)
return balance return balance
def inventory_negbalance_str(self): def inventory_negbalance_str(self):