diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index d5e2d3be854..07573db1a11 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -38,7 +38,8 @@ function takepos_prepare_head() $head[$h][2] = 'setup'; $h++; - for ($i = 1; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++) + $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); + for ($i = 1; $i <= $numterminals; $i++) { $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i; $head[$h][1] = $langs->trans("Terminal"). " ".$i; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 2edb5500d54..f124156de8e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1922,4 +1922,5 @@ YouWillFindItOnYourIFTTTAccount=You will find it on your IFTTT account EndPointFor=End point for %s : %s DeleteEmailCollector=Delete email collector ConfirmDeleteEmailCollector=Are you sure you want to delete this email collector? -RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value \ No newline at end of file +RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value +AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined \ No newline at end of file diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 2b29f46120d..b952285747b 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/takepos/admin/setup.php + * \file htdocs/takepos/admin/terminal.php * \ingroup takepos * \brief Setup page for TakePos module */ @@ -129,6 +129,8 @@ print ''.$langs->trans("CashDeskThirdParty print ''; print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminaltouse}, 'socid', '(s.client IN (1, 3) AND s.status = 1)', 1, 0, 0, array(), 0); print ''; + +$atleastonefound = 0; if (! empty($conf->banque->enabled)) { print ''.$langs->trans("CashDeskBankAccountForSell").''; @@ -149,6 +151,7 @@ if (! empty($conf->banque->enabled)) $name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse; print ''.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).''; print ''; + if (! empty($conf->global->$name)) $atleastonefound++; $cour=preg_match('/^LIQ.*/', $modep->code)?2:1; $form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1); print ''; @@ -191,6 +194,12 @@ if (! empty($conf->stock->enabled)) } print ''; + +if (empty($atleastonefound) && ! empty($conf->banque->enabled)) +{ + print info_admin($langs->trans("AtLeastOneDefaultBankAccountMandatory"), 0, 0, 'error'); +} + print '
'; print '
'; diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index c0a37881cf9..702bb082714 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -17,7 +17,7 @@ */ /** - * \file htdocs/takepos/floors.php + * \file htdocs/takepos/takepos.php * \ingroup takepos * \brief Main TakePOS screen */ @@ -619,6 +619,7 @@ $sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_paiement"; $sql.= " WHERE entity IN (".getEntity('c_paiement').")"; $sql.= " AND active = 1"; $sql.= " ORDER BY libelle"; +print $sql; $resql = $db->query($sql); $paiementsModes = array(); if ($resql){