diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index 0e0249b..0344e07 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -243,6 +243,9 @@ class DeclarationTVA $combined_label = !empty($account_labels) ? implode(', ', $account_labels) : 'No accounts mapped'; $this->createCA3Line($declaration_id, $ca3_line, $combined_label, $combined_amounts); + + // Log the final amounts for debugging + error_log("DeclarationTVA: Final amounts for line $ca3_line: base=$line_total_base, vat=$line_total_vat, total=$line_total_amount"); // Update totals if (in_array($ca3_line, ['A1', 'A2', 'A3', 'A4', 'A5', '08', '09', '9B', '17'])) { diff --git a/core/class/declarationtva_config.class.php b/core/class/declarationtva_config.class.php index 223d96a..b451d8a 100644 --- a/core/class/declarationtva_config.class.php +++ b/core/class/declarationtva_config.class.php @@ -271,25 +271,25 @@ class DeclarationTVA_Config // B. Décompte de la TVA due (VAT Due Calculation) - Notice 4722 '08' => array( - 'label' => 'TVA due au taux de 20%', - 'type' => 'vat', + 'label' => 'TVA due au taux de 20% (Base HT + TVA)', + 'type' => 'base_vat', 'section' => 'B', - 'description' => 'VAT amounts due, calculated on A1/A2 bases at 20% rate', - 'pcg_accounts' => '44571x (TVA collectée à 20%)' + 'description' => 'Base HT and VAT amounts due at 20% rate', + 'pcg_accounts' => 'Base: 7xxxx (Sales); VAT: 44571x (TVA collectée à 20%)' ), '09' => array( - 'label' => 'TVA due au taux de 10%', - 'type' => 'vat', + 'label' => 'TVA due au taux de 10% (Base HT + TVA)', + 'type' => 'base_vat', 'section' => 'B', - 'description' => 'VAT amounts due, calculated on A1/A2 bases at 10% rate', - 'pcg_accounts' => '44572x (TVA collectée à 10%)' + 'description' => 'Base HT and VAT amounts due at 10% rate', + 'pcg_accounts' => 'Base: 7xxxx (Sales); VAT: 44572x (TVA collectée à 10%)' ), '9B' => array( - 'label' => 'TVA due aux taux réduits (5,5% et 2,1%)', - 'type' => 'vat', + 'label' => 'TVA due aux taux réduits (Base HT + TVA)', + 'type' => 'base_vat', 'section' => 'B', - 'description' => 'VAT amounts due, calculated on A1/A2 bases at reduced rates (5,5% and 2,1%)', - 'pcg_accounts' => '44573x (5,5%) / 44574x (2,1%) (TVA collectée aux taux réduits)' + 'description' => 'Base HT and VAT amounts due at reduced rates (5,5% and 2,1%)', + 'pcg_accounts' => 'Base: 7xxxx (Sales); VAT: 44573x (5,5%) / 44574x (2,1%)' ), '17' => array( 'label' => 'TVA due au titre des acquisitions intracommunautaires (autoliquidation)', diff --git a/declarationtva_view.php b/declarationtva_view.php index 4d5929a..93766a6 100644 --- a/declarationtva_view.php +++ b/declarationtva_view.php @@ -138,7 +138,9 @@ print '
| ' . $langs->trans("CA3Line") . ' | '; print '' . $langs->trans("Description") . ' | '; -print '' . $langs->trans("Amount") . ' | '; +print '' . $langs->trans("BaseAmount") . ' | '; +print '' . $langs->trans("VATAmount") . ' | '; +print '' . $langs->trans("TotalAmount") . ' | '; print '||
|---|---|---|---|---|---|---|---|
| A. ' . $langs->trans("CA3SectionA") . ' | '; +print 'A. ' . $langs->trans("CA3SectionA") . ' | '; print '||||||
| ' . $line . ' | '; print '' . $description . ' | '; + print '' . price($data['base_amount']) . ' | '; print '' . price($data['vat_amount']) . ' | '; + print '' . price($data['total_amount']) . ' | '; print '|||
| B. ' . $langs->trans("CA3SectionB") . ' | '; +print 'B. ' . $langs->trans("CA3SectionB") . ' | '; print '||||||
| ' . $line . ' | '; print '' . $description . ' | '; + print '' . price($data['base_amount']) . ' | '; print '' . price($data['vat_amount']) . ' | '; + print '' . price($data['total_amount']) . ' | '; print '|||
| C. ' . $langs->trans("CA3SectionC") . ' | '; +print 'C. ' . $langs->trans("CA3SectionC") . ' | '; print '||||||
| ' . $line . ' | '; print '' . $description . ' | '; + print '' . price($data['base_amount']) . ' | '; print '' . price($data['vat_amount']) . ' | '; + print '' . price($data['total_amount']) . ' | '; print '|||
| D. ' . $langs->trans("CA3SectionD") . ' | '; +print 'D. ' . $langs->trans("CA3SectionD") . ' | '; print '||||||
| ' . $line . ' | '; print '' . $description . ' | '; + print '' . price($data['base_amount']) . ' | '; print '' . price($data['vat_amount']) . ' | '; + print '' . price($data['total_amount']) . ' | '; print '|||