From d74ca2b6c09c68fc1c8244795fa8ff640653f0fb Mon Sep 17 00:00:00 2001 From: brmbar Date: Tue, 6 Aug 2013 21:51:58 +0200 Subject: [PATCH] Shop: Create null inventory fix transaction in case amount is correct --- brmbar3/brmbar/Shop.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/brmbar3/brmbar/Shop.py b/brmbar3/brmbar/Shop.py index 2578d43..5cb378c 100644 --- a/brmbar3/brmbar/Shop.py +++ b/brmbar3/brmbar/Shop.py @@ -164,6 +164,10 @@ class Shop: self.db.commit() return True else: + transaction = self._transaction(description = "BrmBar inventory fix of {}pcs {} in system to {}pcs in reality".format(amount_in_system, item.name,amount_in_reality)) + item.debit(transaction, 0, "Inventory fix - amount was correct") + item.credit(transaction, 0, "Inventory fix - amount was correct") + self.db.commit() return False def fix_cash(self, amount): amount_in_reality = amount @@ -183,4 +187,4 @@ class Shop: self.db.commit() return True else: - return False \ No newline at end of file + return False