25 require
'../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/product/class/html.formproduct.class.php';
30 if (!empty($_REQUEST[
'CASHDESK_ID_THIRDPARTY_id']))
32 $_GET[
'CASHDESK_ID_THIRDPARTY'] =
GETPOST(
'CASHDESK_ID_THIRDPARTY_id',
'alpha');
33 $_POST[
'CASHDESK_ID_THIRDPARTY'] =
GETPOST(
'CASHDESK_ID_THIRDPARTY_id',
'alpha');
34 $_REQUEST[
'CASHDESK_ID_THIRDPARTY'] =
GETPOST(
'CASHDESK_ID_THIRDPARTY_id',
'alpha');
42 $langs->loadLangs(array(
"admin",
"cashdesk"));
48 if (
GETPOST(
'action',
'alpha') ==
'set')
52 if (
GETPOST(
'socid',
'int') < 0) $_POST[
"socid"] =
'';
55 $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);
56 $res =
dolibarr_set_const($db,
"CASHDESK_ID_BANKACCOUNT_CHEQUE", (
GETPOST(
'CASHDESK_ID_BANKACCOUNT_CHEQUE',
'alpha') > 0 ?
GETPOST(
'CASHDESK_ID_BANKACCOUNT_CHEQUE',
'alpha') :
''),
'chaine', 0,
'', $conf->entity);
57 $res =
dolibarr_set_const($db,
"CASHDESK_ID_BANKACCOUNT_CB", (
GETPOST(
'CASHDESK_ID_BANKACCOUNT_CB',
'alpha') > 0 ?
GETPOST(
'CASHDESK_ID_BANKACCOUNT_CB',
'alpha') :
''),
'chaine', 0,
'', $conf->entity);
58 $res =
dolibarr_set_const($db,
"CASHDESK_ID_WAREHOUSE", (
GETPOST(
'CASHDESK_ID_WAREHOUSE',
'alpha') > 0 ?
GETPOST(
'CASHDESK_ID_WAREHOUSE',
'alpha') :
''),
'chaine', 0,
'', $conf->entity);
59 $res =
dolibarr_set_const($db,
"CASHDESK_NO_DECREASE_STOCK",
GETPOST(
'CASHDESK_NO_DECREASE_STOCK',
'alpha'),
'chaine', 0,
'', $conf->entity);
60 $res =
dolibarr_set_const($db,
"CASHDESK_SERVICES",
GETPOST(
'CASHDESK_SERVICES',
'alpha'),
'chaine', 0,
'', $conf->entity);
61 $res =
dolibarr_set_const($db,
"CASHDESK_DOLIBAR_RECEIPT_PRINTER",
GETPOST(
'CASHDESK_DOLIBAR_RECEIPT_PRINTER',
'alpha'),
'chaine', 0,
'', $conf->entity);
65 if (!($res > 0)) $error++;
81 $form =
new Form($db);
84 llxHeader(
'', $langs->trans(
"CashDeskSetup"));
86 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
92 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="post">';
93 print
'<input type="hidden" name="token" value="'.newToken().
'">';
94 print
'<input type="hidden" name="action" value="set">';
96 if (!empty($conf->service->enabled))
98 print
'<table class="noborder centpercent">';
99 print
'<tr class="liste_titre">';
100 print
'<td>'.$langs->trans(
"Parameters").
'</td><td>'.$langs->trans(
"Value").
'</td>';
103 print
'<tr class="oddeven"><td>';
104 print $langs->trans(
"CashdeskShowServices");
105 print
'<td colspan="2">';
106 print $form->selectyesno(
"CASHDESK_SERVICES", $conf->global->CASHDESK_SERVICES, 1);
107 print
"</td></tr>\n";
115 print
'<table class="noborder centpercent">';
116 print
'<tr class="liste_titre">';
117 print
'<td>'.$langs->trans(
"Terminal").
' 0</td><td>'.$langs->trans(
"Value").
'</td>';
120 print
'<tr class="oddeven"><td width=\"50%\">'.$langs->trans(
"CashDeskThirdPartyForSell").
'</td>';
121 print
'<td colspan="2">';
122 print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY,
'socid',
'(s.client in (1,3) AND s.status = 1)', 1, 0, 0, array(), 0);
124 if (!empty($conf->banque->enabled))
126 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForSell").
'</td>';
127 print
'<td colspan="2">';
128 $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CASH,
'CASHDESK_ID_BANKACCOUNT_CASH', 0,
"courant=2", 1);
132 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForCheque").
'</td>';
133 print
'<td colspan="2">';
134 $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CHEQUE,
'CASHDESK_ID_BANKACCOUNT_CHEQUE', 0,
"courant=1", 1);
138 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskBankAccountForCB").
'</td>';
139 print
'<td colspan="2">';
140 $form->select_comptes($conf->global->CASHDESK_ID_BANKACCOUNT_CB,
'CASHDESK_ID_BANKACCOUNT_CB', 0,
"courant=1", 1);
144 if (!empty($conf->stock->enabled))
146 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskDoNotDecreaseStock").
'</td>';
147 print
'<td colspan="2">';
148 if (empty($conf->productbatch->enabled)) {
149 print $form->selectyesno(
'CASHDESK_NO_DECREASE_STOCK', $conf->global->CASHDESK_NO_DECREASE_STOCK, 1);
151 if (!$conf->global->CASHDESK_NO_DECREASE_STOCK) {
152 $res =
dolibarr_set_const($db,
"CASHDESK_NO_DECREASE_STOCK", 1,
'chaine', 0,
'', $conf->entity);
154 print $langs->trans(
"Yes").
'<br>';
155 print
'<span class="opacitymedium">'.$langs->trans(
'StockDecreaseForPointOfSaleDisabledbyBatch').
'</span>';
159 $disabled = $conf->global->CASHDESK_NO_DECREASE_STOCK;
162 print
'<tr class="oddeven"><td>'.$langs->trans(
"CashDeskIdWareHouse").
'</td>';
163 print
'<td colspan="2">';
166 print $formproduct->selectWarehouses($conf->global->CASHDESK_ID_WAREHOUSE,
'CASHDESK_ID_WAREHOUSE',
'', 1, $disabled);
167 print
' <a href="'.DOL_URL_ROOT.
'/product/stock/card.php?action=create&backtopage='.urlencode(
$_SERVER[
"PHP_SELF"]).
'">('.$langs->trans(
"Create").
')</a>';
169 print
'<span class="opacitymedium">'.$langs->trans(
"StockDecreaseForPointOfSaleDisabled").
'</span>';
175 if (!empty($conf->receiptprinter->enabled))
177 print
'<tr class="oddeven"><td>';
178 print $langs->trans(
"DolibarrReceiptPrinter").
' ('.$langs->trans(
"FeatureNotYetAvailable").
')';
179 print
'<td colspan="2">';
180 print $form->selectyesno(
"CASHDESK_DOLIBAR_RECEIPT_PRINTER", $conf->global->CASHDESK_DOLIBAR_RECEIPT_PRINTER, 1);
181 print
"</td></tr>\n";
187 print
'<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'"></div>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.