Simplify account details display to show only relevant amounts

Fixed:
- Removed confusing 'Base hors taxe', 'Montant de la TVA', 'Montant Total' columns
- Now shows only: Account Code, Account Label, Amount, Mapping Type
- BASE accounts show base amounts
- VAT accounts show VAT amounts
- Other accounts show VAT amounts (for consistency)
- Updated colspan for section headers (4 columns instead of 6)
- Simplified subtotals and grand total

This eliminates the confusion of showing the same values in multiple columns for individual accounts.
This commit is contained in:
Frank Cools 2025-10-02 23:41:24 +02:00
parent af58397793
commit 51f43c911f

View File

@ -83,9 +83,7 @@ echo '<table class="noborder centpercent">';
echo '<tr class="liste_titre">';
echo '<th>' . $langs->trans("AccountCode") . '</th>';
echo '<th>' . $langs->trans("AccountLabel") . '</th>';
echo '<th class="right">' . $langs->trans("BaseAmount") . '</th>';
echo '<th class="right">' . $langs->trans("VATAmount") . '</th>';
echo '<th class="right">' . $langs->trans("TotalAmount") . '</th>';
echo '<th class="right">' . $langs->trans("Amount") . '</th>';
echo '<th>' . $langs->trans("MappingType") . '</th>';
echo '</tr>';
@ -102,7 +100,7 @@ $total_amount_other = 0;
// Display BASE accounts first (if any)
if (!empty($base_accounts)) {
echo '<tr class="liste_titre">';
echo '<td colspan="6"><strong>' . $langs->trans("BaseAccounts") . '</strong></td>';
echo '<td colspan="4"><strong>' . $langs->trans("BaseAccounts") . '</strong></td>';
echo '</tr>';
foreach ($base_accounts as $account) {
@ -114,8 +112,6 @@ if (!empty($base_accounts)) {
echo '<td><strong>' . $account['account_code'] . '</strong></td>';
echo '<td>' . $account['account_label'] . '</td>';
echo '<td class="right">' . price($account['base_amount']) . '</td>';
echo '<td class="right">' . price($account['vat_amount']) . '</td>';
echo '<td class="right">' . price($account['total_amount']) . '</td>';
echo '<td>' . $account['mapping_type'] . '</td>';
echo '</tr>';
}
@ -124,8 +120,6 @@ if (!empty($base_accounts)) {
echo '<tr class="liste_titre">';
echo '<td colspan="2"><strong>' . $langs->trans("SubtotalBaseAccounts") . '</strong></td>';
echo '<td class="right"><strong>' . price($total_base_base) . '</strong></td>';
echo '<td class="right"><strong>' . price($total_vat_base) . '</strong></td>';
echo '<td class="right"><strong>' . price($total_amount_base) . '</strong></td>';
echo '<td></td>';
echo '</tr>';
}
@ -133,7 +127,7 @@ if (!empty($base_accounts)) {
// Display VAT accounts second (if any)
if (!empty($vat_accounts)) {
echo '<tr class="liste_titre">';
echo '<td colspan="6"><strong>' . $langs->trans("VATAccounts") . '</strong></td>';
echo '<td colspan="4"><strong>' . $langs->trans("VATAccounts") . '</strong></td>';
echo '</tr>';
foreach ($vat_accounts as $account) {
@ -144,9 +138,7 @@ if (!empty($vat_accounts)) {
echo '<tr class="oddeven">';
echo '<td><strong>' . $account['account_code'] . '</strong></td>';
echo '<td>' . $account['account_label'] . '</td>';
echo '<td class="right">' . price($account['base_amount']) . '</td>';
echo '<td class="right">' . price($account['vat_amount']) . '</td>';
echo '<td class="right">' . price($account['total_amount']) . '</td>';
echo '<td>' . $account['mapping_type'] . '</td>';
echo '</tr>';
}
@ -154,9 +146,7 @@ if (!empty($vat_accounts)) {
// Subtotal for VAT accounts
echo '<tr class="liste_titre">';
echo '<td colspan="2"><strong>' . $langs->trans("SubtotalVATAccounts") . '</strong></td>';
echo '<td class="right"><strong>' . price($total_base_vat) . '</strong></td>';
echo '<td class="right"><strong>' . price($total_vat_vat) . '</strong></td>';
echo '<td class="right"><strong>' . price($total_amount_vat) . '</strong></td>';
echo '<td></td>';
echo '</tr>';
}
@ -170,23 +160,17 @@ foreach ($other_accounts as $account) {
echo '<tr class="oddeven">';
echo '<td><strong>' . $account['account_code'] . '</strong></td>';
echo '<td>' . $account['account_label'] . '</td>';
echo '<td class="right">' . price($account['base_amount']) . '</td>';
echo '<td class="right">' . price($account['vat_amount']) . '</td>';
echo '<td class="right">' . price($account['total_amount']) . '</td>';
echo '<td>' . $account['mapping_type'] . '</td>';
echo '</tr>';
}
// Final totals row
$final_total_base = $total_base_base + $total_base_vat + $total_base_other;
$final_total_vat = $total_vat_base + $total_vat_vat + $total_vat_other;
$final_total_amount = $total_amount_base + $total_amount_vat + $total_amount_other;
echo '<tr class="liste_titre">';
echo '<td colspan="2"><strong>' . $langs->trans("GrandTotal") . '</strong></td>';
echo '<td class="right"><strong>' . price($final_total_base) . '</strong></td>';
echo '<td class="right"><strong>' . price($final_total_vat) . '</strong></td>';
echo '<td class="right"><strong>' . price($final_total_amount) . '</strong></td>';
echo '<td></td>';
echo '</tr>';