mirror of
https://github.com/DRYTRIX/TimeTracker.git
synced 2026-01-02 01:30:15 -06:00
Implement comprehensive support for exporting extra goods (products, services, materials, licenses) in invoice PDF documents. Extra goods now appear in the invoice items table alongside time-based billing entries with rich formatting including name, description, SKU codes, and category labels. Changes: - Enhanced InvoicePDFGenerator._generate_items_rows() to include extra goods with detailed formatting (name, description, SKU, category) - Updated pdf_default.html template to render extra goods loop in the invoice items table with conditional display of optional fields - Enhanced InvoicePDFGeneratorFallback._build_items_table() for ReportLab compatibility with multi-line descriptions - Added 6 comprehensive tests covering both WeasyPrint and ReportLab generators (unit tests and smoke tests) - Created complete feature documentation in docs/INVOICE_EXTRA_GOODS_PDF_EXPORT.md Technical Details: - Extra goods display quantity, unit price, and total amount - Automatic inclusion in invoice totals via existing calculate_totals() - No database migrations required (extra_goods table already exists) - Backward compatible - invoices without goods unchanged - Supports both primary (WeasyPrint) and fallback (ReportLab) generators Testing: - 6 new tests added to tests/test_invoices.py - 3 tests pass on Windows (ReportLab fallback) - 3 tests require WeasyPrint system dependencies (Linux/Docker) - All code changes validated with no linter errors Files Modified: - app/utils/pdf_generator.py - app/templates/invoices/pdf_default.html - app/utils/pdf_generator_fallback.py - tests/test_invoices.py Files Created: - docs/INVOICE_EXTRA_GOODS_PDF_EXPORT.md - INVOICE_GOODS_EXPORT_IMPLEMENTATION_SUMMARY.md