TakePOS cash control report: overlapping text on "Cash" line when opening balance is not zero
Bug
The Cash Control / TakePOS closing report shows overlapping/concatenated text for the "Cash" line when there is a non-zero opening balance, because two separate values (the day's total cash movement and the new balance) are printed in two <div class="inline-block amount width100"> elements right after each other with no line break between them.
Example: with an opening balance of 99259.35 and 25.00 in cash payments, the report displays:
Cash (3 Payments): +25,0099 284,35
instead of two clearly separated values (+25,00 and 99 284,35).
This only happens for the "Cash" line because it is the only line where both <div class="inline-block amount width100"> blocks contain text at the same time. For Cheque/CB the first div is always empty, so the overlap is not visible there.
Steps to reproduce:
- Enable TakePOS module with an opening cash balance != 0
- Register a few cash (LIQ) sales during the day
- Open the cash control / cashier report for that day (htdocs/compta/cashcontrol/report.php)
- Observe the "Cash (X Payments):" line — the delta amount and the new balance are visually stuck together with no separator
Expected: the two amounts should be shown on separate lines/columns, like they already are for Cheque and CB. Actual: they overlap/concatenate into a single unreadable string.
Relevant code in htdocs/compta/cashcontrol/report.php:
print $langs->trans("Cash")...' : '; if (!$summaryonly) { print '
Both divs use class="inline-block amount width100" (display:inline-block + width:100%), a contradictory combination when printed back to back — the second one does not reliably wrap to a new line depending on the rendering context.
Suggested fix: add an explicit line break between the two divs (print '
';) or replace inline-block with block for these two elements so they always stack vertically.
Dolibarr Version
24.0.0
Environment PHP
8.3.33
Environment Database
mysql from 11.8.6-MariaDB,
Steps to reproduce the behavior and expected behavior
The Cash Control / TakePOS closing report shows overlapping/concatenated text for the "Cash" line when there is a non-zero opening balance, because two separate values (the day's total cash movement and the new balance) are printed in two <div class="inline-block amount width100"> elements right after each other with no line break between them.
Example: with an opening balance of 99259.35 and 25.00 in cash payments, the report displays:
Cash (3 Payments): +25,0099 284,35
instead of two clearly separated values (+25,00 and 99 284,35).
This only happens for the "Cash" line because it is the only line where both divs contain text at the same time. For Cheque/CB the first div is always empty, so the overlap is not visible there.
Attached files
Steps:
- Enable TakePOS module with an opening cash balance != 0
- Register a few cash (LIQ) sales during the day
- Open the cash control / cashier report for that day (htdocs/compta/cashcontrol/report.php)
- Observe the "Cash (X Payments):" line — the delta amount and the new balance are visually stuck together with no separator
Expected: the two amounts should be shown on separate lines/columns, like they already are for Cheque and CB. Actual: they overlap/concatenate into a single unreadable string.
Relevant code in htdocs/compta/cashcontrol/report.php:
print $langs->trans("Cash")...' : ';
if (!$summaryonly) {
print '<div class="inline-block amount width100">'.($cash >= 0 ? '+' : '').price($cash).'</div>';
print '<div class="inline-block amount width100">'.price($newcash).'</div>';
}Both divs use class="inline-block amount width100" (display:inline-block + width:100%), a contradictory combination when printed back to back — the second one does not reliably wrap to a new line depending on the rendering context.
Suggested fix: add an explicit line break between the two divs (print '
';) or replace inline-block with block for these two elements so they always stack vertically.
Source: Dolibarr/dolibarr