Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

veranderingen #17

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading