changes
This commit is contained in:
BIN
icons/library_shelf.png
Normal file
BIN
icons/library_shelf.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
@@ -17,9 +17,9 @@ class ExtendLoan(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.buttonBox.accepted.connect(self.extendLoan)
|
||||
|
||||
def extendLoan(self):
|
||||
# print("Extend Loan")
|
||||
#print("Extend Loan")
|
||||
selectedDate = self.extenduntil.selectedDate()
|
||||
# print(selectedDate)
|
||||
#print(selectedDate)
|
||||
self.extendDate = selectedDate
|
||||
self.close()
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class MultiUserFound(QtWidgets.QDialog, Ui_Dialog):
|
||||
self.tableWidget.cellClicked.connect(self.selectUser)
|
||||
|
||||
def selectUser(self, row, column):
|
||||
# print(row, column)
|
||||
#print(row, column)
|
||||
user = User(
|
||||
id=self.tableWidget.item(row, 0).text(),
|
||||
username=self.tableWidget.item(row, 1).text(),
|
||||
|
||||
@@ -40,7 +40,7 @@ class NewEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
)
|
||||
def populateTable(self):
|
||||
for title in self.titles:
|
||||
# print(title)
|
||||
#print(title)
|
||||
entries = self.db.getMediaSimilarSignatureByID(title)
|
||||
# sort by signature
|
||||
entries.sort(key=lambda x: x.signature, reverse=True)
|
||||
@@ -66,7 +66,7 @@ class NewEntry(QtWidgets.QDialog, Ui_Dialog):
|
||||
signature=signature,
|
||||
ppn=eval(ppn),
|
||||
)
|
||||
# print(book)
|
||||
#print(book)
|
||||
if not self.db.checkMediaExists(book):
|
||||
newBookId = self.db.insertMedia(book)
|
||||
self.newIds.append(newBookId)
|
||||
|
||||
@@ -90,7 +90,7 @@ class ReportUi(QtWidgets.QDialog, Ui_Dialog):
|
||||
def report_generated(self):
|
||||
self.reportlink.setOpenExternalLinks(True)
|
||||
fileformat = self.rthread.format
|
||||
print(fileformat)
|
||||
#print(fileformat)
|
||||
self.reportlink.setText(
|
||||
f'<a href="file:///{os.getcwd()}/report.{fileformat}">Report</a>'
|
||||
)
|
||||
|
||||
@@ -72,11 +72,11 @@ class UserUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
extend.exec()
|
||||
if extend.result() == 1:
|
||||
extendDate = extend.extendDate.toString("yyyy-MM-dd")
|
||||
# # print columns of selected rows
|
||||
# #print columns of selected rows
|
||||
for item in self.UserMediaTable.selectedItems():
|
||||
if item.column() == 1:
|
||||
signature = item.text()
|
||||
# print(signature)
|
||||
#print(signature)
|
||||
self.db.extendLoanDuration(signature, extendDate)
|
||||
self.userMedia = []
|
||||
self.UserMediaTable.setRowCount(0)
|
||||
@@ -91,7 +91,7 @@ class UserUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
|
||||
self.UserMediaTable.setRowCount(0)
|
||||
for loan in self.userMedia:
|
||||
# print("looping loans")
|
||||
#print("looping loans")
|
||||
fielddata = eval(f"loan.{searchfield}")
|
||||
if isinstance(fielddata, str):
|
||||
fielddata = fielddata.lower()
|
||||
@@ -141,12 +141,12 @@ class UserUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
if self.radio_currentlyLoaned.isChecked()
|
||||
else "overdue"
|
||||
)
|
||||
print(mode)
|
||||
#print(mode)
|
||||
if self.userMedia == []:
|
||||
books = self.db.getAllMedia(self.user_id)
|
||||
for book in books:
|
||||
self.userMedia.append(book)
|
||||
# print(self.userMedia)
|
||||
#print(self.userMedia)
|
||||
self.UserMediaTable.setRowCount(0)
|
||||
|
||||
for book in self.userMedia:
|
||||
@@ -166,7 +166,7 @@ class UserUI(QtWidgets.QMainWindow, Ui_MainWindow):
|
||||
continue
|
||||
|
||||
self.addBookToTable(book)
|
||||
print(book.title)
|
||||
#print(book.title)
|
||||
def addBookToTable(self, book):
|
||||
self.UserMediaTable.insertRow(0)
|
||||
# item0 = isbn
|
||||
|
||||
@@ -23,7 +23,7 @@ def generate_report():
|
||||
report_path = os.path.join(config.report.path, f"report_{year}_{week}.tsv")
|
||||
day = QDate.currentDate().addDays(-7).toString("yyyy-MM-dd")
|
||||
query = f"""SELECT * FROM loans WHERE loan_date >= '{day}';"""
|
||||
# print(query)
|
||||
#print(query)
|
||||
|
||||
colnames = ["UserId", "Title", "Action", "Datum"]
|
||||
table = PrettyTable(colnames)
|
||||
@@ -49,7 +49,7 @@ def generate_report():
|
||||
loan_action_date,
|
||||
]
|
||||
)
|
||||
# # print(table)
|
||||
# #print(table)
|
||||
# # wruitng the table to a file
|
||||
# with open("report.txt", "w", encoding="utf-8") as f:
|
||||
# f.write(str(table))
|
||||
|
||||
Reference in New Issue
Block a user