Added feature to transfer money to another account + some minor improvements
This commit is contained in:
parent
2bab323b86
commit
8702233934
11 changed files with 164 additions and 30 deletions
|
@ -45,21 +45,30 @@ def select_history(user, language_code="en") -> list:
|
|||
result = _db_select(f"""
|
||||
select
|
||||
concat(
|
||||
price_sum, '{settings.CURRENCY_SUFFIX} - ',
|
||||
product_name, ' (',
|
||||
content_litres::real, -- converting to real removes trailing zeros
|
||||
'l) x ', amount, ' - ', price_sum, '{settings.CURRENCY_SUFFIX}') as "text",
|
||||
'l) x ', amount) as "text",
|
||||
datetime
|
||||
from app_order
|
||||
where user_id = {user_id}
|
||||
|
||||
union
|
||||
union
|
||||
|
||||
select
|
||||
concat('Deposit: +', transaction_sum, '{settings.CURRENCY_SUFFIX}') as "text",
|
||||
concat(transaction_sum, '{settings.CURRENCY_SUFFIX} - Deposit') as "text",
|
||||
datetime
|
||||
from app_userdeposits_view
|
||||
where user_id = {user_id}
|
||||
|
||||
union
|
||||
|
||||
select
|
||||
concat(transaction_sum, '{settings.CURRENCY_SUFFIX} - ', comment) as "text",
|
||||
datetime
|
||||
from app_registertransaction
|
||||
where user_id = {user_id} and is_transfer = true
|
||||
|
||||
order by datetime desc
|
||||
fetch first 30 rows only;
|
||||
""")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue