diff --git a/ChangeLog.md b/ChangeLog.md index ca9f677..ff3fbf5 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +## 2.5.2 + +### UI/UX Improvements +- **Professional Table Styling**: Applied consistent table styling across all PDF pages +- **Enhanced Visual Consistency**: All tables now use the same professional styling as journal tables +- **Improved Readability**: White backgrounds for data rows, light gray for headers and subtotals +- **Unified Design**: Consistent appearance throughout the entire PDF document + ## 2.5.1 ### UI/UX Improvements diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index a75f6a5..6538abd 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -1112,16 +1112,19 @@ class DeclarationTVA_PDF $total_vat_base += $account['vat_amount']; $pdf->SetX($start_x); - $pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C'); - $pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L'); - $pdf->Cell(35, 6, price($account['base_amount'], 0, '', 1, 0), 1, 1, 'R'); + $pdf->SetFont('helvetica', '', 9); + $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); } // Subtotal for BASE accounts $pdf->SetFont('helvetica', 'B', 9); $pdf->SetX($start_x); - $pdf->Cell(115, 6, 'Sous-total comptes de base', 1, 0, 'L'); - $pdf->Cell(35, 6, price($total_base_base, 0, '', 1, 0), 1, 1, 'R'); + $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->Ln(2); } @@ -1137,16 +1140,19 @@ class DeclarationTVA_PDF $total_vat_vat += $account['vat_amount']; $pdf->SetX($start_x); - $pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C'); - $pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L'); - $pdf->Cell(35, 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R'); + $pdf->SetFont('helvetica', '', 9); + $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); } // Subtotal for VAT accounts $pdf->SetFont('helvetica', 'B', 9); $pdf->SetX($start_x); - $pdf->Cell(115, 6, 'Sous-total comptes de TVA', 1, 0, 'L'); - $pdf->Cell(35, 6, price($total_vat_vat, 0, '', 1, 0), 1, 1, 'R'); + $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->Ln(2); } @@ -1158,17 +1164,20 @@ class DeclarationTVA_PDF $total_vat_other += $account['vat_amount']; $pdf->SetX($start_x); - $pdf->Cell(35, 6, $account['account_code'], 1, 0, 'C'); - $pdf->Cell(80, 6, $this->truncateText($account['account_label'], 35), 1, 0, 'L'); - $pdf->Cell(35, 6, price($account['vat_amount'], 0, '', 1, 0), 1, 1, 'R'); + $pdf->SetFont('helvetica', '', 9); + $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); } // Total for other accounts if (!empty($other_accounts)) { $pdf->SetFont('helvetica', 'B', 9); $pdf->SetX($start_x); - $pdf->Cell(115, 6, 'Total', 1, 0, 'L'); - $pdf->Cell(35, 6, price($total_vat_other, 0, '', 1, 0), 1, 1, 'R'); + $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); } } } @@ -1872,12 +1881,11 @@ class DeclarationTVA_PDF // Set X position to center the table for each row $pdf->SetX($start_x); - $pdf->Cell($col_widths[0], 6, $entry['account_code'], 1, 0, 'C'); - $pdf->Cell($col_widths[1], 6, $entry['account_label'], 1, 0, 'L'); - $pdf->Cell($col_widths[2], 6, $entry['entry_label'], 1, 0, 'L'); - $pdf->Cell($col_widths[3], 6, $entry['debit'], 1, 0, 'R'); - $pdf->Cell($col_widths[4], 6, $entry['credit'], 1, 0, 'R'); - $pdf->Ln(); + $pdf->Cell($col_widths[0], 6, $entry['account_code'], 1, 0, 'C', true); + $pdf->Cell($col_widths[1], 6, $entry['account_label'], 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, $entry['entry_label'], 1, 0, 'L', true); + $pdf->Cell($col_widths[3], 6, $entry['debit'], 1, 0, 'R', true); + $pdf->Cell($col_widths[4], 6, $entry['credit'], 1, 1, 'R', true); } } @@ -1938,12 +1946,11 @@ class DeclarationTVA_PDF // Set X position to center the table for each row $pdf->SetX($start_x); - $pdf->Cell($col_widths[0], 6, $entry['account_code'], 1, 0, 'C'); - $pdf->Cell($col_widths[1], 6, $entry['account_label'], 1, 0, 'L'); - $pdf->Cell($col_widths[2], 6, $entry['entry_label'], 1, 0, 'L'); - $pdf->Cell($col_widths[3], 6, $entry['debit'], 1, 0, 'R'); - $pdf->Cell($col_widths[4], 6, $entry['credit'], 1, 0, 'R'); - $pdf->Ln(); + $pdf->Cell($col_widths[0], 6, $entry['account_code'], 1, 0, 'C', true); + $pdf->Cell($col_widths[1], 6, $entry['account_label'], 1, 0, 'L', true); + $pdf->Cell($col_widths[2], 6, $entry['entry_label'], 1, 0, 'L', true); + $pdf->Cell($col_widths[3], 6, $entry['debit'], 1, 0, 'R', true); + $pdf->Cell($col_widths[4], 6, $entry['credit'], 1, 1, 'R', true); } } diff --git a/core/modules/modDeclarationTVA.class.php b/core/modules/modDeclarationTVA.class.php index 178df4e..9c6ba5c 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.1'; + $this->version = '2.5.2'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';