diff --git a/ChangeLog.md b/ChangeLog.md index 2a537ca..a08680e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +## 2.5.4 + +### UI/UX Improvements +- **Column Width Consistency**: Updated detailed page tables to match first page column widths exactly +- **Perfect Table Proportions**: All tables now use identical column proportions (20, 60, 40) +- **Visual Harmony**: Detailed page tables now have the same width and proportions as journal tables +- **Professional Layout**: Consistent table sizing throughout the entire PDF + ## 2.5.3 ### UI/UX Improvements diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index dd422b2..602268b 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -1078,8 +1078,9 @@ class DeclarationTVA_PDF } } - // Calculate table width and center position - $table_width = 150; // 35 + 80 + 35 + // Calculate table width and center position (matching first page proportions) + $col_widths = array(20, 60, 40); // Scaled from first page: Code (20), Libellé (60), Montant (40) + $table_width = array_sum($col_widths); // 120 total width $page_width = $pdf->getPageWidth() - $pdf->getMargins()['left'] - $pdf->getMargins()['right']; $start_x = ($page_width - $table_width) / 2 + $pdf->getMargins()['left']; @@ -1089,9 +1090,9 @@ class DeclarationTVA_PDF // Table header with light gray background (matching first page style) $pdf->SetFont('helvetica', 'B', 8); $pdf->SetFillColor(240, 240, 240); // Light gray background - $pdf->Cell(35, 8, 'Code compte', 1, 0, 'C', true); - $pdf->Cell(80, 8, 'Libellé compte', 1, 0, 'C', true); - $pdf->Cell(35, 8, 'Montant', 1, 1, 'C', true); + $pdf->Cell($col_widths[0], 8, 'Code compte', 1, 0, 'C', true); + $pdf->Cell($col_widths[1], 8, 'Libellé compte', 1, 0, 'C', true); + $pdf->Cell($col_widths[2], 8, 'Montant', 1, 1, 'C', true); $total_base_base = 0; $total_vat_base = 0; @@ -1114,17 +1115,17 @@ class DeclarationTVA_PDF $pdf->SetX($start_x); $pdf->SetFont('helvetica', '', 7); $pdf->SetFillColor(255, 255, 255); // White background for data rows - $pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C', true); - $pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); - $pdf->Cell(35, 6, price($account['base_amount'], 0, '', 1, 0), 1, 1, 'R', true); + $pdf->Cell($col_widths[0], 6, $account['account_code'], 1, 0, 'C', true); + $pdf->Cell($col_widths[1], 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, price($account['base_amount'], 0, '', 1, 0), 1, 1, 'R', true); } // Subtotal for BASE accounts $pdf->SetFont('helvetica', 'B', 7); $pdf->SetX($start_x); $pdf->SetFillColor(248, 248, 248); // Light gray for subtotal - $pdf->Cell(115, 6, 'Sous-total comptes de base', 1, 0, 'L', true); - $pdf->Cell(35, 6, price($total_base_base, 0, '', 1, 0), 1, 1, 'R', true); + $pdf->Cell($col_widths[0] + $col_widths[1], 6, 'Sous-total comptes de base', 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, price($total_base_base, 0, '', 1, 0), 1, 1, 'R', true); $pdf->Ln(2); } @@ -1142,17 +1143,17 @@ class DeclarationTVA_PDF $pdf->SetX($start_x); $pdf->SetFont('helvetica', '', 7); $pdf->SetFillColor(255, 255, 255); // White background for data rows - $pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C', true); - $pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); - $pdf->Cell(35, 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R', true); + $pdf->Cell($col_widths[0], 6, $account['account_code'], 1, 0, 'C', true); + $pdf->Cell($col_widths[1], 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R', true); } // Subtotal for VAT accounts $pdf->SetFont('helvetica', 'B', 7); $pdf->SetX($start_x); $pdf->SetFillColor(248, 248, 248); // Light gray for subtotal - $pdf->Cell(115, 6, 'Sous-total comptes de TVA', 1, 0, 'L', true); - $pdf->Cell(35, 6, price($total_vat_vat, 0, '', 1, 0), 1, 1, 'R', true); + $pdf->Cell($col_widths[0] + $col_widths[1], 6, 'Sous-total comptes de TVA', 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, price($total_vat_vat, 0, '', 1, 0), 1, 1, 'R', true); $pdf->Ln(2); } @@ -1166,9 +1167,9 @@ class DeclarationTVA_PDF $pdf->SetX($start_x); $pdf->SetFont('helvetica', '', 7); $pdf->SetFillColor(255, 255, 255); // White background for data rows - $pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C', true); - $pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); - $pdf->Cell(35, 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R', true); + $pdf->Cell($col_widths[0], 6, $account['account_code'], 1, 0, 'C', true); + $pdf->Cell($col_widths[1], 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R', true); } // Total for other accounts @@ -1176,8 +1177,8 @@ class DeclarationTVA_PDF $pdf->SetFont('helvetica', 'B', 7); $pdf->SetX($start_x); $pdf->SetFillColor(248, 248, 248); // Light gray for total - $pdf->Cell(115, 6, 'Total', 1, 0, 'L', true); - $pdf->Cell(35, 6, price($total_vat_other, 0, '', 1, 0), 1, 1, 'R', true); + $pdf->Cell($col_widths[0] + $col_widths[1], 6, 'Total', 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, price($total_vat_other, 0, '', 1, 0), 1, 1, 'R', true); } } } diff --git a/core/modules/modDeclarationTVA.class.php b/core/modules/modDeclarationTVA.class.php index 9ce799d..d6338d2 100644 --- a/core/modules/modDeclarationTVA.class.php +++ b/core/modules/modDeclarationTVA.class.php @@ -76,7 +76,7 @@ class modDeclarationTVA extends DolibarrModules $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@declarationtva' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' - $this->version = '2.5.3'; + $this->version = '2.5.4'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';