Complete CA-3 Form Structure:
- Added Section C: Décompte de la TVA déductible (Deductible VAT Calculation)
- Added Section D: Résultat (Result)
- Now includes all 4 sections: A, B, C, D
- Total of 17 CA-3 lines covering complete form
Section C - Deductible VAT Calculation:
- Line 20: TVA déductible sur immobilisations (Deductible VAT on fixed assets)
- Line 21: TVA déductible sur autres biens et services (Deductible VAT on other goods and services)
- Line 22: TVA déductible sur importations (Deductible VAT on imports)
Section D - Result:
- Line 25: TVA brute due (Total VAT due)
- Line 26: TVA déductible totale (Total deductible VAT)
- Line 28: TVA nette à payer (Net VAT to pay)
- Line 29: Crédit de TVA à reporter ou remboursement (VAT credit to carry forward or refund)
Enhanced Configuration:
- Added section C and D headers with proper descriptions
- Added all 7 new CA-3 lines for sections C and D
- Updated PCG account mappings for all new lines
- Enhanced form layout to show all 4 sections
Language Support:
- Added English translations for sections C and D and all lines
- Added French translations for sections C and D and all lines
- Complete bilingual support for all 17 CA-3 lines
Documentation:
- Updated PLANNING.md with complete CA-3 structure
- Added sections C and D documentation with all lines
- Complete Notice 4722 compliance with all 4 sections
The module now includes the COMPLETE CA-3 structure with all 4 sections A, B, C, D!
Complete CA-3 Structure Update:
- Added Section B: Décompte de la TVA due (VAT Due Calculation)
- Added 4 new CA-3 lines for VAT due calculations
- Updated all language files with new section and lines
Section B - VAT Due Calculation:
- Line 08: TVA due au taux de 20% (VAT due at 20% rate)
- Line 09: TVA due au taux de 10% (VAT due at 10% rate)
- Line 9B: TVA due aux taux réduits (VAT due at reduced rates 5,5% and 2,1%)
- Line 17: TVA due au titre des acquisitions intracommunautaires (VAT due on intra-EU acquisitions)
Enhanced Configuration:
- Added section B header with proper description
- Added all 4 VAT due calculation lines
- Updated PCG account mappings for VAT due lines
- Enhanced form layout to show both sections A and B
Language Support:
- Added English translations for Section B and all lines
- Added French translations for Section B and all lines
- Updated section headers in both languages
Documentation:
- Updated PLANNING.md with complete CA-3 structure
- Added Section B documentation with all lines
- Complete Notice 4722 compliance
The module now includes the complete CA-3 structure with both sections A and B!
Major Structure Update:
- Updated to latest official CA-3 form structure (Notice 4722)
- Replaced old structure with new 5-line format (A1-A5)
- All changes based on official notice 4722
New CA-3 Lines (Notice 4722):
- A1: HT amount of all taxable operations that form normal sales
- A2: HT amount of special taxable operations not part of ordinary turnover
- A3: HT amount of services purchased from non-established providers (reverse charge)
- A4: HT amount of imports taxable in France (non-EU), excluding petroleum products
- A5: HT amount of taxable operations at exit from suspensive fiscal regime
Enhanced Configuration Interface:
- Added detailed descriptions for each line
- Added PCG account recommendations
- Added notice reference information
- Improved form layout with additional columns
Updated Files:
- core/class/declarationtva_config.class.php: New CA-3 line definitions
- admin/setup_mvp.php: Enhanced interface with descriptions and PCG accounts
- langs/en_US/declarationtva.lang: English translations for new structure
- langs/fr_FR/declarationtva.lang: French translations for new structure
- PLANNING.md: Updated documentation with new structure
Key Features:
- Official Notice 4722 compliance
- Detailed line descriptions and PCG account guidance
- Enhanced user interface with better information display
- Bilingual support for all new content
The module now uses the latest official CA-3 form structure!
Database Schema Overview:
- 10 core tables with complete relationships
- Multi-entity support with full data isolation
- Comprehensive indexing for performance optimization
- Foreign key constraints for data integrity
- Pre-built views for reporting and analytics
Core Tables:
- llx_declarationtva_config: Module configuration and settings
- llx_declarationtva_account_mappings: Multiple PCG account mappings per CA-3 line
- llx_declarationtva_periods: Declaration period management (quarterly/monthly)
- llx_declarationtva_declarations: Main declarations storage with status tracking
- llx_declarationtva_ca3_lines: CA-3 form lines data with amounts and VAT rates
- llx_declarationtva_account_details: Detailed account breakdown for each line
EU Transaction Tables:
- llx_declarationtva_eu_suppliers: EU supplier configuration and autoliquidation settings
- llx_declarationtva_eu_transactions: EU transaction tracking with B2B/B2C classification
Workflow Integration Tables:
- llx_declarationtva_workflow_log: Workflow triggers and automation logging
- llx_declarationtva_audit_trail: Complete audit trail for all changes
- llx_declarationtva_compliance: Compliance validation results and status
Export and Integration Tables:
- llx_declarationtva_exports: Export history and tracking (PDF, XML, CSV)
Key Features:
- Multiple account selection per CA-3 line with weighting and sorting
- Complete audit trail with user tracking and IP logging
- EU transaction handling with autoliquidation automation
- Workflow integration with Dolibarr hooks
- Performance optimization with comprehensive indexing
- Reporting views for analytics and compliance
- Multi-entity support for enterprise deployments
- Data integrity with foreign key constraints
- Initial configuration data for immediate setup
Database Design Principles:
- Scalable architecture for large datasets
- Complete data isolation between entities
- Optimized for French CA-3 compliance
- Full integration with Dolibarr accounting system
- Comprehensive audit trail for tax authorities
- Performance optimization for real-time processing
Multiple Account Selection Features:
- Multi-select dropdown for each CA-3 line from Dolibarr's chart of accounts
- Account search and filtering from llx_accounting_account table
- Real-time account validation against existing chart of accounts
- Account preview with current balances and details
- Account weighting and grouping for complex mappings
- Bulk operations for account management (add/remove multiple accounts)
- Account filtering by type (7xxxx, 4457xx, 4456xx, etc.)
Database Structure:
- New table: llx_declarationtva_account_mappings
- Stores multiple account mappings per CA-3 line
- Account code, label, VAT rate, type, weighting
- Active/inactive status and audit trail
Interface Features:
- Multi-select dropdown with search functionality
- Account preview showing current balances
- Account validation ensuring accounts exist and are active
- Bulk operations for efficient account management
- Account filtering by account type and characteristics
Enhanced Configuration:
- Each CA-3 line can map to multiple PCG accounts
- Account weighting for importance/priority
- Account grouping for complex business scenarios
- Real-time validation against Dolibarr's chart of accounts
- Account preview with current balances
Updated estimates: +27 hours for multiple account selection
Total project: 577+ hours with comprehensive account mapping
Dolibarr Hook System Integration:
- Hook into invoice validation and accounting transfer events
- Automatic EU supplier detection and autoliquidation
- Custom fields for VAT processing (EU flag, transaction type)
- Batch processing for multiple invoices
- Workflow triggers for status changes
Available Hooks:
- supplier_invoice_validate: Auto-detect EU suppliers
- supplier_invoice_accountancy_transfer: Create VAT entries
- invoice_validate: Apply EU transaction rules
- invoice_accountancy_transfer: Generate accounting entries
Automation Workflow:
1. User creates EU supplier invoice
2. Hook triggers on validation
3. Auto-detect EU supplier
4. Create VAT due (4452xxx) and deductible (4456xx) entries
5. Entries ready for CA-3 calculations
Custom Fields:
- EU Supplier Flag
- VAT Treatment (autoliquidation vs normal)
- Transaction Type (B2B, B2C, special cases)
- OSS Threshold tracking
- DEB/DES requirement flags
Enhanced Features:
- Automatic VAT processing
- Reduced manual work for EU transactions
- Seamless integration with Dolibarr workflow
- Custom field management
- Batch processing capabilities
Updated estimates: +44 hours for workflow integration
Total project: 456+ hours with full Dolibarr integration
EU Transaction Scenarios:
1️⃣ Incoming EU Invoices (Purchases):
- Supplier invoices HT (no VAT)
- French autoliquidation: 4452xxx (VAT due) + 4456xx (VAT deductible)
- Net effect: zero if fully deductible
- CA-3 impact: Lines 17 (VAT due) + 20/21 (VAT deductible)
2️⃣ Outgoing EU Invoices (Sales):
- Case A (B2B): No French VAT, Lines 05/06 (base HT only)
- Case B (B2C): OSS threshold handling (€10,000)
- Case C (Special): Construction/energy reverse charge
- Invoice text requirements for EU transactions
3️⃣ DEB/DES Integration:
- Link CA-3 lines 05/06 with exchange declarations
- Cross-validation between CA-3 and DEB/DES
- Automatic data import and validation
Enhanced Features:
- EU transaction type detection and classification
- OSS threshold monitoring and alerts
- DEB/DES data integration and validation
- Special case handling (construction, energy)
- Comprehensive EU transaction workflow
Updated estimates: +64 hours for EU transaction handling
Total project: 414+ hours with full EU compliance
Official CA-3 Form Lines:
- Section A: Opérations imposables (A1, A2, B1-B4)
- A1: Base HT of taxable operations
- A2: Special operations (asset sales, self-deliveries)
- B1-B4: Rate breakdowns (20%, 10%, 5.5%, 2.1%) with base + tax
- Section B: TVA due (Line 17)
- Intra-EU acquisitions autoliquidation
- Section C: TVA déductible (Lines 20, 21)
- Line 20: Capital goods VAT
- Line 21: Operating expenses VAT
- Section D: Résultat (Lines 22, 28, 29)
- Line 22: VAT credit to carry forward
- Line 28: Net VAT to pay
- Line 29: VAT credit amount
Enhanced Features:
- Detailed account breakdown for draft declarations
- Drill-down from form lines to individual transactions
- Separate handling of base amounts (HT) and VAT amounts
- Support for all French VAT rates
- Special operations handling (A2 line)
- Export detailed breakdown reports
Updated task estimates: +37 hours for form structure implementation
Added comprehensive bilingual support for all CA-3 form lines
Core Advanced Features:
- Draft system with detailed account breakdowns
- Validation workflow with approval process
- Automatic journal entry generation (445510/445670)
- Complete audit trail and version history
- Multi-entity support for multiple companies
Analytics & Reporting:
- Period comparison tools with variance analysis
- Interactive dashboard with KPIs and trends
- Exception handling for unusual amounts
- Automated alerts and notifications
User Experience:
- Mobile-responsive design
- Document management with attachments
- Email notifications for deadlines
- Keyboard shortcuts and accessibility
Integration & APIs:
- External tax system integration
- Backup/restore functionality
- Webhook support for real-time updates
- API documentation for third-party access
Updated time estimates: 350+ hours total
Added Phase 7 (Advanced Features) with 80+ hours
Enhanced bilingual support for all new features
- Create PLANNING.md with detailed project architecture and phases
- Create TASK.md with 200+ hour development plan broken into 6 phases
- Add French language support (fr_FR/declarationtva.lang)
- Update English translations with CA3-specific terminology
- Define CA3 box structure and PCG account mappings
- Plan bilingual interface for French-speaking users
- Include database schema, testing, and documentation phases