Fix setup of terminal
This commit is contained in:
parent
5aa7382aee
commit
84714f39e2
@ -37,8 +37,8 @@ function takepos_prepare_head()
|
|||||||
$head[$h][1] = $langs->trans("Parameters");
|
$head[$h][1] = $langs->trans("Parameters");
|
||||||
$head[$h][2] = 'setup';
|
$head[$h][2] = 'setup';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
for ($i = 2; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
for ($i = 1; $i <= $conf->global->TAKEPOS_NUM_TERMINALS; $i++)
|
||||||
{
|
{
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
|
$head[$h][0] = DOL_URL_ROOT.'/takepos/admin/terminal.php?terminal='.$i;
|
||||||
$head[$h][1] = $langs->trans("Terminal"). " ".$i;
|
$head[$h][1] = $langs->trans("Terminal"). " ".$i;
|
||||||
|
|||||||
@ -64,5 +64,6 @@ EnableBarOrRestaurantFeatures=Enable features for Bar or Restaurant
|
|||||||
ConfirmDeletionOfThisPOSSale=Do your confirm the deletion of this current sale ?
|
ConfirmDeletionOfThisPOSSale=Do your confirm the deletion of this current sale ?
|
||||||
History=History
|
History=History
|
||||||
ValidateAndClose=Validate and close
|
ValidateAndClose=Validate and close
|
||||||
Terminals=Terminals
|
Terminal=Terminal
|
||||||
|
NumberOfTerminals=Number of Terminals
|
||||||
TerminalSelect=Select terminal you want to use:
|
TerminalSelect=Select terminal you want to use:
|
||||||
@ -64,6 +64,7 @@ if (GETPOST('action', 'alpha') == 'set')
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
|
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
|
||||||
|
|
||||||
|
/*
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY", (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY", (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH", (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH", (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
@ -76,6 +77,8 @@ if (GETPOST('action', 'alpha') == 'set')
|
|||||||
}
|
}
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE", (GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE", (GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE', 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", GETPOST('CASHDESK_NO_DECREASE_STOCK', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK", GETPOST('CASHDESK_NO_DECREASE_STOCK', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
*/
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_SERVICES", GETPOST('CASHDESK_SERVICES', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "TAKEPOS_ROOT_CATEGORY_ID", GETPOST('TAKEPOS_ROOT_CATEGORY_ID', 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
@ -140,6 +143,15 @@ print '<tr class="liste_titre">';
|
|||||||
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
// Terminals
|
||||||
|
print '<tr class="oddeven"><td>';
|
||||||
|
print $langs->trans("NumberOfTerminals");
|
||||||
|
print '<td colspan="2">';
|
||||||
|
$array=array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5", 6=>"6", 7=>"7", 8=>"8", 9=>"9");
|
||||||
|
print $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS)?'0':$conf->global->TAKEPOS_NUM_TERMINALS), 0);
|
||||||
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
// Services
|
||||||
if (! empty($conf->service->enabled))
|
if (! empty($conf->service->enabled))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
@ -148,14 +160,15 @@ if (! empty($conf->service->enabled))
|
|||||||
print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1);
|
print $form->selectyesno("CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Auto print tickets
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $langs->trans("AutoPrintTickets");
|
print $langs->trans("AutoPrintTickets");
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1);
|
print $form->selectyesno("TAKEPOS_AUTO_PRINT_TICKETS", $conf->global->TAKEPOS_AUTO_PRINT_TICKETS, 1);
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
|
// Root category for products
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
|
print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc"));
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
@ -253,19 +266,11 @@ else
|
|||||||
}
|
}
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
|
|
||||||
// Terminals
|
|
||||||
print '<tr class="oddeven"><td>';
|
|
||||||
print $langs->trans("Terminals");
|
|
||||||
print '<td colspan="2">';
|
|
||||||
$array=array(1=>"1", 2=>"2", 3=>"3", 4=>"4", 5=>"5");
|
|
||||||
print $form->selectarray('TAKEPOS_NUM_TERMINALS', $array, (empty($conf->global->TAKEPOS_NUM_TERMINALS)?'0':$conf->global->TAKEPOS_NUM_TERMINALS), 0);
|
|
||||||
print "</td></tr>\n";
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
/*
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
if (!$conf->global->TAKEPOS_NUM_TERMINALS || $conf->global->TAKEPOS_NUM_TERMINALS=="1") print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
if (!$conf->global->TAKEPOS_NUM_TERMINALS || $conf->global->TAKEPOS_NUM_TERMINALS=="1") print '<td>'.$langs->trans("Parameters").'</td><td>'.$langs->trans("Value").'</td>';
|
||||||
@ -296,7 +301,7 @@ if (! empty($conf->banque->enabled))
|
|||||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code;
|
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code;
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
$cour=preg_match('/^LIQ.*/', $modep->code)?2:1;
|
$cour=preg_match('|^LIQ.*|', $modep->code)?2:1;
|
||||||
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1);
|
$form->select_comptes($conf->global->$name, $name, 0, "courant=".$cour, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
@ -339,6 +344,7 @@ if (! empty($conf->stock->enabled))
|
|||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
*/
|
||||||
|
|
||||||
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
|
||||||
|
|
||||||
|
|||||||
@ -57,26 +57,31 @@ if($resql){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$terminaltouse = $terminal;
|
||||||
|
if ($terminaltouse == '1') $terminaltouse = '';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (GETPOST('action', 'alpha') == 'set')
|
if (GETPOST('action', 'alpha') == 'set')
|
||||||
{
|
{
|
||||||
$db->begin();
|
$db->begin();
|
||||||
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
|
if (GETPOST('socid', 'int') < 0) $_POST["socid"]='';
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY".$terminal, (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_THIRDPARTY".$terminaltouse, (GETPOST('socid', 'int') > 0 ? GETPOST('socid', 'int') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminal, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminal, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminal, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
foreach($paiements as $modep) {
|
foreach($paiements as $modep) {
|
||||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
||||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminal;
|
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
|
||||||
$res = dolibarr_set_const($db, $name, (GETPOST($name, 'alpha') > 0 ? GETPOST($name, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, $name, (GETPOST($name, 'alpha') > 0 ? GETPOST($name, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE".$terminal, (GETPOST('CASHDESK_ID_WAREHOUSE'.$terminal, 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE'.$terminal, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_ID_WAREHOUSE".$terminaltouse, (GETPOST('CASHDESK_ID_WAREHOUSE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_WAREHOUSE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity);
|
||||||
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminal, GETPOST('CASHDESK_NO_DECREASE_STOCK'.$terminal, 'alpha'), 'chaine', 0, '', $conf->entity);
|
$res = dolibarr_set_const($db, "CASHDESK_NO_DECREASE_STOCK".$terminaltouse, GETPOST('CASHDESK_NO_DECREASE_STOCK'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
|
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
|
||||||
|
|
||||||
@ -94,6 +99,7 @@ if (GETPOST('action', 'alpha') == 'set')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -111,7 +117,7 @@ print '<br>';
|
|||||||
|
|
||||||
|
|
||||||
// Mode
|
// Mode
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'?terminal='.$terminal.'" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'?terminal='.(empty($terminal)?1:$terminal).'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="action" value="set">';
|
print '<input type="hidden" name="action" value="set">';
|
||||||
|
|
||||||
@ -122,26 +128,26 @@ print "</tr>\n";
|
|||||||
|
|
||||||
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
print '<tr class="oddeven"><td width=\"50%\">'.$langs->trans("CashDeskThirdPartyForSell").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print $form->select_company($conf->global->{'CASHDESK_ID_THIRDPARTY'.$terminal}, 'socid', 's.client in (1, 3) AND s.status = 1', 1, 0, 0, array(), 0);
|
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>';
|
print '</td></tr>';
|
||||||
if (! empty($conf->banque->enabled))
|
if (! empty($conf->banque->enabled))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForSell").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminal}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminal, 0, "courant=2", 1);
|
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 0, "courant=2", 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCheque").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminal, 0, "courant=1", 1);
|
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 0, "courant=1", 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountForCB").'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminal}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminal, 0, "courant=1", 1);
|
$form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
foreach($paiements as $modep) {
|
foreach($paiements as $modep) {
|
||||||
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
|
||||||
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminal;
|
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("CashDeskBankAccountFor").' '.$langs->trans($modep->libelle).'</td>';
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
$cour=preg_match('/^LIQ.*/', $modep->code)?2:1;
|
$cour=preg_match('/^LIQ.*/', $modep->code)?2:1;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user