fixes
This commit is contained in:
@ -1234,6 +1234,64 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def get_account_entry_categorys(user, token_info):
|
||||
return dbGetMany(user, token_info, {
|
||||
"statement": """
|
||||
SELECT
|
||||
id
|
||||
,description
|
||||
,overhead_relevant
|
||||
FROM account_entry_category_t
|
||||
ORDER BY
|
||||
description
|
||||
""",
|
||||
"params": ()
|
||||
}
|
||||
)
|
||||
|
||||
def insert_account_entry_category(user, token_info, **args):
|
||||
try:
|
||||
body = args["body"]
|
||||
v_description = body["description"]
|
||||
v_overhead_relevant = body["overhead_relevant"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO account_entry_category_t
|
||||
(
|
||||
description
|
||||
,overhead_relevant
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
"params": [
|
||||
v_description
|
||||
,v_overhead_relevant
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
logger.warning("insert_account_entry_category: parameter missing: {}".format(e))
|
||||
raise werkzeug.exceptions.UnprocessableEntity("parameter missing: {}".format(e))
|
||||
|
||||
|
||||
def get_account_entry_category(user, token_info, account_entry_categoryId=None):
|
||||
return dbGetOne(user, token_info, {
|
||||
"statement": """
|
||||
SELECT
|
||||
id
|
||||
,description
|
||||
,overhead_relevant
|
||||
FROM account_entry_category_t
|
||||
WHERE id = %s
|
||||
""",
|
||||
"params": (account_entry_categoryId, )
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
|
||||
def get_account_entrys(user, token_info):
|
||||
return dbGetMany(user, token_info, {
|
||||
"statement": """
|
||||
@ -1243,6 +1301,7 @@ SELECT
|
||||
,account
|
||||
,created_at
|
||||
,amount
|
||||
,account_entry_category
|
||||
FROM account_entry_t
|
||||
ORDER BY
|
||||
amount
|
||||
@ -1258,6 +1317,7 @@ def insert_account_entry(user, token_info, **args):
|
||||
v_account = body["account"]
|
||||
v_created_at = body["created_at"]
|
||||
v_amount = body["amount"]
|
||||
v_account_entry_category = body["account_entry_category"]
|
||||
return dbInsert(user, token_info, {
|
||||
"statement": """
|
||||
INSERT INTO account_entry_t
|
||||
@ -1266,11 +1326,13 @@ INSERT INTO account_entry_t
|
||||
,account
|
||||
,created_at
|
||||
,amount
|
||||
,account_entry_category
|
||||
) VALUES (
|
||||
%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
,%s
|
||||
)
|
||||
RETURNING *
|
||||
""",
|
||||
@ -1279,6 +1341,7 @@ INSERT INTO account_entry_t
|
||||
,v_account
|
||||
,v_created_at
|
||||
,v_amount
|
||||
,v_account_entry_category
|
||||
]
|
||||
})
|
||||
except KeyError as e:
|
||||
@ -1295,6 +1358,7 @@ SELECT
|
||||
,account
|
||||
,created_at
|
||||
,amount
|
||||
,account_entry_category
|
||||
FROM account_entry_t
|
||||
WHERE id = %s
|
||||
""",
|
||||
@ -1313,6 +1377,7 @@ SELECT
|
||||
,account
|
||||
,created_at
|
||||
,amount
|
||||
,account_entry_category
|
||||
FROM account_entry_t
|
||||
WHERE account = %s
|
||||
""",
|
||||
@ -1320,6 +1385,23 @@ SELECT
|
||||
}
|
||||
)
|
||||
|
||||
def get_account_entry_by_account_entry_category(user, token_info, account_entry_categoryId=None):
|
||||
return dbGetMany(user, token_info, {
|
||||
"statement": """
|
||||
SELECT
|
||||
id
|
||||
,description
|
||||
,account
|
||||
,created_at
|
||||
,amount
|
||||
,account_entry_category
|
||||
FROM account_entry_t
|
||||
WHERE account_entry_category = %s
|
||||
""",
|
||||
"params": (account_entry_categoryId, )
|
||||
}
|
||||
)
|
||||
|
||||
def get_notes(user, token_info):
|
||||
return dbGetMany(user, token_info, {
|
||||
"statement": """
|
||||
|
Reference in New Issue
Block a user