diff --git a/ChangeLog b/ChangeLog index ef931857be0..1697b668934 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,7 +49,6 @@ NEW: Add employment anniversary in birthday box NEW: Add extrafield type "IP" to store IP addresses NEW: Add fail2ban rules examples to limit access to /public pages NEW: Add filter "Product subject to lot/Serial" in stock per lot/serial -NEW: Add free membership amounts at the membership type level NEW: Add hidden option MAIN_EMAIL_SUPPORT_ACK to restore Email ack checkbox (feature abandonned by mailers) NEW: Add IMAP port setting on email collector module NEW: Adding JAPAN Chart-of-Account and regions/departments @@ -67,7 +66,6 @@ NEW: Add option --force on CLI cron_run_jobs.php NEW: Add option "Show price on the generated documents for receptions" NEW: Add performance index (name for company and contact) and llx_bank_url(url_id) NEW: Add picto property on sub-module for password generation -NEW: Add price to product box in TakePOS NEW: add redirect on action confirm addconsumedline and addproduceline NEW: Add a new advanced permission "read price" NEW: Add substitution key __SENDEREMAIL_SIGNATURE__ @@ -89,18 +87,11 @@ NEW: Can set a commercial discount by entering amount including VAT NEW: Can set a monthly frequency (or multiple) in cron tasks. NEW: Can set start and end dates and comment on button "Activate all services" NEW: can sort and preselected best supplier price -NEW: Website Can delete a whole website if disabled -NEW: Website Can remove a website template -NEW: Website can set header "Strict-Transport-Security" in web sites. -NEW: Website Can switch status of website and page from the website toolbar -NEW: Website Templates of websites are now directories and not zip into core repo -NEW: Website Add 4 other templates in website module NEW: Can use products categories to make inventory NEW: Change filter type on tickets list into a multiselect combo NEW: conf TIMESPENT_ALWAYS_UPDATE_THM, when it's on we always check current thm of user to update it in task time line NEW: constant PROPAL_NEW_AS_SIGNED NEW: show date delivery planned on orders linked to company and product -NEW: default_lang for members NEW: Default template of contract is not mandatory NEW: Default values in extrafields are not more limited to 255 char. NEW: display currency in takepos menu @@ -108,11 +99,21 @@ NEW: Enable online signature for interventions NEW: Encrypt all sensitive constants in llx_const NEW: extrafield price with currency NEW: filter on reception dates (from / to) in cheque paiement card -NEW: TakePOS Header Scroll in TakePOS -NEW: TakePOS Add setup parameters, can setup terminal name -NEW: TakePOS support of Stripe Terminal with Takepos -NEW: TakePOS Receipt preview in TakePOS setup -NEW: TakePOS different product list on smartphone +NEW: Members: default_lang for members +NEW: Members: Table of membership types +NEW: Members: add free membership amounts at the membership type level +NEW: TakePOS: Header Scroll in TakePOS +NEW: TakePOS: add price to product box in TakePOS +NEW: TakePOS: add setup parameters, can setup terminal name +NEW: TakePOS: support of Stripe Terminal with TakePOS +NEW: TakePOS: Receipt preview in TakePOS setup +NEW: TakePOS: different product list on smartphone +NEW: Website: can delete a whole website if disabled +NEW: Website: can remove a website template +NEW: Website: can set header "Strict-Transport-Security" in web sites. +NEW: Website: can switch status of website and page from the website toolbar +NEW: Website: Templates of websites are now directories and not zip into core repo +NEW: Website: add 4 other templates in website module NEW: If we select another view list mode, we keep it NEW: Init module bookcal NEW: Introduce dolEncrypt and dolDecrypt to be able to encrypt data in db @@ -121,7 +122,7 @@ NEW: invoice export : add accounting affectation NEW: label on products categories filter NEW: The link "add to bookmark" is always on top in the bookmark popup NEW: MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS const to show category customer filter -NEW: Make module WebservicesClient deprecated. Use module WebHook instead +NEW: Make module WebservicesClient deprecated. Use module WebHook instead. NEW: manage no email with thirdparties (better for GDPR) NEW: Manage Position (Rank) on Contract Lines NEW: Manage VAT on all lines on purchases cycle @@ -159,7 +160,6 @@ NEW: SMTP using oauth2 authentication NEW: can substitue project title in mail template NEW: Supplier order list - Add column private and public note NEW: Support IP type in extrafields -NEW: Table of membership types NEW: The purge of files can purge only if older than a number of seconds NEW: Update ActionComm type_code on email message ticket NEW: VAT - Admin - Add information on deadline day for submission of VAT declaration diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php index b2164e80175..c883de79c5e 100644 --- a/htdocs/core/modules/product/mod_codeproduct_elephant.php +++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php @@ -139,7 +139,7 @@ class mod_codeproduct_elephant extends ModeleProductCode * Return an example of result returned by getNextValue * * @param Translate $langs Object langs - * @param product $objproduct Object product + * @param Product $objproduct Object product * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return string example */ diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php index f7578d696f6..5819821f814 100644 --- a/htdocs/core/modules/product/mod_codeproduct_leopard.php +++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php @@ -33,10 +33,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php' class mod_codeproduct_leopard extends ModeleProductCode { /* - * Attention ce module est utilise par defaut si aucun module n'a - * ete definit dans la configuration + * Please note this module is used by default if no module has been defined in the configuration * - * Le fonctionnement de celui-ci doit donc rester le plus ouvert possible + * Its operation must therefore remain as open as possible */ /** @@ -100,7 +99,7 @@ class mod_codeproduct_leopard extends ModeleProductCode /** * Return an example of result returned by getNextValue * - * @param product $objproduct Object product + * @param Product $objproduct Object product * @param int $type Type of third party (1:customer, 2:supplier, -1:autodetect) * @return string Return next value */ diff --git a/htdocs/core/modules/product_batch/mod_lot_advanced.php b/htdocs/core/modules/product_batch/mod_lot_advanced.php index 0e108b6b021..d6128573f97 100644 --- a/htdocs/core/modules/product_batch/mod_lot_advanced.php +++ b/htdocs/core/modules/product_batch/mod_lot_advanced.php @@ -132,7 +132,7 @@ class mod_lot_advanced extends ModeleNumRefBatch * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return string Value if KO, <0 if KO */ public function getNextValue($objsoc, $object) @@ -143,6 +143,15 @@ class mod_lot_advanced extends ModeleNumRefBatch // We get cursor rule $mask = getDolGlobalString('LOT_ADVANCED_MASK'); + $filter = ''; + if (getDolGlobalString('PRODUCTBATCH_LOT_USE_PRODUCT_MASKS') && !empty($object->fk_product)) { + $product = new Product($db); + $res = $product->fetch($object->fk_product); + if ($res > 0 && !empty($product->batch_mask)) { + $mask = $product->batch_mask; + $filter = ''; + } + } if (!$mask) { $this->error = 'NotConfigured'; @@ -151,7 +160,7 @@ class mod_lot_advanced extends ModeleNumRefBatch $date = dol_now(); - $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', '', null, $date); + $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', $filter, null, $date); return $numFinal; } diff --git a/htdocs/core/modules/product_batch/mod_lot_free.php b/htdocs/core/modules/product_batch/mod_lot_free.php index d6b24945ab0..8d14a25374f 100644 --- a/htdocs/core/modules/product_batch/mod_lot_free.php +++ b/htdocs/core/modules/product_batch/mod_lot_free.php @@ -1,6 +1,7 @@ * Copyright (C) 2006-2009 Laurent Destailleur + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,16 +27,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product_batch/modules_product_batch.class.php'; /** - * \class mod_codeproduct_leopard - * \brief Classe permettant la gestion leopard des codes produits + * \class mod_lot_free + * \brief Class allowing lot_free management of batch numbers */ class mod_lot_free extends ModeleNumRefBatch { /* - * Attention ce module est utilise par defaut si aucun module n'a - * ete definit dans la configuration + * Please note this module is used by default if no module has been defined in the configuration * - * Le fonctionnement de celui-ci doit donc rester le plus ouvert possible + * Its operation must therefore remain as open as possible */ @@ -44,7 +44,10 @@ class mod_lot_free extends ModeleNumRefBatch */ public $name = 'lot_free'; - public $code_modifiable; // Code modifiable + /** + * @var string Code modifiable + */ + public $code_modifiable; public $code_modifiable_invalide; // Code modifiable si il est invalide @@ -94,12 +97,11 @@ class mod_lot_free extends ModeleNumRefBatch * Return an example of result returned by getNextValue * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return string Return next value */ public function getNextValue($objsoc, $object) { - global $langs; return ''; } } diff --git a/htdocs/core/modules/product_batch/mod_lot_standard.php b/htdocs/core/modules/product_batch/mod_lot_standard.php index fc8d1389a00..ef3918fd167 100644 --- a/htdocs/core/modules/product_batch/mod_lot_standard.php +++ b/htdocs/core/modules/product_batch/mod_lot_standard.php @@ -112,7 +112,7 @@ class mod_lot_standard extends ModeleNumRefBatch * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return string Value if KO, <0 if KO */ public function getNextValue($objsoc, $object) diff --git a/htdocs/core/modules/product_batch/mod_sn_advanced.php b/htdocs/core/modules/product_batch/mod_sn_advanced.php index f8d61c43c61..6c796f06c3b 100644 --- a/htdocs/core/modules/product_batch/mod_sn_advanced.php +++ b/htdocs/core/modules/product_batch/mod_sn_advanced.php @@ -132,7 +132,7 @@ class mod_sn_advanced extends ModeleNumRefBatch * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return string Value if KO, <0 if KO */ public function getNextValue($objsoc, $object) @@ -144,6 +144,16 @@ class mod_sn_advanced extends ModeleNumRefBatch // We get cursor rule $mask = getDolGlobalString('SN_ADVANCED_MASK'); + $filter = ''; + if (getDolGlobalString('PRODUCTBATCH_SN_USE_PRODUCT_MASKS') && !empty($object->fk_product)) { + $product = new Product($db); + $res = $product->fetch($object->fk_product); + if ($res > 0 && !empty($product->batch_mask)) { + $mask = $product->batch_mask; + $filter = ''; + } + } + if (!$mask) { $this->error = 'NotConfigured'; return 0; @@ -151,7 +161,7 @@ class mod_sn_advanced extends ModeleNumRefBatch $date = dol_now(); - $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', '', null, $date); + $numFinal = get_next_value($db, $mask, 'product_lot', 'batch', $filter, null, $date); return $numFinal; } diff --git a/htdocs/core/modules/product_batch/mod_sn_free.php b/htdocs/core/modules/product_batch/mod_sn_free.php index f6b2417d34b..8ada51fb93b 100644 --- a/htdocs/core/modules/product_batch/mod_sn_free.php +++ b/htdocs/core/modules/product_batch/mod_sn_free.php @@ -93,7 +93,7 @@ class mod_sn_free extends ModeleNumRefBatch * Return an example of result returned by getNextValue * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return string Return next value */ public function getNextValue($objsoc, $object) diff --git a/htdocs/core/modules/product_batch/mod_sn_standard.php b/htdocs/core/modules/product_batch/mod_sn_standard.php index d6c109cff81..ccd49d03b8f 100644 --- a/htdocs/core/modules/product_batch/mod_sn_standard.php +++ b/htdocs/core/modules/product_batch/mod_sn_standard.php @@ -112,7 +112,7 @@ class mod_sn_standard extends ModeleNumRefBatch * Return next free value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return string Value if KO, <0 if KO */ public function getNextValue($objsoc, $object) diff --git a/htdocs/core/modules/product_batch/modules_product_batch.class.php b/htdocs/core/modules/product_batch/modules_product_batch.class.php index 42d4d052bfe..ea64bd98609 100644 --- a/htdocs/core/modules/product_batch/modules_product_batch.class.php +++ b/htdocs/core/modules/product_batch/modules_product_batch.class.php @@ -125,7 +125,7 @@ abstract class ModeleNumRefBatch * Returns next assigned value * * @param Societe $objsoc Object thirdparty - * @param Object $object Object we need next value for + * @param Productlot $object Object we need next value for * @return string Valeur */ public function getNextValue($objsoc, $object) diff --git a/htdocs/exports/class/export.class.php b/htdocs/exports/class/export.class.php index cf0383dd08c..4b8be1dc74d 100644 --- a/htdocs/exports/class/export.class.php +++ b/htdocs/exports/class/export.class.php @@ -175,21 +175,21 @@ class Export $this->array_export_perms[$i] = $bool; // Icon $this->array_export_icon[$i] = (isset($module->export_icon[$r]) ? $module->export_icon[$r] : $module->picto); - // Code du dataset export + // Code of the export dataset / Code du dataset export $this->array_export_code[$i] = $module->export_code[$r]; // Define a key for sort $this->array_export_code_for_sort[$i] = $module->module_position.'_'.$module->export_code[$r]; // Add a key into the module - // Libelle du dataset export + // Export Dataset Label / Libelle du dataset export $this->array_export_label[$i] = $module->getExportDatasetLabel($r); - // Tableau des champ a exporter (cle=champ, valeur=libelle) + // Table of fields to export / Tableau des champ a exporter (cle=champ, valeur=libelle) $this->array_export_fields[$i] = $module->export_fields_array[$r]; - // Tableau des champs a filtrer (cle=champ, valeur1=type de donnees) on verifie que le module a des filtres + // Table of fields to be filtered / Tableau des champs a filtrer (cle=champ, valeur1=type de donnees) on verifie que le module a des filtres $this->array_export_TypeFields[$i] = (isset($module->export_TypeFields_array[$r]) ? $module->export_TypeFields_array[$r] : ''); - // Tableau des entites a exporter (cle=champ, valeur=entite) + // Table of entities for export / Tableau des entites a exporter (cle=champ, valeur=entite) $this->array_export_entities[$i] = $module->export_entities_array[$r]; // Tableau des entites qui requiert abandon du DISTINCT (cle=entite, valeur=champ id child records) $this->array_export_dependencies[$i] = (!empty($module->export_dependencies_array[$r]) ? $module->export_dependencies_array[$r] : ''); - // Tableau des operations speciales sur champ + // Table of special field operations / Tableau des operations speciales sur champ $this->array_export_special[$i] = (!empty($module->export_special_array[$r]) ? $module->export_special_array[$r] : ''); // Array of examples $this->array_export_examplevalues[$i] = (!empty($module->export_examplevalues_array[$r]) ? $module->export_examplevalues_array[$r] : null); @@ -461,9 +461,9 @@ class Export } break; case 'List': - // 0 : Type du champ - // 1 : Nom de la table - // 2 : Nom du champ contenant le libelle + // 0 : Type of the field / Type du champ + // 1 : Name of the table / Nom de la table + // 2 : Name of the field containing the label / Nom du champ contenant le libelle // 3 : Name of field with key (if it is not "rowid"). Used this field as key for combo list. // 4 : Name of element for getEntity(). diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 4eca4b1734a..2016172c381 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -68,6 +68,7 @@ ShipmentBackToDraftInDolibarr=Shipment %s go back to draft status ShipmentDeletedInDolibarr=Shipment %s deleted ShipmentCanceledInDolibarr=Shipment %s canceled ReceptionValidatedInDolibarr=Reception %s validated +ReceptionDeletedInDolibarr=Reception %s deleted ReceptionClassifyClosedInDolibarr=Reception %s classified closed OrderCreatedInDolibarr=Order %s created OrderValidatedInDolibarr=Order %s validated @@ -177,4 +178,4 @@ AddReminder=Create an automatic reminder notification for this event ErrorReminderActionCommCreation=Error creating the reminder notification for this event BrowserPush=Browser Popup Notification ActiveByDefault=Enabled by default -Until=until \ No newline at end of file +Until=until diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index bb6d9b2a084..e962b385931 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -1002,7 +1002,8 @@ class Product extends CommonObject $this->ref = dol_string_nospecial(trim($this->ref)); $this->label = trim($this->label); $this->description = trim($this->description); - $this->note = (isset($this->note) ? trim($this->note) : null); + $this->note_private = (isset($this->note_private) ? trim($this->note_private) : null); + $this->note_public = (isset($this->note_public) ? trim($this->note_public) : null); $this->net_measure = price2num($this->net_measure); $this->net_measure_units = trim($this->net_measure_units); $this->weight = price2num($this->weight); @@ -1197,7 +1198,8 @@ class Product extends CommonObject $sql .= ", fk_state = ".($this->state_id > 0 ? (int) $this->state_id : 'null'); $sql .= ", lifetime = ".($this->lifetime > 0 ? (int) $this->lifetime : 'null'); $sql .= ", qc_frequency = ".($this->qc_frequency > 0 ? (int) $this->qc_frequency : 'null'); - $sql .= ", note = ".(isset($this->note) ? "'".$this->db->escape($this->note)."'" : 'null'); + $sql .= ", note = ".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : 'null'); + $sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null'); $sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'"; if (empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { $sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'"; diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 7009d0d55fc..6fe855543c9 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -110,10 +110,13 @@ class Productlot extends CommonObject public $entity; /** - * @var int ID + * @var int Product ID */ public $fk_product; + /** + * @var string batch ref + */ public $batch; public $eatby = ''; public $sellby = ''; @@ -126,15 +129,18 @@ class Productlot extends CommonObject public $tms = ''; /** - * @var int ID + * @var int user ID */ public $fk_user_creat; /** - * @var int ID + * @var int user ID */ public $fk_user_modif; + /** + * @var string import key + */ public $import_key; @@ -241,9 +247,6 @@ class Productlot extends CommonObject } if (!$error && !$notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action to call a trigger. - // Call triggers $result = $this->call_trigger('PRODUCTLOT_CREATE', $user); if ($result < 0) { diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 07311b3368f..8ae9744a8dd 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -11,6 +11,7 @@ * Copyright (C) 2015 Claudio Aschieri * Copyright (C) 2016-2022 Ferran Marcet * Copyright (C) 2018 Quentin Vial-Gouteyron + * Copyright (C) 2022 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,6 +116,9 @@ class Reception extends CommonObject public $meths; public $listmeths; // List of carriers + /** + * @var CommandeFournisseurDispatch[] + */ public $lines = array(); diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 5d72fed725f..e18f6987a33 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -1986,6 +1986,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $object->town = GETPOST('town', 'alphanohtml'); $object->country_id = GETPOST('country_id') ?GETPOST('country_id', 'int') : $mysoc->country_id; $object->state_id = GETPOST('state_id', 'int'); + $object->parent = GETPOST('parent_company_id', 'int'); $object->socialnetworks = array(); if (isModEnabled('socialnetworks')) { @@ -2614,6 +2615,16 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $parameters = array('socid'=>$socid, 'colspan' => ' colspan="3"', 'colspanvalue' => '3'); include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php'; + // Parent company + if (empty($conf->global->SOCIETE_DISABLE_PARENTCOMPANY)) { + print ''; + print ''.$langs->trans('ParentCompany').''; + print ''; + print img_picto('', 'company', 'class="paddingrightonly"'); + print $form->select_company(GETPOST('parent_company_id') ? GETPOST('parent_company_id') : $object->parent, 'parent_company_id', '', 'SelectThirdParty', 0, 0, null, 0, 'minwidth300 maxwidth500 widthcentpercentminusxx'); + print ''; + } + // Webservices url/key if (!empty($conf->syncsupplierwebservices->enabled)) { print ''.$form->editfieldkey('WebServiceURL', 'webservices_url', '', $object, 0).'';