7 Commits

Author SHA1 Message Date
David Rodenkirchen d5cd05c0e5 release 0.3.7 2026-04-16 08:51:21 +02:00
David Rodenkirchen b8c1df5ff8 Disable commercial PayPal charging 2026-04-16 08:50:11 +02:00
dusker 8877de2cef 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>
2026-04-16 06:48:46 +00:00
David Rodenkirchen bd5c142bcf Fix logout not redirecting properly 2026-04-16 07:32:35 +02:00
David Rodenkirchen e0ed3c7059 update sanitized backup 2026-04-16 07:07:00 +02:00
dusker a53e7100da Fix mariadb health check by adding the root password 2026-04-03 22:09:39 +02:00
David Rodenkirchen 2902c6a58c add sanitized production export 2026-02-24 00:54:24 +01:00
8 changed files with 940 additions and 20 deletions
+1 -1
View File
@@ -1 +1 @@
0.3.6 0.3.7
+2 -1
View File
@@ -21,7 +21,7 @@ services:
MARIADB_USER: ezgg_lan_manager MARIADB_USER: ezgg_lan_manager
MARIADB_PASSWORD: Alkohol1 MARIADB_PASSWORD: Alkohol1
healthcheck: healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-h", "localhost"] test: ["CMD", "mariadb-admin", "ping", "-h", "localhost", "-pAlkohol1"]
interval: 5s interval: 5s
timeout: 3s timeout: 3s
retries: 5 retries: 5
@@ -30,6 +30,7 @@ services:
volumes: volumes:
- database:/var/lib/mysql - database:/var/lib/mysql
- ./sql/create_database.sql:/docker-entrypoint-initdb.d/init.sql - ./sql/create_database.sql:/docker-entrypoint-initdb.d/init.sql
- ./sql:/sql
volumes: volumes:
BIN
View File
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -60,8 +60,10 @@ class UserInfoBox(Component):
self.session[LocalDataService].del_session(self.session[LocalData].stored_session_token) self.session[LocalDataService].del_session(self.session[LocalData].stored_session_token)
self.session[LocalData].stored_session_token = None self.session[LocalData].stored_session_token = None
self.session.attach(self.session[LocalData]) self.session.attach(self.session[LocalData])
await self.status_change_cb() if self.status_change_cb is not None:
await self.status_change_cb()
await self.session[RefreshService].trigger_refresh() await self.session[RefreshService].trigger_refresh()
self.session.navigate_to("")
@event.on_populate @event.on_populate
async def async_init(self) -> None: async def async_init(self) -> None:
+26 -15
View File
@@ -1,7 +1,7 @@
from decimal import Decimal from decimal import Decimal
from typing import Optional 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 import ConfigurationService, UserService, AccountingService
from src.ezgg_lan_manager.components.MainViewContentBox import MainViewContentBox from src.ezgg_lan_manager.components.MainViewContentBox import MainViewContentBox
@@ -14,6 +14,7 @@ class AccountPage(Component):
user: Optional[User] = None user: Optional[User] = None
balance: Optional[Decimal] = None balance: Optional[Decimal] = None
transaction_history: list[Transaction] = list() transaction_history: list[Transaction] = list()
payment_qr_image: bytes = None
banking_info_revealer_open: bool = False banking_info_revealer_open: bool = False
paypal_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.user = await self.session[UserService].get_user(user_id)
self.balance = await self.session[AccountingService].get_balance(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.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: async def _on_banking_info_press(self) -> None:
self.banking_info_revealer_open = not self.banking_info_revealer_open 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 self.paypal_info_revealer_open = not self.paypal_info_revealer_open
def build(self) -> Component: def build(self) -> Component:
if not self.user and not self.balance: if not self.user or not self.payment_qr_image:
return Column( return Column(
MainViewContentBox( MainViewContentBox(
ProgressCircle( ProgressCircle(
@@ -85,6 +91,10 @@ class AccountPage(Component):
margin=0, margin=0,
margin_bottom=1, margin_bottom=1,
align_x=0.5 align_x=0.5
),
Image(self.payment_qr_image,
min_width=20,
min_height=20
) )
), ),
margin=2, margin=2,
@@ -223,19 +233,20 @@ class AccountPage(Component):
on_press=self._on_paypal_info_press on_press=self._on_paypal_info_press
), ),
paypal_info_revealer, paypal_info_revealer,
Link( # Disabled because people did not understand the fee's and kept charging 24.03 € to their accounts
content=Button( # Link(
content=Text("PAYPAL (3% Gebühr - Gewerblich)", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"), # content=Button(
shape="rectangle", # content=Text("PAYPAL (3% Gebühr - Gewerblich)", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"),
style="major", # shape="rectangle",
color="secondary", # style="major",
grow_x=True, # color="secondary",
margin=2, # grow_x=True,
margin_top=0 # margin=2,
), # margin_top=0
target_url="https://www.paypal.com/ncp/payment/89YMGVZ4S33RS", # ),
open_in_new_tab=True # target_url="https://www.paypal.com/ncp/payment/89YMGVZ4S33RS",
) # open_in_new_tab=True
# )
) )
), ),
MainViewContentBox( MainViewContentBox(
@@ -1,4 +1,6 @@
import io
import logging import logging
import qrcode
from collections.abc import Callable from collections.abc import Callable
from datetime import datetime from datetime import datetime
from decimal import Decimal, ROUND_DOWN from decimal import Decimal, ROUND_DOWN
@@ -74,3 +76,29 @@ class AccountingService:
return "0.00 €" return "0.00 €"
rounded_decimal = str(euros.quantize(Decimal(".01"), rounding=ROUND_DOWN)) rounded_decimal = str(euros.quantize(Decimal(".01"), rounding=ROUND_DOWN))
return f"{rounded_decimal}" return f"{rounded_decimal}"
@staticmethod
def make_payment_qr_image(beneficiary_name, beneficiary_bic, beneficiary_iban, text, amount_euros=None) -> bytes:
text = text.replace("\n",";")
amount_formatted = "EUR{:.2f}".format(amount_euros) if amount_euros else ""
epc_text = f"""BCD
002
1
SCT
{beneficiary_bic}
{beneficiary_name}
{beneficiary_iban}
{amount_formatted}
{text}
"""
qr = qrcode.QRCode(
version=6,
error_correction=qrcode.constants.ERROR_CORRECT_M,
)
qr.add_data(epc_text)
img = qr.make_image()
img_bytes = io.BytesIO()
img.save(img_bytes)
return img_bytes.getvalue()
@@ -21,5 +21,6 @@ class LocalDataService:
self._session[key] = session self._session[key] = session
return key return key
def del_session(self, token: str) -> None: def del_session(self, token: Optional[str]) -> None:
self._session.pop(token, None) if token is not None:
self._session.pop(token, None)