From 31e3442c7c400846e75f5821b9ee60190dc565e9 Mon Sep 17 00:00:00 2001 From: robertem <3456661+RandomGamer342@users.noreply.github.com> Date: Sun, 22 Apr 2018 15:44:24 +0000 Subject: [PATCH] Fix user transaction error and other unexpected behaviour --- text_interface/addstock.py | 4 ++-- text_interface/miscmenus.py | 2 +- text_interface/printermenu.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/text_interface/addstock.py b/text_interface/addstock.py index c414aac..63527b8 100644 --- a/text_interface/addstock.py +++ b/text_interface/addstock.py @@ -92,8 +92,8 @@ much money you're due in credits for the purchase when prompted.\n''' def perform_transaction(self): print 'Did you pay a different price?' - if self.confirm('>', default=True): - price = self.input_int() + if self.confirm('>', default=False): + price = self.input_int('How much did you pay?', default=self.price) if price > self.price: print 'Illegal action, total can not be higher than your total.' else: diff --git a/text_interface/miscmenus.py b/text_interface/miscmenus.py index 5bcf8a4..f5b1512 100644 --- a/text_interface/miscmenus.py +++ b/text_interface/miscmenus.py @@ -34,7 +34,7 @@ class TransferMenu(Menu): print 'Transfered %d kr from %s to %s' % (amount, user1, user2) print 'User %s\'s credit is now %d kr' % (user1, user1.credit) print 'User %s\'s credit is now %d kr' % (user2, user2.credit) - print 'Comment: $s' % comment + print 'Comment: %s' % comment except sqlalchemy.exc.SQLAlchemyError, e: print 'Could not perform transfer: %s' % e # self.pause() diff --git a/text_interface/printermenu.py b/text_interface/printermenu.py index 5aa31c4..f21c22d 100644 --- a/text_interface/printermenu.py +++ b/text_interface/printermenu.py @@ -18,7 +18,7 @@ Put it up somewhere in the vicinity. def _execute(self): self.print_header() - thing = self.input_thing('Prodct/User> ') + thing = self.input_thing('Product/User> ') if isinstance(thing, Product): if re.match(r"^[0-9]{13}$", thing.bar_code):