Skip to content

Commit

Permalink
Merge pull request #17 from Hack42/newbranch
Browse files Browse the repository at this point in the history
veranderingen
  • Loading branch information
meneerhenk authored Sep 13, 2024
2 parents 86efb27 + b2078cf commit 59d34b3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugins/POS.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def slowwrite(self, y):
def bon(self, bonID):
if bonID in self.bonnetjes:
self.open()
self.slowwrite(self.bonnetjes[bonID]["bon"].encode())
self.slowwrite(self.bonnetjes[bonID]["bon"])
return True
return False

Expand Down
7 changes: 4 additions & 3 deletions plugins/declaratie.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ def amount(self, text):
return True
try:
value = float(text)
if 0 < value < 5000:
if -5000 < value < 5000:
self.value = value
if self.soort == "verkoop":
self.master.send_message(
True, "message", "Why do you give us E %.2f?" % self.value
)
self.value = -self.value
elif self.soort == "declaratie":
self.master.send_message(
True, "message", "Where did you spend E %.2f on?" % self.value
Expand Down Expand Up @@ -138,7 +139,7 @@ def runasbar(self, text):
return True
try:
value = float(text)
if 0 < value < 5000:
if -5000 < value < 5000:
if value > self.value:
return self.askbar(
"E %.2f is larger than E %.2f ; " % (value, self.value)
Expand Down Expand Up @@ -229,7 +230,7 @@ def runasbank(self, text):
return True
try:
value = float(text)
if 0 < value < 5000:
if -5000 < value < 5000:
if value > (self.value - self.asbar - self.ascash):
return self.askbank(
"E %.2f is larger than E %.2f ; "
Expand Down
4 changes: 2 additions & 2 deletions plugins/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ def writestock(self):
def voorraad_amount(self, text):
try:
aantal = int(text)
if not 0 < aantal < 5000:
if not -1 < aantal < 5000:
self.master.donext(self, "voorraad_amount")
self.master.send_message(
True,
"message",
"Please enter a number between 1 and 4999, how much "
"Please enter a number between 0 and 4999, how much "
+ self.prod
+ " is in stock?",
)
Expand Down
6 changes: 5 additions & 1 deletion plugins/undo.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def doundo(self, text):
),
)
return True
else:
print(self.undo.keys())
print(f"transID not in undo: {transID}")
self.listundo()
return True
except:
Expand Down Expand Up @@ -131,7 +134,8 @@ def listundo(self, restore=False):
for transID in self.undo.keys():
txt = ""
for usr in self.undo[transID]["totals"].keys():
txt += usr + " €" + "%.2f" % self.undo[transID]["totals"][usr] + " "
txt += " €" + "%.2f" % self.undo[transID]["totals"][usr] + " "
#txt += usr + " €" + "%.2f" % self.undo[transID]["totals"][usr] + " "
txt += time.strftime(
"%Y-%m-%d %H:%M:%S", time.localtime(transID + 1300000000)
)
Expand Down

0 comments on commit 59d34b3

Please sign in to comment.