Skip to content

Commit

Permalink
Fix RegisterList
Browse files Browse the repository at this point in the history
  • Loading branch information
kanehekili committed Mar 2, 2024
1 parent 41d1c83 commit b56519f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/RegModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def updateRFIDAbrechnung(self, mbr):
return
now = datetime.now().isoformat()
data = []
data.append((now, mbr.id))
self.db.insertMany(self.dbSystem.REGISTERTABLE, ('register_date', 'mitglied_id'), data)
data.append((now, mbr.id,mbr.rfid))
self.db.insertMany(self.dbSystem.REGISTERTABLE, ('register_date', 'mitglied_id','uuid'), data)
Log.info("Dispensing NEW Chip %d to member %d",mbr.rfid,mbr.id)
mbr.initialRFID = mbr.rfid

Expand Down
2 changes: 1 addition & 1 deletion src/TsvAuswertung.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ def configTable(self):

def registerTable(self):
# list only NON Assa Abloy keys
stmt = "select id,register_date,last_name,CAST(birth_date AS DATE),access,m.uuid from Mitglieder m LEFT JOIN AssaAbloy a on a.uuid=m.uuid join RegisterList r on m.id=r.mitglied_id where a.uuid IS NULL and month(register_date)>month(CURDATE())-3 ORDER BY r.register_date ASC;"
stmt = "select id,register_date,last_name,CAST(birth_date AS DATE),access,r.uuid from Mitglieder m LEFT JOIN AssaAbloy a on a.uuid=m.uuid join RegisterList r on m.id=r.mitglied_id where a.uuid IS NULL and month(register_date)>month(CURDATE())-3 ORDER BY r.register_date ASC"
return self.db.select(stmt)

def aboTable(self):
Expand Down
5 changes: 4 additions & 1 deletion src/TsvDBCreator.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,14 @@ class SetUpTSVDB():
)
"""
#will be set whenever a "new" token has been issued - just for Abrechnung
#Alter table RegisterList add uuid INT UNSIGNED NOT NULL DEFAULT 0;
#fix zeros: update RegisterList r inner join Mitglieder m on r.mitglied_id = m.id set r.uuid=m.uuid where r.uuid=0;
REGISTERTABLE="RegisterList"
TABLE8="""
CREATE OR REPLACE TABLE RegisterList (
register_date DATETIME,
mitglied_id INT
mitglied_id INT,
uuid INT UNSIGNED NOT NULL
)
"""
#overview for abos
Expand Down

0 comments on commit b56519f

Please sign in to comment.