v2.5.4: Perfect table column width consistency across all PDF pages

- Updated detailed page tables to match first page column widths exactly
- All tables now use identical column proportions (20, 60, 40)
- Detailed page tables now have the same width and proportions as journal tables
- Consistent table sizing throughout the entire PDF
- Updated module version to 2.5.4
This commit is contained in:
Frank Cools 2025-10-08 12:31:42 +02:00
parent cc5ab9a062
commit 3474cebd13
3 changed files with 30 additions and 21 deletions

View File

@ -1,5 +1,13 @@
# CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) # 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 ## 2.5.3
### UI/UX Improvements ### UI/UX Improvements

View File

@ -1078,8 +1078,9 @@ class DeclarationTVA_PDF
} }
} }
// Calculate table width and center position // Calculate table width and center position (matching first page proportions)
$table_width = 150; // 35 + 80 + 35 $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']; $page_width = $pdf->getPageWidth() - $pdf->getMargins()['left'] - $pdf->getMargins()['right'];
$start_x = ($page_width - $table_width) / 2 + $pdf->getMargins()['left']; $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) // Table header with light gray background (matching first page style)
$pdf->SetFont('helvetica', 'B', 8); $pdf->SetFont('helvetica', 'B', 8);
$pdf->SetFillColor(240, 240, 240); // Light gray background $pdf->SetFillColor(240, 240, 240); // Light gray background
$pdf->Cell(35, 8, 'Code compte', 1, 0, 'C', true); $pdf->Cell($col_widths[0], 8, 'Code compte', 1, 0, 'C', true);
$pdf->Cell(80, 8, 'Libellé compte', 1, 0, 'C', true); $pdf->Cell($col_widths[1], 8, 'Libellé compte', 1, 0, 'C', true);
$pdf->Cell(35, 8, 'Montant', 1, 1, 'C', true); $pdf->Cell($col_widths[2], 8, 'Montant', 1, 1, 'C', true);
$total_base_base = 0; $total_base_base = 0;
$total_vat_base = 0; $total_vat_base = 0;
@ -1114,17 +1115,17 @@ class DeclarationTVA_PDF
$pdf->SetX($start_x); $pdf->SetX($start_x);
$pdf->SetFont('helvetica', '', 7); $pdf->SetFont('helvetica', '', 7);
$pdf->SetFillColor(255, 255, 255); // White background for data rows $pdf->SetFillColor(255, 255, 255); // White background for data rows
$pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C', true); $pdf->Cell($col_widths[0], 6, $account['account_code'], 1, 0, 'C', true);
$pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); $pdf->Cell($col_widths[1], 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[2], 6, price($account['base_amount'], 0, '', 1, 0), 1, 1, 'R', true);
} }
// Subtotal for BASE accounts // Subtotal for BASE accounts
$pdf->SetFont('helvetica', 'B', 7); $pdf->SetFont('helvetica', 'B', 7);
$pdf->SetX($start_x); $pdf->SetX($start_x);
$pdf->SetFillColor(248, 248, 248); // Light gray for subtotal $pdf->SetFillColor(248, 248, 248); // Light gray for subtotal
$pdf->Cell(115, 6, 'Sous-total comptes de base', 1, 0, 'L', true); $pdf->Cell($col_widths[0] + $col_widths[1], 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[2], 6, price($total_base_base, 0, '', 1, 0), 1, 1, 'R', true);
$pdf->Ln(2); $pdf->Ln(2);
} }
@ -1142,17 +1143,17 @@ class DeclarationTVA_PDF
$pdf->SetX($start_x); $pdf->SetX($start_x);
$pdf->SetFont('helvetica', '', 7); $pdf->SetFont('helvetica', '', 7);
$pdf->SetFillColor(255, 255, 255); // White background for data rows $pdf->SetFillColor(255, 255, 255); // White background for data rows
$pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C', true); $pdf->Cell($col_widths[0], 6, $account['account_code'], 1, 0, 'C', true);
$pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); $pdf->Cell($col_widths[1], 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[2], 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R', true);
} }
// Subtotal for VAT accounts // Subtotal for VAT accounts
$pdf->SetFont('helvetica', 'B', 7); $pdf->SetFont('helvetica', 'B', 7);
$pdf->SetX($start_x); $pdf->SetX($start_x);
$pdf->SetFillColor(248, 248, 248); // Light gray for subtotal $pdf->SetFillColor(248, 248, 248); // Light gray for subtotal
$pdf->Cell(115, 6, 'Sous-total comptes de TVA', 1, 0, 'L', true); $pdf->Cell($col_widths[0] + $col_widths[1], 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[2], 6, price($total_vat_vat, 0, '', 1, 0), 1, 1, 'R', true);
$pdf->Ln(2); $pdf->Ln(2);
} }
@ -1166,9 +1167,9 @@ class DeclarationTVA_PDF
$pdf->SetX($start_x); $pdf->SetX($start_x);
$pdf->SetFont('helvetica', '', 7); $pdf->SetFont('helvetica', '', 7);
$pdf->SetFillColor(255, 255, 255); // White background for data rows $pdf->SetFillColor(255, 255, 255); // White background for data rows
$pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C', true); $pdf->Cell($col_widths[0], 6, $account['account_code'], 1, 0, 'C', true);
$pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L', true); $pdf->Cell($col_widths[1], 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[2], 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R', true);
} }
// Total for other accounts // Total for other accounts
@ -1176,8 +1177,8 @@ class DeclarationTVA_PDF
$pdf->SetFont('helvetica', 'B', 7); $pdf->SetFont('helvetica', 'B', 7);
$pdf->SetX($start_x); $pdf->SetX($start_x);
$pdf->SetFillColor(248, 248, 248); // Light gray for total $pdf->SetFillColor(248, 248, 248); // Light gray for total
$pdf->Cell(115, 6, 'Total', 1, 0, 'L', true); $pdf->Cell($col_widths[0] + $col_widths[1], 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[2], 6, price($total_vat_other, 0, '', 1, 0), 1, 1, 'R', true);
} }
} }
} }

View File

@ -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' $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' // 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 // Url to the file with your last numberversion of this module
//$this->url_last_version = 'http://www.example.com/versionmodule.txt'; //$this->url_last_version = 'http://www.example.com/versionmodule.txt';