From fd67aed7dd26059598b85c08f3d6835d8189b9fe Mon Sep 17 00:00:00 2001 From: Christoffer Viken Date: Fri, 12 May 2017 19:34:33 +0000 Subject: [PATCH] Added "total purchase" option back * Does not have ability to set total to greater than sum. --- text_interface/addstock.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/text_interface/addstock.py b/text_interface/addstock.py index 5bdd3ad..213c75d 100644 --- a/text_interface/addstock.py +++ b/text_interface/addstock.py @@ -91,6 +91,14 @@ much money you're due in credits for the purchase when prompted.\n''' self.products[thing] = [amount, price] def perform_transaction(self): + print 'Did you pay a different price?' + if not self.confirm('>', default=True): + price = self.input_int() + if price > self.price: + print 'Illegal action, total can not be higher than your total.' + else: + self.price = price + description = self.input_str('Log message> ', length_range=(0, 50)) if description == '': description = 'Purchased products for PVVVV, adjusted credit ' + str(self.price)