mirror of
https://github.com/brmlab/brmbar.git
synced 2025-06-08 13:24:01 +02:00
brmbarv3 TODO: Shop.inventory_balance() is computing wrong results
This commit is contained in:
parent
7f37f0baad
commit
0ab5e579c7
2 changed files with 5 additions and 0 deletions
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue