dolibarr 24.0.0-beta
pdf_other.php
1<?php
2/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2012-2107 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2019 Ferran Marcet <fmarcet@2byte.es>
7 * Copyright (C) 2021-2024 Anthony Berton <anthony.berton@bb2a.fr>
8 * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
9 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
10 * Copyright (C) 2024-2025 Nick Fragoulis
11 * Copyright (C) 2025 William Mead <william@m34d.com>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 */
26
32// Load Dolibarr environment
33require '../main.inc.php';
42require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
43require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
44require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
45require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
46require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
47require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
48require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
49require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
50
51// Load translation files required by the page
52$langs->loadLangs(array('admin', 'bills', 'companies', 'languages', 'members', 'other', 'products', 'propal', 'receptions', 'stocks', 'trips', 'orders', 'sendings'));
53
54if (!$user->admin) {
56}
57
58$action = GETPOST('action', 'aZ09');
59$modulepart = GETPOST('modulepart', 'aZ09');
60
61$diroffile = '';
62$varname = '';
63if ($modulepart == 'propal') {
64 $diroffile = $conf->propal->dir_output;
65 $varname = 'MAIN_INFO_PROPAL_TERMSOFSALE';
66}
67if ($modulepart == 'order') {
68 $diroffile = $conf->order->dir_output;
69 $varname = 'MAIN_INFO_ORDER_TERMSOFSALE';
70}
71if ($modulepart == 'contrat') {
72 $diroffile = $conf->contract->dir_output;
73 $varname = 'MAIN_INFO_CONTRACT_TERMSOFSALE';
74}
75if ($modulepart == 'invoice') {
76 $diroffile = $conf->invoice->dir_output;
77 $varname = 'MAIN_INFO_INVOICE_TERMSOFSALE';
78}
79
80
81/*
82 * Actions
83 */
84
85if ($action == 'update') {
86 if (GETPOSTISSET('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) {
87 dolibarr_set_const($db, "MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", GETPOST("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING"), 'chaine', 0, '', $conf->entity);
88 }
89 if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) {
90 dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity);
91 }
92 if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTMODE')) {
93 dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTMODE", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTMODE"), 'chaine', 0, '', $conf->entity);
94 }
95 if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
96 dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
97 }
98 if (GETPOSTISSET('PROPOSAL_SHOW_SHIPPING_ADDRESS')) {
99 dolibarr_set_const($db, "PROPOSAL_SHOW_SHIPPING_ADDRESS", GETPOSTINT("PROPOSAL_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity);
100 }
101 if (GETPOSTISSET('SALES_ORDER_SHOW_SHIPPING_ADDRESS')) {
102 dolibarr_set_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", GETPOSTINT("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity);
103 dolibarr_del_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", $conf->entity);
104 }
105 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE')) {
106 dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", GETPOST("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), 'chaine', 0, '', $conf->entity);
107 }
108 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN')) {
109 dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", GETPOST("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), 'chaine', 0, '', $conf->entity);
110 }
111 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE')) {
112 dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", GETPOST("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), 'chaine', 0, '', $conf->entity);
113 }
114 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN')) {
115 dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", GETPOST("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), 'chaine', 0, '', $conf->entity);
116 }
117 if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) {
118 dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOSTINT("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH"), 'chaine', 0, '', $conf->entity);
119 }
120 if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) {
121 dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_PROPAL", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", 'int'), 'chaine', 0, '', $conf->entity);
122 }
123 if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
124 dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_ORDER", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_ORDER", 'int'), 'chaine', 0, '', $conf->entity);
125 }
126 if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_CONTRACT')) {
127 dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_CONTRACT", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_CONTRACT", 'int'), 'chaine', 0, '', $conf->entity);
128 }
129 if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
130 dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_INVOICE", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", 'int'), 'chaine', 0, '', $conf->entity);
131 }
132 if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) {
133 dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOSTINT("INVOICE_ADD_ZATCA_QR_CODE"), 'chaine', 0, '', $conf->entity);
134 if (GETPOSTINT('INVOICE_ADD_ZATCA_QR_CODE') == 1) {
135 dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity);
136 }
137 }
138 if (GETPOSTISSET('INVOICE_ADD_EPC_QR_CODE')) {
139 dolibarr_set_const($db, "INVOICE_ADD_EPC_QR_CODE", GETPOST("INVOICE_ADD_EPC_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
140 if (GETPOSTINT('INVOICE_ADD_EPC_QR_CODE') == 1) {
141 dolibarr_del_const($db, "INVOICE_ADD_EPC_QR_CODE", $conf->entity);
142 }
143 }
144 if (GETPOSTISSET('INVOICE_ADD_SWISS_QR_CODE')) {
145 dolibarr_set_const($db, "INVOICE_ADD_SWISS_QR_CODE", GETPOST("INVOICE_ADD_SWISS_QR_CODE", 'alpha'), 'chaine', 0, '', $conf->entity);
146 if (GETPOST('INVOICE_ADD_SWISS_QR_CODE', 'alpha') != '0') {
147 dolibarr_del_const($db, "INVOICE_ADD_ZATCA_QR_CODE", $conf->entity);
148 }
149 }
150 if (GETPOSTISSET('INVOICE_CATEGORY_OF_OPERATION')) {
151 dolibarr_set_const($db, "INVOICE_CATEGORY_OF_OPERATION", GETPOSTINT("INVOICE_CATEGORY_OF_OPERATION"), 'chaine', 0, '', $conf->entity);
152 }
153 if (GETPOSTISSET('INVOICE_SHOW_SHIPPING_ADDRESS')) {
154 dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOSTINT("INVOICE_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity);
155 dolibarr_del_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", $conf->entity);
156 }
157 if (GETPOSTISSET('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
158 dolibarr_set_const($db, "PDF_INVOICE_SHOW_VAT_ANALYSIS", GETPOSTINT("PDF_INVOICE_SHOW_VAT_ANALYSIS"), 'chaine', 0, '', $conf->entity);
159 dolibarr_del_const($db, "PDF_INVOICE_SHOW_VAT_ANALYSIS", $conf->entity);
160 }
161 if (GETPOSTISSET('PDF_INVOICE_SHOW_BALANCE_SUMMARY')) {
162 dolibarr_set_const($db, "PDF_INVOICE_SHOW_BALANCE_SUMMARY", GETPOSTINT("PDF_INVOICE_SHOW_BALANCE_SUMMARY"), 'chaine', 0, '', $conf->entity);
163 dolibarr_del_const($db, "PDF_INVOICE_SHOW_BALANCE_SUMMARY", $conf->entity);
164 }
165 if (GETPOSTISSET('INVOICE_HIDE_LINKED_OBJECT')) {
166 dolibarr_set_const($db, "INVOICE_HIDE_LINKED_OBJECT", GETPOSTINT("INVOICE_HIDE_LINKED_OBJECT"), 'chaine', 0, '', $conf->entity);
167 }
168 if (GETPOSTISSET('BARCODE_ON_SHIPPING_PDF')) {
169 dolibarr_set_const($db, "BARCODE_ON_SHIPPING_PDF", GETPOSTINT("BARCODE_ON_SHIPPING_PDF"), 'chaine', 0, '', $conf->entity);
170 }
171 if (GETPOSTISSET('BARCODE_ON_RECEPTION_PDF')) {
172 dolibarr_set_const($db, "BARCODE_ON_RECEPTION_PDF", GETPOSTINT("BARCODE_ON_RECEPTION_PDF"), 'chaine', 0, '', $conf->entity);
173 }
174 if (GETPOSTISSET('BARCODE_ON_STOCKTRANSFER_PDF')) {
175 dolibarr_set_const($db, "BARCODE_ON_STOCKTRANSFER_PDF", GETPOSTINT("BARCODE_ON_STOCKTRANSFER_PDF"), 'chaine', 0, '', $conf->entity);
176 }
177 // add a file to concat
178 $concat_options = array('MAIN_INFO_PROPAL_TERMSOFSALE', 'MAIN_INFO_ORDER_TERMSOFSALE', 'MAIN_INFO_CONTRACT_TERMSOFSALE', 'MAIN_INFO_INVOICE_TERMSOFSALE');
179 foreach ($concat_options as $varname) {
180 if (isset($_FILES[$varname]) && $_FILES[$varname]["name"]) {
181 if (!preg_match('/(\.pdf)$/i', $_FILES[$varname]["name"])) { // Document can be used on a lot of different places. Only pdf can be supported.
182 $langs->load("errors");
183 setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors');
184 } else {
185 switch ($varname) {
186 case 'MAIN_INFO_PROPAL_TERMSOFSALE':
187 $diroffile = $conf->propal->dir_output;
188 break;
189 case 'MAIN_INFO_ORDER_TERMSOFSALE':
190 $diroffile = $conf->order->dir_output;
191 break;
192 case 'MAIN_INFO_CONTRACT_TERMSOFSALE':
193 $diroffile = $conf->contract->dir_output;
194 break;
195 case 'MAIN_INFO_INVOICE_TERMSOFSALE':
196 $diroffile = $conf->invoice->dir_output;
197 break;
198 }
199 if ($diroffile) {
200 $dirforterms = $diroffile.'/';
201 $original_file = $_FILES[$varname]["name"];
202 $result = dol_move_uploaded_file($_FILES[$varname]["tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES[$varname]['error']);
203 if ((int) $result > 0) {
204 dolibarr_set_const($db, $varname, $original_file, 'chaine', 0, '', $conf->entity);
205 }
206 }
207 }
208 }
209 }
210
211 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
212
213 header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
214 exit;
215}
216// Remove file to concat
217if ($action == 'removetermsofsale') {
218 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
219
220 $filename = getDolGlobalString($varname);
221 if ($filename != '') {
222 $file = dol_sanitizePathName($diroffile).'/'.dol_sanitizeFileName($filename);
223 dol_delete_file($file);
224 }
225 dolibarr_del_const($db, $varname, $conf->entity);
226}
227
228
229/*
230 * View
231 */
232
233$wikihelp = 'EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
234llxHeader('', $langs->trans("Setup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-pdf_other');
235
236$form = new Form($db);
237$formother = new FormOther($db);
238$formadmin = new FormAdmin($db);
239$formfile = new FormFile($db);
240
241print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
242
243$head = pdf_admin_prepare_head();
244
245print dol_get_fiche_head($head, 'other', '', -1, '');
246
247$tooltiptext = '';
248print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
249print "<br>\n";
250
251
252$maxfilesizearray = getMaxFileSizeArray();
253$tooltipconcatpdf = ($maxfilesizearray['maxmin'] > 0) ? $langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
254
255$documenturl = getDolGlobalString('DOL_URL_ROOT_DOCUMENT_PHP', DOL_URL_ROOT.'/document.php');
256
257
258print '<form enctype="multipart/form-data" method="post" action="'.dolBuildUrl($_SERVER["PHP_SELF"]).'">';
259print '<input type="hidden" name="token" value="'.newToken().'">';
260print '<input type="hidden" name="action" value="update">';
261
262if (isModEnabled('propal')) {
263 print '<div id="proposal" class="anchorundermenu"></div>';
264
265 print load_fiche_titre($langs->trans("Proposal"), '', 'proposal');
266 print '<div class="div-table-responsive-no-min">';
267 print '<table summary="more" class="noborder centpercent">';
268 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
269
270 /* This feature seems not yet used into Dolibarr. So option is kept hidden and enabled by default
271 print '<tr class="oddeven"><td>';
272 print $form->textwithpicto($langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING"), '');
273 print '</td><td>';
274 if ($conf->use_javascript_ajax) {
275 print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
276 } else {
277 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
278 print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'));
279 }
280 print '</td></tr>';
281 */
282
283 print '<tr class="oddeven"><td>';
284 print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
285 print '</td><td>';
286 if ($conf->use_javascript_ajax) {
287 print ajax_constantonoff('PDF_PROPAL_SHOW_PRICE_INCL_TAX');
288 } else {
289 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
290 print $form->selectarray("PDF_PROPAL_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX'));
291 }
292 print '</td></tr>';
293
294 print '<tr class="oddeven"><td>';
295 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
296 print '</td><td>';
297 if ($conf->use_javascript_ajax) {
298 print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
299 } else {
300 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
301 print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'));
302 }
303 print '</td></tr>';
304
305 // Add delivery address option for proposals
306 print '<tr class="oddeven"><td>';
307 print $form->textwithpicto($langs->trans("PROPOSAL_SHOW_SHIPPING_ADDRESS"), $langs->trans("PROPOSAL_SHOW_SHIPPING_ADDRESSMore"));
308 print '</td><td>';
309 if ($conf->use_javascript_ajax) {
310 print ajax_constantonoff('PROPOSAL_SHOW_SHIPPING_ADDRESS');
311 } else {
312 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
313 print $form->selectarray("PROPOSAL_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('PROPOSAL_SHOW_SHIPPING_ADDRESS'));
314 }
315 print '</td></tr>';
316
317 // Concat PDF
318 print '<tr class="oddeven"><td>';
319 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $tooltipconcatpdf);
320 print '</td><td>';
321 if ($conf->use_javascript_ajax) {
322 print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL', array(), null, 0, 0, 1);
323 } else {
324 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
325 print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'));
326 }
327
328 if (getDolGlobalString("MAIN_PDF_ADD_TERMSOFSALE_PROPAL")) {
329 $modulepart = 'propal';
330 print '<div class="inline-block nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
331 print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="MAIN_INFO_PROPAL_TERMSOFSALE" id="MAIN_INFO_PROPAL_TERMSOFSALE" accept="application/pdf">';
332 print '</div>';
333 if (getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE")) {
334 $termofsale = getDolGlobalString("MAIN_INFO_PROPAL_TERMSOFSALE");
335 if (file_exists($conf->propal->dir_output.'/'.$termofsale)) {
336 $file = dol_dir_list($conf->propal->dir_output, 'files', 0, $termofsale);
337 print ' ';
338 print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '').'</div>';
339 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&modulepart='.$modulepart.'&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
340 }
341 }
342 print '</div>';
343 }
344 print '</td></tr>';
345
346 print '</table>';
347 print '</div>';
348
349 print '<br>';
350}
351
352if (isModEnabled('order')) {
353 print '<div id="order" class="anchorundermenu"></div>';
354
355 $langs->load("orders");
356 print load_fiche_titre($langs->trans('CustomersOrders'), '', 'order');
357
358 print '<div class="div-table-responsive-no-min">';
359 print '<table summary="more" class="noborder centpercent">';
360
361 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
362
363 print '<tr class="oddeven"><td>';
364 print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
365 print '</td><td>';
366 if ($conf->use_javascript_ajax) {
367 print ajax_constantonoff('PDF_ORDER_SHOW_PRICE_INCL_TAX');
368 } else {
369 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
370 print $form->selectarray("PDF_ORDER_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX'));
371 }
372 print '</td></tr>';
373
374 print '<tr class="oddeven"><td>';
375 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
376 print '</td><td>';
377 if ($conf->use_javascript_ajax) {
378 print ajax_constantonoff('MAIN_GENERATE_ORDERS_WITH_PICTURE');
379 } else {
380 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
381 print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE'));
382 }
383 print '</td></tr>';
384
385 print '<tr class="oddeven"><td>';
386 print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore"));
387 print '</td><td>';
388 if ($conf->use_javascript_ajax) {
389 print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS');
390 } else {
391 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
392 print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('SALES_ORDER_SHOW_SHIPPING_ADDRESS'));
393 }
394 print '</td></tr>';
395
396 // Concat PDF
397 print '<tr class="oddeven"><td>';
398 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), '');
399 print '</td><td>';
400 if ($conf->use_javascript_ajax) {
401 print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER', array(), null, 0, 0, 1);
402 } else {
403 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
404 print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_ORDER'));
405 }
406
407 if (getDolGlobalString("MAIN_PDF_ADD_TERMSOFSALE_ORDER")) {
408 $modulepart = 'order';
409 print '<div class="inline-block nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
410 print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="MAIN_INFO_ORDER_TERMSOFSALE" id="MAIN_INFO_ORDER_TERMSOFSALE" accept="application/pdf">';
411 print '</div>';
412 if (getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE")) {
413 $termofsale = getDolGlobalString("MAIN_INFO_ORDER_TERMSOFSALE");
414 if (file_exists($conf->order->dir_output.'/'.$termofsale)) {
415 $file = dol_dir_list($conf->order->dir_output, 'files', 0, $termofsale);
416 print ' ';
417 print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '').'</div>';
418 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&modulepart='.$modulepart.'&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
419 }
420 }
421 print '</div>';
422 }
423
424 print '</td></tr>';
425
426 print '</table>';
427 print '</div>';
428
429 print '<br>';
430}
431
432if (isModEnabled('contract')) {
433 print '<div id="contrat" class="anchorundermenu"></div>';
434
435 print load_fiche_titre($langs->trans("Contract"), '', 'contract');
436 print '<div class="div-table-responsive-no-min">';
437 print '<table summary="more" class="noborder centpercent">';
438 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
439
440 // Concat PDF
441 print '<tr class="oddeven"><td>';
442 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_CONTRACT"), $tooltipconcatpdf);
443 print '</td><td>';
444 if ($conf->use_javascript_ajax) {
445 print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_CONTRACT', array(), null, 0, 0, 1);
446 } else {
447 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
448 print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_CONTRACT", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_CONTRACT'));
449 }
450
451 if (getDolGlobalString("MAIN_PDF_ADD_TERMSOFSALE_CONTRACT")) {
452 $modulepart = 'contrat';
453 print '<div class="inline-block nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
454 print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="MAIN_INFO_CONTRACT_TERMSOFSALE" id="MAIN_INFO_CONTRACT_TERMSOFSALE" accept="application/pdf">';
455 print '</div>';
456 if (getDolGlobalString("MAIN_INFO_CONTRACT_TERMSOFSALE")) {
457 $termofsale = getDolGlobalString("MAIN_INFO_CONTRACT_TERMSOFSALE");
458 if (file_exists($conf->contract->dir_output.'/'.$termofsale)) {
459 $file = dol_dir_list($conf->contract->dir_output, 'files', 0, $termofsale);
460 print ' ';
461 print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '').'</div>';
462 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&modulepart='.$modulepart.'&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
463 }
464 }
465 print '</div>';
466 }
467 print '</td></tr>';
468
469 print '</table>';
470 print '</div>';
471
472 print '<br>';
473}
474
475
476if (isModEnabled('invoice')) {
477 print '<div id="invoice" class="anchorundermenu"></div>';
478
479 print load_fiche_titre($langs->trans("Invoices"), '', 'bill');
480
481 print '<div class="div-table-responsive-no-min">';
482 print '<table summary="more" class="noborder centpercent">';
483 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
484
485 print '<tr class="oddeven"><td>';
486 print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly"));
487 print '</td><td>';
488 if ($conf->use_javascript_ajax) {
489 print ajax_constantonoff('PDF_INVOICE_SHOW_PRICE_INCL_TAX');
490 } else {
491 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
492 print $form->selectarray("PDF_INVOICE_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_INVOICE_SHOW_PRICE_INCL_TAX'));
493 }
494 print '</td></tr>';
495
496 print '<tr class="oddeven"><td>';
497 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
498 print '</td><td>';
499 if ($conf->use_javascript_ajax) {
500 print ajax_constantonoff('MAIN_GENERATE_INVOICES_WITH_PICTURE');
501 } else {
502 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
503 print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE'));
504 }
505 print '</td></tr>';
506
507 print '<tr class="oddeven"><td>';
508 print $form->textwithpicto($langs->trans("INVOICE_SHOW_SHIPPING_ADDRESS"), $langs->trans("INVOICE_SHOW_SHIPPING_ADDRESSMore"));
509 print '</td><td>';
510 if ($conf->use_javascript_ajax) {
511 print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS');
512 } else {
513 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
514 print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('INVOICE_SHOW_SHIPPING_ADDRESS'));
515 }
516 print '</td></tr>';
517
518 // Concat PDF
519 print '<tr class="oddeven"><td>';
520 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), '');
521 print '</td><td>';
522 if ($conf->use_javascript_ajax) {
523 print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE', array(), null, 0, 0, 1);
524 } else {
525 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
526 print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'));
527 }
528
529 if (getDolGlobalString("MAIN_PDF_ADD_TERMSOFSALE_INVOICE")) {
530 $modulepart = 'invoice';
531 print '<div class="inline-block nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
532 print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="MAIN_INFO_INVOICE_TERMSOFSALE" id="MAIN_INFO_INVOICE_TERMSOFSALE" accept="application/pdf">';
533 print '</div>';
534 if (getDolGlobalString("MAIN_INFO_INVOICE_TERMSOFSALE")) {
535 $termofsale = getDolGlobalString("MAIN_INFO_INVOICE_TERMSOFSALE");
536 if (file_exists($conf->invoice->dir_output.'/'.$termofsale)) {
537 $file = dol_dir_list($conf->invoice->dir_output, 'files', 0, $termofsale);
538 print ' ';
539 print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&file='.urlencode($termofsale).'">'.$termofsale.'</a>'.$formfile->showPreview($file[0], $modulepart, $termofsale, 0, '').'</div>';
540 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&modulepart='.$modulepart.'&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
541 }
542 }
543 print '</div>';
544 }
545 print '</td></tr>';
546
547 // QR Codes
548 print '<tr class="oddeven"><td>';
549 print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore"));
550 print '</td><td>';
551 if ($conf->use_javascript_ajax) {
552 print ajax_constantonoff('INVOICE_ADD_ZATCA_QR_CODE');
553 } else {
554 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
555 print $form->selectarray("INVOICE_ADD_ZATCA_QR_CODE", $arrval, getDolGlobalString('INVOICE_ADD_ZATCA_QR_CODE'));
556 }
557 print '</td></tr>';
558
559 print '<tr class="oddeven"><td>';
560 print $form->textwithpicto($langs->trans("INVOICE_ADD_EPC_QR_CODE"), $langs->trans("INVOICE_ADD_EPC_QR_CODEMore"));
561 print '</td><td>';
562 if ($conf->use_javascript_ajax) {
563 print ajax_constantonoff('INVOICE_ADD_EPC_QR_CODE');
564 } else {
565 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
566 print $form->selectarray("INVOICE_ADD_EPC_QR_CODE", $arrval, getDolGlobalString('INVOICE_ADD_EPC_QR_CODE'));
567 }
568 print '</td></tr>';
569
570 print '<tr class="oddeven"><td>';
571 if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') == 'bottom') {
572 print $form->textwithpicto($langs->trans("INVOICE_ADD_SWISS_QR_CODE"), $langs->trans("INVOICE_ADD_SWISS_QR_CODEMore"));
573 } else {
574 print $langs->trans("INVOICE_ADD_SWISS_QR_CODE");
575 }
576 print '</td><td>';
577 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
578 if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 1) {
579 $arrval['bottom'] = $langs->trans("AtBottomOfPage").' ('.$langs->trans("Experimental").' - Need PHP 8.1+ and some PHP libs)';
580 }
581 print $form->selectarray("INVOICE_ADD_SWISS_QR_CODE", $arrval, getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE'));
582 print '</td></tr>';
583
584 // Mention category of operations
585 // French Decret n°2099-1299 2022-10-07
586 print '<tr class="oddeven"><td>';
587 print $form->textwithpicto($langs->trans("InvoiceOptionCategoryOfOperations"), $langs->trans('InvoiceOptionCategoryOfOperationsHelp'), 1);
588 print '</td><td>';
589 $arrval = array('0'=>$langs->trans("No"),
590 '1'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes1"),
591 '2'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes2")
592 );
593 print $form->selectarray("INVOICE_CATEGORY_OF_OPERATION", $arrval, getDolGlobalString('INVOICE_CATEGORY_OF_OPERATION'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
594 print '</td></tr>';
595
596 print '<tr class="oddeven"><td>';
597 print $form->textwithpicto($langs->trans("PDF_INVOICE_SHOW_VAT_ANALYSIS"), '');
598 print '</td><td>';
599 if ($conf->use_javascript_ajax) {
600 print ajax_constantonoff('PDF_INVOICE_SHOW_VAT_ANALYSIS');
601 } else {
602 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
603 print $form->selectarray("PDF_INVOICE_SHOW_VAT_ANALYSIS", $arrval, getDolGlobalInt('PDF_INVOICE_SHOW_VAT_ANALYSIS'));
604 }
605 print '</td></tr>';
606
607
608 print '<tr class="oddeven"><td>';
609 print $form->textwithpicto($langs->trans("PDF_INVOICE_SHOW_BALANCE_SUMMARY"), '');
610 print '</td><td>';
611 if ($conf->use_javascript_ajax) {
612 print ajax_constantonoff('PDF_INVOICE_SHOW_BALANCE_SUMMARY');
613 } else {
614 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
615 print $form->selectarray("PDF_INVOICE_SHOW_BALANCE_SUMMARY", $arrval, getDolGlobalInt('PDF_INVOICE_SHOW_BALANCE_SUMMARY'));
616 }
617 print '</td></tr>';
618
619 /* Keep this option hidden for the moment to avoid options inflation. We'll see later if it is used enough...
620 print '<tr class="oddeven"><td>';
621 print $form->textwithpicto($langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT"), $langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACTMore"));
622 print '</td><td>';
623 if ($conf->use_javascript_ajax) {
624 print ajax_constantonoff('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT');
625 } else {
626 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
627 print $form->selectarray("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT", $arrval, getDolGlobalInt('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT'));
628 }
629 print '</td></tr>';
630 */
631 print '<tr class="oddeven"><td>';
632 print $form->textwithpicto($langs->trans("INVOICE_HIDE_LINKED_OBJECT"), $langs->trans("INVOICE_HIDE_LINKED_OBJECTMore"));
633 print '</td><td>';
634 if ($conf->use_javascript_ajax) {
635 print ajax_constantonoff('INVOICE_HIDE_LINKED_OBJECT');
636 } else {
637 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
638 print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT'));
639 }
640 print '</td></tr>';
641
642 print '</table>';
643 print '</div>';
644
645 print '<br>';
646}
647
648
649if (isModEnabled('supplier_proposal')) {
650 print '<div id="supplier_proposal"></div>';
651
652 $langs->load("supplier_proposal");
653 print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal');
654
655 print '<div class="div-table-responsive-no-min">';
656 print '<table summary="more" class="noborder centpercent">';
657 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
658
659 print '<tr class="oddeven"><td>';
660 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), '');
661 print '</td><td>';
662 if ($conf->use_javascript_ajax) {
663 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE');
664 } else {
665 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
666 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'));
667 }
668 print '</td></tr>';
669
670 print '<tr class="oddeven"><td>';
671 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), '');
672 print '</td><td>';
673 if ($conf->use_javascript_ajax) {
674 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN');
675 } else {
676 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
677 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'));
678 }
679 print '</td></tr>';
680
681 print '</table>';
682 print '</div>';
683
684 print '<br>';
685}
686
687
688if (isModEnabled('supplier_order')) {
689 print '<div id="supplier_order"></div>';
690
691 $langs->load("supplier_order");
692 print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal');
693
694 print '<div class="div-table-responsive-no-min">';
695 print '<table summary="more" class="noborder centpercent">';
696 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px"></td></tr>';
697
698 print '<tr class="oddeven"><td>';
699 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), '');
700 print '</td><td>';
701 if ($conf->use_javascript_ajax) {
702 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE');
703 } else {
704 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
705 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'));
706 }
707 print '</td></tr>';
708
709 print '<tr class="oddeven"><td>';
710 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), '');
711 print '</td><td>';
712 if ($conf->use_javascript_ajax) {
713 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN');
714 } else {
715 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
716 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'));
717 }
718 print '</td></tr>';
719
720 print '</table>';
721 print '</div>';
722
723 print '<br>';
724}
725
726if (isModEnabled('shipping')) {
727 print '<div id="shipping"></div>';
728
729 print load_fiche_titre($langs->trans("Shipments"), '', 'shipment');
730
731 print '<div class="div-table-responsive-no-min">';
732 print '<table summary="more" class="noborder centpercent">';
733 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
734
735 print '<tr class="oddeven"><td>';
736 print $langs->trans("BARCODE_ON_SHIPPING_PDF");
737 print '</td><td>';
738 if ($conf->use_javascript_ajax) {
739 print ajax_constantonoff('BARCODE_ON_SHIPPING_PDF');
740 } else {
741 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
742 print $form->selectarray("BARCODE_ON_SHIPPING_PDF", $arrval, getDolGlobalString('BARCODE_ON_SHIPPING_PDF'));
743 }
744 print '</td></tr>';
745 print '</table>';
746 print '</div>';
747
748 print '<br>';
749}
750
751if (isModEnabled('reception')) {
752 print '<div id="reception"></div>';
753
754 print load_fiche_titre($langs->trans("Receptions"), '', 'reception');
755
756 print '<div class="div-table-responsive-no-min">';
757 print '<table summary="more" class="noborder centpercent">';
758 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
759
760 print '<tr class="oddeven"><td>';
761 print $langs->trans("RECEPTION_PDF_HIDE_ORDERED");
762 print '</td><td>';
763 if ($conf->use_javascript_ajax) {
764 print ajax_constantonoff('RECEPTION_PDF_HIDE_ORDERED');
765 } else {
766 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
767 print $form->selectarray("RECEPTION_PDF_HIDE_ORDERED", $arrval, getDolGlobalString('RECEPTION_PDF_HIDE_ORDERED'));
768 }
769 print '</td></tr>';
770
771 print '<tr class="oddeven"><td>';
772 print $langs->trans("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT");
773 print '</td><td>';
774 if ($conf->use_javascript_ajax) {
775 print ajax_constantonoff('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT');
776 } else {
777 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
778 print $form->selectarray("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT", $arrval, getDolGlobalString('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT'));
779 }
780 print '</td></tr>';
781
782 print '<tr class="oddeven"><td>';
783 print $langs->trans("BARCODE_ON_RECEPTION_PDF");
784 print '</td><td>';
785 if ($conf->use_javascript_ajax) {
786 print ajax_constantonoff('BARCODE_ON_RECEPTION_PDF');
787 } else {
788 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
789 print $form->selectarray("BARCODE_ON_RECEPTION_PDF", $arrval, getDolGlobalString('BARCODE_ON_RECEPTION_PDF'));
790 }
791 print '</td></tr>';
792 print '</table>';
793 print '</div>';
794
795 print '<br>';
796}
797
798if (isModEnabled('stocktransfer')) {
799 print '<div id="stocktransfer"></div>';
800
801 print load_fiche_titre($langs->trans("StockTransfer"), '', 'stock');
802
803 print '<div class="div-table-responsive-no-min">';
804 print '<table summary="more" class="noborder centpercent">';
805 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px"></td></tr>';
806
807 print '<tr class="oddeven"><td>';
808 print $langs->trans("BARCODE_ON_STOCKTRANSFER_PDF");
809 print '</td><td>';
810 if ($conf->use_javascript_ajax) {
811 print ajax_constantonoff('BARCODE_ON_STOCKTRANSFER_PDF');
812 } else {
813 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
814 print $form->selectarray("BARCODE_ON_STOCKTRANSFER_PDF", $arrval, getDolGlobalString('BARCODE_ON_STOCKTRANSFER_PDF'));
815 }
816 print '</td></tr>';
817
818 print '</table>';
819 print '</div>';
820
821 print '<br>';
822}
823
824print '<br><div class="center">';
825print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
826print '</div>';
827
828print '</form>';
829
830
831// End of page
832llxFooter();
833$db->close();
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).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to generate html code for admin pages.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to help generate other html components Only common components are here.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_delete_file($file, $disableglob=0, $nophperrors=0, $nohook=0, $object=null, $allowdotdot=false, $indexdatabase=1, $nolog=0)
Remove a file or several files with a mask.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
Definition files.lib.php:64
dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $keyforsourcefile='addedfile', $upload_dir='', $mode=0)
Check validity of a file upload from an GUI page, and move it to its final destination.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dol_sanitizePathName($str, $newstr='_', $unaccent=0, $allowdash=0)
Clean a string to use it as a path name.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1, $includequotes=0, $allowdash=0)
Clean a string to use it as a file name.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
pdf_admin_prepare_head()
Return array head with list of tabs to view object information.
Definition pdf.lib.php:49
getMaxFileSizeArray()
Return the max allowed for file upload.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.