- 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
4.8 KiB
4.8 KiB
DeclarationTVA - French CA-3 VAT Declaration Module
Project Overview
This Dolibarr module creates the French VAT declaration CA-3 (Déclaration de TVA CA3) with PCG account mapping functionality. The module allows users to configure PCG (Plan Comptable Général) accounts for each CA-3 box and generates the appropriate VAT declaration.
Architecture
Core Components
- Module Class:
modDeclarationTVA.class.php- Main module descriptor - Setup Interface:
admin/setup.php- Configuration page for PCG account mapping - Database Schema:
sql/dolibarr_allversions.sql- Database structure - Language Support: Bilingual (French/English) interface
- Main Interface:
declarationtvaindex.php- Main module page
CA-3 Box Structure
The module handles the following CA-3 boxes:
| Box | Label | Description | PCG Accounts |
|---|---|---|---|
| 01 | Livraisons de biens et prestations de services imposables en France | Domestic sales at 20% (or reduced rates) | 7xxxx (Sales) → 44571x (TVA collectée à 20%), 44572x (10%), 44573x (5,5%), 44574x (2,1%) |
| 02 | Autres opérations imposables | Other taxable domestic operations | Same 4457xx depending on rate |
| 03 | Acquisitions intracommunautaires | Intra-EU purchases (autoliquidation) | Base: 6xxxx purchases / 2xxxx immobilisations. VAT due: 4452xxx (TVA due intracom) |
| 05 | Importations | Imports from outside EU | 4452xxx (TVA due sur importations) |
| 08 | Autres opérations imposables | Specific operations (reverse charge on services, etc.) | 4452xxx |
Technical Requirements
Database Structure
- Main table:
llx_declarationtva_config- Stores PCG account mappings - Declaration table:
llx_declarationtva_declarations- Stores generated declarations - Period table:
llx_declarationtva_periods- Manages declaration periods
Key Features
- PCG Account Configuration: Setup page to map PCG accounts to CA-3 boxes
- Period Management: Handle quarterly/monthly declaration periods
- Data Extraction: Query Dolibarr accounting data based on PCG mappings
- Declaration Generation: Create CA-3 format declarations
- Export Functionality: Export to various formats (PDF, XML, CSV)
- Bilingual Interface: French and English language support
File Structure
declarationtva/
├── admin/
│ ├── setup.php (Enhanced with PCG configuration)
│ └── about.php
├── core/
│ ├── modules/modDeclarationTVA.class.php
│ └── class/
│ ├── declarationtva.class.php
│ ├── declarationtva_config.class.php
│ └── declarationtva_period.class.php
├── lib/
│ └── declarationtva.lib.php
├── langs/
│ ├── en_US/declarationtva.lang
│ └── fr_FR/declarationtva.lang
├── sql/
│ └── dolibarr_allversions.sql
├── templates/
│ └── declarationtva/
│ ├── ca3_form.tpl
│ └── ca3_pdf.tpl
└── declarationtvaindex.php
Development Phases
Phase 1: Foundation (Week 1-2)
- Database schema design and implementation
- Core class structure
- Basic module setup and configuration
Phase 2: Configuration Interface (Week 3-4)
- PCG account mapping interface
- Period management
- User permissions and access control
Phase 3: Data Processing (Week 5-6)
- Accounting data extraction
- CA-3 calculation logic
- Data validation and error handling
Phase 4: User Interface (Week 7-8)
- Main declaration interface
- Period selection and management
- Declaration preview and editing
Phase 5: Export and Reporting (Week 9-10)
- PDF generation
- XML export for tax authorities
- CSV export for analysis
Phase 6: Testing and Documentation (Week 11-12)
- Unit testing
- Integration testing
- User documentation
- French tax compliance validation
Success Criteria
-
Functional Requirements
- Complete CA-3 form generation
- Accurate PCG account mapping
- Proper period management
- Export functionality
-
Technical Requirements
- Dolibarr compatibility (v19+)
- Bilingual interface (FR/EN)
- Database integrity
- Performance optimization
-
Compliance Requirements
- French tax authority format compliance
- Data accuracy and validation
- Audit trail maintenance
Risk Mitigation
- Tax Compliance: Regular validation with French tax requirements
- Data Accuracy: Comprehensive testing with real accounting data
- Performance: Optimization for large datasets
- User Experience: Intuitive interface for non-technical users
Future Enhancements
- Automated Submission: Direct submission to tax authorities
- Advanced Analytics: VAT analysis and reporting
- Multi-Entity Support: Support for multiple companies
- Integration: Enhanced integration with other Dolibarr modules