Commit Graph

355 Commits

Author SHA1 Message Date
c36b9c436b Fix official template recognition for PDF generation
- Update isFillablePDF() to recognize ca3_official_template.pdf
- Ensure official template is used for CA-3 form generation
- Fix missing CA-3 pages in PDF output
- Use official template instead of falling back to basic PDF generation
2025-10-08 01:36:11 +02:00
82a996700e Fix template path resolution for PDF generation
- Use realpath() to get absolute path to templates directory
- Fix template loading for CA-3 PDF generation
- Resolve template path mismatch issue
- Ensure official template is found and used correctly
2025-10-08 01:33:07 +02:00
c471defd25 Implement minor version system for template management
- Add major.minor version format (30.1)
- Keep government version as major number (30)
- Use minor version for fixes and improvements (.1, .2, .3)
- Update manifest.json with minor version system
- Add practical examples to maintenance manual
- Enable automatic updates for template fixes
- Maintain government version compliance
2025-10-08 01:26:12 +02:00
e8cbd9b3df Add comprehensive template maintenance manual
- Complete guide for updating official CA-3 templates
- Step-by-step instructions for template management
- Version control and file structure documentation
- Troubleshooting guide and best practices
- Quick reference checklist for template updates
2025-10-08 01:21:29 +02:00
3631b33079 Remove debug code from template management
- Remove debug logging from action handling
- Remove debug logging from template reset method
- Remove debug logging from template info method
- Clean up production code after successful debugging
2025-10-08 01:19:51 +02:00
e8f9ab260a Fix template action handling by moving outside tab logic
- Move template actions (upload, reset, update) outside tab conditional blocks
- Ensure template actions are processed regardless of active tab
- Fix REVENIR AU MODELE OFFICIEL button functionality
- Remove duplicate action handlers from templates tab section
2025-10-08 01:18:52 +02:00
39ddbaac49 Add debugging to action handling
- Add debug logging to track received actions
- Debug action processing flow
- Identify why reset_template action is not being processed
2025-10-08 01:17:55 +02:00
9f634d2998 Add debugging to template reset action handler
- Add debug logging to reset_template action
- Track if reset action is being triggered
- Debug action handling flow
2025-10-08 01:16:56 +02:00
d48800a849 Add debugging to template reset functionality
- Add debug logging to resetToDefaultTemplate method
- Add debug logging to getTemplateInfo method
- Track template path resolution and file operations
- Debug REVENIR AU MODELE OFFICIEL button issues
2025-10-08 01:16:08 +02:00
5ea9b31a7d Fix template path for reset functionality
- Update template_path to use relative path from class file
- Fix REVENIR AU MODELE OFFICIEL button functionality
- Ensure template detection works correctly
- Resolve template path mismatch issue
2025-10-08 01:13:45 +02:00
a520248a04 Revert to official government version 30
- Keep template version at 30 (official government version)
- Remove version 31 entry from manifest
- Maintain official CA-3 template version 30
- Template version should match government document version
2025-10-08 01:11:10 +02:00
86b3cfe639 Update template version to 31
- Update hardcoded template version in PDF class to 31
- Update manifest.json current_version to 31
- Add new release entry for version 31
- Enable version checking and update notifications
2025-10-08 01:09:52 +02:00
afd681a057 Add official CA-3 template and update manifest
- Add ca3_official_template.pdf as the official template
- Update manifest.json to point to the official template
- Enable online template updates with the official template
- Template now available for download from Gitea
2025-10-08 01:07:56 +02:00
fa4c3b6317 Update manifest to point to existing custom template
- Fix manifest download URL to point to ca3_custom_template.pdf
- Enable online template updates with existing template file
- Resolve template download issues for other installations
2025-10-08 01:02:59 +02:00
e2cf7bfe9b Improve error messaging for Gitea access issues
- Add more descriptive error messages for Gitea server access problems
- Indicate potential causes: private repository or server configuration
- Help users understand why online template updates may not work
- Maintain functionality with local fallback
2025-10-07 20:26:01 +02:00
abd4156a88 Improve template management with better fallback messaging
- Add informative messages when using local files due to Gitea inaccessibility
- Provide clear feedback about fallback behavior
- Maintain functionality even when Gitea server is not accessible
- Support both online and offline template management scenarios
2025-10-07 20:23:52 +02:00
f10f402073 Fix template management with online/offline fallback
- Try to fetch manifest from Gitea first, fallback to local if not accessible
- Try to download templates from Gitea first, fallback to local if not accessible
- Support both online template updates and offline functionality
- Enable other installations to check for template updates when online
- Provide reliable fallback for offline installations
2025-10-07 20:21:47 +02:00
96dc421177 Fix Gitea manifest fetching error in template management
- Replace Gitea manifest fetching with local manifest file
- Use local template files instead of downloading from Gitea
- Fix 'Failed to fetch manifest from Gitea' error in template management tab
- Use local files for template updates instead of external Gitea server
- Improve reliability by removing external dependencies
2025-10-07 20:20:13 +02:00
6178d9bdb7 Fix Update Configuration button translation and remove title
- Remove 'Actions' title from configuration page
- Add missing UpdateConfiguration translation to French and English
- Fix button text to display properly in both languages
- Clean up configuration page by removing unnecessary title
2025-10-07 20:17:35 +02:00
6de32d198f Remove redundant current configuration summary section
- Remove the 'Current Configuration' section that duplicated information
- Users can see their configuration directly in the form above
- Simplify configuration page by removing redundant summary
- Improve user experience with cleaner, more focused interface
2025-10-07 20:15:50 +02:00
62a0b5dba2 Remove D section from configuration page
- Remove D section (calculated lines) from configuration interface
- Remove D section from section headers configuration
- Simplify configuration page by removing unnecessary calculated section
- Clean up interface to show only configurable sections (A and B)
2025-10-07 20:14:31 +02:00
8eaf68f544 Fix empty title line display
- Add condition to only show description when it's not empty
- Prevent empty description lines from being displayed
- Clean up configuration page by removing empty title lines
- Improve user experience with cleaner interface
2025-10-07 20:13:20 +02:00
f7e90c59b6 Completely remove all section descriptions and references
- Remove 'HT amounts of all taxable operations' description
- Remove all section descriptions (A, B, D sections)
- Fix 'Référence:' display to only show when notice is not empty
- Clean up configuration page completely by removing all technical text
- Simplify interface to show only section titles
2025-10-07 20:12:22 +02:00
8a498cb3f5 Remove Notice 4722 references from section headers
- Remove 'Notice 4722 (3310-CA3-SD)' from section A description
- Remove 'Notice 4722 - Summary Table CA3 (3310-CA3-SD)' reference
- Remove 'Notice 4722 - VAT Due Calculation' reference
- Remove 'Notice 4722 - Final Result' reference
- Clean up configuration page by removing technical notice references
- Simplify section descriptions for better user experience
2025-10-07 20:11:28 +02:00
776263bb90 Remove DeclarationTVAPCGMapping title from configuration page
- Remove the redundant title section from the PCG Mapping tab
- Clean up the configuration page interface further
- Improve user experience with less redundant text
2025-10-07 20:10:19 +02:00
58591ba3a2 Remove Notice 4722 header from configuration page
- Remove the informational header about Notice 4722 and CA-3 structure
- Clean up the configuration page interface
- Simplify the page layout for better user experience
2025-10-07 20:08:43 +02:00
2d8dfc432e Change button text from 'CONFIGURER LES COMPTES PCG' to 'CONFIGURATION'
- Update French language file: ConfigurePCGAccounts = Configuration
- Update English language file: ConfigurePCGAccounts = Configuration
- Simplify button text for better user experience
- Maintain consistency across both languages
2025-10-07 20:07:31 +02:00
f3525ce019 Fix tabbed interface using Dolibarr's native tab system
- Replace custom tab implementation with Dolibarr's native dol_get_fiche_head() function
- Use proper tab navigation with URL parameters (?tab=mapping, ?tab=templates)
- Remove custom JavaScript in favor of Dolibarr's built-in tab functionality
- Maintain all existing functionality while using standard Dolibarr patterns
- Fix tab visibility and navigation issues
2025-10-07 18:35:00 +02:00
f7d27ae649 Add tabbed interface to configuration page
- Split configuration page into two tabs: PCG Mapping and Template Management
- Move CA-3 PDF template upload section to separate 'Template Management' tab
- Add JavaScript for tab switching functionality
- Add language strings for tab labels in French and English
- Improve user experience by organizing configuration options logically
- Maintain all existing functionality while improving navigation
2025-10-07 18:32:41 +02:00
6918e92168 v2.3.0: Complete journal table implementation with proper balancing and formatting
- Added journal entry table to detailed PDF with columns: Code compte, Libellé compte, Libellé écriture, Débit, Crédit
- Implemented complex balancing logic for TD > 0 and TD <= 0 cases
- Added account label lookup with proper mapping for 4455100, 4456700, 658000, 758000
- Fixed account label retrieval to use custom uppercase labels from chart of accounts
- Optimized table layout with centered positioning and appropriate column widths
- Reduced font sizes for better page fit while maintaining readability
- Added final balancing entries using 658000 (debit) and 758000 (credit) accounts
- Removed all debug logging for production-ready code
2025-10-07 18:28:10 +02:00
db687bdb77 Fix VAT result entry to use 4455100
- Restored getVATResultEntry call (needed for main journal entries)
- Changed account code from 4456700 to 4455100
- Uses getAccountLabel for proper account name
- Should now show 4455100 with TD amount in journal table
2025-10-07 15:48:35 +02:00
e225a0c35c Remove duplicate VAT result and rounding entries
- Removed getVATResultEntry call (was creating 4456700)
- Removed getRoundingEntry call (was creating duplicate entries)
- All balancing now handled in getBalancingEntries method
- Should now show only 4455100 with TD amount, no 4456700
2025-10-07 15:47:09 +02:00
ff6350890a Fix to use TD amount directly without rounding
- TD amount is already rounded (69.00), so no rounding difference needed
- Only creates single entry with TD amount on 4455100
- No more unnecessary rounding calculations
- Should show 4455100 with 69.00 (exact TD amount)
2025-10-07 15:44:58 +02:00
cf3eb9d359 Fix journal entries to use TD line calculation
- Now uses Line 16 - Line 23 calculation (same as view page)
- Added getLineAmount method to get line amounts from database
- Uses TD amount as main balancing entry instead of journal difference
- Should handle both positive and negative TD amounts correctly
- Main amount on 4455100, rounding difference on 758000
2025-10-07 15:42:32 +02:00
908e4d794c Fix to create correct 2 entries as requested
- Main amount (rounded) on 4455100: 69.00
- Rounding difference on 758000: 0.90
- For difference 69.90: 4455100 credit 70.00 + 758000 credit 0.90
- Should now show correct split between main and rounding accounts
2025-10-07 15:34:08 +02:00
ee0c0c4bdc Change account from 758000 to 4455100
- Changed account code from 758000 to 4455100
- Updated debug message to reflect correct account
- Should now show 4455100 with 0.90 for example 1
- Single entry with correct account as requested
2025-10-07 15:32:15 +02:00
5e254515e1 Fix to create only 1 entry as requested
- Removed main balancing entry (4455100)
- Only creates 758000 entry with real difference (0.90)
- No more split entries, just single entry as user requested
- Should show only 758000 with 0.90, no 4455100 entry
2025-10-07 15:30:45 +02:00
26345aee03 Add debugging to journal entries generation
- Added debug logging to see how many balancing entries are found
- Added logging to show each balancing entry being added
- Added total count of entries after balancing
- Should help identify if entries are being added to the PDF
2025-10-07 15:25:56 +02:00
aa56cf4640 Add debugging to template path resolution
- Added debug logging to see what template path is being used
- This will help identify if the path is correct or if files are missing
- Should show exactly where the system is looking for template files
2025-10-07 15:24:22 +02:00
40fa2b2f73 Add unique identifier to debug messages
- Added *** NEW LOGIC *** to debug messages
- This will help identify if the new code is actually being executed
- Should show if there are multiple code paths or caching issues
2025-10-07 15:21:19 +02:00
0d37fc00aa Add debugging to trace entry creation
- Added debug logging to see what amounts are being created
- Cleared caches and reset OPcache
- Should help identify if the new logic is being executed
- Will show exactly what values are being put in the journal table
2025-10-07 15:18:43 +02:00
00add0de70 Simplify to exactly 2 lines as requested
- Rounded difference on 4455100 (formatAmount)
- Real difference on 758000 (formatAmountReal)
- For difference 69.90: 4455100 credit 70.00 + 758000 credit 0.90
- No more complex logic, just 2 simple lines
- Exactly what user requested: 69.00 on 4455100 and 0.90 on 758000
2025-10-07 15:17:25 +02:00
0aa02d8318 Fix split rounding correctly
- Main amount: rounded value on 4455100/4456700 (formatAmount)
- Rounding difference: real difference on 758000/658000 (formatAmountReal)
- For difference 69.90: 4455100 credit 70.00 + 758000 credit 0.90
- For difference -0.90: 4456700 debit 1.00 + 658000 debit 0.90
- Should now show correct split between main and rounding accounts
2025-10-07 15:13:32 +02:00
95f88537eb Remove ALL rounding completely
- NO round() function anywhere
- Uses real difference values only (formatAmountReal)
- Single entry with real difference on correct account
- For difference 69.90: 4455100 credit 69.90 (real value)
- No more rounding, no more split entries
2025-10-07 14:57:32 +02:00
da6bb79204 Fix to create exactly 2 lines with correct amounts
- Changed difference calculation back to (debits - credits)
- Creates exactly 2 lines: main amount + rounding difference
- For difference 69.90: 4455100 credit 70.00 + 758000 credit 0.90
- Removed complex logic, simplified to 2 entries only
2025-10-07 14:56:44 +02:00
93830f309f Fix split entries for proper balancing
- Main entry: rounded amount on 4455100/4456700 (formatAmount)
- Rounding entry: real difference on 758000/658000 (formatAmountReal)
- For difference -0.90: 4455100 credit 1.00 + 758000 credit 0.90
- Should now show correct split between main and rounding accounts
2025-10-07 14:53:46 +02:00
673a2e4fda Remove ALL rounding from difference calculation
- Completely removed rounding logic
- Now uses real difference values only (formatAmountReal)
- No more rounded amounts or complex rounding logic
- Simple: real difference goes to 4455100/4456700 with real value
- Should show 4455100 with 0.90 instead of 1.00
2025-10-07 14:51:31 +02:00
c00894db2d Fix small difference handling for proper rounding
- Added special handling for differences < 1.0 (like -0.90)
- Small differences now create rounding-only entries (758000/658000)
- No main balancing entry (4455100/4456700) for small differences
- Should show 758000 with 0.90 instead of 4455100 with 1.00
2025-10-07 14:50:59 +02:00
23aa6cccb8 Fix rounding logic for small differences
- Added handling for cases where rounded difference is 0 but real difference is not 0
- Now creates rounding-only entry when difference is small (like -0.90)
- Should show 758000 with 0.90 instead of 1.00
- Handles edge cases where difference rounds to 0 but real value is significant
2025-10-07 14:48:42 +02:00
7b633b99c5 Add debugging to trace account selection logic
- Added debug logging to show which account is being created
- Added logging for difference calculation and condition evaluation
- Should help identify why example 1 shows 4456700 instead of 4455100
- Will help trace the source of duplicate 4455100 entries
2025-10-07 14:46:02 +02:00