diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 1ddab39dcbe..415281af65d 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -978,36 +978,39 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
query($sql);
-$paiementsModes = array();
-if ($resql) {
- while ($obj = $db->fetch_object($resql)) {
- $paycode = $obj->code;
- if ($paycode == 'LIQ') {
- $paycode = 'CASH';
- }
- if ($paycode == 'CHQ') {
- $paycode = 'CHEQUE';
- }
+ $resql = $db->query($sql);
+ $paiementsModes = array();
+ if ($resql) {
+ while ( $obj = $db->fetch_object($resql) ) {
+ $paycode = $obj->code;
+ if ($paycode == 'LIQ') {
+ $paycode = 'CASH';
+ }
+ if ($paycode == 'CHQ') {
+ $paycode = 'CHEQUE';
+ }
- $constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
- //var_dump($constantforkey.' '.$conf->global->$constantforkey);
- if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
- array_push($paiementsModes, $obj);
+ $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
+ //var_dump($constantforkey.' '.$conf->global->$constantforkey);
+ if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
+ array_push($paiementsModes, $obj);
+ }
}
}
+
+ if (empty($paiementsModes)) {
+ $langs->load('errors');
+ setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
+ setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
+ }
}
-if (empty($paiementsModes)) {
- $langs->load('errors');
- setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
- setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
-}
if (count($maincategories) == 0) {
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
$tmpcategory = new Categorie($db);
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 0c00fcdd938..4130ac5c3cb 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -188,11 +188,9 @@ if ($action == 'valid' && $user->rights->facture->creer) {
if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
$bankaccount = GETPOST('accountid', 'int');
} else {
- if ($pay == "cash") {
+ if ($pay == 'LIQ') {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "card") {
- $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "cheque") {
+ } elseif ($pay == "CHQ") {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
} else {
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index ba8ac8f82f7..6e22f27f7ff 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -316,23 +316,20 @@ print '';
+ print '';
} else {
print '';
}
@@ -345,23 +342,20 @@ print '';
+ print '';
} else {
$button = array_pop($action_buttons);
print '';
@@ -375,23 +369,20 @@ print '';
+ print '';
} else {
$button = array_pop($action_buttons);
print '';