Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Colspan error in card.php #31778

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

Conversation

cmfpmatik
Copy link
Contributor

@cmfpmatik cmfpmatik commented Nov 12, 2024

The replacement of the code is necessary to address a layout issue in the table caused by incorrect column handling, which can affect the proper display of data.

Explanation of the Problem

In the original code:
The table displays the HT (pre-tax) value in one column, and if the MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES variable is enabled, an additional column is added for the TTC (tax-included) value.
This means that the number of columns in the table changes depending on the configuration: an extra column appears when MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is active.
This variation in the number of columns can cause issues with the table layout, especially if other cells (like headers or summary rows) use a colspan attribute that does not match the total number of columns, resulting in misalignment.

Why Replace with the New Code?

The new code solves this issue by displaying both the HT and TTC values in the same column, separated by a visual divider, when MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is enabled:

If MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is enabled: The HT value is followed by the TTC value within the same cell, maintaining a consistent column count.
Otherwise: Only the HT value is displayed, still within a single cell.

Conclusion :

Consistent Column Count: The number of columns remains constant, regardless of the MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES setting. This ensures that the colspan attribute in other parts of the table remains accurate, preserving the layout.

The code modification ensures that the table layout is correct and that columns remain alwys properly aligned, preventing layout issues that could occur if the number of columns.

The replacement of the code is necessary to address a layout issue in the table caused by incorrect column handling, which can affect the proper display of data.

Explanation of the Problem

In the original code:
    The table displays the HT (pre-tax) value in one column, and if the MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES variable is enabled, an additional column is added for the TTC (tax-included) value.
    This means that the number of columns in the table changes depending on the configuration: an extra column appears when MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is active.
    This variation in the number of columns can cause issues with the table layout, especially if other cells (like headers or summary rows) use a colspan attribute that does not match the total number of columns, resulting in misalignment.

Why Replace with the New Code?

The new code solves this issue by displaying both the HT and TTC values in the same column, separated by a visual divider, when MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is enabled:

    If MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is enabled: The HT value is followed by the TTC value within the same cell, maintaining a consistent column count.
    Otherwise: Only the HT value is displayed, still within a single cell.

Conclusion :

    Consistent Column Count: The number of columns remains constant, regardless of the MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES setting. This ensures that the colspan attribute in other parts of the table remains accurate, preserving the layout.

The code modification ensures that the table layout is correct and that columns remain alwys properly aligned, preventing layout issues that could occur if the number of columns.
htdocs/comm/card.php Outdated Show resolved Hide resolved
@eldy
Copy link
Member

eldy commented Nov 12, 2024

The goal of option MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is to add one column.
Each information must be into its dedicated column.
Can't reproduce trouble with old code. Can you describe how to reproduce the bug(with screenshot)

@eldy eldy added the Discussion Some questions or discussions are opened and wait answers of author or other people to be processed label Nov 12, 2024
@cmfpmatik
Copy link
Contributor Author

The goal of option MAIN_SHOW_PRICE_WITH_TAX_IN_SUMMARIES is to add one column.

Okay, but you have to increase the colspan first in this case.

Each information must be into its dedicated column. Can't reproduce trouble with old code. Can you describe how to reproduce the bug(with screenshot)

Why not! But in merge #24518, I preferred this approach for many reasons, but you mentioned : "Both fields represent the same information, only the unit differs. So i suggest to keep only one line: The original line and you just add the value in the second unit on the same line"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Some questions or discussions are opened and wait answers of author or other people to be processed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants