Add EPC QR code to make bank transactions easier (#61)
See https://de.wikipedia.org/wiki/EPC-QR-Code#EPC-QR-Code_f%C3%BCr_%C3%9Cberweisung_erstellen for more information about the EPC coding Co-authored-by: dusker <dusker@gmx.de> Reviewed-on: #61 Co-authored-by: dusker <jens.graef+ezgg@posteo.de> Co-committed-by: dusker <jens.graef+ezgg@posteo.de>
This commit was merged in pull request #61.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from decimal import Decimal
|
||||
from typing import Optional
|
||||
|
||||
from rio import Column, Component, event, Text, TextStyle, Button, Color, Revealer, Row, ProgressCircle, Link
|
||||
from rio import Column, Component, event, Text, TextStyle, Button, Color, Revealer, Row, ProgressCircle, Link, Image
|
||||
|
||||
from src.ezgg_lan_manager import ConfigurationService, UserService, AccountingService
|
||||
from src.ezgg_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
@@ -14,6 +14,7 @@ class AccountPage(Component):
|
||||
user: Optional[User] = None
|
||||
balance: Optional[Decimal] = None
|
||||
transaction_history: list[Transaction] = list()
|
||||
payment_qr_image: bytes = None
|
||||
banking_info_revealer_open: bool = False
|
||||
paypal_info_revealer_open: bool = False
|
||||
|
||||
@@ -28,6 +29,11 @@ class AccountPage(Component):
|
||||
self.user = await self.session[UserService].get_user(user_id)
|
||||
self.balance = await self.session[AccountingService].get_balance(user_id)
|
||||
self.transaction_history = await self.session[AccountingService].get_transaction_history(user_id)
|
||||
self.payment_qr_image = self.session[AccountingService].make_payment_qr_image(
|
||||
"Einfach Zocken Gaming Gesellschaft",
|
||||
"GENODE51BIK",
|
||||
"DE47517624340019856607",
|
||||
f"AUFLADUNG - {self.user.user_id} - {self.user.user_name}")
|
||||
|
||||
async def _on_banking_info_press(self) -> None:
|
||||
self.banking_info_revealer_open = not self.banking_info_revealer_open
|
||||
@@ -36,7 +42,7 @@ class AccountPage(Component):
|
||||
self.paypal_info_revealer_open = not self.paypal_info_revealer_open
|
||||
|
||||
def build(self) -> Component:
|
||||
if not self.user and not self.balance:
|
||||
if not self.user or not self.payment_qr_image:
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
ProgressCircle(
|
||||
@@ -85,6 +91,10 @@ class AccountPage(Component):
|
||||
margin=0,
|
||||
margin_bottom=1,
|
||||
align_x=0.5
|
||||
),
|
||||
Image(self.payment_qr_image,
|
||||
min_width=20,
|
||||
min_height=20
|
||||
)
|
||||
),
|
||||
margin=2,
|
||||
|
||||
Reference in New Issue
Block a user