Commit Graph

10 Commits

Author SHA1 Message Date
1f0f4f927d Update CA-3 structure to Notice 4722 (3310-CA3-SD) - Latest Official Form
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!
2025-10-02 17:02:23 +02:00
d7bb9d23e8 Complete CA-3 configuration interface with all sections and headers
Configuration Interface Improvements:
- Added all missing CA-3 lines from planning document
- Implemented proper section headers (A, B, C, D)
- Added section descriptions for better understanding
- Organized lines by section for logical grouping

CA-3 Lines Added:
- A1, A2: Taxable operations base amounts
- B1-B4: VAT rate breakdowns (20%, 10%, 5.5%, 2.1%)
- 05, 06: Intra-EU operations (B2B)
- 17: VAT due on intra-EU acquisitions
- 20, 21: Deductible VAT (fixed assets, other)
- 22, 28, 29: Result calculations

Section Headers:
- A. Opérations imposables (Taxable Operations)
- B. TVA due (VAT Due)
- C. TVA déductible (Deductible VAT)
- D. Résultat (Result)

Enhanced Features:
- Section-based organization in configuration
- Type indicators (Base/VAT) for each line
- Improved visual layout with section headers
- Better grouping in current configuration display

Language Support:
- Added English translations for all new labels
- Added French translations for all new labels
- Consistent terminology across both languages

The configuration page now shows the complete CA-3 structure as defined in the planning document!
2025-10-02 16:36:12 +02:00
2a0c0b83b1 Add comprehensive multiple PCG account selection functionality
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
2025-10-02 16:06:41 +02:00
991d96f7be Add comprehensive advanced intelligence features for CA-3 VAT module
Advanced Analytics & Intelligence:
- VAT Forecasting: Predict future obligations using historical data
- Anomaly Detection: AI-powered detection of unusual VAT patterns
- Cash Flow Impact: Calculate VAT impact on cash flow projections
- VAT Optimization: Suggest strategies to minimize VAT payments
- Trend Analysis: Identify VAT trends and seasonal patterns
- Benchmarking: Compare performance against industry standards
- Risk Assessment: Flag potential compliance risks
- Predictive Alerts: Early warning system for VAT issues

Tax Authority Integration:
- Direct Submission: Submit CA-3 declarations directly to French tax authorities
- API Integration: Connect with French tax authority APIs
- Real-time Validation: Validate declarations against tax authority systems
- Electronic Signatures: Digital signature for declaration submission
- Receipt Management: Store and manage tax authority receipts
- Status Tracking: Track declaration status with tax authorities
- Amendment Handling: Process declaration amendments and corrections
- Payment Integration: Direct payment of VAT obligations

Advanced Reporting & Compliance:
- Multi-Period Analysis: Compare VAT across multiple periods
- VAT Reconciliation: Reconcile VAT with general ledger
- Audit Trail: Complete audit trail for tax authorities
- Compliance Dashboard: Real-time compliance status monitoring
- Regulatory Updates: Automatic updates for tax law changes
- Penalty Calculation: Calculate potential penalties for late submissions
- Deadline Management: Automated deadline tracking and reminders
- Document Generation: Auto-generate supporting documentation

Business Intelligence:
- VAT Analytics: Deep insights into VAT patterns and trends
- Cost Analysis: Analyze VAT impact on business costs
- Profitability Impact: Show how VAT affects product profitability
- Customer VAT Analysis: Analyze VAT by customer segments
- Supplier VAT Analysis: Analyze VAT by supplier categories
- Geographic Analysis: VAT analysis by geographic regions
- Product Analysis: VAT analysis by product categories
- Seasonal Analysis: Identify seasonal VAT patterns

Updated estimates: +106 hours for advanced intelligence features
Total project: 550+ hours with comprehensive business intelligence
2025-10-02 16:02:21 +02:00
1d18a82f19 Add Dolibarr workflow integration for automated VAT processing
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
2025-10-02 15:59:41 +02:00
a08cc30293 Add comprehensive EU transaction handling for CA-3 VAT declarations
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
2025-10-02 15:55:13 +02:00
a48cfc18a8 Add official CA-3 form structure (n° 3310-CA3-SD) with precise line mappings
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
2025-10-02 15:53:06 +02:00
e7d2d39cd6 Add comprehensive advanced features for CA-3 VAT declaration module
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
2025-10-02 15:47:58 +02:00
c240ef9769 Complete CA-3 structure with all three sections
- Add Section A: TVA collectée (Output VAT) - Boxes 01, 02, 03, 05, 08
- Add Section B: TVA déductible (Input VAT) - Boxes 20, 21, 22
- Add Section C: Résultat (Result) - Boxes 25, 26, 28, 29
- Update French translations with complete box descriptions
- Update English translations with full CA-3 structure
- Add PCG account mappings for all sections
- Update task list with complete calculation logic
- Include automatic totals and net calculations
- Add new task for complete CA-3 form structure implementation
2025-10-02 15:42:04 +02:00
1720dadd7a Add comprehensive project planning and task list
- 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
2025-10-02 15:38:13 +02:00