Applied the summary helper and JavaScripts to the transaction form, so that the transaction form works in the accounting application.

This commit is contained in:
2020-08-05 07:48:50 +08:00
parent 2c6256b497
commit b2ce0eff54
10 changed files with 1539 additions and 2 deletions

View File

@ -18,6 +18,7 @@
"""The utilities of the accounting application.
"""
import datetime
import json
import re
@ -374,7 +375,11 @@ def fill_txn_from_post(txn_type, txn, post):
txn (Transaction): The transaction.
post (dict): The POSTed data.
"""
txn.date = post["date"]
m = re.match("^([0-9]{4})-([0-9]{2})-([0-9]{2})$", post["date"])
txn.date = datetime.date(
int(m.group(1)),
int(m.group(2)),
int(m.group(3)))
if "notes" in post:
txn.notes = post["notes"]
else: