FIX Setup of TakePos was not possible after a clean install

This commit is contained in:
Laurent Destailleur 2019-08-01 11:27:35 +02:00
parent 192fb45ce7
commit 12b530c418
4 changed files with 16 additions and 4 deletions

View File

@ -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;

View File

@ -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
RecipientEmailsWillBeReplacedWithThisValue=Recipient emails will be always replaced with this value
AtLeastOneDefaultBankAccountMandatory=At least 1 default bank account must be defined

View File

@ -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 '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdParty
print '<td colspan="2">';
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 '</td></tr>';
$atleastonefound = 0;
if (! empty($conf->banque->enabled))
{
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
@ -149,6 +151,7 @@ if (! empty($conf->banque->enabled))
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
print '<td colspan="2">';
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 '</td></tr>';
@ -191,6 +194,12 @@ if (! empty($conf->stock->enabled))
}
print '</table>';
if (empty($atleastonefound) && ! empty($conf->banque->enabled))
{
print info_admin($langs->trans("AtLeastOneDefaultBankAccountMandatory"), 0, 0, 'error');
}
print '<br>';
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';

View File

@ -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){