Fix background color override by Dolibarr CSS using !important

Fixed:
- Added !important to all background-color declarations to override Dolibarr's striped table CSS
- Applied to both <tr> and individual <td> elements for complete coverage
- This ensures the light red background (#ffe6e6) shows on calculated lines despite Dolibarr's pair/impair classes

The !important declaration forces the custom background color to take precedence over Dolibarr's default table styling.
This commit is contained in:
Frank Cools 2025-10-02 23:51:15 +02:00
parent b8615ceba0
commit 97485b1d98

View File

@ -234,10 +234,10 @@ foreach ($base_vat_lines as $line) {
// Line 16: Subtotal (calculated automatically)
$data = isset($ca3_data['16']) ? $ca3_data['16'] : array('line_label' => '', 'vat_amount' => 0);
print '<tr class="pair" style="background-color: #ffe6e6;">';
print '<td><strong>16</strong></td>';
print '<td colspan="2"><strong>Sous-total TVA due (08 + 09 + 9B)</strong></td>';
print '<td class="right"><strong>' . formatAmount($data['vat_amount']) . '</strong></td>';
print '<tr class="pair" style="background-color: #ffe6e6 !important;">';
print '<td style="background-color: #ffe6e6 !important;"><strong>16</strong></td>';
print '<td colspan="2" style="background-color: #ffe6e6 !important;"><strong>Sous-total TVA due (08 + 09 + 9B)</strong></td>';
print '<td class="right" style="background-color: #ffe6e6 !important;"><strong>' . formatAmount($data['vat_amount']) . '</strong></td>';
print '</tr>';
// Reset to normal layout for line 17
@ -303,10 +303,10 @@ foreach ($section_c_lines as $line) {
// Line 23: Subtotal (calculated automatically)
$data = isset($ca3_data['23']) ? $ca3_data['23'] : array('line_label' => '', 'vat_amount' => 0);
print '<tr class="pair" style="background-color: #ffe6e6;">';
print '<td><strong>23</strong></td>';
print '<td colspan="2"><strong>Sous-total TVA déductible (20 + 21 + 22)</strong></td>';
print '<td class="right"><strong>' . formatAmount($data['vat_amount']) . '</strong></td>';
print '<tr class="pair" style="background-color: #ffe6e6 !important;">';
print '<td style="background-color: #ffe6e6 !important;"><strong>23</strong></td>';
print '<td colspan="2" style="background-color: #ffe6e6 !important;"><strong>Sous-total TVA déductible (20 + 21 + 22)</strong></td>';
print '<td class="right" style="background-color: #ffe6e6 !important;"><strong>' . formatAmount($data['vat_amount']) . '</strong></td>';
print '</tr>';
// Section D: Résultat
@ -331,10 +331,10 @@ foreach ($section_d_lines as $line) {
$description = isset($ca3_definitions[$line]) ? $ca3_definitions[$line]['label'] : $data['line_label'];
}
print '<tr style="background-color: #ffe6e6;">';
print '<td><strong>' . $line . '</strong></td>';
print '<td colspan="2">' . $description . '</td>';
print '<td class="right">' . formatAmount($data['vat_amount']) . '</td>';
print '<tr style="background-color: #ffe6e6 !important;">';
print '<td style="background-color: #ffe6e6 !important;"><strong>' . $line . '</strong></td>';
print '<td colspan="2" style="background-color: #ffe6e6 !important;">' . $description . '</td>';
print '<td class="right" style="background-color: #ffe6e6 !important;">' . formatAmount($data['vat_amount']) . '</td>';
print '</tr>';
}