diff --git a/ChangeLog b/ChangeLog index 9682b0bd3bc..b1e050e14e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,21 +12,20 @@ NEW: Module Reception (for a more accurate management of your receptions) moved WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: -* Properties ->contactid have been renamed into ->contact_id -* Properties ->titre have been renamed into ->title -* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english) -* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in - your email templates. -* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom - days of holiday. +* The object "livraison" has been renamed into "delivery" (directory, class, keys, methods with livraison in name ...). +* All properties ->contactid have been renamed into ->contact_id +* All properties ->titre have been renamed into ->title +* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id * Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency. +* The deprecated subsitution key __SIGNATURE__ has been removed. Use __USER_SIGNATURE__ if you used the old syntax in your email templates. +* The hidden option HOLIDAY_MORE_PUBLIC_HOLIDAYS has been removed. Use instead the dictionary table if you need to define custom days of holiday. * If you build a class that implement CommonObject to use the incoterm properties or methods (->fk_incoterm, ->label_incoterm, ->location_incoterm), you must now also include declaration of the Trait 'CommonIncoterm' in your class. All incoterm functions were moved into this Trait. * The GETPOST(..., 'alpha') has now the same behaviour than GETPOST(..., 'alphanohtml') so no html will be allowed. Use GETPOST(..., 'restricthtml') to accept HTML. -* If you have links in your code with '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors. -* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of amount. +* If you have links in your code with '&action=add', '&action=update', '&action=delete' as a parameter, you must also add '&token='.newToken() as another parameter to avoid CSRF protection errors. +* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of simple amount. * The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed. -* Depreciate all methods with name valide(). Use instead methods validate(). +* Depreciate all methods with name ->valide(). Use instead methods ->validate(). ***** ChangeLog for 12.0.3 compared to 12.0.2 ***** diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec index 039dafd198f..628ef917c05 100755 --- a/build/rpm/dolibarr_fedora.spec +++ b/build/rpm/dolibarr_fedora.spec @@ -181,6 +181,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/debugbar +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/emailcollector @@ -198,7 +199,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec index 098a041680a..aefc375d961 100755 --- a/build/rpm/dolibarr_generic.spec +++ b/build/rpm/dolibarr_generic.spec @@ -261,6 +261,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/debugbar +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/emailcollector @@ -278,7 +279,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec index a3f2d1d8d96..bcccb7c02a4 100755 --- a/build/rpm/dolibarr_mandriva.spec +++ b/build/rpm/dolibarr_mandriva.spec @@ -177,6 +177,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/custom %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/debugbar %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm @@ -195,7 +196,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index 5b1b86b28f4..8a55dd84faa 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -189,6 +189,7 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/debugbar +%_datadir/dolibarr/htdocs/delivery %_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/emailcollector @@ -206,7 +207,6 @@ done >>%{name}.lang %_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt -%_datadir/dolibarr/htdocs/livraison %_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/margin diff --git a/dev/initdata/purge-data.php b/dev/initdata/purge-data.php index e6a67aa73c8..18256c33766 100755 --- a/dev/initdata/purge-data.php +++ b/dev/initdata/purge-data.php @@ -120,8 +120,8 @@ $sqls=array( "DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'", ), 'delivery'=>array( - "DELETE FROM ".MAIN_DB_PREFIX."livraisondet WHERE fk_livraison IN (select rowid FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__')", - "DELETE FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__'", + "DELETE FROM ".MAIN_DB_PREFIX."deliverydet WHERE fk_delivery IN (select rowid FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__')", + "DELETE FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__'", ), 'contract'=>array( "DELETE FROM ".MAIN_DB_PREFIX."contratdet_extrafields WHERE fk_object IN (select rowid FROM ".MAIN_DB_PREFIX."contratdet WHERE fk_contrat IN (select rowid FROM ".MAIN_DB_PREFIX."contrat where datec < '__DATE__'))", diff --git a/dev/initdemo/mysqldump_dolibarr_12.0.0.sql b/dev/initdemo/mysqldump_dolibarr_12.0.0.sql index eba3113014c..a05c05c066e 100644 --- a/dev/initdemo/mysqldump_dolibarr_12.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_12.0.0.sql @@ -7522,13 +7522,13 @@ INSERT INTO `llx_links` VALUES (1,1,'2018-01-16 16:45:35','http://www.dolicloud. UNLOCK TABLES; -- --- Table structure for table `llx_livraison` +-- Table structure for table `llx_delivery` -- -DROP TABLE IF EXISTS `llx_livraison`; +DROP TABLE IF EXISTS `llx_delivery`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraison` ( +CREATE TABLE `llx_delivery` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `ref` varchar(30) COLLATE utf8_unicode_ci NOT NULL, @@ -7554,61 +7554,61 @@ CREATE TABLE `llx_livraison` ( `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `extraparams` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), - UNIQUE KEY `idx_livraison_uk_ref` (`ref`,`entity`), - KEY `idx_livraison_fk_soc` (`fk_soc`), - KEY `idx_livraison_fk_user_author` (`fk_user_author`), - KEY `idx_livraison_fk_user_valid` (`fk_user_valid`), - CONSTRAINT `fk_livraison_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), - CONSTRAINT `fk_livraison_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), - CONSTRAINT `fk_livraison_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) + UNIQUE KEY `idx_delivery_uk_ref` (`ref`,`entity`), + KEY `idx_delivery_fk_soc` (`fk_soc`), + KEY `idx_delivery_fk_user_author` (`fk_user_author`), + KEY `idx_delivery_fk_user_valid` (`fk_user_valid`), + CONSTRAINT `fk_delivery_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), + CONSTRAINT `fk_delivery_fk_user_author` FOREIGN KEY (`fk_user_author`) REFERENCES `llx_user` (`rowid`), + CONSTRAINT `fk_delivery_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `llx_livraison` +-- Dumping data for table `llx_delivery` -- -LOCK TABLES `llx_livraison` WRITE; -/*!40000 ALTER TABLE `llx_livraison` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraison` ENABLE KEYS */; +LOCK TABLES `llx_delivery` WRITE; +/*!40000 ALTER TABLE `llx_delivery` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_delivery` ENABLE KEYS */; UNLOCK TABLES; -- --- Table structure for table `llx_livraison_extrafields` +-- Table structure for table `llx_delivery_extrafields` -- -DROP TABLE IF EXISTS `llx_livraison_extrafields`; +DROP TABLE IF EXISTS `llx_delivery_extrafields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraison_extrafields` ( +CREATE TABLE `llx_delivery_extrafields` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `fk_object` int(11) NOT NULL, `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), - KEY `idx_livraison_extrafields` (`fk_object`) + KEY `idx_delivery_extrafields` (`fk_object`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `llx_livraison_extrafields` +-- Dumping data for table `llx_delivery_extrafields` -- -LOCK TABLES `llx_livraison_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_livraison_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraison_extrafields` ENABLE KEYS */; +LOCK TABLES `llx_delivery_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_delivery_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_delivery_extrafields` ENABLE KEYS */; UNLOCK TABLES; -- --- Table structure for table `llx_livraisondet` +-- Table structure for table `llx_deliverydet` -- -DROP TABLE IF EXISTS `llx_livraisondet`; +DROP TABLE IF EXISTS `llx_deliverydet`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraisondet` ( +CREATE TABLE `llx_deliverydet` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, - `fk_livraison` int(11) DEFAULT NULL, + `fk_delivery` int(11) DEFAULT NULL, `fk_origin_line` int(11) DEFAULT NULL, `fk_product` int(11) DEFAULT NULL, `description` text COLLATE utf8_unicode_ci DEFAULT NULL, @@ -7617,44 +7617,44 @@ CREATE TABLE `llx_livraisondet` ( `total_ht` double(24,8) DEFAULT 0.00000000, `rang` int(11) DEFAULT 0, PRIMARY KEY (`rowid`), - KEY `idx_livraisondet_fk_expedition` (`fk_livraison`), - CONSTRAINT `fk_livraisondet_fk_livraison` FOREIGN KEY (`fk_livraison`) REFERENCES `llx_livraison` (`rowid`) + KEY `idx_deliverydet_fk_expedition` (`fk_delivery`), + CONSTRAINT `fk_deliverydet_fk_delivery` FOREIGN KEY (`fk_delivery`) REFERENCES `llx_delivery` (`rowid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `llx_livraisondet` +-- Dumping data for table `llx_deliverydet` -- -LOCK TABLES `llx_livraisondet` WRITE; -/*!40000 ALTER TABLE `llx_livraisondet` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraisondet` ENABLE KEYS */; +LOCK TABLES `llx_deliverydet` WRITE; +/*!40000 ALTER TABLE `llx_deliverydet` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_deliverydet` ENABLE KEYS */; UNLOCK TABLES; -- --- Table structure for table `llx_livraisondet_extrafields` +-- Table structure for table `llx_deliverydet_extrafields` -- -DROP TABLE IF EXISTS `llx_livraisondet_extrafields`; +DROP TABLE IF EXISTS `llx_deliverydet_extrafields`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `llx_livraisondet_extrafields` ( +CREATE TABLE `llx_deliverydet_extrafields` ( `rowid` int(11) NOT NULL AUTO_INCREMENT, `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `fk_object` int(11) NOT NULL, `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`rowid`), - KEY `idx_livraisondet_extrafields` (`fk_object`) + KEY `idx_deliverydet_extrafields` (`fk_object`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `llx_livraisondet_extrafields` +-- Dumping data for table `llx_deliverydet_extrafields` -- -LOCK TABLES `llx_livraisondet_extrafields` WRITE; -/*!40000 ALTER TABLE `llx_livraisondet_extrafields` DISABLE KEYS */; -/*!40000 ALTER TABLE `llx_livraisondet_extrafields` ENABLE KEYS */; +LOCK TABLES `llx_deliverydet_extrafields` WRITE; +/*!40000 ALTER TABLE `llx_deliverydet_extrafields` DISABLE KEYS */; +/*!40000 ALTER TABLE `llx_deliverydet_extrafields` ENABLE KEYS */; UNLOCK TABLES; -- diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index f87edd87483..0eadfa2c629 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -67,12 +67,12 @@ if ($action == 'disable_sending') if ($action == 'activate_delivery') { dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1", 'chaine', 0, '', $conf->entity); // We must also enable this - dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1", 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "MAIN_SUBMODULE_DELIVERY", "1", 'chaine', 0, '', $conf->entity); header("Location: confexped.php"); exit; } elseif ($action == 'disable_delivery') { - dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON", $conf->entity); + dolibarr_del_const($db, "MAIN_SUBMODULE_DELIVERY", $conf->entity); header("Location: confexped.php"); exit; } @@ -121,7 +121,7 @@ else print ""; print ''; -// Bon de livraison activation/desactivation +// Delivery note activate/deactivate Bon de livraison activation/desactivation print ''; print ''; print $langs->trans("DeliveriesOrderAbility"); @@ -131,7 +131,7 @@ print ''; print ''; print ''; -if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) +if (empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { print ''.img_picto($langs->trans("Disabled"), 'switch_off').''; } else { diff --git a/htdocs/admin/livraison.php b/htdocs/admin/delivery.php similarity index 92% rename from htdocs/admin/livraison.php rename to htdocs/admin/delivery.php index 9e4f132e374..dc63b7a5f2f 100644 --- a/htdocs/admin/livraison.php +++ b/htdocs/admin/delivery.php @@ -24,15 +24,15 @@ */ /** - * \file htdocs/admin/livraison.php - * \ingroup livraison - * \brief Page d'administration/configuration du module Livraison + * \file htdocs/admin/delivery.php + * \ingroup delivery + * \brief age to setup extra fields of delivery */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.lib.php'; -require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; +require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; // Load translation files required by the page $langs->loadLangs(array("admin", "sendings", "deliveries", "other")); @@ -87,7 +87,7 @@ if ($action == 'specimen') { $modele = GETPOST('module', 'alpha'); - $sending = new Livraison($db); + $sending = new Delivery($db); $sending->initAsSpecimen(); // Search template files @@ -95,7 +95,7 @@ if ($action == 'specimen') $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); foreach ($dirmodels as $reldir) { - $file = dol_buildpath($reldir."core/modules/livraison/doc/pdf_".$modele.".modules.php", 0); + $file = dol_buildpath($reldir."core/modules/delivery/doc/pdf_".$modele.".modules.php", 0); if (file_exists($file)) { $filefound = 1; @@ -112,7 +112,7 @@ if ($action == 'specimen') if ($module->write_file($sending, $langs) > 0) { - header("Location: ".DOL_URL_ROOT."/document.php?modulepart=livraison&file=SPECIMEN.pdf"); + header("Location: ".DOL_URL_ROOT."/document.php?modulepart=delivery&file=SPECIMEN.pdf"); return; } else { setEventMessages($module->error, $module->errors, 'errors'); @@ -134,17 +134,17 @@ if ($action == 'del') $ret = delDocumentModel($value, $type); if ($ret > 0) { - if ($conf->global->LIVRAISON_ADDON_PDF == "$value") dolibarr_del_const($db, 'LIVRAISON_ADDON_PDF', $conf->entity); + if ($conf->global->DELIVERY_ADDON_PDF == "$value") dolibarr_del_const($db, 'DELIVERY_ADDON_PDF', $conf->entity); } } if ($action == 'setdoc') { - if (dolibarr_set_const($db, "LIVRAISON_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) + if (dolibarr_set_const($db, "DELIVERY_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) { // La constante qui a ete lue en avant du nouveau set // on passe donc par une variable pour avoir un affichage coherent - $conf->global->LIVRAISON_ADDON_PDF = $value; + $conf->global->DELIVERY_ADDON_PDF = $value; } // On active le modele @@ -160,7 +160,7 @@ if ($action == 'setmod') // TODO Verifier si module numerotation choisi peut etre active // par appel methode canBeActivated - dolibarr_set_const($db, "LIVRAISON_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); + dolibarr_set_const($db, "DELIVERY_ADDON_NUMBER", $value, 'chaine', 0, '', $conf->entity); } @@ -199,7 +199,7 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/livraison/"); + $dir = dol_buildpath($reldir."core/modules/delivery/"); if (is_dir($dir)) { @@ -208,7 +208,7 @@ foreach ($dirmodels as $reldir) { while (($file = readdir($handle)) !== false) { - if (substr($file, 0, 14) == 'mod_livraison_' && substr($file, dol_strlen($file) - 3, 3) == 'php') + if (substr($file, 0, 14) == 'mod_delivery_' && substr($file, dol_strlen($file) - 3, 3) == 'php') { $file = substr($file, 0, dol_strlen($file) - 4); @@ -237,7 +237,7 @@ foreach ($dirmodels as $reldir) print ''."\n"; print ''; - if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") + if ($conf->global->DELIVERY_ADDON_NUMBER == "$file") { print img_picto($langs->trans("Activated"), 'switch_on'); } else { @@ -245,13 +245,13 @@ foreach ($dirmodels as $reldir) } print ''; - $livraison = new Livraison($db); - $livraison->initAsSpecimen(); + $delivery = new Delivery($db); + $delivery->initAsSpecimen(); // Info $htmltooltip = ''; $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().'
'; - $nextval = $module->getNextValue($mysoc, $livraison); + $nextval = $module->getNextValue($mysoc, $delivery); if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval $htmltooltip .= ''.$langs->trans("NextValue").': '; if ($nextval) { @@ -323,7 +323,7 @@ clearstatcache(); foreach ($dirmodels as $reldir) { - $dir = dol_buildpath($reldir."core/modules/livraison/doc/"); + $dir = dol_buildpath($reldir."core/modules/delivery/doc/"); if (is_dir($dir)) { @@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir) // Default print ""; - if ($conf->global->LIVRAISON_ADDON_PDF == "$name") + if ($conf->global->DELIVERY_ADDON_PDF == "$name") { print img_picto($langs->trans("Default"), 'on'); } else { diff --git a/htdocs/admin/livraison_extrafields.php b/htdocs/admin/delivery_extrafields.php similarity index 94% rename from htdocs/admin/livraison_extrafields.php rename to htdocs/admin/delivery_extrafields.php index 4ec88fa20a9..38628fa171b 100644 --- a/htdocs/admin/livraison_extrafields.php +++ b/htdocs/admin/delivery_extrafields.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/admin/livraison_extrafields.php - * \ingroup livraison - * \brief Page to setup extra fields of livraison + * \file htdocs/admin/delivery_extrafields.php + * \ingroup delivery + * \brief Page to setup extra fields of delivery */ require '../main.inc.php'; @@ -49,7 +49,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoenti $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); -$elementtype = 'livraison'; //Must be the $table_element of the class that manage extrafield +$elementtype = 'delivery'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/admin/livraisondet_extrafields.php b/htdocs/admin/deliverydet_extrafields.php similarity index 94% rename from htdocs/admin/livraisondet_extrafields.php rename to htdocs/admin/deliverydet_extrafields.php index bcfce0e9f84..50dea86c2a5 100644 --- a/htdocs/admin/livraisondet_extrafields.php +++ b/htdocs/admin/deliverydet_extrafields.php @@ -24,9 +24,9 @@ */ /** - * \file htdocs/admin/livraisondet_extrafields.php - * \ingroup livraison - * \brief Page to setup extra fields of livraison + * \file htdocs/admin/deliverydet_extrafields.php + * \ingroup delivery + * \brief Page to setup extra fields of delivery */ require '../main.inc.php'; @@ -50,7 +50,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoenti $action = GETPOST('action', 'aZ09'); $attrname = GETPOST('attrname', 'alpha'); -$elementtype = 'livraisondet'; //Must be the $table_element of the class that manage extrafield +$elementtype = 'deliverydet'; //Must be the $table_element of the class that manage extrafield if (!$user->admin) accessforbidden(); diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index aa20ee83712..4a4cf3c37dd 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -287,7 +287,7 @@ if (empty($reshook)) dol_print_error($db, $object->error); } elseif ($action == 'setdate_livraison' && $usercancreate) { - $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear'])); + $result = $object->set_delivery_date($user, dol_mktime(12, 0, 0, $_POST['date_livraisonmonth'], $_POST['date_livraisonday'], $_POST['date_livraisonyear'])); if ($result < 0) dol_print_error($db, $object->error); } // Positionne ref client diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 18fce5fbaa7..c772044af81 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -152,9 +152,9 @@ class Propal extends CommonObject public $datep; /** - * @var integer|string $date_livraison; + * @var integer|string $delivery_date; */ - public $date_livraison; + public $delivery_date; public $fin_validite; @@ -2065,11 +2065,11 @@ class Propal extends CommonObject * Set delivery date * * @param User $user Object user that modify - * @param int $date_livraison Delivery date + * @param int $delivery_date Delivery date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if ko, >0 if ok */ - public function set_date_livraison($user, $date_livraison, $notrigger = 0) + public function set_delivery_date($user, $delivery_date, $notrigger = 0) { // phpcs:enable if (!empty($user->rights->propal->creer)) @@ -2079,7 +2079,7 @@ class Propal extends CommonObject $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."propal "; - $sql .= " SET date_livraison = ".($date_livraison != '' ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_livraison = ".($delivery_date != '' ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); @@ -2093,7 +2093,7 @@ class Propal extends CommonObject if (!$error) { $this->oldcopy = clone $this; - $this->date_livraison = $date_livraison; + $this->date_livraison = $delivery_date; } if (!$notrigger && empty($error)) diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index f4bdc1cb0aa..596fe4e94bc 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -541,7 +541,7 @@ if (empty($reshook)) $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $object->fetch($id); - $result = $object->set_date_livraison($user, $datedelivery); + $result = $object->set_delivery_date($user, $datedelivery); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); } @@ -2556,7 +2556,7 @@ if ($action == 'create' && $usercancreate) $numshipping = $object->nb_expedition(); if ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || !empty($conf->global->STOCK_SUPPORTS_SERVICES))) { - if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer)) { + if (($conf->expedition_bon->enabled && $user->rights->expedition->creer) || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->creer)) { if ($user->rights->expedition->creer) { print ''.$langs->trans('CreateShipment').''; } else { diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index fbf6c2548b9..b7095bef93a 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -180,7 +180,7 @@ class Commande extends CommonOrder */ public $date_commande; - public $date_livraison; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) + public $delivery_date; // Date expected of shipment (date starting shipment, not the reception that occurs some days after) /** * @var int ID @@ -2552,11 +2552,11 @@ class Commande extends CommonOrder * Set the planned delivery date * * @param User $user Objet utilisateur qui modifie - * @param int $date_livraison Date de livraison + * @param int $delivery_date Delivery date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ - public function set_date_livraison($user, $date_livraison, $notrigger = 0) + public function set_delivery_date($user, $delivery_date, $notrigger = 0) { // phpcs:enable if ($user->rights->commande->creer) @@ -2566,7 +2566,7 @@ class Commande extends CommonOrder $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."commande"; - $sql .= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_livraison = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); @@ -2580,7 +2580,7 @@ class Commande extends CommonOrder if (!$error) { $this->oldcopy = clone $this; - $this->date_livraison = $date_livraison; + $this->date_livraison = $delivery_date; } if (!$notrigger && empty($error)) diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php index 54b8955d519..bc86591fc22 100644 --- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php +++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php @@ -112,10 +112,10 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes while ($line < $num) { $objp = $this->db->fetch_object($result); $date = $this->db->jdate($objp->date_commande); - $date_livraison = $this->db->jdate($objp->date_livraison); + $delivery_date = $this->db->jdate($objp->date_livraison); $datem = $this->db->jdate($objp->tms); - $supplierorderstatic->date_livraison = $date_livraison; + $supplierorderstatic->date_livraison = $delivery_date; $supplierorderstatic->statut = $objp->fk_statut; $supplierorderstatic->id = $objp->rowid; @@ -152,7 +152,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes $this->info_box_contents[$line][] = array( 'td' => 'class="right"', - 'text' => $delayIcon.' '.dol_print_date($date_livraison, 'day').'', + 'text' => $delayIcon.' '.dol_print_date($delivery_date, 'day').'', 'asis' => 1 ); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index be1d4d45cdc..c9f038722ba 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3356,7 +3356,7 @@ abstract class CommonObject } elseif ($objecttype == 'shipping') { $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; } elseif ($objecttype == 'delivery') { - $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon'; + $classpath = 'delivery/class'; $subelement = 'delivery'; $module = 'delivery_note'; } elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') { $classpath = 'fourn/class'; $module = 'fournisseur'; } elseif ($objecttype == 'fichinter') { diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index ce726265006..d87174c5636 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -122,7 +122,7 @@ class Conf // First level object // TODO Remove this part. $this->expedition_bon = new stdClass(); - $this->livraison_bon = new stdClass(); + $this->delivery_note = new stdClass(); $this->fournisseur = new stdClass(); $this->product = new stdClass(); $this->service = new stdClass(); @@ -370,8 +370,8 @@ class Conf // Sous module bons d'expedition $this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0); - // Sous module bons de livraison - $this->livraison_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_LIVRAISON) ? $this->global->MAIN_SUBMODULE_LIVRAISON : 0); + // Sub module delivery note Sous module bons de livraison + $this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_DELIVERY) ? $this->global->MAIN_SUBMODULE_DELIVERY : 0); // Module fournisseur if (!empty($this->fournisseur)) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index f28ad165453..bf52ff5871a 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6898,7 +6898,7 @@ class Form $tplpath = 'reception'; if (empty($conf->reception->enabled)) continue; // Do not show if module disabled } elseif ($objecttype == 'delivery') { - $tplpath = 'livraison'; + $tplpath = 'delivery'; if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled } elseif ($objecttype == 'invoice_supplier') { $tplpath = 'fourn/facture'; diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 464dbafa375..c700cd9d6f1 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -366,7 +366,7 @@ class FormFile } $printer = 0; - if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'livraison', 'ticket'))) // The direct print feature is implemented only for such elements + if (in_array($modulepart, array('facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) // The direct print feature is implemented only for such elements { $printer = (!empty($user->rights->printing->read) && !empty($conf->printing->enabled)) ?true:false; } @@ -466,11 +466,11 @@ class FormFile include_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php'; $modellist = ModelePdfReception::liste_modeles($this->db); } - } elseif ($modulepart == 'livraison') + } elseif ($modulepart == 'delivery') { if (is_array($genallowed)) $modellist = $genallowed; else { - include_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; + include_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; $modellist = ModelePDFDeliveryOrder::liste_modeles($this->db); } } elseif ($modulepart == 'ficheinter') diff --git a/htdocs/core/lib/expedition.lib.php b/htdocs/core/lib/expedition.lib.php index b575247e84b..92c58d7b5db 100644 --- a/htdocs/core/lib/expedition.lib.php +++ b/htdocs/core/lib/expedition.lib.php @@ -51,9 +51,9 @@ function expedition_prepare_head(Expedition $object) $hselected = $h; $h++; - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; + $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; $head[$h][1] = $langs->trans("Receivings"); $h++; } @@ -109,25 +109,25 @@ function expedition_admin_prepare_head() $h++; } - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - $head[$h][0] = DOL_URL_ROOT."/admin/livraison.php"; + $head[$h][0] = DOL_URL_ROOT."/admin/delivery.php"; $head[$h][1] = $langs->trans("Receivings"); $head[$h][2] = 'receivings'; $h++; } - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - $head[$h][0] = DOL_URL_ROOT.'/admin/livraison_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/admin/delivery_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFields"); $head[$h][2] = 'attributes_receivings'; $h++; } - if (!empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) + if (!empty($conf->global->MAIN_SUBMODULE_DELIVERY)) { - $head[$h][0] = DOL_URL_ROOT.'/admin/livraisondet_extrafields.php'; + $head[$h][0] = DOL_URL_ROOT.'/admin/deliverydet_extrafields.php'; $head[$h][1] = $langs->trans("ExtraFieldsLines"); $head[$h][2] = 'attributeslines_receivings'; $h++; diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index d926e6105a1..1e0d298bb69 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2644,10 +2644,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $accessallowed = 1; } $original_file = $conf->expedition->dir_output."/sending/".$original_file; - } // Wrapping pour les bons de livraison - elseif ($modulepart == 'livraison' && !empty($conf->expedition->dir_output)) + } // Delivery Note Wrapping + elseif ($modulepart == 'delivery' && !empty($conf->expedition->dir_output)) { - if ($fuser->rights->expedition->livraison->{$lire} || preg_match('/^specimen/i', $original_file)) + if ($fuser->rights->expedition->delivery->{$lire} || preg_match('/^specimen/i', $original_file)) { $accessallowed = 1; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index fe7866f3a50..f7c81e148e4 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -8723,9 +8723,9 @@ function getElementProperties($element_type) $module = 'expedition_bon'; } if ($element_type == 'delivery') { - $classpath = 'livraison/class'; - $subelement = 'livraison'; - $module = 'livraison_bon'; + $classpath = 'delivery/class'; + $subelement = 'delivery'; + $module = 'delivery_note'; } if ($element_type == 'contract') { $classpath = 'contrat/class'; diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index bb89d1777d8..d49085ecb8e 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1791,9 +1791,9 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '') $myobject = 'expedition'; $module = 'expedition_bon'; } elseif ($objecttype == 'delivery') { - $classpath = 'livraison/class'; - $myobject = 'livraison'; - $module = 'livraison_bon'; + $classpath = 'delivery/class'; + $myobject = 'delivery'; + $module = 'delivery_note'; } elseif ($objecttype == 'contract') { $classpath = 'contrat/class'; $module = 'contrat'; diff --git a/htdocs/core/lib/order.lib.php b/htdocs/core/lib/order.lib.php index 939b731f135..bf7bc352e3f 100644 --- a/htdocs/core/lib/order.lib.php +++ b/htdocs/core/lib/order.lib.php @@ -59,17 +59,17 @@ function commande_prepare_head(Commande $object) } if (($conf->expedition_bon->enabled && $user->rights->expedition->lire) - || ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire)) + || ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire)) { $nbShipments = $object->getNbOfShipments(); $nbReceiption = 0; $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; $text = ''; if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments"); - if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - '; - if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings"); + if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled) $text .= ' - '; + if ($conf->delivery_note->enabled) $text .= $langs->trans("Receivings"); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''.($nbShipments ? $nbShipments : 0); - if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - '; - if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0); + if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - '; + if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ($nbReceiption ? $nbReceiption : 0); if ($nbShipments > 0 || $nbReceiption > 0) $text .= ''; $head[$h][1] = $text; $head[$h][2] = 'shipping'; diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index a1dab5cd6cb..ef41614116f 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -43,13 +43,13 @@ function propal_prepare_head($object) $h++; if ((empty($conf->commande->enabled) && ((!empty($conf->expedition->enabled) && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire) - || (!empty($conf->expedition->enabled) && !empty($conf->livraison_bon->enabled) && $user->rights->expedition->livraison->lire)))) + || (!empty($conf->expedition->enabled) && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire)))) { $langs->load("sendings"); $text = ''; $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; if ($conf->expedition_bon->enabled) $text = $langs->trans("Shipment"); - if ($conf->livraison_bon->enabled) $text .= '/'.$langs->trans("Receivings"); + if ($conf->delivery_note->enabled) $text .= '/'.$langs->trans("Receivings"); $head[$h][1] = $text; $head[$h][2] = 'shipping'; $h++; diff --git a/htdocs/core/lib/sendings.lib.php b/htdocs/core/lib/sendings.lib.php index b81757f261f..59f0e46d428 100644 --- a/htdocs/core/lib/sendings.lib.php +++ b/htdocs/core/lib/sendings.lib.php @@ -47,7 +47,7 @@ function shipping_prepare_head($object) $head[$h][2] = 'shipping'; $h++; - if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire) + if ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire) { // delivery link $object->fetchObjectLinked($object->id, $object->element); @@ -56,7 +56,7 @@ function shipping_prepare_head($object) // Take first one element of array $tmp = reset($object->linkedObjectsIds['delivery']); - $head[$h][0] = DOL_URL_ROOT."/livraison/card.php?id=".$tmp; + $head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".$tmp; $head[$h][1] = $langs->trans("DeliveryCard"); $head[$h][2] = 'delivery'; $h++; @@ -135,7 +135,7 @@ function delivery_prepare_head($object) $h++; } - $head[$h][0] = DOL_URL_ROOT."/livraison/card.php?id=".$object->id; + $head[$h][0] = DOL_URL_ROOT."/delivery/card.php?id=".$object->id; $head[$h][1] = $langs->trans("DeliveryCard"); $head[$h][2] = 'delivery'; $h++; @@ -213,13 +213,13 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end,"; $sql .= " ed.rowid as edrowid, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot as warehouse_id,"; $sql .= " e.rowid as sendingid, e.ref as exp_ref, e.date_creation, e.date_delivery, e.date_expedition,"; - //if ($conf->livraison_bon->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,"; + //if ($conf->delivery_note->enabled) $sql .= " l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received,"; $sql .= ' p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch,'; $sql .= ' p.description as product_desc'; $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql .= ", ".MAIN_DB_PREFIX."expedition as e"; $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; - //if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."livraisondet as ld ON ld.fk_livraison = l.rowid AND obj.rowid = ld.fk_origin_line"; + //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; //TODO Add link to expeditiondet_batch $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; @@ -260,7 +260,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') print ''; print ''; }*/ - if (!empty($conf->livraison_bon->enabled)) + if (!empty($conf->delivery_note->enabled)) { print ''.$langs->trans("DeliveryOrder").''; //print ''.$langs->trans("QtyReceived").''; @@ -403,9 +403,9 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') }*/ // Informations on receipt - if (!empty($conf->livraison_bon->enabled)) + if (!empty($conf->delivery_note->enabled)) { - include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; + include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; $expedition->id = $objp->sendingid; $expedition->fetchObjectLinked($expedition->id, $expedition->element); //var_dump($expedition->linkedObjects); @@ -423,7 +423,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '') // Ref print ''; print $receiving->getNomUrl($db); - //print ''.img_object($langs->trans("ShowReceiving"),'sending').' '.$objp->livraison_ref.''; + //print ''.img_object($langs->trans("ShowReceiving"),'sending').' '.$objp->livraison_ref.''; print ''; // Qty received //print ''; diff --git a/htdocs/core/modules/bank/doc/pdf_ban.modules.php b/htdocs/core/modules/bank/doc/pdf_ban.modules.php index 27b40d48257..56c538af8a6 100644 --- a/htdocs/core/modules/bank/doc/pdf_ban.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_ban.modules.php @@ -262,7 +262,7 @@ class pdf_ban extends ModeleBankAccountDoc } } - $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR"); + $this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR"); return 0; } diff --git a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php index b6e4cbc191a..2b8987958f4 100644 --- a/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php +++ b/htdocs/core/modules/bank/doc/pdf_sepamandate.modules.php @@ -415,7 +415,7 @@ class pdf_sepamandate extends ModeleBankAccountDoc } } - $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR"); + $this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR"); return 0; } diff --git a/htdocs/core/modules/livraison/doc/index.html b/htdocs/core/modules/delivery/doc/index.html similarity index 100% rename from htdocs/core/modules/livraison/doc/index.html rename to htdocs/core/modules/delivery/doc/index.html diff --git a/htdocs/core/modules/livraison/doc/pdf_storm.modules.php b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php similarity index 99% rename from htdocs/core/modules/livraison/doc/pdf_storm.modules.php rename to htdocs/core/modules/delivery/doc/pdf_storm.modules.php index 2019de478eb..7de29cce294 100644 --- a/htdocs/core/modules/livraison/doc/pdf_storm.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_storm.modules.php @@ -23,13 +23,13 @@ */ /** - * \file htdocs/core/modules/livraison/doc/pdf_storm.modules.php + * \file htdocs/core/modules/delivery/doc/pdf_storm.modules.php * \ingroup livraison * \brief File of class to manage receving receipts with template Storm */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; -require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; +require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; @@ -157,7 +157,7 @@ class pdf_storm extends ModelePDFDeliveryOrder /** * Function to build pdf onto disk * - * @param Livraison $object Object to generate + * @param Delivery $object Object to generate * @param Translate $outputlangs Lang output object * @param string $srctemplatepath Full path of source filename for generator using a template file * @param int $hidedetails Do not show line details diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php similarity index 99% rename from htdocs/core/modules/livraison/doc/pdf_typhon.modules.php rename to htdocs/core/modules/delivery/doc/pdf_typhon.modules.php index 34b66066f54..114283c6773 100644 --- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php +++ b/htdocs/core/modules/delivery/doc/pdf_typhon.modules.php @@ -22,13 +22,13 @@ */ /** - * \file htdocs/core/modules/livraison/doc/pdf_typhon.modules.php + * \file htdocs/core/modules/delivery/doc/pdf_typhon.modules.php * \ingroup livraison * \brief File of class to manage receving receipts with template Typhon */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; -require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; +require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php'; @@ -618,7 +618,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder } } - $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR"); + $this->error = $langs->transnoentities("ErrorConstantNotDefined", "DELIVERY_OUTPUTDIR"); return 0; } @@ -844,7 +844,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // If SHIPPING contact defined on order, we use it $usecontact = false; $arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING'); - if (count($arrayidcontact) > 0) + if ($arrayidcontact && count($arrayidcontact) > 0) { $usecontact = true; $result = $object->fetch_contact($arrayidcontact[0]); diff --git a/htdocs/core/modules/livraison/index.html b/htdocs/core/modules/delivery/index.html similarity index 100% rename from htdocs/core/modules/livraison/index.html rename to htdocs/core/modules/delivery/index.html diff --git a/htdocs/core/modules/livraison/mod_livraison_jade.php b/htdocs/core/modules/delivery/mod_delivery_jade.php similarity index 88% rename from htdocs/core/modules/livraison/mod_livraison_jade.php rename to htdocs/core/modules/delivery/mod_delivery_jade.php index 01788cd863b..822986cffa5 100644 --- a/htdocs/core/modules/livraison/mod_livraison_jade.php +++ b/htdocs/core/modules/delivery/mod_delivery_jade.php @@ -19,20 +19,20 @@ */ /** - * \file htdocs/core/modules/livraison/mod_livraison_jade.php + * \file htdocs/core/modules/delivery/mod_delivery_jade.php * \ingroup delivery * \brief Fichier contenant la classe du modele de numerotation de reference de bon de livraison Jade */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; /** - * \class mod_livraison_jade + * \class mod_delivery_jade * \brief Classe du modele de numerotation de reference de bon de livraison Jade */ -class mod_livraison_jade extends ModeleNumRefDeliveryOrder +class mod_delivery_jade extends ModeleNumRefDeliveryOrder { /** * Dolibarr version of the loaded document @@ -98,7 +98,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder $posindice = strlen($this->prefix) + 6; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL - $sql .= " FROM ".MAIN_DB_PREFIX."livraison"; + $sql .= " FROM ".MAIN_DB_PREFIX."delivery"; $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; $sql .= " AND entity = ".$conf->entity; @@ -132,12 +132,12 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder // First, we get the max value $posindice = strlen($this->prefix) + 6; $sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL - $sql .= " FROM ".MAIN_DB_PREFIX."livraison"; + $sql .= " FROM ".MAIN_DB_PREFIX."delivery"; $sql .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'"; $sql .= " AND entity = ".$conf->entity; $resql = $db->query($sql); - dol_syslog("mod_livraison_jade::getNextValue", LOG_DEBUG); + dol_syslog("mod_delivery_jade::getNextValue", LOG_DEBUG); if ($resql) { $obj = $db->fetch_object($resql); if ($obj) $max = intval($obj->max); @@ -153,7 +153,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder if ($max >= (pow(10, 4) - 1)) $num = $max + 1; // If counter > 9999, we do not format on 4 chars, we take number as it is else $num = sprintf("%04s", $max + 1); - dol_syslog("mod_livraison_jade::getNextValue return ".$this->prefix.$yymm."-".$num); + dol_syslog("mod_delivery_jade::getNextValue return ".$this->prefix.$yymm."-".$num); return $this->prefix.$yymm."-".$num; } @@ -166,7 +166,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder * @param Object $object Object livraison * @return string Texte descriptif */ - public function livraison_get_num($objsoc = 0, $object = '') + public function delivery_get_num($objsoc = 0, $object = '') { // phpcs:enable return $this->getNextValue($objsoc, $object); diff --git a/htdocs/core/modules/livraison/mod_livraison_saphir.php b/htdocs/core/modules/delivery/mod_delivery_saphir.php similarity index 89% rename from htdocs/core/modules/livraison/mod_livraison_saphir.php rename to htdocs/core/modules/delivery/mod_delivery_saphir.php index ad03984a6f2..10a979d4ee2 100644 --- a/htdocs/core/modules/livraison/mod_livraison_saphir.php +++ b/htdocs/core/modules/delivery/mod_delivery_saphir.php @@ -19,17 +19,17 @@ */ /** - * \file htdocs/core/modules/livraison/mod_livraison_saphir.php + * \file htdocs/core/modules/delivery/mod_livraison_saphir.php * \ingroup expedition * \brief Fichier contenant la classe du modele de numerotation de reference de livraison Saphir */ -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; /** - * \class mod_livraison_saphir + * \class mod_delivery_saphir * \brief Classe du modele de numerotation de reference de livraison Saphir */ -class mod_livraison_saphir extends ModeleNumRefDeliveryOrder +class mod_delivery_saphir extends ModeleNumRefDeliveryOrder { /** * Dolibarr version of the loaded document @@ -72,7 +72,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder $texte .= '
'; $texte .= ''; $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Delivery"), $langs->transnoentities("Delivery")); @@ -83,7 +83,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder // Parametrage du prefix $texte .= ''; - $texte .= ''; + $texte .= ''; $texte .= ''; @@ -131,7 +131,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; // On defini critere recherche compteur - $mask = $conf->global->LIVRAISON_SAPHIR_MASK; + $mask = $conf->global->DELIVERY_SAPHIR_MASK; if (!$mask) { @@ -139,7 +139,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder return 0; } - $numFinal = get_next_value($db, $mask, 'livraison', 'ref', '', $objsoc, $object->date_livraison); + $numFinal = get_next_value($db, $mask, 'delivery', 'ref', '', $objsoc, $object->date_livraison); return $numFinal; } @@ -166,7 +166,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder * @param Object $object Objet livraison * @return string Texte descripif */ - public function livraison_get_num($objsoc = 0, $object = '') + public function delivery_get_num($objsoc = 0, $object = '') { // phpcs:enable return $this->getNextValue($objsoc, $object); diff --git a/htdocs/core/modules/livraison/modules_livraison.php b/htdocs/core/modules/delivery/modules_delivery.php similarity index 98% rename from htdocs/core/modules/livraison/modules_livraison.php rename to htdocs/core/modules/delivery/modules_delivery.php index 9bf8a9e3ca2..80e2b092d42 100644 --- a/htdocs/core/modules/livraison/modules_livraison.php +++ b/htdocs/core/modules/delivery/modules_delivery.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/core/modules/livraison/modules_livraison.php + * \file htdocs/core/modules/delivery/modules_delivery.php * \ingroup expedition * \brief Fichier contenant la classe mere de generation de bon de livraison en PDF * et la classe mere de numerotation des bons de livraisons diff --git a/htdocs/core/modules/modExpedition.class.php b/htdocs/core/modules/modExpedition.class.php index 19e22497a7a..165633849a1 100644 --- a/htdocs/core/modules/modExpedition.class.php +++ b/htdocs/core/modules/modExpedition.class.php @@ -103,21 +103,21 @@ class modExpedition extends DolibarrModules $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON_PDF"; + $this->const[$r][0] = "DELIVERY_ADDON_PDF"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "typhon"; $this->const[$r][3] = 'Nom du gestionnaire de generation des bons de reception en PDF'; $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON_NUMBER"; + $this->const[$r][0] = "DELIVERY_ADDON_NUMBER"; $this->const[$r][1] = "chaine"; - $this->const[$r][2] = "mod_livraison_jade"; + $this->const[$r][2] = "mod_delivery_jade"; $this->const[$r][3] = 'Nom du gestionnaire de numerotation des bons de reception'; $this->const[$r][4] = 0; $r++; - $this->const[$r][0] = "LIVRAISON_ADDON_PDF_ODT_PATH"; + $this->const[$r][0] = "DELIVERY_ADDON_PDF_ODT_PATH"; $this->const[$r][1] = "chaine"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries"; $this->const[$r][3] = ""; @@ -191,7 +191,7 @@ class modExpedition extends DolibarrModules $this->rights[$r][1] = 'Read delivery receipts'; $this->rights[$r][2] = 'r'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'livraison'; + $this->rights[$r][4] = 'delivery'; $this->rights[$r][5] = 'lire'; $r++; @@ -199,7 +199,7 @@ class modExpedition extends DolibarrModules $this->rights[$r][1] = 'Create/modify delivery receipts'; $this->rights[$r][2] = 'w'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'livraison'; + $this->rights[$r][4] = 'delivery'; $this->rights[$r][5] = 'creer'; $r++; @@ -207,7 +207,7 @@ class modExpedition extends DolibarrModules $this->rights[$r][1] = 'Validate delivery receipts'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'livraison_advance'; + $this->rights[$r][4] = 'delivery_advance'; $this->rights[$r][5] = 'validate'; $r++; @@ -215,7 +215,7 @@ class modExpedition extends DolibarrModules $this->rights[$r][1] = 'Delete delivery receipts'; $this->rights[$r][2] = 'd'; $this->rights[$r][3] = 0; - $this->rights[$r][4] = 'livraison'; + $this->rights[$r][4] = 'delivery'; $this->rights[$r][5] = 'supprimer'; diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 0615a1070a3..8cf0cca3f18 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -141,7 +141,7 @@ if (empty($reshook) && is_array($extrafields->attributes[$object->table_element] if ($object->element == 'order_supplier') $permok = $user->rights->fournisseur->commande->creer; if ($object->element == 'invoice_supplier') $permok = $user->rights->fournisseur->facture->creer; if ($object->element == 'shipping') $permok = $user->rights->expedition->creer; - if ($object->element == 'delivery') $permok = $user->rights->expedition->livraison->creer; + if ($object->element == 'delivery') $permok = $user->rights->expedition->delivery->creer; if ($object->element == 'productlot') $permok = $user->rights->stock->creer; if ($object->element == 'facturerec') $permok = $user->rights->facture->creer; if ($object->element == 'mo') $permok = $user->rights->mrp->write; diff --git a/htdocs/livraison/card.php b/htdocs/delivery/card.php similarity index 95% rename from htdocs/livraison/card.php rename to htdocs/delivery/card.php index 40dd90d4049..5cd7d5fff8d 100644 --- a/htdocs/livraison/card.php +++ b/htdocs/delivery/card.php @@ -22,14 +22,14 @@ */ /** - * \file htdocs/livraison/card.php + * \file htdocs/delivery/card.php * \ingroup livraison * \brief Page to describe a delivery receipt */ require '../main.inc.php'; -require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; -require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.php'; +require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/modules_delivery.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; @@ -57,9 +57,9 @@ $backtopage = GETPOST('backtopage', 'alpha'); // Security check $id = GETPOST('id', 'int'); if ($user->socid) $socid = $user->socid; -$result = restrictedArea($user, 'expedition', $id, 'livraison', 'livraison'); +$result = restrictedArea($user, 'expedition', $id, 'delivery', 'livraison'); -$object = new Livraison($db); +$object = new Delivery($db); $extrafields = new ExtraFields($db); // fetch optionals attributes and labels @@ -126,8 +126,8 @@ if ($action == 'add') $action = 'create'; } } elseif ($action == 'confirm_valid' && $confirm == 'yes' && - ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate))) + ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) ) { $result = $object->valid($user); @@ -151,7 +151,7 @@ if ($action == 'add') } } -if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->livraison->supprimer) +if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->delivery->supprimer) { $db->begin(); $result = $object->delete(); @@ -167,10 +167,10 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio } } -if ($action == 'setdate_livraison' && $user->rights->expedition->livraison->creer) +if ($action == 'setdate_livraison' && $user->rights->expedition->delivery->creer) { $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); - $result = $object->set_date_livraison($user, $datedelivery); + $result = $object->set_delivery_date($user, $datedelivery); if ($result < 0) { $mesg = '
'.$object->error.'
'; @@ -306,7 +306,7 @@ if ($action == 'create') // Create. Seems to no be used /* - * Livraison + * Delivery */ if ($typeobject == 'commande' && $expedition->origin_id > 0 && !empty($conf->commande->enabled)) @@ -458,7 +458,7 @@ if ($action == 'create') // Create. Seems to no be used print '
'.$langs->trans("Mask").':'.$form->textwithpicto('', $tooltip, 1, 1).''.$form->textwithpicto('', $tooltip, 1, 1).' 
'; print $langs->trans('IncotermLabel'); print ''; - if ($user->rights->expedition->livraison->creer) print ''.img_edit().''; + if ($user->rights->expedition->delivery->creer) print ''.img_edit().''; else print ' '; print '
'; print ''; @@ -647,14 +647,14 @@ if ($action == 'create') // Create. Seems to no be used if ($object->statut == 0 && $num_prod > 0) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate))) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) { print '
'.$langs->trans("Validate").''; } } - if ($user->rights->expedition->livraison->supprimer) + if ($user->rights->expedition->delivery->supprimer) { if ($conf->expedition_bon->enabled) { @@ -678,10 +678,10 @@ if ($action == 'create') // Create. Seems to no be used $filedir = $conf->expedition->dir_output."/receipt/".$objectref; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; - $genallowed = $user->rights->expedition->livraison->lire; - $delallowed = $user->rights->expedition->livraison->creer; + $genallowed = $user->rights->expedition->delivery->lire; + $delallowed = $user->rights->expedition->delivery->creer; - print $formfile->showdocuments('livraison', $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + print $formfile->showdocuments('delivery', $objectref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); /* * Linked object block (of linked shipment) diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/delivery/class/delivery.class.php similarity index 91% rename from htdocs/livraison/class/livraison.class.php rename to htdocs/delivery/class/delivery.class.php index 7ef93b016d1..ecf1c7bdcc4 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -22,7 +22,7 @@ */ /** - * \file htdocs/livraison/class/livraison.class.php + * \file htdocs/delivery/class/delivery.class.php * \ingroup delivery * \brief Delivery Order Management Class File */ @@ -37,7 +37,7 @@ if (!empty($conf->commande->enabled)) require_once DOL_DOCUMENT_ROOT.'/commande/ /** * Class to manage receptions */ -class Livraison extends CommonObject +class Delivery extends CommonObject { /** * @var string ID to identify managed object @@ -47,24 +47,24 @@ class Livraison extends CommonObject /** * @var int Field with ID of parent key if this field has a parent */ - public $fk_element = "fk_livraison"; + public $fk_element = "fk_delivery"; /** * @var string Name of table without prefix where object is stored */ - public $table_element = "livraison"; + public $table_element = "delivery"; /** * @var int Name of subtable line */ - public $table_element_line = "livraisondet"; + public $table_element_line = "deliverydet"; /** * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png */ public $picto = 'sending'; - public $brouillon; + public $draft; public $socid; public $ref_customer; @@ -108,28 +108,28 @@ class Livraison extends CommonObject * Create delivery receipt in database * * @param User $user Objet du user qui cree - * @return int <0 si erreur, id livraison cree si ok + * @return int <0 si erreur, id delivery cree si ok */ public function create($user) { global $conf; - dol_syslog("Livraison::create"); + dol_syslog("Delivery::create"); - if (empty($this->model_pdf)) $this->model_pdf = $conf->global->LIVRAISON_ADDON_PDF; + if (empty($this->model_pdf)) $this->model_pdf = $conf->global->DELIVERY_ADDON_PDF; $error = 0; $now = dol_now(); - /* On positionne en mode brouillon le bon de livraison */ - $this->brouillon = 1; + /* Delivery note as draft On positionne en mode draft le bon de livraison */ + $this->draft = 1; $this->user = $user; $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."livraison ("; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."delivery ("; $sql .= "ref"; $sql .= ", entity"; $sql .= ", fk_soc"; @@ -158,19 +158,19 @@ class Livraison extends CommonObject $sql .= ", '".$this->db->escape($this->location_incoterms)."'"; $sql .= ")"; - dol_syslog("Livraison::create", LOG_DEBUG); + dol_syslog("Delivery::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."livraison"); + $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."delivery"); $numref = "(PROV".$this->id.")"; - $sql = "UPDATE ".MAIN_DB_PREFIX."livraison "; + $sql = "UPDATE ".MAIN_DB_PREFIX."delivery "; $sql .= "SET ref = '".$this->db->escape($numref)."'"; $sql .= " WHERE rowid = ".$this->id; - dol_syslog("Livraison::create", LOG_DEBUG); + dol_syslog("Delivery::create", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { @@ -207,7 +207,7 @@ class Livraison extends CommonObject if (!$conf->expedition_bon->enabled) { - // TODO uniformiser les statuts + // TODO standardize status uniformiser les statuts $ret = $this->setStatut(2, $this->origin_id, $this->origin); if (!$ret) { @@ -257,7 +257,7 @@ class Livraison extends CommonObject $idprod = $fk_product; $j = 0; - $sql = "INSERT INTO ".MAIN_DB_PREFIX."livraisondet (fk_livraison, fk_origin_line,"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."deliverydet (fk_delivery, fk_origin_line,"; $sql .= " fk_product, description, qty)"; $sql .= " VALUES (".$this->id.",".$origin_id.","; $sql .= " ".($idprod > 0 ? $idprod : "null").","; @@ -292,7 +292,7 @@ class Livraison extends CommonObject $sql .= ", el.fk_source as origin_id, el.sourcetype as origin"; $sql .= ', l.fk_incoterms, l.location_incoterms'; $sql .= ", i.libelle as label_incoterms"; - $sql .= " FROM ".MAIN_DB_PREFIX."livraison as l"; + $sql .= " FROM ".MAIN_DB_PREFIX."delivery as l"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON el.fk_target = l.rowid AND el.targettype = '".$this->db->escape($this->element)."'"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON l.fk_incoterms = i.rowid'; $sql .= " WHERE l.rowid = ".$id; @@ -330,7 +330,7 @@ class Livraison extends CommonObject $this->label_incoterms = $obj->label_incoterms; $this->db->free($result); - if ($this->statut == 0) $this->brouillon = 1; + if ($this->statut == 0) $this->draft = 1; // Retrieve all extrafields // fetch optionals attributes and labels @@ -373,17 +373,17 @@ class Livraison extends CommonObject $error = 0; - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer)) - || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison_advance->validate))) + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer)) + || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) { - if (!empty($conf->global->LIVRAISON_ADDON_NUMBER)) + if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) { // Setting the command numbering module name - $modName = $conf->global->LIVRAISON_ADDON_NUMBER; + $modName = $conf->global->DELIVERY_ADDON_NUMBER; - if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/livraison/'.$modName.'.php')) + if (is_readable(DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php')) { - require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/'.$modName.'.php'; + require_once DOL_DOCUMENT_ROOT.'/core/modules/delivery/'.$modName.'.php'; $now = dol_now(); @@ -394,7 +394,7 @@ class Livraison extends CommonObject if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) // empty should not happened, but when it occurs, the test save life { - $numref = $objMod->livraison_get_num($soc, $this); + $numref = $objMod->delivery_get_num($soc, $this); } else { $numref = $this->ref; } @@ -402,7 +402,7 @@ class Livraison extends CommonObject // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice. $sql = "SELECT ref"; - $sql .= " FROM ".MAIN_DB_PREFIX."livraison"; + $sql .= " FROM ".MAIN_DB_PREFIX."delivery"; $sql .= " WHERE ref = '".$this->db->escape($numref)."'"; $sql .= " AND fk_statut <> 0"; $sql .= " AND entity = ".$conf->entity; @@ -417,7 +417,7 @@ class Livraison extends CommonObject } } - $sql = "UPDATE ".MAIN_DB_PREFIX."livraison SET"; + $sql = "UPDATE ".MAIN_DB_PREFIX."delivery SET"; $sql .= " ref='".$this->db->escape($numref)."'"; $sql .= ", fk_statut = 1"; $sql .= ", date_valid = '".$this->db->idate($now)."'"; @@ -526,7 +526,7 @@ class Livraison extends CommonObject $num = count($expedition->lines); for ($i = 0; $i < $num; $i++) { - $line = new LivraisonLigne($this->db); + $line = new DeliveryLigne($this->db); $line->origin_line_id = $expedition->lines[$i]->origin_line_id; $line->libelle = $expedition->lines[$i]->libelle; $line->description = $expedition->lines[$i]->description; @@ -570,14 +570,14 @@ class Livraison extends CommonObject if ($id > 0 && !$error && empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) // For avoid conflicts if trigger used { - $livraisonline = new LivraisonLigne($this->db); - $livraisonline->array_options = $array_options; - $livraisonline->id = $id; - $result = $livraisonline->insertExtraFields(); + $line = new DeliveryLigne($this->db); + $line->array_options = $array_options; + $line->id = $id; + $result = $line->insertExtraFields(); if ($result < 0) { - $this->error[] = $livraisonline->error; + $this->error[] = $line->error; $error++; } } @@ -597,7 +597,7 @@ class Livraison extends CommonObject public function addline($origin_id, $qty) { $num = count($this->lines); - $line = new LivraisonLigne($this->db); + $line = new DeliveryLigne($this->db); $line->origin_id = $origin_id; $line->qty = $qty; @@ -643,8 +643,8 @@ class Livraison extends CommonObject $error = 0; - $sql = "DELETE FROM ".MAIN_DB_PREFIX."livraisondet"; - $sql .= " WHERE fk_livraison = ".$this->id; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."deliverydet"; + $sql .= " WHERE fk_delivery = ".$this->id; if ($this->db->query($sql)) { // Delete linked object @@ -653,13 +653,13 @@ class Livraison extends CommonObject if (!$error) { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."livraison"; + $sql = "DELETE FROM ".MAIN_DB_PREFIX."delivery"; $sql .= " WHERE rowid = ".$this->id; if ($this->db->query($sql)) { $this->db->commit(); - // On efface le repertoire de pdf provisoire + // Deleting pdf folder's draft On efface le repertoire de pdf provisoire $ref = dol_sanitizeFileName($this->ref); if (!empty($conf->expedition->dir_output)) { @@ -725,7 +725,7 @@ class Livraison extends CommonObject $label = img_picto('', $this->picto).' '.$langs->trans("ShowReceiving").':
'; $label .= ''.$langs->trans("Status").': '.$this->ref; - $url = DOL_URL_ROOT.'/livraison/card.php?id='.$this->id; + $url = DOL_URL_ROOT.'/delivery/card.php?id='.$this->id; //if ($option !== 'nolink') //{ @@ -760,10 +760,10 @@ class Livraison extends CommonObject $sql .= " cd.qty as qty_asked, cd.label as custom_label, cd.fk_unit,"; $sql .= " p.ref as product_ref, p.fk_product_type as fk_product_type, p.label as product_label, p.description as product_desc,"; $sql .= " p.weight, p.weight_units, p.width, p.width_units, p.length, p.length_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units, p.tobatch as product_tobatch"; - $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."livraisondet as ld"; + $sql .= " FROM ".MAIN_DB_PREFIX."commandedet as cd, ".MAIN_DB_PREFIX."deliverydet as ld"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on p.rowid = ld.fk_product"; $sql .= " WHERE ld.fk_origin_line = cd.rowid"; - $sql .= " AND ld.fk_livraison = ".$this->id; + $sql .= " AND ld.fk_delivery = ".$this->id; dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG); $resql = $this->db->query($sql); @@ -773,7 +773,7 @@ class Livraison extends CommonObject $i = 0; while ($i < $num) { - $line = new LivraisonLigne($this->db); + $line = new DeliveryLigne($this->db); $obj = $this->db->fetch_object($resql); @@ -911,7 +911,7 @@ class Livraison extends CommonObject $this->note_private = 'Private note'; $i = 0; - $line = new LivraisonLigne($this->db); + $line = new DeliveryLigne($this->db); $line->fk_product = $prodids[0]; $line->qty_asked = 10; $line->qty_shipped = 9; @@ -956,10 +956,10 @@ class Livraison extends CommonObject // Get lines of sources alread delivered $sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty"; - $sql .= " FROM ".MAIN_DB_PREFIX."livraisondet as ld, ".MAIN_DB_PREFIX."livraison as l,"; + $sql .= " FROM ".MAIN_DB_PREFIX."deliverydet as ld, ".MAIN_DB_PREFIX."delivery as l,"; $sql .= " ".MAIN_DB_PREFIX.$this->linked_object[0]['type']." as c"; $sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd"; - $sql .= " WHERE ld.fk_livraison = l.rowid"; + $sql .= " WHERE ld.fk_delivery = l.rowid"; $sql .= " AND ld.fk_origin_line = cd.rowid"; $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = c.rowid"; $sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".$this->linked_object[0]['linkid']; @@ -1001,23 +1001,23 @@ class Livraison extends CommonObject * Set the planned delivery date * * @param User $user Objet utilisateur qui modifie - * @param integer $date_livraison Date de livraison + * @param integer $delivery_date Delivery date * @return int <0 if KO, >0 if OK */ - public function set_date_livraison($user, $date_livraison) + public function set_delivery_date($user, $delivery_date) { // phpcs:enable if ($user->rights->expedition->creer) { - $sql = "UPDATE ".MAIN_DB_PREFIX."livraison"; - $sql .= " SET date_delivery = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql = "UPDATE ".MAIN_DB_PREFIX."delivery"; + $sql .= " SET date_delivery = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); + dol_syslog(get_class($this)."::set_delivery_date", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $this->date_delivery = $date_livraison; + $this->date_delivery = $delivery_date; return 1; } else { $this->error = $this->db->error(); @@ -1050,12 +1050,12 @@ class Livraison extends CommonObject if ($this->model_pdf) { $modele = $this->model_pdf; - } elseif (!empty($conf->global->LIVRAISON_ADDON_PDF)) { - $modele = $conf->global->LIVRAISON_ADDON_PDF; + } elseif (!empty($conf->global->DELIVERY_ADDON_PDF)) { + $modele = $conf->global->DELIVERY_ADDON_PDF; } } - $modelpath = "core/modules/livraison/doc/"; + $modelpath = "core/modules/delivery/doc/"; return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref); } @@ -1071,7 +1071,7 @@ class Livraison extends CommonObject public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id) { $tables = array( - 'livraison' + 'delivery' ); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); @@ -1083,7 +1083,7 @@ class Livraison extends CommonObject /** * Management class of delivery note lines */ -class LivraisonLigne extends CommonObjectLine +class DeliveryLigne extends CommonObjectLine { /** * @var DoliDB Database handler. @@ -1125,12 +1125,12 @@ class LivraisonLigne extends CommonObjectLine /** * @var string ID to identify managed object */ - public $element = 'livraisondet'; + public $element = 'deliverydet'; /** * @var string Name of table without prefix where object is stored */ - public $table_element = 'livraisondet'; + public $table_element = 'deliverydet'; /** * Constructor diff --git a/htdocs/livraison/class/index.html b/htdocs/delivery/class/index.html similarity index 100% rename from htdocs/livraison/class/index.html rename to htdocs/delivery/class/index.html diff --git a/htdocs/livraison/index.html b/htdocs/delivery/index.html similarity index 100% rename from htdocs/livraison/index.html rename to htdocs/delivery/index.html diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index baf8d6be46e..a26b6bf8113 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -102,7 +102,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context $hookmanager->initHooks(array('expeditioncard', 'globalcard')); -$permissiondellink = $user->rights->expedition->livraison->creer; // Used by the include of actions_dellink.inc.php +$permissiondellink = $user->rights->expedition->delivery->creer; // Used by the include of actions_dellink.inc.php //var_dump($object->lines[0]->detail_batch); @@ -399,12 +399,12 @@ if (empty($reshook)) /* * Build a receiving receipt */ - elseif ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user->rights->expedition->livraison->creer) + elseif ($action == 'create_delivery' && $conf->delivery_note->enabled && $user->rights->expedition->delivery->creer) { $result = $object->create_delivery($user); if ($result > 0) { - header("Location: ".DOL_URL_ROOT.'/livraison/card.php?action=create_delivery&id='.$result); + header("Location: ".DOL_URL_ROOT.'/delivery/card.php?action=create_delivery&id='.$result); exit; } else { setEventMessages($object->error, $object->errors, 'errors'); @@ -479,7 +479,7 @@ if (empty($reshook)) $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $object->fetch($id); - $result = $object->set_date_livraison($user, $datedelivery); + $result = $object->set_delivery_date($user, $datedelivery); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -2046,13 +2046,13 @@ if ($action == 'create') $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as shipmentline_id, ed.qty as qty_shipped, ed.fk_expedition as expedition_id, ed.fk_origin_line, ed.fk_entrepot"; $sql .= ", e.rowid as shipment_id, e.ref as shipment_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_expedition"; - //if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; + //if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; $sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch'; $sql .= ', p.description as product_desc'; $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql .= ", ".MAIN_DB_PREFIX."expedition as e"; $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; - //if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."livraisondet as ld ON ld.fk_livraison = l.rowid AND obj.rowid = ld.fk_origin_line"; + //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_expedition = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('expedition').")"; $sql .= " AND obj.fk_".$origin." = ".$origin_id; @@ -2467,7 +2467,7 @@ if ($action == 'create') // This is just to generate a delivery receipt //var_dump($object->linkedObjectsIds['delivery']); - if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && empty($object->linkedObjectsIds['delivery'])) + if ($conf->delivery_note->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->delivery->creer && empty($object->linkedObjectsIds['delivery'])) { print ''.$langs->trans("CreateDeliveryOrder").''; } diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 1f4a0d42386..ccc67a1c256 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -880,13 +880,13 @@ class Expedition extends CommonObject // phpcs:enable global $conf; - if ($conf->livraison_bon->enabled) + if ($conf->delivery_note->enabled) { if ($this->statut == self::STATUS_VALIDATED || $this->statut == self::STATUS_CLOSED) { // Expedition validee - include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; - $delivery = new Livraison($this->db); + include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php'; + $delivery = new Delivery($this->db); $result = $delivery->create_from_sending($user, $this->id); if ($result > 0) { @@ -1962,23 +1962,23 @@ class Expedition extends CommonObject * Set the planned delivery date * * @param User $user Objet user that modify - * @param integer $date_livraison Date of delivery + * @param integer $delivery_date Date of delivery * @return int <0 if KO, >0 if OK */ - public function set_date_livraison($user, $date_livraison) + public function set_delivery_date($user, $delivery_date) { // phpcs:enable if ($user->rights->expedition->creer) { $sql = "UPDATE ".MAIN_DB_PREFIX."expedition"; - $sql .= " SET date_delivery = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_delivery = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); + dol_syslog(get_class($this)."::set_delivery_date", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $this->date_delivery = $date_livraison; + $this->date_delivery = $delivery_date; return 1; } else { $this->error = $this->db->error(); diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 37bee98d73f..b4e8047341b 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -127,8 +127,8 @@ $arrayfields = array( 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled) ? 0 : 1)), - 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->livraison_bon->enabled) ? 0 : 1)), + 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)), + 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)), 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))) ); @@ -246,7 +246,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.rowid = ee.fk_target"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target"; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON e.fk_user_author = u.rowid'; // We'll need this table joined to the select in order to filter by sale diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index 5b3949dc584..31d6fcaed02 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -108,7 +108,7 @@ if (empty($reshook)) $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $object->fetch($id); - $result = $object->set_date_livraison($user, $datedelivery); + $result = $object->set_delivery_date($user, $datedelivery); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index aad242d9157..ba9f79a3c99 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -117,7 +117,7 @@ class CommandeFournisseur extends CommonOrder /** * Delivery date */ - public $date_livraison; + public $delivery_date; public $total_ht; public $total_tva; @@ -2262,11 +2262,11 @@ class CommandeFournisseur extends CommonOrder * Set the planned delivery date * * @param User $user Objet user making change - * @param integer $date_livraison Planned delivery date + * @param integer $delivery_date Planned delivery date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 if KO, >0 if OK */ - public function set_date_livraison($user, $date_livraison, $notrigger = 0) + public function set_delivery_date($user, $delivery_date, $notrigger = 0) { // phpcs:enable if ($user->rights->fournisseur->commande->creer) @@ -2276,7 +2276,7 @@ class CommandeFournisseur extends CommonOrder $this->db->begin(); $sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; - $sql .= " SET date_livraison = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_livraison = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; dol_syslog(__METHOD__, LOG_DEBUG); @@ -2290,7 +2290,7 @@ class CommandeFournisseur extends CommonOrder if (!$error) { $this->oldcopy = clone $this; - $this->date_livraison = $date_livraison; + $this->date_livraison = $delivery_date; } if (!$notrigger && empty($error)) @@ -2324,7 +2324,7 @@ class CommandeFournisseur extends CommonOrder * Set the id projet * * @param User $user Objet utilisateur qui modifie - * @param int $id_projet Date de livraison + * @param int $id_projet Delivery date * @param int $notrigger 1=Does not execute triggers, 0= execute triggers * @return int <0 si ko, >0 si ok */ diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index 1d67609ee3a..e202b3e8efd 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -203,7 +203,7 @@ if (empty($reshook)) // date of delivery if ($action == 'setdate_livraison' && $usercancreate) { - $result = $object->set_date_livraison($user, $datelivraison); + $result = $object->set_delivery_date($user, $datelivraison); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors'); } @@ -1199,7 +1199,7 @@ if (empty($reshook)) $result = $srcobject->fetch($object->origin_id); if ($result > 0) { - $object->set_date_livraison($user, $srcobject->date_livraison); + $object->set_delivery_date($user, $srcobject->date_livraison); $object->set_id_projet($user, $srcobject->fk_project); $lines = $srcobject->lines; diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 389d7dc478e..784bb8f60b8 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -403,6 +403,7 @@ ALTER TABLE llx_projet_task_time MODIFY COLUMN tms timestamp DEFAULT CURRENT_TIM ALTER TABLE llx_projet_task_time MODIFY COLUMN datec datetime; + DELETE FROM llx_user_rights WHERE fk_id IN (SELECT id FROM llx_rights_def where module = 'holiday' and perms = 'lire_tous'); DELETE FROM llx_rights_def where module = 'holiday' and perms = 'lire_tous'; @@ -421,3 +422,61 @@ INSERT INTO llx_c_product_nature (code, label, active) VALUES (1, 'Finished', 1) ALTER TABLE llx_product MODIFY COLUMN finished tinyint DEFAULT NULL; ALTER TABLE llx_product ADD CONSTRAINT fk_product_finished FOREIGN KEY (finished) REFERENCES llx_c_product_nature (code); + +-- MIGRATION TO DO AFTER RENAMING AN OBJECT + +-- rename Table +ALTER TABLE llx_livraison RENAME TO llx_delivery; +ALTER TABLE llx_livraison_extrafields RENAME TO llx_delivery_extrafields; +ALTER TABLE llx_livraisondet RENAME TO llx_deliverydet; +ALTER TABLE llx_livraisondet_extrafields RENAME TO llx_deliverydet_extrafields; + +-- rename index +ALTER TABLE llx_delivery DROP INDEX idx_livraison_uk_ref; +ALTER TABLE llx_delivery ADD UNIQUE INDEX idx_delivery_uk_ref (ref, entity); +ALTER TABLE llx_delivery DROP INDEX idx_livraison_fk_soc; +ALTER TABLE llx_delivery ADD INDEX idx_delivery_fk_soc (fk_soc); +ALTER TABLE llx_delivery DROP INDEX idx_livraison_fk_user_author; +ALTER TABLE llx_delivery ADD INDEX idx_delivery_fk_user_author (fk_user_author); +ALTER TABLE llx_delivery DROP INDEX idx_livraison_fk_user_valid; +ALTER TABLE llx_delivery ADD INDEX idx_delivery_fk_user_valid (fk_user_valid); + +-- drop constraint +ALTER TABLE llx_livraison DROP CONSTRAINT fk_livraison_fk_soc; +ALTER TABLE llx_livraison DROP CONSTRAINT fk_livraison_fk_user_author; +ALTER TABLE llx_livraison DROP CONSTRAINT fk_livraison_fk_user_valid; + +-- add constraint +ALTER TABLE llx_delivery ADD CONSTRAINT fk_delivery_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); +ALTER TABLE llx_delivery ADD CONSTRAINT fk_delivery_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); +ALTER TABLE llx_delivery ADD CONSTRAINT fk_delivery_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); + +-- update llx_extrafields +UPDATE llx_extrafields SET elementtype = 'delivery' WHERE elementtype = 'livraison'; +UPDATE llx_extrafields SET elementtype = 'deliverydet' WHERE elementtype = 'livraisondet'; + +-- update llx_ecm_files +UPDATE llx_ecm_files SET src_object_type = 'delivery' WHERE src_object_type = 'livraison'; + +-- update llx_links +UPDATE llx_links SET objecttype = 'delivery' WHERE objecttype = 'livraison'; + +-- update llx_document_model +UPDATE llx_document_model SET type = 'delivery' WHERE type = 'livraison'; + +-- update llx_object_lang +UPDATE llx_object_lang SET type_object = 'delivery' WHERE type_object = 'livraison'; + +-- update llx_c_type_contact +UPDATE llx_c_type_contact SET element = 'delivery' WHERE element = 'livraison'; + +-- update llx_c_email_template +UPDATE llx_c_email_template SET type_template = 'delivery' WHERE type_template = 'livraison'; + +-- update llx_element_element +UPDATE llx_element_element SET sourcetype = 'delivery' WHERE sourcetype = 'livraison'; +UPDATE llx_element_element SET targettype = 'delivery' WHERE targettype = 'livraison'; + +-- update llx_actioncomm +UPDATE llx_actioncomm SET element_type = 'delivery' WHERE element_type = 'livraison'; + diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index c9c916ed3ad..d21c43bfb8a 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -91,8 +91,8 @@ delete from llx_commandedet where fk_commande in (select rowid from llx_commande delete from llx_commande where ref = ''; delete from llx_propaldet where fk_propal in (select rowid from llx_propal where ref = ''); delete from llx_propal where ref = ''; -delete from llx_livraisondet where fk_livraison in (select rowid from llx_livraison where ref = ''); -delete from llx_livraison where ref = ''; +delete from llx_deliverydet where fk_delivery in (select rowid from llx_delivery where ref = ''); +delete from llx_delivery where ref = ''; delete from llx_expeditiondet where fk_expedition in (select rowid from llx_expedition where ref = ''); delete from llx_expedition where ref = ''; delete from llx_holiday_logs where fk_user_update not IN (select rowid from llx_user); @@ -187,8 +187,8 @@ delete from llx_categorie_project where fk_categorie not in (select rowid from l delete from llx_ecm_files where src_object_type = 'expensereport' and src_object_id NOT IN (select rowid from llx_expensereport); -- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links. -delete from llx_livraisondet where fk_livraison not in (select fk_target from llx_element_element where targettype = 'delivery') AND fk_livraison not in (select fk_source from llx_element_element where sourcetype = 'delivery'); -delete from llx_livraison where rowid not in (select fk_target from llx_element_element where targettype = 'delivery') AND rowid not in (select fk_source from llx_element_element where sourcetype = 'delivery'); +delete from llx_deliverydet where fk_delivery not in (select fk_target from llx_element_element where targettype = 'delivery') AND fk_delivery not in (select fk_source from llx_element_element where sourcetype = 'delivery'); +delete from llx_delivery where rowid not in (select fk_target from llx_element_element where targettype = 'delivery') AND rowid not in (select fk_source from llx_element_element where sourcetype = 'delivery'); -- Fix delete element_element orphelins (right side) diff --git a/htdocs/install/mysql/tables/llx_livraison.key.sql b/htdocs/install/mysql/tables/llx_delivery.key.sql similarity index 58% rename from htdocs/install/mysql/tables/llx_livraison.key.sql rename to htdocs/install/mysql/tables/llx_delivery.key.sql index e0e21c13451..4eb3b96f2a0 100644 --- a/htdocs/install/mysql/tables/llx_livraison.key.sql +++ b/htdocs/install/mysql/tables/llx_delivery.key.sql @@ -18,12 +18,12 @@ -- =================================================================== -ALTER TABLE llx_livraison ADD UNIQUE INDEX idx_livraison_uk_ref (ref, entity); +ALTER TABLE llx_delivery ADD UNIQUE INDEX idx_delivery_uk_ref (ref, entity); -ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_soc (fk_soc); -ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_user_author (fk_user_author); -ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_user_valid (fk_user_valid); +ALTER TABLE llx_delivery ADD INDEX idx_delivery_fk_soc (fk_soc); +ALTER TABLE llx_delivery ADD INDEX idx_delivery_fk_user_author (fk_user_author); +ALTER TABLE llx_delivery ADD INDEX idx_delivery_fk_user_valid (fk_user_valid); -ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); -ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); -ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); +ALTER TABLE llx_delivery ADD CONSTRAINT fk_delivery_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid); +ALTER TABLE llx_delivery ADD CONSTRAINT fk_delivery_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid); +ALTER TABLE llx_delivery ADD CONSTRAINT fk_delivery_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid); diff --git a/htdocs/install/mysql/tables/llx_livraison.sql b/htdocs/install/mysql/tables/llx_delivery.sql similarity index 98% rename from htdocs/install/mysql/tables/llx_livraison.sql rename to htdocs/install/mysql/tables/llx_delivery.sql index e58e8c3c0bd..8216b5cf145 100644 --- a/htdocs/install/mysql/tables/llx_livraison.sql +++ b/htdocs/install/mysql/tables/llx_delivery.sql @@ -17,7 +17,7 @@ -- -- =================================================================== -create table llx_livraison +create table llx_delivery ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, diff --git a/htdocs/install/mysql/tables/llx_livraison_extrafields.key.sql b/htdocs/install/mysql/tables/llx_delivery_extrafields.key.sql similarity index 90% rename from htdocs/install/mysql/tables/llx_livraison_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_delivery_extrafields.key.sql index 87d8931d27c..a9118a2493b 100644 --- a/htdocs/install/mysql/tables/llx_livraison_extrafields.key.sql +++ b/htdocs/install/mysql/tables/llx_delivery_extrafields.key.sql @@ -17,4 +17,4 @@ -- =================================================================== -ALTER TABLE llx_livraison_extrafields ADD INDEX idx_livraison_extrafields (fk_object); +ALTER TABLE llx_delivery_extrafields ADD INDEX idx_delivery_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_livraison_extrafields.sql b/htdocs/install/mysql/tables/llx_delivery_extrafields.sql similarity index 96% rename from htdocs/install/mysql/tables/llx_livraison_extrafields.sql rename to htdocs/install/mysql/tables/llx_delivery_extrafields.sql index d1fc611bfdd..2639902e0a5 100644 --- a/htdocs/install/mysql/tables/llx_livraison_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_delivery_extrafields.sql @@ -16,7 +16,7 @@ -- -- ======================================================================== -create table llx_livraison_extrafields +create table llx_delivery_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, diff --git a/htdocs/install/mysql/tables/llx_livraisondet.key.sql b/htdocs/install/mysql/tables/llx_deliverydet.key.sql similarity index 81% rename from htdocs/install/mysql/tables/llx_livraisondet.key.sql rename to htdocs/install/mysql/tables/llx_deliverydet.key.sql index 3006d520907..67ad3c37615 100644 --- a/htdocs/install/mysql/tables/llx_livraisondet.key.sql +++ b/htdocs/install/mysql/tables/llx_deliverydet.key.sql @@ -18,5 +18,5 @@ -- =================================================================== -ALTER TABLE llx_livraisondet ADD INDEX idx_livraisondet_fk_expedition (fk_livraison); -ALTER TABLE llx_livraisondet ADD CONSTRAINT fk_livraisondet_fk_livraison FOREIGN KEY (fk_livraison) REFERENCES llx_livraison (rowid); +ALTER TABLE llx_deliverydet ADD INDEX idx_deliverydet_fk_expedition (fk_delivery); +ALTER TABLE llx_deliverydet ADD CONSTRAINT fk_deliverydet_fk_delivery FOREIGN KEY (fk_delivery) REFERENCES llx_delivery (rowid); diff --git a/htdocs/install/mysql/tables/llx_livraisondet.sql b/htdocs/install/mysql/tables/llx_deliverydet.sql similarity index 96% rename from htdocs/install/mysql/tables/llx_livraisondet.sql rename to htdocs/install/mysql/tables/llx_deliverydet.sql index 3b30da9a955..69612018bf3 100644 --- a/htdocs/install/mysql/tables/llx_livraisondet.sql +++ b/htdocs/install/mysql/tables/llx_deliverydet.sql @@ -17,10 +17,10 @@ -- -- =================================================================== -create table llx_livraisondet +create table llx_deliverydet ( rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_livraison integer, + fk_delivery integer, fk_origin_line integer, -- Correspondance de la ligne avec le document d'origine (propal, commande) fk_product integer, description text, diff --git a/htdocs/install/mysql/tables/llx_livraisondet_extrafields.key.sql b/htdocs/install/mysql/tables/llx_deliverydet_extrafields.key.sql similarity index 90% rename from htdocs/install/mysql/tables/llx_livraisondet_extrafields.key.sql rename to htdocs/install/mysql/tables/llx_deliverydet_extrafields.key.sql index cc9ee6673d0..3bce2b47a3b 100644 --- a/htdocs/install/mysql/tables/llx_livraisondet_extrafields.key.sql +++ b/htdocs/install/mysql/tables/llx_deliverydet_extrafields.key.sql @@ -17,4 +17,4 @@ -- =================================================================== -ALTER TABLE llx_livraisondet_extrafields ADD INDEX idx_livraisondet_extrafields (fk_object); +ALTER TABLE llx_deliverydet_extrafields ADD INDEX idx_deliverydet_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_livraisondet_extrafields.sql b/htdocs/install/mysql/tables/llx_deliverydet_extrafields.sql similarity index 96% rename from htdocs/install/mysql/tables/llx_livraisondet_extrafields.sql rename to htdocs/install/mysql/tables/llx_deliverydet_extrafields.sql index 667f66ae0a8..00f240211c3 100644 --- a/htdocs/install/mysql/tables/llx_livraisondet_extrafields.sql +++ b/htdocs/install/mysql/tables/llx_deliverydet_extrafields.sql @@ -16,7 +16,7 @@ -- -- =================================================================== -create table llx_livraisondet_extrafields +create table llx_deliverydet_extrafields ( rowid integer AUTO_INCREMENT PRIMARY KEY, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 309343b7789..cd98cdfef2e 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -124,7 +124,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facturedet_extrafiel CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinter FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinter_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_fichinterdet_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_livraison FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); +CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_delivery FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_loan FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_localtax FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 6c154ca062a..c6208f1dd1b 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -2090,11 +2090,11 @@ function migrate_commande_livraison($db, $langs, $conf) if ($resql2) { - $date_livraison = $db->jdate($obj->date_livraison); + $delivery_date = $db->jdate($obj->date_livraison); $sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET"; $sqlu .= " ref_client='".$db->escape($obj->ref_client)."'"; - $sqlu .= ", date_livraison='".$db->idate($date_livraison)."'"; + $sqlu .= ", date_livraison='".$db->idate($delivery_date)."'"; $sqlu .= " WHERE rowid = ".$obj->rowid; $resql3 = $db->query($sqlu); if (!$resql3) diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index b7b4c2047f3..450dc1ebd57 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -425,7 +425,7 @@ if (empty($reshook)) $datedelivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int')); $object->fetch($id); - $result = $object->set_date_livraison($user, $datedelivery); + $result = $object->set_delivery_date($user, $datedelivery); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); @@ -1665,13 +1665,13 @@ if ($action == 'create') $sql = "SELECT obj.rowid, obj.fk_product, obj.label, obj.description, obj.product_type as fk_product_type, obj.qty as qty_asked, obj.date_start, obj.date_end"; $sql .= ", ed.rowid as receptionline_id, ed.qty, ed.fk_reception as reception_id, ed.fk_entrepot"; $sql .= ", e.rowid as reception_id, e.ref as reception_ref, e.date_creation, e.date_valid, e.date_delivery, e.date_reception"; - //if ($conf->livraison_bon->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; + //if ($conf->delivery_note->enabled) $sql .= ", l.rowid as livraison_id, l.ref as livraison_ref, l.date_delivery, ld.qty as qty_received"; $sql .= ', p.label as product_label, p.ref, p.fk_product_type, p.rowid as prodid, p.tobatch as product_tobatch'; $sql .= ', p.description as product_desc'; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= ", ".MAIN_DB_PREFIX."reception as e"; $sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; - //if ($conf->livraison_bon->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."livraisondet as ld ON ld.fk_livraison = l.rowid AND obj.rowid = ld.fk_origin_line"; + //if ($conf->delivery_note->enabled) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.fk_reception = e.rowid LEFT JOIN ".MAIN_DB_PREFIX."deliverydet as ld ON ld.fk_delivery = l.rowid AND obj.rowid = ld.fk_origin_line"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid"; $sql .= " WHERE e.entity IN (".getEntity('reception').")"; $sql .= " AND obj.fk_commande = ".$origin_id; diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 8ea45ccd1c8..0a2458f57a6 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1224,23 +1224,23 @@ class Reception extends CommonObject * Set the planned delivery date * * @param User $user Objet utilisateur qui modifie - * @param integer $date_livraison Date de livraison + * @param integer $delivery_date Delivery date * @return int <0 if KO, >0 if OK */ - public function set_date_livraison($user, $date_livraison) + public function set_delivery_date($user, $delivery_date) { // phpcs:enable if ($user->rights->reception->creer) { $sql = "UPDATE ".MAIN_DB_PREFIX."reception"; - $sql .= " SET date_delivery = ".($date_livraison ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_delivery = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; - dol_syslog(get_class($this)."::set_date_livraison", LOG_DEBUG); + dol_syslog(get_class($this)."::set_delivery_date", LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) { - $this->date_delivery = $date_livraison; + $this->date_delivery = $delivery_date; return 1; } else { $this->error = $this->db->error(); diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index 891a5630c7f..db8d652cc95 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -429,7 +429,7 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'reception' AND ee.targettype = 'delivery'"; -$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."livraison as l ON l.rowid = ee.fk_target"; +$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target"; if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all { $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 517f16a7916..7c3ea2d5d84 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -239,7 +239,7 @@ if (empty($reshook)) 'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php', 'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php', 'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php', - 'Livraison' => '/livraison/class/livraison.class.php', + 'Livraison' => '/delivery/class/delivery.class.php', 'Product' => '/product/class/product.class.php', 'Project' => '/projet/class/project.class.php', 'Ticket' => '/ticket/class/ticket.class.php', diff --git a/htdocs/societe/class/api_thirdparties.class.php b/htdocs/societe/class/api_thirdparties.class.php index 735ff6b49af..9a572a7e06f 100644 --- a/htdocs/societe/class/api_thirdparties.class.php +++ b/htdocs/societe/class/api_thirdparties.class.php @@ -420,7 +420,7 @@ class Thirdparties extends DolibarrApi 'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php', 'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php', 'ProductFournisseur' => '/fourn/class/fournisseur.product.class.php', - 'Livraison' => '/livraison/class/livraison.class.php', + 'Livraison' => '/delivery/class/delivery.class.php', 'Product' => '/product/class/product.class.php', 'Project' => '/projet/class/project.class.php', 'Ticket' => '/ticket/class/ticket.class.php', diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 2e18bf532c8..c364d3c63f4 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -229,7 +229,7 @@ if (empty($reshook)) else setEventMessages($langs->trans($object->error), null, 'errors'); } } elseif ($action == 'setdate_livraison' && $usercancreate) { - $result = $object->set_date_livraison($user, dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); + $result = $object->set_delivery_date($user, dol_mktime(12, 0, 0, $_POST['liv_month'], $_POST['liv_day'], $_POST['liv_year'])); if ($result < 0) dol_print_error($db, $object->error); } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 07b2dfe1d8b..cf18491e493 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -112,7 +112,7 @@ class SupplierProposal extends CommonObject /** * @var integer|string date_livraison */ - public $date_livraison; + public $delivery_date; /** * @deprecated @@ -1511,25 +1511,25 @@ class SupplierProposal extends CommonObject * Set delivery date * * @param User $user Object user that modify - * @param int $date_livraison Delivery date + * @param int $delivery_date Delivery date * @return int <0 if ko, >0 if ok */ - public function set_date_livraison($user, $date_livraison) + public function set_delivery_date($user, $delivery_date) { // phpcs:enable if (!empty($user->rights->supplier_proposal->creer)) { $sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal "; - $sql .= " SET date_livraison = ".($date_livraison != '' ? "'".$this->db->idate($date_livraison)."'" : 'null'); + $sql .= " SET date_livraison = ".($delivery_date != '' ? "'".$this->db->idate($delivery_date)."'" : 'null'); $sql .= " WHERE rowid = ".$this->id; if ($this->db->query($sql)) { - $this->date_livraison = $date_livraison; + $this->date_livraison = $delivery_date; return 1; } else { $this->error = $this->db->error(); - dol_syslog(get_class($this)."::set_date_livraison Erreur SQL"); + dol_syslog(get_class($this)."::set_delivery_date Erreur SQL"); return -1; } } diff --git a/phpstan.neon b/phpstan.neon index 71b70a42218..02e47e753d7 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -41,7 +41,7 @@ parameters: - %currentWorkingDirectory%/htdocs/core/modules/facture - %currentWorkingDirectory%/htdocs/core/modules/fichinter - %currentWorkingDirectory%/htdocs/core/modules/holiday - - %currentWorkingDirectory%/htdocs/core/modules/livraison + - %currentWorkingDirectory%/htdocs/core/modules/delivery #- %currentWorkingDirectory%/htdocs/core/modules/member - %currentWorkingDirectory%/htdocs/core/modules/payment - %currentWorkingDirectory%/htdocs/core/modules/product