diff --git a/ChangeLog.md b/ChangeLog.md index e1e7507..ea83dbc 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,13 @@ # CHANGELOG MODULE DECLARATIONTVA FOR [DOLIBARR ERP CRM](https://www.dolibarr.org) +## 2.5.16 + +### Bug Fixes +- **Fixed Line 08 Resume Display**: Now shows separate counts for base and VAT accounts for lines 08, 09, 9B +- **Improved Account Summary**: Resume now displays "Comptes de base: X | Comptes de TVA: Y" for mixed account lines +- **Better Line Details**: More accurate account breakdown in PDF detailed pages +- **Enhanced Clarity**: Clear distinction between base and VAT accounts in line summaries + ## 2.5.15 ### Bug Fixes diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index f198756..eea2669 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -1077,7 +1077,24 @@ class DeclarationTVA_PDF // Add line summary information (without title) - using table font size $pdf->SetFont('helvetica', '', 7); $pdf->Cell(0, 6, 'Période: ' . dol_print_date($line_details['start_date'], 'day') . ' - ' . dol_print_date($line_details['end_date'], 'day'), 0, 1); - $pdf->Cell(0, 6, 'Nombre de comptes: ' . $line_details['account_count'], 0, 1); + + // Special handling for lines with both base and VAT accounts (08, 09, 9B) + if (in_array($line_code, array('08', '09', '9B'))) { + // Count base and VAT accounts separately + $base_count = 0; + $vat_count = 0; + foreach ($line_details['account_details'] as $account) { + if (strpos($account['mapping_type'], '_BASE') !== false) { + $base_count++; + } elseif (strpos($account['mapping_type'], '_VAT') !== false) { + $vat_count++; + } + } + $pdf->Cell(0, 6, 'Comptes de base: ' . $base_count . ' | Comptes de TVA: ' . $vat_count, 0, 1); + } else { + // Standard count for other lines + $pdf->Cell(0, 6, 'Nombre de comptes: ' . $line_details['account_count'], 0, 1); + } if (!empty($line_details['calculated_line'])) { $calc = $line_details['calculated_line']; diff --git a/core/modules/modDeclarationTVA.class.php b/core/modules/modDeclarationTVA.class.php index c54545c..10cf299 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.15'; + $this->version = '2.5.16'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';