Management: Fix negative inventory balance

This commit is contained in:
Petr Baudis 2012-10-17 20:54:55 +02:00
parent 17ea4c72c6
commit 09d57550a3
2 changed files with 3 additions and 3 deletions

View file

@ -89,7 +89,7 @@ class ShopAdapter(QtCore.QObject):
return shop.profits.balance_str() return shop.profits.balance_str()
@QtCore.Slot(result='QVariant') @QtCore.Slot(result='QVariant')
def balance_inventory(self): def balance_inventory(self):
return shop.inventory_negbalance_str() return shop.inventory_balance_str()
@QtCore.Slot(result='QVariant') @QtCore.Slot(result='QVariant')
def balance_credit(self): def balance_credit(self):
return shop.credit_negbalance_str() return shop.credit_negbalance_str()

View file

@ -120,8 +120,8 @@ class Shop:
# statement that will... ugh, accounting is hard! # 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_balance_str(self):
return self.currency.str(-self.inventory_balance()) return self.currency.str(self.inventory_balance())
def account_list(self, acctype): def account_list(self, acctype):
accts = [] accts = []