- Move Bookkeeping instantiation inside the loop
- Create fresh instance for each accounting entry
- Prevents field contamination between entries
- Ensures each entry is processed independently
- Use correct field names for Bookkeeping class
- Set all required fields: doc_date, doc_ref, code_journal, numero_compte, etc.
- Use proper debit/credit logic with sens field
- Set journal code to 'OD' for VAT declarations
- Link entries to declaration via fk_doc
- Update verification query to use correct field names
- Replace Bookkeeping::create() with direct SQL INSERT
- Bookkeeping class was returning success but not actually saving records
- Add detailed SQL logging to track insert operations
- Ensure entries are actually committed to database
- Add verification query after each bookkeeping create call
- Add final verification to count total entries created
- Help identify if entries are actually being saved to database
- Add debug logs to track bank account ID from config
- Add debug logs to show bank account query and results
- Help identify why bank account code is empty
- Add debug logs to track each accounting entry being created
- Add debug logs to track bookkeeping create results
- Help identify why entries are not being saved to database
- Add user parameter to createODJournalEntries method signature
- Pass user parameter from createAccountingEntries to createODJournalEntries
- Fixes user parameter getting lost between createAccountingEntries and saveAccountingEntries
- Add debug logs to track user parameter through method calls
- Update createAccountingEntries to accept user parameter
- Remove redundant global user declarations
- Pass user parameter through entire accounting creation chain
- Add user parameter to submitDeclaration method signature
- Pass user object from view file to submitDeclaration method
- Remove redundant global user declaration
- Fixes null user parameter in bookkeeping create method
- Use htdocs/accountancy/class/bookkeeping.class.php
- Replace direct SQL with proper Dolibarr Bookkeeping class
- Maintains proper Dolibarr integration and error handling
- Remove dependency on non-existent AccountingBookkeeping class
- Use direct SQL INSERT into accounting_bookkeeping table
- Fixes 'Failed opening required' error for accounting class
- Creates accounting entries directly in database
- Add debug logs to track method calls and return values
- Help diagnose why account details are not being found
- Track account count returned by getCA3LineDetails
- Add debug logs to track CA-3 lines found
- Add debug logs to track OD entries creation
- Add debug logs to track line 8, 20, and balancing entries
- Help diagnose why no OD journal entries are being created
- Temporarily disable status validation to allow re-submission
- Add resetDeclarationStatus() method for testing
- Add reset button for submitted declarations
- Add French language strings for reset functionality
- Allows multiple submission attempts during testing
- Remove duplicate 'Create accounting entries' toggle from journal configuration
- Use existing 'Auto-create accounting entries' setting for submission workflow
- Clean up unused language strings
- Consolidate accounting entry control into single, clear setting
- Add comprehensive accounting integration with OD and bank journal entries
- Create configurable accounting entries toggle in setup
- Implement submission workflow with accounting entry creation
- Add proper error handling and validation
- Support VAT refund threshold logic for account selection
- Integrate with Dolibarr's AccountingBookkeeping class
- Add French language strings for new features
- Fixed return value handling in generateCompleteCA3PDF() method
- Export now correctly returns file path instead of boolean
- Improved error handling for PDF generation failures
- Export functionality now works with both fillable and improved layouts
- Updated module version to 2.5.31
- Created single method generateCompleteCA3PDF() for both export and validation
- Export uses fillable template when available, validation uses improved layout
- Both export and validation now use the same improved detailed pages
- Cleaner architecture with status parameter (export/validation)
- All PDF improvements centralized in generateImprovedPDF() method
- Better maintainability and consistency across all PDF generation
- Updated module version to 2.5.30
- Restored export functionality to use fillable PDF template when available
- Fixed validation PDF to use improved layout with all enhancements
- Separated export and validation: export uses fillable template, validation uses improved layout
- Validation PDF now includes OD and bank journal tables on first page
- Validation PDF now has all improvements (footer, filtered accounts, etc.)
- Updated module version to 2.5.29
- Validation now uses the same improved PDF generation as export
- Validation PDF now includes OD and bank journal tables on first page
- Both export and validation now use generateBasicPDF() for consistency
- Validation PDF now has all improvements (footer, filtered accounts, etc.)
- Fixed issue where validation used different PDF generation method
- Updated module version to 2.5.28
- Cleaned up all debug statements and error_log calls from PDF generation
- Removed test data and debugging code for production readiness
- Eliminated unnecessary logging during PDF generation
- Code is now clean and optimized for production use
- Updated module version to 2.5.27
- Footer now displays declaration period centered between company name and page number
- Enhanced footer information with company name, declaration period, and page count
- Professional PDF layout with complete footer information
- Declaration period helps identify the document period
- Updated module version to 2.5.26