From 3d5e9b1ca8c56777dbc7d037c377ea2290aada17 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Thu, 2 Oct 2025 21:51:28 +0200 Subject: [PATCH] Fix table alignment with proper column spanning Fixed: - Description column now spans 2 columns (colspan='2') for normal rows - All section headers span 4 columns (colspan='4') - Table headers properly aligned with data rows - Lines 08, 09, 9B: 4 columns (Line | Description | Base HT | VAT) - All other lines: 3 columns (Line | Description spanning 2 | Amount) - Table should now be properly aligned and readable --- declarationtva_view.php | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/declarationtva_view.php b/declarationtva_view.php index ba6781d..5114fb3 100644 --- a/declarationtva_view.php +++ b/declarationtva_view.php @@ -155,7 +155,13 @@ foreach ($ca3_lines as $line) { // Section A: Opérations imposables print ''; -print 'A. ' . $langs->trans("CA3SectionA") . ''; +print 'A. ' . $langs->trans("CA3SectionA") . ''; +print ''; + +print ''; +print '' . $langs->trans("CA3Line") . ''; +print '' . $langs->trans("Description") . ''; +print '' . $langs->trans("Amount") . ''; print ''; $section_a_lines = array('A1', 'A2', 'A3', 'A4', 'A5'); @@ -164,14 +170,14 @@ foreach ($section_a_lines as $line) { $description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label']; print ''; print '' . $line . ''; - print '' . $description . ''; + print '' . $description . ''; print '' . price($data['vat_amount']) . ''; print ''; } // Section B: TVA due print ''; -print 'B. ' . $langs->trans("CA3SectionB") . ''; +print 'B. ' . $langs->trans("CA3SectionB") . ''; print ''; // Special header for lines 08, 09, 9B with base and VAT columns @@ -201,7 +207,7 @@ foreach ($base_vat_lines as $line) { // Reset to normal layout for line 17 print ''; print '' . $langs->trans("CA3Line") . ''; -print '' . $langs->trans("Description") . ''; +print '' . $langs->trans("Description") . ''; print '' . $langs->trans("Amount") . ''; print ''; @@ -209,13 +215,19 @@ $data = isset($ca3_data['17']) ? $ca3_data['17'] : array('line_label' => '', 'va $description = isset($ca3_definitions['17']) ? $ca3_definitions['17']['label'] : $data['line_label']; print ''; print '17'; -print '' . $description . ''; +print '' . $description . ''; print '' . price($data['vat_amount']) . ''; print ''; // Section C: TVA déductible print ''; -print 'C. ' . $langs->trans("CA3SectionC") . ''; +print 'C. ' . $langs->trans("CA3SectionC") . ''; +print ''; + +print ''; +print '' . $langs->trans("CA3Line") . ''; +print '' . $langs->trans("Description") . ''; +print '' . $langs->trans("Amount") . ''; print ''; $section_c_lines = array('20', '21', '22'); @@ -224,14 +236,20 @@ foreach ($section_c_lines as $line) { $description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label']; print ''; print '' . $line . ''; - print '' . $description . ''; + print '' . $description . ''; print '' . price($data['vat_amount']) . ''; print ''; } // Section D: Résultat print ''; -print 'D. ' . $langs->trans("CA3SectionD") . ''; +print 'D. ' . $langs->trans("CA3SectionD") . ''; +print ''; + +print ''; +print '' . $langs->trans("CA3Line") . ''; +print '' . $langs->trans("Description") . ''; +print '' . $langs->trans("Amount") . ''; print ''; $section_d_lines = array('25', '26', '28', '29'); @@ -240,7 +258,7 @@ foreach ($section_d_lines as $line) { $description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label']; print ''; print '' . $line . ''; - print '' . $description . ''; + print '' . $description . ''; print '' . price($data['vat_amount']) . ''; print ''; }