Fixed trailing whitespace.

This commit is contained in:
s3lph 2018-09-07 19:06:47 +02:00
parent 2c6996a9b4
commit 22d4bd2cd5
3 changed files with 30 additions and 2 deletions

View file

@ -612,7 +612,7 @@ class MatematDatabase(object):
fromdate, min_id = row fromdate, min_id = row
created: datetime = datetime.fromtimestamp(fromdate) created: datetime = datetime.fromtimestamp(fromdate)
cursor.execute(''' cursor.execute('''
SELECT t.ta_id, t.value, t.old_balance, t.date, c.ta_id, d.ta_id, m.ta_id, c.product, m.agent, m.reason SELECT t.ta_id, t.value, t.old_balance, t.date, c.ta_id, d.ta_id, m.ta_id, c.product, m.agent, m.reason
FROM transactions AS t FROM transactions AS t
LEFT JOIN consumptions AS c LEFT JOIN consumptions AS c
ON t.ta_id = c.ta_id ON t.ta_id = c.ta_id
@ -642,7 +642,7 @@ class MatematDatabase(object):
if write: if write:
cursor.execute(''' cursor.execute('''
INSERT INTO receipts (user_id, first_ta_id, last_ta_id) INSERT INTO receipts (user_id, first_ta_id, last_ta_id)
VALUES (:user_id, :first_ta, :last_ta) VALUES (:user_id, :first_ta, :last_ta)
''', { ''', {
'user_id': user.id, 'user_id': user.id,
'first_ta': transactions[0].id, 'first_ta': transactions[0].id,

26
templates/receipt.txt Normal file
View file

@ -0,0 +1,26 @@
===================================================================
MATEMAT RECEIPT
===================================================================
User: {{ user|safe }}
Accounting period: {{ fdate|safe }} -- {{ tdate|safe }}
Opening balance: {{ fbal|safe }}
Transactions:
{% for t in transactions %}
{% include 'transaction.txt' %}
{% endfor %}
------------
Closing balance: {{ tbal|safe }}
===================================================================
{{ instance_name|striptags }}{% if receipt_id > 1 %}
Receipt N° {{ receipt_id|safe }}{% endif %}
This receipt is only provided for informational purposes and has no
legal force.

View file

@ -0,0 +1,2 @@
{{ t.receipt_date|safe }} {{ t.receipt_description.ljust(36)|safe }} {% if t.receipt_message is none %}{{ t.receipt_value.rjust(8)|safe }}{% else %}
{{ t.receipt_message.ljust(36)|safe }} {{ t.receipt_value.rjust(8)|safe }}{% endif %}