This commit is contained in:
Midgard 2021-08-31 23:08:59 +02:00
parent 4b5192bcc3
commit 7ce1a81caa
Signed by: midgard
GPG key ID: 511C112F1331BBB4

14
tab
View file

@ -55,21 +55,27 @@ def formatted_transaction(transaction, me, balance_after=None):
transaction["message"] transaction["message"]
).strip() ).strip()
header = f"{date} {message}"
assertion = balance_assertion(balance_after) assertion = balance_assertion(balance_after)
if debtor == me: if debtor == me:
# If the issuer wasn't Tap, we assume the money we gave was for food manual change to the # If the issuer wasn't Tap, we assume the money we gave was for food manual change to the
# output required if it wasn't # output required if it wasn't
to_account = TAP_ACCOUNT if issuer == "Tap" else FOOD_ACCOUNT if issuer == "Tap":
to_account = TAP_ACCOUNT
message = f"Zeus WPI | {message}"
else:
to_account = FOOD_ACCOUNT
message = f"{issuer} | {message}"
to_line = f"{to_account} {amount}" to_line = f"{to_account} {amount}"
from_line = f"tab {assertion}" from_line = f"tab {assertion}"
else: else:
message = f"{debtor} | {message}"
to_line = f"tab {amount} {assertion}" to_line = f"tab {amount} {assertion}"
from_line = f"; {debtor}" from_line = f";"
header = f"{date} {message}"
return "\n".join([ return "\n".join([