From 71be9f5b3f81c6c1de439ae6144095d3bd1a2532 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Aug 2019 21:01:17 +0200 Subject: [PATCH] Fix test on terminal for 'cashdesk' module --- htdocs/compta/cashcontrol/cashcontrol_card.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php index 4f67f02d7f5..fed2182e236 100644 --- a/htdocs/compta/cashcontrol/cashcontrol_card.php +++ b/htdocs/compta/cashcontrol/cashcontrol_card.php @@ -235,8 +235,15 @@ if ($action=="create" || $action=="start") $posmodule = GETPOST('posmodule', 'alpha'); $terminalid = GETPOST('posnumber', 'alpha'); $terminaltouse = $terminalid; + if ($terminaltouse == '1' && $posmodule=='cashdesk') $terminaltouse = ''; + if ($posmodule=='cashdesk' && $terminaltouse != '' && $terminaltouse != '1') { + $terminaltouse = ''; + setEventMessages($langs->trans("OnlyTerminal1IsAvailableForCashDeskModule"), null, 'errors'); + $error++; + } + // Calculate $initialbalanceforterminal for terminal 0 foreach($arrayofpaymentmode as $key => $val) { @@ -271,7 +278,7 @@ if ($action=="create" || $action=="start") } else { - setEventMessages($langs->trans("SetupOfTerminalNotComplete", $terminalid), null, 'errors'); + setEventMessages($langs->trans("SetupOfTerminalNotComplete", $terminaltouse), null, 'errors'); $error++; } }