Skip to content

Commit

Permalink
FIX: receipt printing did not close printer connection
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmax committed Dec 29, 2023
1 parent 57c0e5c commit c48853a
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions FabLabKasse/kassenbuch.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,18 @@ def print_receipt(self, cfg):
profile=cfg.get("receipt", "profile"),
magic_encode_args={"defaultsymbol": " "},
)
printer.image(cfg.get("receipt", "logo"))
printer.text("\n")
printer.text(
self.receipt(
header=cfg.get("receipt", "header"), footer=cfg.get("receipt", "footer")
).replace("ẞ", "ß")
)
printer.cut(mode="PART")
try:
printer.image(cfg.get("receipt", "logo"))
printer.text("\n")
printer.text(
self.receipt(
header=cfg.get("receipt", "header"),
footer=cfg.get("receipt", "footer"),
).replace("ẞ", "ß")
)
printer.cut(mode="PART")
finally:
printer.close()


class Buchung(object):
Expand Down

0 comments on commit c48853a

Please sign in to comment.