This commit introduces a `PDFExporter` class to handle PDF invoice
generation logic. This separates PDF creation from the main
application logic, improving modularity.
- Created PDFExporter class with methods for generating PDF invoices.
- Moved PDF generation code from MainWindow to PDFExporter.
- Added attributes for company and client information.
This commit introduces a `Database` class to encapsulate all
database-related operations. This improves code organization,
testability, and maintainability.
- Created Database class with methods for creating tables,
loading/saving projects, log entries, and settings.
- Added error handling for database connection and operations.
- Implemented methods to load and save invoice numbers.
- Replaced direct database access with Database class methods.
- Added `invoice_file` attribute to store the filename where the invoice number is persisted.
- Implemented `load_invoice_number` to read the last invoice number from the file on app startup. If the file doesn't exist or contains an invalid number, it defaults to 1.
- Implemented `save_invoice_number` to persist the incremented invoice number to the file after generating a PDF.
- Modified `export_to_pdf` to increment and save the invoice number after successful PDF generation.