diff options
author | Sebastian Reichel <sre@ring0.de> | 2012-05-30 11:40:43 +0200 |
---|---|---|
committer | Sebastian Reichel <sre@ring0.de> | 2012-05-30 11:40:43 +0200 |
commit | 702c0cf99a115a523fccc50452b057d1d034a9e6 (patch) | |
tree | 2a688a02bedc8c2d89a34d464ef84f9ca844e530 /invoice | |
parent | c10452ff907f0356d702fea95dad2678eee67acb (diff) | |
download | serial-barcode-scanner-702c0cf99a115a523fccc50452b057d1d034a9e6.tar.bz2 |
indent ascii table
Diffstat (limited to 'invoice')
-rwxr-xr-x | invoice/generate-invoice.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/invoice/generate-invoice.py b/invoice/generate-invoice.py index 2a3196f..6688d83 100755 --- a/invoice/generate-invoice.py +++ b/invoice/generate-invoice.py @@ -150,20 +150,20 @@ def generate_invoice_text(user, title, subject, start=0, stop=0): if len(row["product"]) > namelength: namelength = len(row["product"]) - result += "+------------+----------+-" + namelength * "-" + "-+----------+\n" - result += "| Datum | Uhrzeit | Artikel" + (namelength - len("Artikel")) * " " + " | Preis |\n" - result += "+------------+----------+-" + namelength * "-" + "-+----------+\n" + result += " +------------+----------+-" + namelength * "-" + "-+----------+\n" + result += " | Datum | Uhrzeit | Artikel" + (namelength - len("Artikel")) * " " + " | Preis |\n" + result += " +------------+----------+-" + namelength * "-" + "-+----------+\n" for row in get_invoice_data(user, start, stop): total += row["price"] if lastdate != row["date"]: - result += "| %s | %s | %s | %3d,%02d € |\n" % (row["date"], row["time"], row["product"] + (namelength - len(row["product"])) * " ", row["price"] / 100, row["price"] % 100) + result += " | %s | %s | %s | %3d,%02d € |\n" % (row["date"], row["time"], row["product"] + (namelength - len(row["product"])) * " ", row["price"] / 100, row["price"] % 100) lastdate = row["date"] else: - result += "| %s | %s | %s | %3d,%02d € |\n" % (" ", row["time"], row["product"] + (namelength - len(row["product"])) * " ", row["price"] / 100, row["price"] % 100) - result += "+------------+----------+-" + namelength * "-" + "-+----------+\n" - result += "| Summe: " + namelength * " " + " | %3d,%02d € |\n" % (total / 100, total % 100) - result += "+-------------------------" + namelength * "-" + "-+----------+\n\n" + result += " | %s | %s | %s | %3d,%02d € |\n" % (" ", row["time"], row["product"] + (namelength - len(row["product"])) * " ", row["price"] / 100, row["price"] % 100) + result += " +------------+----------+-" + namelength * "-" + "-+----------+\n" + result += " | Summe: " + namelength * " " + " | %3d,%02d € |\n" % (total / 100, total % 100) + result += " +-------------------------" + namelength * "-" + "-+----------+\n\n" result += "Umsatzsteuer wird nicht erhoben, da Kreativität trifft Technik e.V. als Kleinunternehmen\n" result += "der Regelung des § 19 Abs. 1 UStG unterfällt.\n\n" |