diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php index 7e46c10a341..5d35bfd1214 100644 --- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php +++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php @@ -57,11 +57,11 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos */ public function info() { - global $conf, $langs; + global $db, $langs; $langs->load('cashdesk@cashdesk'); - $form = new Form($this->db); + $form = new Form($db); $texte = $langs->trans('GenericNumRefModelDesc')."
\n"; $texte .= '
'; @@ -79,9 +79,9 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos // Parametrage du prefix $texte .= ''.$langs->trans("Mask").':'; - $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; + $texte .= ''.$form->textwithpicto('', $tooltip, 1, 1).''; - $texte .= '  '; + $texte .= '  '; $texte .= ''; @@ -121,12 +121,12 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos */ public function getNextValue($objsoc = null, $invoice = null, $mode = 'next') { - global $db, $conf; + global $db; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK; + $mask = getDolGlobalString('TAKEPOS_REF_UNIVERSAL_MASK'); if (!$mask) { $this->error = 'NotConfigured'; @@ -136,9 +136,10 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos // Get entities $entity = getEntity('invoicenumber', 1, $invoice); + $date = (empty($invoice->date) ? dol_now() : $invoice->date); $pos_source = is_object($invoice) && $invoice->pos_source > 0 ? $invoice->pos_source : 0; $mask = str_replace('{TN}', $pos_source, $mask); - $numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $invoice->date, $mode, false, null, $entity); + $numFinal = get_next_value($db, $mask, 'facture', 'ref', '', $objsoc, $date, $mode, false, null, $entity); return $numFinal; } diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index a7a3183fa33..cfa4e281e06 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -196,8 +196,8 @@ foreach ($dirmodels as $reldir) { } print ''."\n"; - print ''; - if ($conf->global->TAKEPOS_REF_ADDON == "$file") { + print ''; + if (getDolGlobalString('TAKEPOS_REF_ADDON') == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { print ''; @@ -277,7 +277,7 @@ if (!empty($conf->service->enabled)) { print ''; print $form->textwithpicto($langs->trans("RootCategoryForProductsToSell"), $langs->trans("RootCategoryForProductsToSellDesc")); print ''; -print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, $conf->global->TAKEPOS_ROOT_CATEGORY_ID, 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0); +print img_object('', 'category', 'class="paddingright"').$form->select_all_categories(Categorie::TYPE_PRODUCT, getDolGlobalInt('TAKEPOS_ROOT_CATEGORY_ID'), 'TAKEPOS_ROOT_CATEGORY_ID', 64, 0, 0); print ajax_combobox('TAKEPOS_ROOT_CATEGORY_ID'); print "\n";