From 877a66057dc91bca52510a3dfaf7ac44068b4ea0 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Thu, 2 Oct 2025 20:54:52 +0200 Subject: [PATCH] Restore complete CA-3 table structure with sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CA-3 Table Structure: - Section A: Opérations imposables (A1, A2, A3, A4, A5) - Section B: TVA due (08, 09, 9B, 17) - Section C: TVA déductible (20, 21, 22) - Section D: Résultat (25, 26, 28, 29) - Proper section headers with bold formatting - All 17 CA-3 lines as per configuration - Real calculated amounts from database - Bilingual section titles --- declarationtva_view.php | 75 +++++++++++++++++++++++++++++---- langs/en_US/declarationtva.lang | 4 ++ langs/fr_FR/declarationtva.lang | 4 ++ 3 files changed, 75 insertions(+), 8 deletions(-) diff --git a/declarationtva_view.php b/declarationtva_view.php index 66b4fd8..b6d5c97 100644 --- a/declarationtva_view.php +++ b/declarationtva_view.php @@ -144,18 +144,77 @@ print ''; // Get actual CA-3 lines from database $ca3_lines = $declarationtva->getCA3Lines($id); +// Create a lookup array for quick access +$ca3_data = array(); +foreach ($ca3_lines as $line) { + $ca3_data[$line['ca3_line']] = $line; +} + +// Section A: Opérations imposables +print ''; +print 'A. ' . $langs->trans("CA3SectionA") . ''; +print ''; + +$section_a_lines = array('A1', 'A2', 'A3', 'A4', 'A5'); +foreach ($section_a_lines as $line) { + $data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'vat_amount' => 0); + print ''; + print '' . $line . ''; + print '' . $data['line_label'] . ''; + print '' . price($data['vat_amount']) . ''; + print ''; +} + +// Section B: TVA due +print ''; +print 'B. ' . $langs->trans("CA3SectionB") . ''; +print ''; + +$section_b_lines = array('08', '09', '9B', '17'); +foreach ($section_b_lines as $line) { + $data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'vat_amount' => 0); + print ''; + print '' . $line . ''; + print '' . $data['line_label'] . ''; + print '' . price($data['vat_amount']) . ''; + print ''; +} + +// Section C: TVA déductible +print ''; +print 'C. ' . $langs->trans("CA3SectionC") . ''; +print ''; + +$section_c_lines = array('20', '21', '22'); +foreach ($section_c_lines as $line) { + $data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'vat_amount' => 0); + print ''; + print '' . $line . ''; + print '' . $data['line_label'] . ''; + print '' . price($data['vat_amount']) . ''; + print ''; +} + +// Section D: Résultat +print ''; +print 'D. ' . $langs->trans("CA3SectionD") . ''; +print ''; + +$section_d_lines = array('25', '26', '28', '29'); +foreach ($section_d_lines as $line) { + $data = isset($ca3_data[$line]) ? $ca3_data[$line] : array('line_label' => '', 'vat_amount' => 0); + print ''; + print '' . $line . ''; + print '' . $data['line_label'] . ''; + print '' . price($data['vat_amount']) . ''; + print ''; +} + +// Show message if no data if (empty($ca3_lines)) { print ''; print '' . $langs->trans("NoCA3Data") . ''; print ''; -} else { - foreach ($ca3_lines as $line) { - print ''; - print '' . $line['ca3_line'] . ''; - print '' . $line['line_label'] . ''; - print '' . price($line['vat_amount']) . ''; - print ''; - } } print ''; diff --git a/langs/en_US/declarationtva.lang b/langs/en_US/declarationtva.lang index 6e5fb0e..0f81175 100644 --- a/langs/en_US/declarationtva.lang +++ b/langs/en_US/declarationtva.lang @@ -433,3 +433,7 @@ NoCA3Data = No CA-3 data calculated yet. Click Recalculate to calculate amounts. TotalVATCollected = Total VAT Collected TotalVATDeductible = Total VAT Deductible VATCredit = VAT Credit +CA3SectionA = Taxable Operations +CA3SectionB = VAT Due +CA3SectionC = Deductible VAT +CA3SectionD = Result diff --git a/langs/fr_FR/declarationtva.lang b/langs/fr_FR/declarationtva.lang index 6669a83..da0bb66 100644 --- a/langs/fr_FR/declarationtva.lang +++ b/langs/fr_FR/declarationtva.lang @@ -422,3 +422,7 @@ NoCA3Data = Aucune donnée CA-3 calculée. Cliquez sur Recalculer pour calculer TotalVATCollected = TVA Collectée Totale TotalVATDeductible = TVA Déductible Totale VATCredit = Crédit de TVA +CA3SectionA = Opérations imposables +CA3SectionB = TVA due +CA3SectionC = TVA déductible +CA3SectionD = Résultat