Only check takepos configuration if a terminal is choosen, to prevent error message

This commit is contained in:
Laurent Dinclaux 2021-09-07 22:31:09 +11:00
parent 02f21d478a
commit a39f469a50

View File

@ -978,6 +978,7 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
<?php <?php
// TakePOS setup check // TakePOS setup check
if ( isset( $_SESSION["takeposterminal"] ) && $_SESSION["takeposterminal"] ) {
$sql = "SELECT code, libelle FROM " . MAIN_DB_PREFIX . "c_paiement"; $sql = "SELECT code, libelle FROM " . MAIN_DB_PREFIX . "c_paiement";
$sql .= " WHERE entity IN (" . getEntity( 'c_paiement' ) . ")"; $sql .= " WHERE entity IN (" . getEntity( 'c_paiement' ) . ")";
$sql .= " AND active = 1"; $sql .= " AND active = 1";
@ -1008,6 +1009,8 @@ if (empty($paiementsModes)) {
setEventMessages( $langs->trans( "ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv( "TakePOS" ) ), null, 'errors' ); setEventMessages( $langs->trans( "ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv( "TakePOS" ) ), null, 'errors' );
setEventMessages( $langs->trans( "ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"] ), null, 'errors' ); setEventMessages( $langs->trans( "ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"] ), null, 'errors' );
} }
}
if (count($maincategories) == 0) { if (count($maincategories) == 0) {
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) { if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
$tmpcategory = new Categorie($db); $tmpcategory = new Categorie($db);