diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php
index fa3c97e2685..7c507c8c907 100644
--- a/htdocs/compta/cashcontrol/report.php
+++ b/htdocs/compta/cashcontrol/report.php
@@ -156,11 +156,11 @@ if ($resql) {
print "\n";
print '
';
print '';
- if ($object->status != $object::STATUS_DRAFT) {
- $nameterminal = getDolGlobalString("TAKEPOS_TERMINAL_NAME_".$object->id);
- print $langs->trans("CashControl")." #".$object->id.(($nameterminal != "TAKEPOS_TERMINAL_NAME_".$object->id) ? ' - '.$nameterminal : '');
- } else {
- print $langs->trans("CashControl")." #".$object->id." (".$langs->trans("Draft").")";
+
+ $nameterminal = getDolGlobalString("TAKEPOS_TERMINAL_NAME_".$object->posnumber);
+ print $langs->trans("CashControl")." #".$object->id.(($nameterminal != "TAKEPOS_TERMINAL_NAME_".$object->posnumber) ? ' - '.$nameterminal : '');
+ if ($object->status == $object::STATUS_DRAFT) {
+ print "
(".$langs->trans("Draft").")";
}
print "
";
print $mysoc->name;