dolibarr 21.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 Frédéric France <frederic.france@free.fr>
10 * Copyright (C) 2024 Nick Fragoulis
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 3 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <https://www.gnu.org/licenses/>.
24 */
25
31// Load Dolibarr environment
32require '../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
39require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
40require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
41
51// Load translation files required by the page
52$langs->loadLangs(array('admin', 'bills', 'companies', 'languages', 'members', 'other', 'products', 'propal', 'receptions', 'stocks', 'trips', 'orders'));
53
54if (!$user->admin) {
56}
57
58$action = GETPOST('action', 'aZ09');
59
60
61/*
62 * Actions
63 */
64
65if ($action == 'update') {
66 if (GETPOSTISSET('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')) {
67 dolibarr_set_const($db, "MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", GETPOST("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING"), 'chaine', 0, '', $conf->entity);
68 }
69 if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTTERM')) {
70 dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTTERM", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTTERM"), 'chaine', 0, '', $conf->entity);
71 }
72 if (GETPOSTISSET('PROPOSAL_PDF_HIDE_PAYMENTMODE')) {
73 dolibarr_set_const($db, "PROPOSAL_PDF_HIDE_PAYMENTMODE", GETPOST("PROPOSAL_PDF_HIDE_PAYMENTMODE"), 'chaine', 0, '', $conf->entity);
74 }
75 if (GETPOSTISSET('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')) {
76 dolibarr_set_const($db, "MAIN_GENERATE_PROPOSALS_WITH_PICTURE", GETPOST("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), 'chaine', 0, '', $conf->entity);
77 }
78 if (GETPOSTISSET('SALES_ORDER_SHOW_SHIPPING_ADDRESS')) {
79 dolibarr_set_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", GETPOSTINT("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity);
80 dolibarr_del_const($db, "SALES_ORDER_SHOW_SHIPPING_ADDRESS", $conf->entity);
81 }
82 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE')) {
83 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);
84 }
85 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN')) {
86 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);
87 }
88 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE')) {
89 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);
90 }
91 if (GETPOSTISSET('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN')) {
92 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);
93 }
94 if (GETPOSTISSET('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')) {
95 dolibarr_set_const($db, "MAIN_DOCUMENTS_WITH_PICTURE_WIDTH", GETPOSTINT("MAIN_DOCUMENTS_WITH_PICTURE_WIDTH"), 'chaine', 0, '', $conf->entity);
96 }
97 if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')) {
98 dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_PROPAL", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", 'int'), 'chaine', 0, '', $conf->entity);
99 }
100 if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_ORDER')) {
101 dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_ORDER", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_ORDER", 'int'), 'chaine', 0, '', $conf->entity);
102 }
103 if (GETPOSTISSET('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')) {
104 dolibarr_set_const($db, "MAIN_PDF_ADD_TERMSOFSALE_INVOICE", GETPOST("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", 'int'), 'chaine', 0, '', $conf->entity);
105 }
106 if (GETPOSTISSET('INVOICE_ADD_ZATCA_QR_CODE')) {
107 dolibarr_set_const($db, "INVOICE_ADD_ZATCA_QR_CODE", GETPOSTINT("INVOICE_ADD_ZATCA_QR_CODE"), 'chaine', 0, '', $conf->entity);
108 if (GETPOSTINT('INVOICE_ADD_ZATCA_QR_CODE') == 1) {
109 dolibarr_del_const($db, "INVOICE_ADD_SWISS_QR_CODE", $conf->entity);
110 }
111 }
112 if (GETPOSTISSET('INVOICE_ADD_EPC_QR_CODE')) {
113 dolibarr_set_const($db, "INVOICE_ADD_EPC_QR_CODE", GETPOST("INVOICE_ADD_EPC_QR_CODE", 'int'), 'chaine', 0, '', $conf->entity);
114 if (GETPOSTINT('INVOICE_ADD_EPC_QR_CODE') == 1) {
115 dolibarr_del_const($db, "INVOICE_ADD_EPC_QR_CODE", $conf->entity);
116 }
117 }
118 if (GETPOSTISSET('INVOICE_ADD_SWISS_QR_CODE')) {
119 dolibarr_set_const($db, "INVOICE_ADD_SWISS_QR_CODE", GETPOST("INVOICE_ADD_SWISS_QR_CODE", 'alpha'), 'chaine', 0, '', $conf->entity);
120 if (GETPOST('INVOICE_ADD_SWISS_QR_CODE', 'alpha') != '0') {
121 dolibarr_del_const($db, "INVOICE_ADD_ZATCA_QR_CODE", $conf->entity);
122 }
123 }
124 if (GETPOSTISSET('INVOICE_CATEGORY_OF_OPERATION')) {
125 dolibarr_set_const($db, "INVOICE_CATEGORY_OF_OPERATION", GETPOSTINT("INVOICE_CATEGORY_OF_OPERATION"), 'chaine', 0, '', $conf->entity);
126 }
127 if (GETPOSTISSET('INVOICE_SHOW_SHIPPING_ADDRESS')) {
128 dolibarr_set_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", GETPOSTINT("INVOICE_SHOW_SHIPPING_ADDRESS"), 'chaine', 0, '', $conf->entity);
129 dolibarr_del_const($db, "INVOICE_SHOW_SHIPPING_ADDRESS", $conf->entity);
130 }
131 if (GETPOSTISSET('PDF_INVOICE_SHOW_VAT_ANALYSIS')) {
132 dolibarr_set_const($db, "PDF_INVOICE_SHOW_VAT_ANALYSIS", GETPOSTINT("PDF_INVOICE_SHOW_VAT_ANALYSIS"), 'chaine', 0, '', $conf->entity);
133 dolibarr_del_const($db, "PDF_INVOICE_SHOW_VAT_ANALYSIS", $conf->entity);
134 }
135 if (GETPOSTISSET('BARCODE_ON_SHIPPING_PDF')) {
136 dolibarr_set_const($db, "BARCODE_ON_SHIPPING_PDF", GETPOSTINT("BARCODE_ON_SHIPPING_PDF"), 'chaine', 0, '', $conf->entity);
137 }
138 if (GETPOSTISSET('BARCODE_ON_RECEPTION_PDF')) {
139 dolibarr_set_const($db, "BARCODE_ON_RECEPTION_PDF", GETPOSTINT("BARCODE_ON_RECEPTION_PDF"), 'chaine', 0, '', $conf->entity);
140 }
141 if (GETPOSTISSET('BARCODE_ON_STOCKTRANSFER_PDF')) {
142 dolibarr_set_const($db, "BARCODE_ON_STOCKTRANSFER_PDF", GETPOSTINT("BARCODE_ON_STOCKTRANSFER_PDF"), 'chaine', 0, '', $conf->entity);
143 }
144
145 // Terms of sale
146 if ($_FILES['termsofsale']["name"]) {
147 if (!preg_match('/(\.pdf)$/i', $_FILES['termsofsale']["name"])) { // Document can be used on a lot of different places. Only pdf can be supported.
148 $langs->load("errors");
149 setEventMessages($langs->trans("ErrorBadFormat"), null, 'errors');
150 } else {
151 $dirforterms = $conf->mycompany->dir_output.'/';
152 $original_file = $_FILES['termsofsale']["name"];
153 $result = dol_move_uploaded_file($_FILES['termsofsale']["tmp_name"], $dirforterms.$original_file, 1, 0, $_FILES['termsofsale']['error']);
154 if ($result) {
155 dolibarr_set_const($db, 'MAIN_INFO_SOCIETE_TERMSOFSALE', $original_file, 'chaine', 0, '', $conf->entity);
156 }
157 }
158 }
159
160 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
161
162 header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
163 exit;
164}
165
166
167// Terms of sale
168if ($action == 'removetermsofsale') {
169 require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
170
171 $filename = $mysoc->termsofsale;
172 $file = $conf->mycompany->dir_output.'/'.$filename;
173
174 if ($filename != '') {
175 dol_delete_file($file);
176 }
177 dolibarr_del_const($db, 'MAIN_INFO_SOCIETE_TERMSOFSALE', $conf->entity);
178
179 $mysoc->termsofsale = '';
180}
181
182
183/*
184 * View
185 */
186
187$wikihelp = 'EN:First_setup|FR:Premiers_param&eacute;trages|ES:Primeras_configuraciones';
188llxHeader('', $langs->trans("Setup"), $wikihelp, '', 0, 0, '', '', '', 'mod-admin page-pdf_other');
189
190$form = new Form($db);
191$formother = new FormOther($db);
192$formadmin = new FormAdmin($db);
193$formfile = new FormFile($db);
194
195print load_fiche_titre($langs->trans("PDF"), '', 'title_setup');
196
197$head = pdf_admin_prepare_head();
198
199print dol_get_fiche_head($head, 'other', '', -1, '');
200
201$tooltiptext = '';
202print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
203print "<br>\n";
204
205print '<form enctype="multipart/form-data" method="post" action="'.$_SERVER["PHP_SELF"].'">';
206print '<input type="hidden" name="token" value="'.newToken().'">';
207print '<input type="hidden" name="action" value="update">';
208
209if (isModEnabled('propal')) {
210 print load_fiche_titre($langs->trans("Proposal"), '', 'proposal');
211
212 print '<div class="div-table-responsive-no-min">';
213 print '<table summary="more" class="noborder centpercent">';
214 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
215
216 /* This feature seems not yet used into Dolibarr. So option is kept hidden and enabled by default
217 print '<tr class="oddeven"><td>';
218 print $form->textwithpicto($langs->trans("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING"), '');
219 print '</td><td>';
220 if ($conf->use_javascript_ajax) {
221 print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING');
222 } else {
223 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
224 print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING);
225 }
226 print '</td></tr>';
227 */
228
229 print '<tr class="oddeven"><td>';
230 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp"));
231 print '</td><td>';
232 if ($conf->use_javascript_ajax) {
233 print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL');
234 } else {
235 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
236 print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL);
237 }
238 print '</td></tr>';
239
240 print '<tr class="oddeven"><td>';
241 print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral"));
242 print '</td><td>';
243 if ($conf->use_javascript_ajax) {
244 print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
245 } else {
246 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
247 print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE);
248 }
249 print '</td></tr>';
250
251 print '</table>';
252 print '</div>';
253}
254
255if (isModEnabled('order')) {
256 print load_fiche_titre($langs->trans("Orders"), '', 'bill');
257
258 print '<div class="div-table-responsive-no-min">';
259 print '<table summary="more" class="noborder centpercent">';
260 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
261 print '<tr class="oddeven"><td>';
262 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp"));
263 print '</td><td>';
264 if ($conf->use_javascript_ajax) {
265 print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER');
266 } else {
267 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
268 print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER);
269 }
270 print '</td></tr>';
271 print '</table>';
272 print '</div>';
273}
274
275if (isModEnabled('order')) {
276 $langs->load("orders");
277 print load_fiche_titre($langs->trans('CustomersOrders'), '', 'order');
278
279 print '<div class="div-table-responsive-no-min">';
280 print '<table summary="more" class="noborder centpercent">';
281 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
282
283 print '<tr class="oddeven"><td>';
284 print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore"));
285 print '</td><td>';
286 if ($conf->use_javascript_ajax) {
287 print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS');
288 } else {
289 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
290 print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS);
291 }
292 print '</td></tr>';
293
294 print '</table>';
295 print '</div>';
296}
297
298
299if (isModEnabled('supplier_proposal')) {
300 $langs->load("supplier_proposal");
301 print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal');
302
303 print '<div class="div-table-responsive-no-min">';
304 print '<table summary="more" class="noborder centpercent">';
305 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
306
307 print '<tr class="oddeven"><td>';
308 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), '');
309 print '</td><td>';
310 if ($conf->use_javascript_ajax) {
311 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE');
312 } else {
313 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
314 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE);
315 }
316 print '</td></tr>';
317
318 print '<tr class="oddeven"><td>';
319 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), '');
320 print '</td><td>';
321 if ($conf->use_javascript_ajax) {
322 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN');
323 } else {
324 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
325 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN);
326 }
327 print '</td></tr>';
328
329 print '</table>';
330 print '</div>';
331}
332
333
334if (isModEnabled('supplier_order')) {
335 $langs->load("supplier_order");
336 print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal');
337
338 print '<div class="div-table-responsive-no-min">';
339 print '<table summary="more" class="noborder centpercent">';
340 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
341
342 print '<tr class="oddeven"><td>';
343 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), '');
344 print '</td><td>';
345 if ($conf->use_javascript_ajax) {
346 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE');
347 } else {
348 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
349 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE);
350 }
351 print '</td></tr>';
352
353 print '<tr class="oddeven"><td>';
354 print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), '');
355 print '</td><td>';
356 if ($conf->use_javascript_ajax) {
357 print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN');
358 } else {
359 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
360 print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN);
361 }
362 print '</td></tr>';
363
364 print '</table>';
365 print '</div>';
366}
367
368if (isModEnabled('invoice')) {
369 print load_fiche_titre($langs->trans("Invoices"), '', 'bill');
370
371 print '<div class="div-table-responsive-no-min">';
372 print '<table summary="more" class="noborder centpercent">';
373 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
374
375 print '<tr class="oddeven"><td>';
376 print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp"));
377 print '</td><td>';
378 if ($conf->use_javascript_ajax) {
379 print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE');
380 } else {
381 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
382 print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_INVOICE);
383 }
384 print '</td></tr>';
385 print '<tr class="oddeven"><td>';
386 print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore"));
387 print '</td><td>';
388 if ($conf->use_javascript_ajax) {
389 print ajax_constantonoff('INVOICE_ADD_ZATCA_QR_CODE');
390 } else {
391 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
392 print $form->selectarray("INVOICE_ADD_ZATCA_QR_CODE", $arrval, getDolGlobalString('INVOICE_ADD_ZATCA_QR_CODE'));
393 }
394 print '</td></tr>';
395
396 print '<tr class="oddeven"><td>';
397 print $form->textwithpicto($langs->trans("INVOICE_ADD_EPC_QR_CODE"), $langs->trans("INVOICE_ADD_EPC_QR_CODEMore"));
398 print '</td><td>';
399 if ($conf->use_javascript_ajax) {
400 print ajax_constantonoff('INVOICE_ADD_EPC_QR_CODE');
401 } else {
402 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
403 print $form->selectarray("INVOICE_ADD_EPC_QR_CODE", $arrval, getDolGlobalString('INVOICE_ADD_EPC_QR_CODE'));
404 }
405 print '</td></tr>';
406
407 print '<tr class="oddeven"><td>';
408 if (getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE') == 'bottom') {
409 print $form->textwithpicto($langs->trans("INVOICE_ADD_SWISS_QR_CODE"), $langs->trans("INVOICE_ADD_SWISS_QR_CODEMore"));
410 } else {
411 print $langs->trans("INVOICE_ADD_SWISS_QR_CODE");
412 }
413 print '</td><td>';
414 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
415 if (getDolGlobalString('MAIN_FEATURES_LEVEL') >= 1) {
416 $arrval['bottom'] = $langs->trans("AtBottomOfPage").' ('.$langs->trans("Experimental").' - Need PHP 8.1+ and some PHP libs)';
417 }
418 print $form->selectarray("INVOICE_ADD_SWISS_QR_CODE", $arrval, getDolGlobalString('INVOICE_ADD_SWISS_QR_CODE'));
419 print '</td></tr>';
420
421 // Mention category of operations
422 // French Decret n°2099-1299 2022-10-07
423 print '<tr class="oddeven"><td>';
424 print $form->textwithpicto($langs->trans("InvoiceOptionCategoryOfOperations"), $langs->trans('InvoiceOptionCategoryOfOperationsHelp'), 1);
425 print '</td><td>';
426 $arrval = array('0'=>$langs->trans("No"),
427 '1'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes1"),
428 '2'=>$langs->trans("InvoiceOptionCategoryOfOperationsYes2")
429 );
430 print $form->selectarray("INVOICE_CATEGORY_OF_OPERATION", $arrval, getDolGlobalString('INVOICE_CATEGORY_OF_OPERATION'), 0, 0, 0, '', 0, 0, 0, '', 'minwidth75imp');
431 print '</td></tr>';
432
433 print '<tr class="oddeven"><td>';
434 print $form->textwithpicto($langs->trans("INVOICE_SHOW_SHIPPING_ADDRESS"), $langs->trans("INVOICE_SHOW_SHIPPING_ADDRESSMore"));
435 print '</td><td>';
436 if ($conf->use_javascript_ajax) {
437 print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS');
438 } else {
439 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
440 print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS);
441 }
442 print '</td></tr>';
443
444 /* too late to have it enabled by default in v21
445 print '<tr class="oddeven"><td>';
446 print $form->textwithpicto($langs->trans("PDF_INVOICE_SHOW_VAT_ANALYSIS"), '');
447 print '</td><td>';
448 if ($conf->use_javascript_ajax) {
449 print ajax_constantonoff('PDF_INVOICE_SHOW_VAT_ANALYSIS');
450 } else {
451 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
452 print $form->selectarray("PDF_INVOICE_SHOW_VAT_ANALYSIS", $arrval, $conf->global->PDF_INVOICE_SHOW_VAT_ANALYSIS);
453 }
454 print '</td></tr>';
455 */
456
457 /* Keep this option hidden for the moment to avoid options inflation. We'll see later if it is used enough...
458 print '<tr class="oddeven"><td>';
459 print $form->textwithpicto($langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT"), $langs->trans("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACTMore"));
460 print '</td><td>';
461 if ($conf->use_javascript_ajax) {
462 print ajax_constantonoff('SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT');
463 } else {
464 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
465 print $form->selectarray("SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT", $arrval, $conf->global->SUPPLIER_PROPOSAL_ADD_BILLING_CONTACT);
466 }
467 print '</td></tr>';
468 */
469
470 print '</table>';
471 print '</div>';
472}
473
474if (isModEnabled('shipping')) {
475 print load_fiche_titre($langs->trans("Shipments"), '', 'shipment');
476
477 print '<div class="div-table-responsive-no-min">';
478 print '<table summary="more" class="noborder centpercent">';
479 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
480
481 print '<tr class="oddeven"><td>';
482 print $langs->trans("BARCODE_ON_SHIPPING_PDF");
483 print '</td><td>';
484 if ($conf->use_javascript_ajax) {
485 print ajax_constantonoff('BARCODE_ON_SHIPPING_PDF');
486 } else {
487 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
488 print $form->selectarray("BARCODE_ON_SHIPPING_PDF", $arrval, getDolGlobalString('BARCODE_ON_SHIPPING_PDF'));
489 }
490 print '</td></tr>';
491 print '</table>';
492 print '</div>';
493}
494
495
496if (isModEnabled('reception')) {
497 print load_fiche_titre($langs->trans("Receptions"), '', 'reception');
498
499 print '<div class="div-table-responsive-no-min">';
500 print '<table summary="more" class="noborder centpercent">';
501 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
502
503 print '<tr class="oddeven"><td>';
504 print $langs->trans("RECEPTION_PDF_HIDE_ORDERED");
505 print '</td><td>';
506 if ($conf->use_javascript_ajax) {
507 print ajax_constantonoff('RECEPTION_PDF_HIDE_ORDERED');
508 } else {
509 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
510 print $form->selectarray("RECEPTION_PDF_HIDE_ORDERED", $arrval, getDolGlobalString('RECEPTION_PDF_HIDE_ORDERED'));
511 }
512 print '</td></tr>';
513
514 print '<tr class="oddeven"><td>';
515 print $langs->trans("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT");
516 print '</td><td>';
517 if ($conf->use_javascript_ajax) {
518 print ajax_constantonoff('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT');
519 } else {
520 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
521 print $form->selectarray("MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT", $arrval, getDolGlobalString('MAIN_PDF_RECEPTION_DISPLAY_AMOUNT_HT'));
522 }
523 print '</td></tr>';
524
525 print '<tr class="oddeven"><td>';
526 print $langs->trans("BARCODE_ON_RECEPTION_PDF");
527 print '</td><td>';
528 if ($conf->use_javascript_ajax) {
529 print ajax_constantonoff('BARCODE_ON_RECEPTION_PDF');
530 } else {
531 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
532 print $form->selectarray("BARCODE_ON_RECEPTION_PDF", $arrval, getDolGlobalString('BARCODE_ON_RECEPTION_PDF'));
533 }
534 print '</td></tr>';
535 print '</table>';
536 print '</div>';
537}
538
539if (isModEnabled('stocktransfer')) {
540 print load_fiche_titre($langs->trans("StockTransfer"), '', 'stock');
541
542 print '<div class="div-table-responsive-no-min">';
543 print '<table summary="more" class="noborder centpercent">';
544 print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
545
546 print '<tr class="oddeven"><td>';
547 print $langs->trans("BARCODE_ON_STOCKTRANSFER_PDF");
548 print '</td><td>';
549 if ($conf->use_javascript_ajax) {
550 print ajax_constantonoff('BARCODE_ON_STOCKTRANSFER_PDF');
551 } else {
552 $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
553 print $form->selectarray("BARCODE_ON_STOCKTRANSFER_PDF", $arrval, getDolGlobalString('BARCODE_ON_STOCKTRANSFER_PDF'));
554 }
555 print '</td></tr>';
556
557 print '</table>';
558 print '</div>';
559}
560
561print load_fiche_titre($langs->trans("Files"), '', 'file');
562print '<div class="div-table-responsive-no-min">';
563print '<table summary="more" class="noborder centpercent">';
564print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameters").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
565
566// Terms of sale
567$tooltiptermsofsale = $langs->trans('AvailableFormats').' : pdf';
568$maxfilesizearray = getMaxFileSizeArray();
569$tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '<br>'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : '';
570$documenturl = DOL_URL_ROOT.'/document.php';
571if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) {
572 $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP;
573}
574$modulepart = 'mycompany';
575
576print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("TERMSOFSALE"), $tooltiptermsofsale).'</label></td><td>';
577print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
578print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="termsofsale" id="termsofsale" accept="application/pdf">';
579
580if (!empty($mysoc->termsofsale)) {
581 if (file_exists($conf->mycompany->dir_output.'/'.$mysoc->termsofsale)) {
582 print '<div class="inline-block valignmiddle marginrightonly"><a href="'.$documenturl.'?modulepart='.$modulepart.'&amp;file='.urlencode($mysoc->termsofsale).'">'.$mysoc->termsofsale.'</a>'.$formfile->showPreview($mysoc->termsofsale, $modulepart, $mysoc->termsofsale, 0, '');
583 print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removetermsofsale&token='.newToken().'">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
584 }
585}
586print '</div>';
587print '</td></tr>';
588print '</table>';
589print '</div>';
590
591print '<br><div class="center">';
592print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
593print '</div>';
594
595print '</form>';
596
597
598// End of page
599llxFooter();
600$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.
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:71
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 permettant la generation de composants html autre Only common components are here.
llxFooter()
Footer empty.
Definition document.php:107
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_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $nohook=0, $varfiles='addedfile', $upload_dir='')
Check validity of a file upload from an GUI page, and move it to its final destination.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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)
Show tabs of a record.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
pdf_admin_prepare_head()
Return array head with list of tabs to view object information.
Definition pdf.lib.php:48
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.