Merge branch 'translateModLivraison2ModDelivery' of

https://github.com/orebd/dolibarr into develop

# Conflicts:
#	htdocs/install/mysql/migration/12.0.0-13.0.0.sql
This commit is contained in:
Laurent Destailleur 2020-10-25 16:01:18 +01:00
commit cd4d738a56
68 changed files with 389 additions and 331 deletions

View File

@ -12,21 +12,20 @@ NEW: Module Reception (for a more accurate management of your receptions) moved
WARNING: WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
* Properties ->contactid have been renamed into ->contact_id * The object "livraison" has been renamed into "delivery" (directory, class, keys, methods with livraison in name ...).
* Properties ->titre have been renamed into ->title * All properties ->contactid have been renamed into ->contact_id
* Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id (english) * All properties ->titre have been renamed into ->title
* The deprecated subsitution key __SIGNATURE__ has been removed. Replace with __USER_SIGNATURE__ if you used the old syntax in * Property $paiementid in API 'api_supplier_invoices.php' has been renamed into into $payment_mode_id
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.
* Property 'num_paiement' has been renamed 'num_payment' everywhere for better code consistency. * 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), * 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. 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. * 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. * 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 amount. * 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. * 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 ***** ***** ChangeLog for 12.0.3 compared to 12.0.2 *****

View File

@ -181,6 +181,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/debugbar %_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/delivery
%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/emailcollector %_datadir/dolibarr/htdocs/emailcollector
@ -198,7 +199,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/intracommreport
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin

View File

@ -261,6 +261,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/debugbar %_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/delivery
%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/emailcollector %_datadir/dolibarr/htdocs/emailcollector
@ -278,7 +279,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/intracommreport
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin

View File

@ -177,6 +177,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/custom %_datadir/dolibarr/htdocs/custom
%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/delivery
%_datadir/dolibarr/htdocs/debugbar %_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/ecm
@ -195,7 +196,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/intracommreport
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin

View File

@ -189,6 +189,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/datapolicy %_datadir/dolibarr/htdocs/datapolicy
%_datadir/dolibarr/htdocs/dav %_datadir/dolibarr/htdocs/dav
%_datadir/dolibarr/htdocs/debugbar %_datadir/dolibarr/htdocs/debugbar
%_datadir/dolibarr/htdocs/delivery
%_datadir/dolibarr/htdocs/don %_datadir/dolibarr/htdocs/don
%_datadir/dolibarr/htdocs/ecm %_datadir/dolibarr/htdocs/ecm
%_datadir/dolibarr/htdocs/emailcollector %_datadir/dolibarr/htdocs/emailcollector
@ -206,7 +207,6 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/install %_datadir/dolibarr/htdocs/install
%_datadir/dolibarr/htdocs/intracommreport %_datadir/dolibarr/htdocs/intracommreport
%_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt %_datadir/dolibarr/htdocs/langs/HOWTO-Translation.txt
%_datadir/dolibarr/htdocs/livraison
%_datadir/dolibarr/htdocs/loan %_datadir/dolibarr/htdocs/loan
%_datadir/dolibarr/htdocs/mailmanspip %_datadir/dolibarr/htdocs/mailmanspip
%_datadir/dolibarr/htdocs/margin %_datadir/dolibarr/htdocs/margin

View File

@ -120,8 +120,8 @@ $sqls=array(
"DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'", "DELETE FROM ".MAIN_DB_PREFIX."expedition where date_creation < '__DATE__'",
), ),
'delivery'=>array( '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."deliverydet WHERE fk_delivery IN (select rowid FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__')",
"DELETE FROM ".MAIN_DB_PREFIX."livraison where date_creation < '__DATE__'", "DELETE FROM ".MAIN_DB_PREFIX."delivery where date_creation < '__DATE__'",
), ),
'contract'=>array( '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__'))", "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__'))",

View File

@ -7522,13 +7522,13 @@ INSERT INTO `llx_links` VALUES (1,1,'2018-01-16 16:45:35','http://www.dolicloud.
UNLOCK TABLES; 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 @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_livraison` ( CREATE TABLE `llx_delivery` (
`rowid` int(11) NOT NULL AUTO_INCREMENT, `rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`ref` varchar(30) COLLATE utf8_unicode_ci NOT NULL, `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, `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL,
`extraparams` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `extraparams` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`rowid`), PRIMARY KEY (`rowid`),
UNIQUE KEY `idx_livraison_uk_ref` (`ref`,`entity`), UNIQUE KEY `idx_delivery_uk_ref` (`ref`,`entity`),
KEY `idx_livraison_fk_soc` (`fk_soc`), KEY `idx_delivery_fk_soc` (`fk_soc`),
KEY `idx_livraison_fk_user_author` (`fk_user_author`), KEY `idx_delivery_fk_user_author` (`fk_user_author`),
KEY `idx_livraison_fk_user_valid` (`fk_user_valid`), KEY `idx_delivery_fk_user_valid` (`fk_user_valid`),
CONSTRAINT `fk_livraison_fk_soc` FOREIGN KEY (`fk_soc`) REFERENCES `llx_societe` (`rowid`), CONSTRAINT `fk_delivery_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_delivery_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`) CONSTRAINT `fk_delivery_fk_user_valid` FOREIGN KEY (`fk_user_valid`) REFERENCES `llx_user` (`rowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!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; LOCK TABLES `llx_delivery` WRITE;
/*!40000 ALTER TABLE `llx_livraison` DISABLE KEYS */; /*!40000 ALTER TABLE `llx_delivery` DISABLE KEYS */;
/*!40000 ALTER TABLE `llx_livraison` ENABLE KEYS */; /*!40000 ALTER TABLE `llx_delivery` ENABLE KEYS */;
UNLOCK TABLES; 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 @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_livraison_extrafields` ( CREATE TABLE `llx_delivery_extrafields` (
`rowid` int(11) NOT NULL AUTO_INCREMENT, `rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`fk_object` int(11) NOT NULL, `fk_object` int(11) NOT NULL,
`import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`rowid`), PRIMARY KEY (`rowid`),
KEY `idx_livraison_extrafields` (`fk_object`) KEY `idx_delivery_extrafields` (`fk_object`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!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; LOCK TABLES `llx_delivery_extrafields` WRITE;
/*!40000 ALTER TABLE `llx_livraison_extrafields` DISABLE KEYS */; /*!40000 ALTER TABLE `llx_delivery_extrafields` DISABLE KEYS */;
/*!40000 ALTER TABLE `llx_livraison_extrafields` ENABLE KEYS */; /*!40000 ALTER TABLE `llx_delivery_extrafields` ENABLE KEYS */;
UNLOCK TABLES; 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 @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_livraisondet` ( CREATE TABLE `llx_deliverydet` (
`rowid` int(11) NOT NULL AUTO_INCREMENT, `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_origin_line` int(11) DEFAULT NULL,
`fk_product` int(11) DEFAULT NULL, `fk_product` int(11) DEFAULT NULL,
`description` text COLLATE utf8_unicode_ci 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, `total_ht` double(24,8) DEFAULT 0.00000000,
`rang` int(11) DEFAULT 0, `rang` int(11) DEFAULT 0,
PRIMARY KEY (`rowid`), PRIMARY KEY (`rowid`),
KEY `idx_livraisondet_fk_expedition` (`fk_livraison`), KEY `idx_deliverydet_fk_expedition` (`fk_delivery`),
CONSTRAINT `fk_livraisondet_fk_livraison` FOREIGN KEY (`fk_livraison`) REFERENCES `llx_livraison` (`rowid`) CONSTRAINT `fk_deliverydet_fk_delivery` FOREIGN KEY (`fk_delivery`) REFERENCES `llx_delivery` (`rowid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!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; LOCK TABLES `llx_deliverydet` WRITE;
/*!40000 ALTER TABLE `llx_livraisondet` DISABLE KEYS */; /*!40000 ALTER TABLE `llx_deliverydet` DISABLE KEYS */;
/*!40000 ALTER TABLE `llx_livraisondet` ENABLE KEYS */; /*!40000 ALTER TABLE `llx_deliverydet` ENABLE KEYS */;
UNLOCK TABLES; 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 @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */; /*!40101 SET character_set_client = utf8 */;
CREATE TABLE `llx_livraisondet_extrafields` ( CREATE TABLE `llx_deliverydet_extrafields` (
`rowid` int(11) NOT NULL AUTO_INCREMENT, `rowid` int(11) NOT NULL AUTO_INCREMENT,
`tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `tms` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
`fk_object` int(11) NOT NULL, `fk_object` int(11) NOT NULL,
`import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL, `import_key` varchar(14) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`rowid`), PRIMARY KEY (`rowid`),
KEY `idx_livraisondet_extrafields` (`fk_object`) KEY `idx_deliverydet_extrafields` (`fk_object`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */; /*!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; LOCK TABLES `llx_deliverydet_extrafields` WRITE;
/*!40000 ALTER TABLE `llx_livraisondet_extrafields` DISABLE KEYS */; /*!40000 ALTER TABLE `llx_deliverydet_extrafields` DISABLE KEYS */;
/*!40000 ALTER TABLE `llx_livraisondet_extrafields` ENABLE KEYS */; /*!40000 ALTER TABLE `llx_deliverydet_extrafields` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
-- --

View File

@ -67,12 +67,12 @@ if ($action == 'disable_sending')
if ($action == 'activate_delivery') 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_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"); header("Location: confexped.php");
exit; exit;
} elseif ($action == 'disable_delivery') } 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"); header("Location: confexped.php");
exit; exit;
} }
@ -121,7 +121,7 @@ else
print "</td>"; print "</td>";
print '</tr>'; print '</tr>';
// Bon de livraison activation/desactivation // Delivery note activate/deactivate Bon de livraison activation/desactivation
print '<tr>'; print '<tr>';
print '<td>'; print '<td>';
print $langs->trans("DeliveriesOrderAbility"); print $langs->trans("DeliveriesOrderAbility");
@ -131,7 +131,7 @@ print '<td>';
print '</td>'; print '</td>';
print '<td class="center">'; print '<td class="center">';
if (empty($conf->global->MAIN_SUBMODULE_LIVRAISON)) if (empty($conf->global->MAIN_SUBMODULE_DELIVERY))
{ {
print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>'; print '<a href="confexped.php?action=activate_delivery">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
} else { } else {

View File

@ -24,15 +24,15 @@
*/ */
/** /**
* \file htdocs/admin/livraison.php * \file htdocs/admin/delivery.php
* \ingroup livraison * \ingroup delivery
* \brief Page d'administration/configuration du module Livraison * \brief age to setup extra fields of delivery
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.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/pdf.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/expedition.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 // Load translation files required by the page
$langs->loadLangs(array("admin", "sendings", "deliveries", "other")); $langs->loadLangs(array("admin", "sendings", "deliveries", "other"));
@ -87,7 +87,7 @@ if ($action == 'specimen')
{ {
$modele = GETPOST('module', 'alpha'); $modele = GETPOST('module', 'alpha');
$sending = new Livraison($db); $sending = new Delivery($db);
$sending->initAsSpecimen(); $sending->initAsSpecimen();
// Search template files // Search template files
@ -95,7 +95,7 @@ if ($action == 'specimen')
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']); $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
foreach ($dirmodels as $reldir) 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)) if (file_exists($file))
{ {
$filefound = 1; $filefound = 1;
@ -112,7 +112,7 @@ if ($action == 'specimen')
if ($module->write_file($sending, $langs) > 0) 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; return;
} else { } else {
setEventMessages($module->error, $module->errors, 'errors'); setEventMessages($module->error, $module->errors, 'errors');
@ -134,17 +134,17 @@ if ($action == 'del')
$ret = delDocumentModel($value, $type); $ret = delDocumentModel($value, $type);
if ($ret > 0) 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 ($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 // La constante qui a ete lue en avant du nouveau set
// on passe donc par une variable pour avoir un affichage coherent // 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 // On active le modele
@ -160,7 +160,7 @@ if ($action == 'setmod')
// TODO Verifier si module numerotation choisi peut etre active // TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated // 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) foreach ($dirmodels as $reldir)
{ {
$dir = dol_buildpath($reldir."core/modules/livraison/"); $dir = dol_buildpath($reldir."core/modules/delivery/");
if (is_dir($dir)) if (is_dir($dir))
{ {
@ -208,7 +208,7 @@ foreach ($dirmodels as $reldir)
{ {
while (($file = readdir($handle)) !== false) 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); $file = substr($file, 0, dol_strlen($file) - 4);
@ -237,7 +237,7 @@ foreach ($dirmodels as $reldir)
print '</td>'."\n"; print '</td>'."\n";
print '<td class="center">'; print '<td class="center">';
if ($conf->global->LIVRAISON_ADDON_NUMBER == "$file") if ($conf->global->DELIVERY_ADDON_NUMBER == "$file")
{ {
print img_picto($langs->trans("Activated"), 'switch_on'); print img_picto($langs->trans("Activated"), 'switch_on');
} else { } else {
@ -245,13 +245,13 @@ foreach ($dirmodels as $reldir)
} }
print '</td>'; print '</td>';
$livraison = new Livraison($db); $delivery = new Delivery($db);
$livraison->initAsSpecimen(); $delivery->initAsSpecimen();
// Info // Info
$htmltooltip = ''; $htmltooltip = '';
$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>'; $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
$nextval = $module->getNextValue($mysoc, $livraison); $nextval = $module->getNextValue($mysoc, $delivery);
if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
$htmltooltip .= ''.$langs->trans("NextValue").': '; $htmltooltip .= ''.$langs->trans("NextValue").': ';
if ($nextval) { if ($nextval) {
@ -323,7 +323,7 @@ clearstatcache();
foreach ($dirmodels as $reldir) foreach ($dirmodels as $reldir)
{ {
$dir = dol_buildpath($reldir."core/modules/livraison/doc/"); $dir = dol_buildpath($reldir."core/modules/delivery/doc/");
if (is_dir($dir)) if (is_dir($dir))
{ {
@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir)
// Default // Default
print "<td align=\"center\">"; print "<td align=\"center\">";
if ($conf->global->LIVRAISON_ADDON_PDF == "$name") if ($conf->global->DELIVERY_ADDON_PDF == "$name")
{ {
print img_picto($langs->trans("Default"), 'on'); print img_picto($langs->trans("Default"), 'on');
} else { } else {

View File

@ -22,9 +22,9 @@
*/ */
/** /**
* \file htdocs/admin/livraison_extrafields.php * \file htdocs/admin/delivery_extrafields.php
* \ingroup livraison * \ingroup delivery
* \brief Page to setup extra fields of livraison * \brief Page to setup extra fields of delivery
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -49,7 +49,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoenti
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$attrname = GETPOST('attrname', 'alpha'); $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(); if (!$user->admin) accessforbidden();

View File

@ -24,9 +24,9 @@
*/ */
/** /**
* \file htdocs/admin/livraisondet_extrafields.php * \file htdocs/admin/deliverydet_extrafields.php
* \ingroup livraison * \ingroup delivery
* \brief Page to setup extra fields of livraison * \brief Page to setup extra fields of delivery
*/ */
require '../main.inc.php'; require '../main.inc.php';
@ -50,7 +50,7 @@ foreach ($tmptype2label as $key => $val) $type2label[$key] = $langs->transnoenti
$action = GETPOST('action', 'aZ09'); $action = GETPOST('action', 'aZ09');
$attrname = GETPOST('attrname', 'alpha'); $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(); if (!$user->admin) accessforbidden();

View File

@ -287,7 +287,7 @@ if (empty($reshook))
dol_print_error($db, $object->error); dol_print_error($db, $object->error);
} elseif ($action == 'setdate_livraison' && $usercancreate) } 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) if ($result < 0)
dol_print_error($db, $object->error); dol_print_error($db, $object->error);
} // Positionne ref client } // Positionne ref client

View File

@ -152,9 +152,9 @@ class Propal extends CommonObject
public $datep; public $datep;
/** /**
* @var integer|string $date_livraison; * @var integer|string $delivery_date;
*/ */
public $date_livraison; public $delivery_date;
public $fin_validite; public $fin_validite;
@ -2065,11 +2065,11 @@ class Propal extends CommonObject
* Set delivery date * Set delivery date
* *
* @param User $user Object user that modify * @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 * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if ko, >0 if ok * @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 // phpcs:enable
if (!empty($user->rights->propal->creer)) if (!empty($user->rights->propal->creer))
@ -2079,7 +2079,7 @@ class Propal extends CommonObject
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."propal "; $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; $sql .= " WHERE rowid = ".$this->id;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -2093,7 +2093,7 @@ class Propal extends CommonObject
if (!$error) if (!$error)
{ {
$this->oldcopy = clone $this; $this->oldcopy = clone $this;
$this->date_livraison = $date_livraison; $this->date_livraison = $delivery_date;
} }
if (!$notrigger && empty($error)) if (!$notrigger && empty($error))

View File

@ -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')); $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); $object->fetch($id);
$result = $object->set_date_livraison($user, $datedelivery); $result = $object->set_delivery_date($user, $datedelivery);
if ($result < 0) { if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
} }
@ -2556,7 +2556,7 @@ if ($action == 'create' && $usercancreate)
$numshipping = $object->nb_expedition(); $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 ($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) { if ($user->rights->expedition->creer) {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id.'">'.$langs->trans('CreateShipment').'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id.'">'.$langs->trans('CreateShipment').'</a>';
} else { } else {

View File

@ -180,7 +180,7 @@ class Commande extends CommonOrder
*/ */
public $date_commande; 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 * @var int ID
@ -2552,11 +2552,11 @@ class Commande extends CommonOrder
* Set the planned delivery date * Set the planned delivery date
* *
* @param User $user Objet utilisateur qui modifie * @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 * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 si ko, >0 si ok * @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 // phpcs:enable
if ($user->rights->commande->creer) if ($user->rights->commande->creer)
@ -2566,7 +2566,7 @@ class Commande extends CommonOrder
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."commande"; $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; $sql .= " WHERE rowid = ".$this->id;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -2580,7 +2580,7 @@ class Commande extends CommonOrder
if (!$error) if (!$error)
{ {
$this->oldcopy = clone $this; $this->oldcopy = clone $this;
$this->date_livraison = $date_livraison; $this->date_livraison = $delivery_date;
} }
if (!$notrigger && empty($error)) if (!$notrigger && empty($error))

View File

@ -112,10 +112,10 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
while ($line < $num) { while ($line < $num) {
$objp = $this->db->fetch_object($result); $objp = $this->db->fetch_object($result);
$date = $this->db->jdate($objp->date_commande); $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); $datem = $this->db->jdate($objp->tms);
$supplierorderstatic->date_livraison = $date_livraison; $supplierorderstatic->date_livraison = $delivery_date;
$supplierorderstatic->statut = $objp->fk_statut; $supplierorderstatic->statut = $objp->fk_statut;
$supplierorderstatic->id = $objp->rowid; $supplierorderstatic->id = $objp->rowid;
@ -152,7 +152,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$this->info_box_contents[$line][] = array( $this->info_box_contents[$line][] = array(
'td' => 'class="right"', 'td' => 'class="right"',
'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-dolly" ></i> '.dol_print_date($date_livraison, 'day').'</span>', 'text' => $delayIcon.'<span class="classfortooltip" title="'.$langs->trans('DateDeliveryPlanned').'"><i class="fa fa-dolly" ></i> '.dol_print_date($delivery_date, 'day').'</span>',
'asis' => 1 'asis' => 1
); );

View File

@ -3356,7 +3356,7 @@ abstract class CommonObject
} elseif ($objecttype == 'shipping') { } elseif ($objecttype == 'shipping') {
$classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon'; $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
} elseif ($objecttype == 'delivery') { } 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') { } elseif ($objecttype == 'invoice_supplier' || $objecttype == 'order_supplier') {
$classpath = 'fourn/class'; $module = 'fournisseur'; $classpath = 'fourn/class'; $module = 'fournisseur';
} elseif ($objecttype == 'fichinter') { } elseif ($objecttype == 'fichinter') {

View File

@ -122,7 +122,7 @@ class Conf
// First level object // First level object
// TODO Remove this part. // TODO Remove this part.
$this->expedition_bon = new stdClass(); $this->expedition_bon = new stdClass();
$this->livraison_bon = new stdClass(); $this->delivery_note = new stdClass();
$this->fournisseur = new stdClass(); $this->fournisseur = new stdClass();
$this->product = new stdClass(); $this->product = new stdClass();
$this->service = new stdClass(); $this->service = new stdClass();
@ -370,8 +370,8 @@ class Conf
// Sous module bons d'expedition // Sous module bons d'expedition
$this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0); $this->expedition_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_EXPEDITION) ? $this->global->MAIN_SUBMODULE_EXPEDITION : 0);
// Sous module bons de livraison // Sub module delivery note Sous module bons de livraison
$this->livraison_bon->enabled = (!empty($this->global->MAIN_SUBMODULE_LIVRAISON) ? $this->global->MAIN_SUBMODULE_LIVRAISON : 0); $this->delivery_note->enabled = (!empty($this->global->MAIN_SUBMODULE_DELIVERY) ? $this->global->MAIN_SUBMODULE_DELIVERY : 0);
// Module fournisseur // Module fournisseur
if (!empty($this->fournisseur)) if (!empty($this->fournisseur))

View File

@ -6898,7 +6898,7 @@ class Form
$tplpath = 'reception'; $tplpath = 'reception';
if (empty($conf->reception->enabled)) continue; // Do not show if module disabled if (empty($conf->reception->enabled)) continue; // Do not show if module disabled
} elseif ($objecttype == 'delivery') { } elseif ($objecttype == 'delivery') {
$tplpath = 'livraison'; $tplpath = 'delivery';
if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled if (empty($conf->expedition->enabled)) continue; // Do not show if module disabled
} elseif ($objecttype == 'invoice_supplier') { } elseif ($objecttype == 'invoice_supplier') {
$tplpath = 'fourn/facture'; $tplpath = 'fourn/facture';

View File

@ -366,7 +366,7 @@ class FormFile
} }
$printer = 0; $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; $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'; include_once DOL_DOCUMENT_ROOT.'/core/modules/reception/modules_reception.php';
$modellist = ModelePdfReception::liste_modeles($this->db); $modellist = ModelePdfReception::liste_modeles($this->db);
} }
} elseif ($modulepart == 'livraison') } elseif ($modulepart == 'delivery')
{ {
if (is_array($genallowed)) $modellist = $genallowed; if (is_array($genallowed)) $modellist = $genallowed;
else { 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); $modellist = ModelePDFDeliveryOrder::liste_modeles($this->db);
} }
} elseif ($modulepart == 'ficheinter') } elseif ($modulepart == 'ficheinter')

View File

@ -51,9 +51,9 @@ function expedition_prepare_head(Expedition $object)
$hselected = $h; $hselected = $h;
$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"); $head[$h][1] = $langs->trans("Receivings");
$h++; $h++;
} }
@ -109,25 +109,25 @@ function expedition_admin_prepare_head()
$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"); $head[$h][1] = $langs->trans("Receivings");
$head[$h][2] = 'receivings'; $head[$h][2] = 'receivings';
$h++; $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][1] = $langs->trans("ExtraFields");
$head[$h][2] = 'attributes_receivings'; $head[$h][2] = 'attributes_receivings';
$h++; $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][1] = $langs->trans("ExtraFieldsLines");
$head[$h][2] = 'attributeslines_receivings'; $head[$h][2] = 'attributeslines_receivings';
$h++; $h++;

View File

@ -2644,10 +2644,10 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$accessallowed = 1; $accessallowed = 1;
} }
$original_file = $conf->expedition->dir_output."/sending/".$original_file; $original_file = $conf->expedition->dir_output."/sending/".$original_file;
} // Wrapping pour les bons de livraison } // Delivery Note Wrapping
elseif ($modulepart == 'livraison' && !empty($conf->expedition->dir_output)) 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; $accessallowed = 1;
} }

View File

@ -8723,9 +8723,9 @@ function getElementProperties($element_type)
$module = 'expedition_bon'; $module = 'expedition_bon';
} }
if ($element_type == 'delivery') { if ($element_type == 'delivery') {
$classpath = 'livraison/class'; $classpath = 'delivery/class';
$subelement = 'livraison'; $subelement = 'delivery';
$module = 'livraison_bon'; $module = 'delivery_note';
} }
if ($element_type == 'contract') { if ($element_type == 'contract') {
$classpath = 'contrat/class'; $classpath = 'contrat/class';

View File

@ -1791,9 +1791,9 @@ function dolGetElementUrl($objectid, $objecttype, $withpicto = 0, $option = '')
$myobject = 'expedition'; $myobject = 'expedition';
$module = 'expedition_bon'; $module = 'expedition_bon';
} elseif ($objecttype == 'delivery') { } elseif ($objecttype == 'delivery') {
$classpath = 'livraison/class'; $classpath = 'delivery/class';
$myobject = 'livraison'; $myobject = 'delivery';
$module = 'livraison_bon'; $module = 'delivery_note';
} elseif ($objecttype == 'contract') { } elseif ($objecttype == 'contract') {
$classpath = 'contrat/class'; $classpath = 'contrat/class';
$module = 'contrat'; $module = 'contrat';

View File

@ -59,17 +59,17 @@ function commande_prepare_head(Commande $object)
} }
if (($conf->expedition_bon->enabled && $user->rights->expedition->lire) 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; $nbShipments = $object->getNbOfShipments(); $nbReceiption = 0;
$head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/expedition/shipment.php?id='.$object->id;
$text = ''; $text = '';
if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments"); if ($conf->expedition_bon->enabled) $text .= $langs->trans("Shipments");
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled) $text .= ' - '; if ($conf->expedition_bon->enabled && $conf->delivery_note->enabled) $text .= ' - ';
if ($conf->livraison_bon->enabled) $text .= $langs->trans("Receivings"); if ($conf->delivery_note->enabled) $text .= $langs->trans("Receivings");
if ($nbShipments > 0 || $nbReceiption > 0) $text .= '<span class="badge marginleftonlyshort">'.($nbShipments ? $nbShipments : 0); if ($nbShipments > 0 || $nbReceiption > 0) $text .= '<span class="badge marginleftonlyshort">'.($nbShipments ? $nbShipments : 0);
if ($conf->expedition_bon->enabled && $conf->livraison_bon->enabled && ($nbShipments > 0 || $nbReceiption > 0)) $text .= ' - '; if ($conf->expedition_bon->enabled && $conf->delivery_note->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 .= ($nbReceiption ? $nbReceiption : 0);
if ($nbShipments > 0 || $nbReceiption > 0) $text .= '</span>'; if ($nbShipments > 0 || $nbReceiption > 0) $text .= '</span>';
$head[$h][1] = $text; $head[$h][1] = $text;
$head[$h][2] = 'shipping'; $head[$h][2] = 'shipping';

View File

@ -43,13 +43,13 @@ function propal_prepare_head($object)
$h++; $h++;
if ((empty($conf->commande->enabled) && ((!empty($conf->expedition->enabled) && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire) 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"); $langs->load("sendings");
$text = ''; $text = '';
$head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/expedition/propal.php?id='.$object->id;
if ($conf->expedition_bon->enabled) $text = $langs->trans("Shipment"); 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][1] = $text;
$head[$h][2] = 'shipping'; $head[$h][2] = 'shipping';
$h++; $h++;

View File

@ -47,7 +47,7 @@ function shipping_prepare_head($object)
$head[$h][2] = 'shipping'; $head[$h][2] = 'shipping';
$h++; $h++;
if ($conf->livraison_bon->enabled && $user->rights->expedition->livraison->lire) if ($conf->delivery_note->enabled && $user->rights->expedition->delivery->lire)
{ {
// delivery link // delivery link
$object->fetchObjectLinked($object->id, $object->element); $object->fetchObjectLinked($object->id, $object->element);
@ -56,7 +56,7 @@ function shipping_prepare_head($object)
// Take first one element of array // Take first one element of array
$tmp = reset($object->linkedObjectsIds['delivery']); $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][1] = $langs->trans("DeliveryCard");
$head[$h][2] = 'delivery'; $head[$h][2] = 'delivery';
$h++; $h++;
@ -135,7 +135,7 @@ function delivery_prepare_head($object)
$h++; $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][1] = $langs->trans("DeliveryCard");
$head[$h][2] = 'delivery'; $head[$h][2] = 'delivery';
$h++; $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 = "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 .= " 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,"; $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.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 .= ' p.description as product_desc';
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql .= ", ".MAIN_DB_PREFIX."expedition as e"; $sql .= ", ".MAIN_DB_PREFIX."expedition as e";
$sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; $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 .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
//TODO Add link to expeditiondet_batch //TODO Add link to expeditiondet_batch
$sql .= " WHERE e.entity IN (".getEntity('expedition').")"; $sql .= " WHERE e.entity IN (".getEntity('expedition').")";
@ -260,7 +260,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
print '<td>'; print '<td>';
print '</td>'; print '</td>';
}*/ }*/
if (!empty($conf->livraison_bon->enabled)) if (!empty($conf->delivery_note->enabled))
{ {
print '<td>'.$langs->trans("DeliveryOrder").'</td>'; print '<td>'.$langs->trans("DeliveryOrder").'</td>';
//print '<td class="center">'.$langs->trans("QtyReceived").'</td>'; //print '<td class="center">'.$langs->trans("QtyReceived").'</td>';
@ -403,9 +403,9 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
}*/ }*/
// Informations on receipt // 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->id = $objp->sendingid;
$expedition->fetchObjectLinked($expedition->id, $expedition->element); $expedition->fetchObjectLinked($expedition->id, $expedition->element);
//var_dump($expedition->linkedObjects); //var_dump($expedition->linkedObjects);
@ -423,7 +423,7 @@ function show_list_sending_receive($origin, $origin_id, $filter = '')
// Ref // Ref
print '<td>'; print '<td>';
print $receiving->getNomUrl($db); print $receiving->getNomUrl($db);
//print '<a href="'.DOL_URL_ROOT.'/livraison/card.php?id='.$livraison_id.'">'.img_object($langs->trans("ShowReceiving"),'sending').' '.$objp->livraison_ref.'<a>'; //print '<a href="'.DOL_URL_ROOT.'/delivery/card.php?id='.$livraison_id.'">'.img_object($langs->trans("ShowReceiving"),'sending').' '.$objp->livraison_ref.'<a>';
print '</td>'; print '</td>';
// Qty received // Qty received
//print '<td class="center">'; //print '<td class="center">';

View File

@ -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; return 0;
} }

View File

@ -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; return 0;
} }

View File

@ -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 * \ingroup livraison
* \brief File of class to manage receving receipts with template Storm * \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.'/core/modules/delivery/modules_delivery.php';
require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.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/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.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 * 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 Translate $outputlangs Lang output object
* @param string $srctemplatepath Full path of source filename for generator using a template file * @param string $srctemplatepath Full path of source filename for generator using a template file
* @param int $hidedetails Do not show line details * @param int $hidedetails Do not show line details

View File

@ -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 * \ingroup livraison
* \brief File of class to manage receving receipts with template Typhon * \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.'/core/modules/delivery/modules_delivery.php';
require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.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/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.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; return 0;
} }
@ -844,7 +844,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder
// If SHIPPING contact defined on order, we use it // If SHIPPING contact defined on order, we use it
$usecontact = false; $usecontact = false;
$arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING'); $arrayidcontact = $object->commande->getIdContact('external', 'SHIPPING');
if (count($arrayidcontact) > 0) if ($arrayidcontact && count($arrayidcontact) > 0)
{ {
$usecontact = true; $usecontact = true;
$result = $object->fetch_contact($arrayidcontact[0]); $result = $object->fetch_contact($arrayidcontact[0]);

View File

@ -19,20 +19,20 @@
*/ */
/** /**
* \file htdocs/core/modules/livraison/mod_livraison_jade.php * \file htdocs/core/modules/delivery/mod_delivery_jade.php
* \ingroup delivery * \ingroup delivery
* \brief Fichier contenant la classe du modele de numerotation de reference de bon de livraison Jade * \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 * \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 * Dolibarr version of the loaded document
@ -98,7 +98,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
$posindice = strlen($this->prefix) + 6; $posindice = strlen($this->prefix) + 6;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $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 .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
$sql .= " AND entity = ".$conf->entity; $sql .= " AND entity = ".$conf->entity;
@ -132,12 +132,12 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
// First, we get the max value // First, we get the max value
$posindice = strlen($this->prefix) + 6; $posindice = strlen($this->prefix) + 6;
$sql = "SELECT MAX(CAST(SUBSTRING(ref FROM ".$posindice.") AS SIGNED)) as max"; // This is standard SQL $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 .= " WHERE ref LIKE '".$db->escape($this->prefix)."____-%'";
$sql .= " AND entity = ".$conf->entity; $sql .= " AND entity = ".$conf->entity;
$resql = $db->query($sql); $resql = $db->query($sql);
dol_syslog("mod_livraison_jade::getNextValue", LOG_DEBUG); dol_syslog("mod_delivery_jade::getNextValue", LOG_DEBUG);
if ($resql) { if ($resql) {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($obj) $max = intval($obj->max); 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 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); 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; return $this->prefix.$yymm."-".$num;
} }
@ -166,7 +166,7 @@ class mod_livraison_jade extends ModeleNumRefDeliveryOrder
* @param Object $object Object livraison * @param Object $object Object livraison
* @return string Texte descriptif * @return string Texte descriptif
*/ */
public function livraison_get_num($objsoc = 0, $object = '') public function delivery_get_num($objsoc = 0, $object = '')
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $object); return $this->getNextValue($objsoc, $object);

View File

@ -19,17 +19,17 @@
*/ */
/** /**
* \file htdocs/core/modules/livraison/mod_livraison_saphir.php * \file htdocs/core/modules/delivery/mod_livraison_saphir.php
* \ingroup expedition * \ingroup expedition
* \brief Fichier contenant la classe du modele de numerotation de reference de livraison Saphir * \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 * \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 * Dolibarr version of the loaded document
@ -72,7 +72,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
$texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">'; $texte .= '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
$texte .= '<input type="hidden" name="token" value="'.newToken().'">'; $texte .= '<input type="hidden" name="token" value="'.newToken().'">';
$texte .= '<input type="hidden" name="action" value="updateMask">'; $texte .= '<input type="hidden" name="action" value="updateMask">';
$texte .= '<input type="hidden" name="maskconstdelivery" value="LIVRAISON_SAPHIR_MASK">'; $texte .= '<input type="hidden" name="maskconstdelivery" value="DELIVERY_SAPHIR_MASK">';
$texte .= '<table class="nobordernopadding" width="100%">'; $texte .= '<table class="nobordernopadding" width="100%">';
$tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Delivery"), $langs->transnoentities("Delivery")); $tooltip = $langs->trans("GenericMaskCodes", $langs->transnoentities("Delivery"), $langs->transnoentities("Delivery"));
@ -83,7 +83,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
// Parametrage du prefix // Parametrage du prefix
$texte .= '<tr><td>'.$langs->trans("Mask").':</td>'; $texte .= '<tr><td>'.$langs->trans("Mask").':</td>';
$texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskdelivery" value="'.$conf->global->LIVRAISON_SAPHIR_MASK.'">', $tooltip, 1, 1).'</td>'; $texte .= '<td class="right">'.$form->textwithpicto('<input type="text" class="flat" size="24" name="maskdelivery" value="'.$conf->global->DELIVERY_SAPHIR_MASK.'">', $tooltip, 1, 1).'</td>';
$texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>'; $texte .= '<td class="left" rowspan="2">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
@ -131,7 +131,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// On defini critere recherche compteur // On defini critere recherche compteur
$mask = $conf->global->LIVRAISON_SAPHIR_MASK; $mask = $conf->global->DELIVERY_SAPHIR_MASK;
if (!$mask) if (!$mask)
{ {
@ -139,7 +139,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
return 0; 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; return $numFinal;
} }
@ -166,7 +166,7 @@ class mod_livraison_saphir extends ModeleNumRefDeliveryOrder
* @param Object $object Objet livraison * @param Object $object Objet livraison
* @return string Texte descripif * @return string Texte descripif
*/ */
public function livraison_get_num($objsoc = 0, $object = '') public function delivery_get_num($objsoc = 0, $object = '')
{ {
// phpcs:enable // phpcs:enable
return $this->getNextValue($objsoc, $object); return $this->getNextValue($objsoc, $object);

View File

@ -22,7 +22,7 @@
*/ */
/** /**
* \file htdocs/core/modules/livraison/modules_livraison.php * \file htdocs/core/modules/delivery/modules_delivery.php
* \ingroup expedition * \ingroup expedition
* \brief Fichier contenant la classe mere de generation de bon de livraison en PDF * \brief Fichier contenant la classe mere de generation de bon de livraison en PDF
* et la classe mere de numerotation des bons de livraisons * et la classe mere de numerotation des bons de livraisons

View File

@ -103,21 +103,21 @@ class modExpedition extends DolibarrModules
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "LIVRAISON_ADDON_PDF"; $this->const[$r][0] = "DELIVERY_ADDON_PDF";
$this->const[$r][1] = "chaine"; $this->const[$r][1] = "chaine";
$this->const[$r][2] = "typhon"; $this->const[$r][2] = "typhon";
$this->const[$r][3] = 'Nom du gestionnaire de generation des bons de reception en PDF'; $this->const[$r][3] = 'Nom du gestionnaire de generation des bons de reception en PDF';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $r++;
$this->const[$r][0] = "LIVRAISON_ADDON_NUMBER"; $this->const[$r][0] = "DELIVERY_ADDON_NUMBER";
$this->const[$r][1] = "chaine"; $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][3] = 'Nom du gestionnaire de numerotation des bons de reception';
$this->const[$r][4] = 0; $this->const[$r][4] = 0;
$r++; $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][1] = "chaine";
$this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries"; $this->const[$r][2] = "DOL_DATA_ROOT/doctemplates/deliveries";
$this->const[$r][3] = ""; $this->const[$r][3] = "";
@ -191,7 +191,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Read delivery receipts'; $this->rights[$r][1] = 'Read delivery receipts';
$this->rights[$r][2] = 'r'; $this->rights[$r][2] = 'r';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison'; $this->rights[$r][4] = 'delivery';
$this->rights[$r][5] = 'lire'; $this->rights[$r][5] = 'lire';
$r++; $r++;
@ -199,7 +199,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Create/modify delivery receipts'; $this->rights[$r][1] = 'Create/modify delivery receipts';
$this->rights[$r][2] = 'w'; $this->rights[$r][2] = 'w';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison'; $this->rights[$r][4] = 'delivery';
$this->rights[$r][5] = 'creer'; $this->rights[$r][5] = 'creer';
$r++; $r++;
@ -207,7 +207,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Validate delivery receipts'; $this->rights[$r][1] = 'Validate delivery receipts';
$this->rights[$r][2] = 'd'; $this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison_advance'; $this->rights[$r][4] = 'delivery_advance';
$this->rights[$r][5] = 'validate'; $this->rights[$r][5] = 'validate';
$r++; $r++;
@ -215,7 +215,7 @@ class modExpedition extends DolibarrModules
$this->rights[$r][1] = 'Delete delivery receipts'; $this->rights[$r][1] = 'Delete delivery receipts';
$this->rights[$r][2] = 'd'; $this->rights[$r][2] = 'd';
$this->rights[$r][3] = 0; $this->rights[$r][3] = 0;
$this->rights[$r][4] = 'livraison'; $this->rights[$r][4] = 'delivery';
$this->rights[$r][5] = 'supprimer'; $this->rights[$r][5] = 'supprimer';

View File

@ -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 == 'order_supplier') $permok = $user->rights->fournisseur->commande->creer;
if ($object->element == 'invoice_supplier') $permok = $user->rights->fournisseur->facture->creer; if ($object->element == 'invoice_supplier') $permok = $user->rights->fournisseur->facture->creer;
if ($object->element == 'shipping') $permok = $user->rights->expedition->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 == 'productlot') $permok = $user->rights->stock->creer;
if ($object->element == 'facturerec') $permok = $user->rights->facture->creer; if ($object->element == 'facturerec') $permok = $user->rights->facture->creer;
if ($object->element == 'mo') $permok = $user->rights->mrp->write; if ($object->element == 'mo') $permok = $user->rights->mrp->write;

View File

@ -22,14 +22,14 @@
*/ */
/** /**
* \file htdocs/livraison/card.php * \file htdocs/delivery/card.php
* \ingroup livraison * \ingroup livraison
* \brief Page to describe a delivery receipt * \brief Page to describe a delivery receipt
*/ */
require '../main.inc.php'; require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; require_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/livraison/modules_livraison.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/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/sendings.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@ -57,9 +57,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
// Security check // Security check
$id = GETPOST('id', 'int'); $id = GETPOST('id', 'int');
if ($user->socid) $socid = $user->socid; 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); $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels // fetch optionals attributes and labels
@ -126,8 +126,8 @@ if ($action == 'add')
$action = 'create'; $action = 'create';
} }
} elseif ($action == 'confirm_valid' && $confirm == 'yes' && } 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->delivery->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_advance->validate)))
) )
{ {
$result = $object->valid($user); $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(); $db->begin();
$result = $object->delete(); $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')); $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) if ($result < 0)
{ {
$mesg = '<div class="error">'.$object->error.'</div>'; $mesg = '<div class="error">'.$object->error.'</div>';
@ -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)) 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 '<table width="100%" class="nobordernopadding"><tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel'); print $langs->trans('IncotermLabel');
print '<td><td class="right">'; print '<td><td class="right">';
if ($user->rights->expedition->livraison->creer) print '<a class="editfielda" href="'.DOL_URL_ROOT.'/livraison/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>'; if ($user->rights->expedition->delivery->creer) print '<a class="editfielda" href="'.DOL_URL_ROOT.'/delivery/card.php?id='.$object->id.'&action=editincoterm">'.img_edit().'</a>';
else print '&nbsp;'; else print '&nbsp;';
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
@ -647,14 +647,14 @@ if ($action == 'create') // Create. Seems to no be used
if ($object->statut == 0 && $num_prod > 0) if ($object->statut == 0 && $num_prod > 0)
{ {
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer)) 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->livraison_advance->validate))) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate)))
{ {
print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=valid">'.$langs->trans("Validate").'</a>'; print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&amp;action=valid">'.$langs->trans("Validate").'</a>';
} }
} }
if ($user->rights->expedition->livraison->supprimer) if ($user->rights->expedition->delivery->supprimer)
{ {
if ($conf->expedition_bon->enabled) 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; $filedir = $conf->expedition->dir_output."/receipt/".$objectref;
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id; $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
$genallowed = $user->rights->expedition->livraison->lire; $genallowed = $user->rights->expedition->delivery->lire;
$delallowed = $user->rights->expedition->livraison->creer; $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) * Linked object block (of linked shipment)

View File

@ -22,7 +22,7 @@
*/ */
/** /**
* \file htdocs/livraison/class/livraison.class.php * \file htdocs/delivery/class/delivery.class.php
* \ingroup delivery * \ingroup delivery
* \brief Delivery Order Management Class File * \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 to manage receptions
*/ */
class Livraison extends CommonObject class Delivery extends CommonObject
{ {
/** /**
* @var string ID to identify managed object * @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 * @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 * @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 * @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 * @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
*/ */
public $picto = 'sending'; public $picto = 'sending';
public $brouillon; public $draft;
public $socid; public $socid;
public $ref_customer; public $ref_customer;
@ -108,28 +108,28 @@ class Livraison extends CommonObject
* Create delivery receipt in database * Create delivery receipt in database
* *
* @param User $user Objet du user qui cree * @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) public function create($user)
{ {
global $conf; 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; $error = 0;
$now = dol_now(); $now = dol_now();
/* On positionne en mode brouillon le bon de livraison */ /* Delivery note as draft On positionne en mode draft le bon de livraison */
$this->brouillon = 1; $this->draft = 1;
$this->user = $user; $this->user = $user;
$this->db->begin(); $this->db->begin();
$sql = "INSERT INTO ".MAIN_DB_PREFIX."livraison ("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."delivery (";
$sql .= "ref"; $sql .= "ref";
$sql .= ", entity"; $sql .= ", entity";
$sql .= ", fk_soc"; $sql .= ", fk_soc";
@ -158,19 +158,19 @@ class Livraison extends CommonObject
$sql .= ", '".$this->db->escape($this->location_incoterms)."'"; $sql .= ", '".$this->db->escape($this->location_incoterms)."'";
$sql .= ")"; $sql .= ")";
dol_syslog("Livraison::create", LOG_DEBUG); dol_syslog("Delivery::create", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) 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.")"; $numref = "(PROV".$this->id.")";
$sql = "UPDATE ".MAIN_DB_PREFIX."livraison "; $sql = "UPDATE ".MAIN_DB_PREFIX."delivery ";
$sql .= "SET ref = '".$this->db->escape($numref)."'"; $sql .= "SET ref = '".$this->db->escape($numref)."'";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
dol_syslog("Livraison::create", LOG_DEBUG); dol_syslog("Delivery::create", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
@ -207,7 +207,7 @@ class Livraison extends CommonObject
if (!$conf->expedition_bon->enabled) if (!$conf->expedition_bon->enabled)
{ {
// TODO uniformiser les statuts // TODO standardize status uniformiser les statuts
$ret = $this->setStatut(2, $this->origin_id, $this->origin); $ret = $this->setStatut(2, $this->origin_id, $this->origin);
if (!$ret) if (!$ret)
{ {
@ -257,7 +257,7 @@ class Livraison extends CommonObject
$idprod = $fk_product; $idprod = $fk_product;
$j = 0; $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 .= " fk_product, description, qty)";
$sql .= " VALUES (".$this->id.",".$origin_id.","; $sql .= " VALUES (".$this->id.",".$origin_id.",";
$sql .= " ".($idprod > 0 ? $idprod : "null").","; $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 .= ", el.fk_source as origin_id, el.sourcetype as origin";
$sql .= ', l.fk_incoterms, l.location_incoterms'; $sql .= ', l.fk_incoterms, l.location_incoterms';
$sql .= ", i.libelle as label_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."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 .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_incoterms as i ON l.fk_incoterms = i.rowid';
$sql .= " WHERE l.rowid = ".$id; $sql .= " WHERE l.rowid = ".$id;
@ -330,7 +330,7 @@ class Livraison extends CommonObject
$this->label_incoterms = $obj->label_incoterms; $this->label_incoterms = $obj->label_incoterms;
$this->db->free($result); $this->db->free($result);
if ($this->statut == 0) $this->brouillon = 1; if ($this->statut == 0) $this->draft = 1;
// Retrieve all extrafields // Retrieve all extrafields
// fetch optionals attributes and labels // fetch optionals attributes and labels
@ -373,17 +373,17 @@ class Livraison extends CommonObject
$error = 0; $error = 0;
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->livraison->creer)) 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->livraison_advance->validate))) || (!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 // 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(); $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 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 { } else {
$numref = $this->ref; $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. // Test if is not already in valid status. If so, we stop to avoid decrementing the stock twice.
$sql = "SELECT ref"; $sql = "SELECT ref";
$sql .= " FROM ".MAIN_DB_PREFIX."livraison"; $sql .= " FROM ".MAIN_DB_PREFIX."delivery";
$sql .= " WHERE ref = '".$this->db->escape($numref)."'"; $sql .= " WHERE ref = '".$this->db->escape($numref)."'";
$sql .= " AND fk_statut <> 0"; $sql .= " AND fk_statut <> 0";
$sql .= " AND entity = ".$conf->entity; $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 .= " ref='".$this->db->escape($numref)."'";
$sql .= ", fk_statut = 1"; $sql .= ", fk_statut = 1";
$sql .= ", date_valid = '".$this->db->idate($now)."'"; $sql .= ", date_valid = '".$this->db->idate($now)."'";
@ -526,7 +526,7 @@ class Livraison extends CommonObject
$num = count($expedition->lines); $num = count($expedition->lines);
for ($i = 0; $i < $num; $i++) 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->origin_line_id = $expedition->lines[$i]->origin_line_id;
$line->libelle = $expedition->lines[$i]->libelle; $line->libelle = $expedition->lines[$i]->libelle;
$line->description = $expedition->lines[$i]->description; $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 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); $line = new DeliveryLigne($this->db);
$livraisonline->array_options = $array_options; $line->array_options = $array_options;
$livraisonline->id = $id; $line->id = $id;
$result = $livraisonline->insertExtraFields(); $result = $line->insertExtraFields();
if ($result < 0) if ($result < 0)
{ {
$this->error[] = $livraisonline->error; $this->error[] = $line->error;
$error++; $error++;
} }
} }
@ -597,7 +597,7 @@ class Livraison extends CommonObject
public function addline($origin_id, $qty) public function addline($origin_id, $qty)
{ {
$num = count($this->lines); $num = count($this->lines);
$line = new LivraisonLigne($this->db); $line = new DeliveryLigne($this->db);
$line->origin_id = $origin_id; $line->origin_id = $origin_id;
$line->qty = $qty; $line->qty = $qty;
@ -643,8 +643,8 @@ class Livraison extends CommonObject
$error = 0; $error = 0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."livraisondet"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."deliverydet";
$sql .= " WHERE fk_livraison = ".$this->id; $sql .= " WHERE fk_delivery = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
// Delete linked object // Delete linked object
@ -653,13 +653,13 @@ class Livraison extends CommonObject
if (!$error) if (!$error)
{ {
$sql = "DELETE FROM ".MAIN_DB_PREFIX."livraison"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."delivery";
$sql .= " WHERE rowid = ".$this->id; $sql .= " WHERE rowid = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->db->commit(); $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); $ref = dol_sanitizeFileName($this->ref);
if (!empty($conf->expedition->dir_output)) if (!empty($conf->expedition->dir_output))
{ {
@ -725,7 +725,7 @@ class Livraison extends CommonObject
$label = img_picto('', $this->picto).' <u>'.$langs->trans("ShowReceiving").'</u>:<br>'; $label = img_picto('', $this->picto).' <u>'.$langs->trans("ShowReceiving").'</u>:<br>';
$label .= '<b>'.$langs->trans("Status").'</b>: '.$this->ref; $label .= '<b>'.$langs->trans("Status").'</b>: '.$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') //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 .= " 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.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 .= " 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 .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p on p.rowid = ld.fk_product";
$sql .= " WHERE ld.fk_origin_line = cd.rowid"; $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); dol_syslog(get_class($this)."::fetch_lines", LOG_DEBUG);
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
@ -773,7 +773,7 @@ class Livraison extends CommonObject
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$line = new LivraisonLigne($this->db); $line = new DeliveryLigne($this->db);
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
@ -911,7 +911,7 @@ class Livraison extends CommonObject
$this->note_private = 'Private note'; $this->note_private = 'Private note';
$i = 0; $i = 0;
$line = new LivraisonLigne($this->db); $line = new DeliveryLigne($this->db);
$line->fk_product = $prodids[0]; $line->fk_product = $prodids[0];
$line->qty_asked = 10; $line->qty_asked = 10;
$line->qty_shipped = 9; $line->qty_shipped = 9;
@ -956,10 +956,10 @@ class Livraison extends CommonObject
// Get lines of sources alread delivered // Get lines of sources alread delivered
$sql = "SELECT ld.fk_origin_line, sum(ld.qty) as qty"; $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']." as c";
$sql .= ", ".MAIN_DB_PREFIX.$this->linked_object[0]['type']."det as cd"; $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 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']." = c.rowid";
$sql .= " AND cd.fk_".$this->linked_object[0]['type']." = ".$this->linked_object[0]['linkid']; $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 * Set the planned delivery date
* *
* @param User $user Objet utilisateur qui modifie * @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 * @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 // phpcs:enable
if ($user->rights->expedition->creer) if ($user->rights->expedition->creer)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."livraison"; $sql = "UPDATE ".MAIN_DB_PREFIX."delivery";
$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; $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); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->date_delivery = $date_livraison; $this->date_delivery = $delivery_date;
return 1; return 1;
} else { } else {
$this->error = $this->db->error(); $this->error = $this->db->error();
@ -1050,12 +1050,12 @@ class Livraison extends CommonObject
if ($this->model_pdf) { if ($this->model_pdf) {
$modele = $this->model_pdf; $modele = $this->model_pdf;
} elseif (!empty($conf->global->LIVRAISON_ADDON_PDF)) { } elseif (!empty($conf->global->DELIVERY_ADDON_PDF)) {
$modele = $conf->global->LIVRAISON_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); 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) public static function replaceThirdparty(DoliDB $db, $origin_id, $dest_id)
{ {
$tables = array( $tables = array(
'livraison' 'delivery'
); );
return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables); return CommonObject::commonReplaceThirdparty($db, $origin_id, $dest_id, $tables);
@ -1083,7 +1083,7 @@ class Livraison extends CommonObject
/** /**
* Management class of delivery note lines * Management class of delivery note lines
*/ */
class LivraisonLigne extends CommonObjectLine class DeliveryLigne extends CommonObjectLine
{ {
/** /**
* @var DoliDB Database handler. * @var DoliDB Database handler.
@ -1125,12 +1125,12 @@ class LivraisonLigne extends CommonObjectLine
/** /**
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
public $element = 'livraisondet'; public $element = 'deliverydet';
/** /**
* @var string Name of table without prefix where object is stored * @var string Name of table without prefix where object is stored
*/ */
public $table_element = 'livraisondet'; public $table_element = 'deliverydet';
/** /**
* Constructor * Constructor

View File

@ -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 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('expeditioncard', 'globalcard')); $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); //var_dump($object->lines[0]->detail_batch);
@ -399,12 +399,12 @@ if (empty($reshook))
/* /*
* Build a receiving receipt * 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); $result = $object->create_delivery($user);
if ($result > 0) 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; exit;
} else { } else {
setEventMessages($object->error, $object->errors, 'errors'); 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')); $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); $object->fetch($id);
$result = $object->set_date_livraison($user, $datedelivery); $result = $object->set_delivery_date($user, $datedelivery);
if ($result < 0) if ($result < 0)
{ {
setEventMessages($object->error, $object->errors, 'errors'); 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 = "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 .= ", 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"; $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.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 .= ', p.description as product_desc';
$sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed";
$sql .= ", ".MAIN_DB_PREFIX."expedition as e"; $sql .= ", ".MAIN_DB_PREFIX."expedition as e";
$sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; $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 .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
$sql .= " WHERE e.entity IN (".getEntity('expedition').")"; $sql .= " WHERE e.entity IN (".getEntity('expedition').")";
$sql .= " AND obj.fk_".$origin." = ".$origin_id; $sql .= " AND obj.fk_".$origin." = ".$origin_id;
@ -2467,7 +2467,7 @@ if ($action == 'create')
// This is just to generate a delivery receipt // This is just to generate a delivery receipt
//var_dump($object->linkedObjectsIds['delivery']); //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 '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>'; print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=create_delivery">'.$langs->trans("CreateDeliveryOrder").'</a>';
} }

View File

@ -880,13 +880,13 @@ class Expedition extends CommonObject
// phpcs:enable // phpcs:enable
global $conf; global $conf;
if ($conf->livraison_bon->enabled) if ($conf->delivery_note->enabled)
{ {
if ($this->statut == self::STATUS_VALIDATED || $this->statut == self::STATUS_CLOSED) if ($this->statut == self::STATUS_VALIDATED || $this->statut == self::STATUS_CLOSED)
{ {
// Expedition validee // Expedition validee
include_once DOL_DOCUMENT_ROOT.'/livraison/class/livraison.class.php'; include_once DOL_DOCUMENT_ROOT.'/delivery/class/delivery.class.php';
$delivery = new Livraison($this->db); $delivery = new Delivery($this->db);
$result = $delivery->create_from_sending($user, $this->id); $result = $delivery->create_from_sending($user, $this->id);
if ($result > 0) if ($result > 0)
{ {
@ -1962,23 +1962,23 @@ class Expedition extends CommonObject
* Set the planned delivery date * Set the planned delivery date
* *
* @param User $user Objet user that modify * @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 * @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 // phpcs:enable
if ($user->rights->expedition->creer) if ($user->rights->expedition->creer)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."expedition"; $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; $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); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->date_delivery = $date_livraison; $this->date_delivery = $delivery_date;
return 1; return 1;
} else { } else {
$this->error = $this->db->error(); $this->error = $this->db->error();

View File

@ -127,8 +127,8 @@ $arrayfields = array(
'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), '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), '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.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->livraison_bon->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))) '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_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."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."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'; $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 // We'll need this table joined to the select in order to filter by sale

View File

@ -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')); $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); $object->fetch($id);
$result = $object->set_date_livraison($user, $datedelivery); $result = $object->set_delivery_date($user, $datedelivery);
if ($result < 0) if ($result < 0)
{ {
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');

View File

@ -117,7 +117,7 @@ class CommandeFournisseur extends CommonOrder
/** /**
* Delivery date * Delivery date
*/ */
public $date_livraison; public $delivery_date;
public $total_ht; public $total_ht;
public $total_tva; public $total_tva;
@ -2262,11 +2262,11 @@ class CommandeFournisseur extends CommonOrder
* Set the planned delivery date * Set the planned delivery date
* *
* @param User $user Objet user making change * @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 * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 if KO, >0 if OK * @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 // phpcs:enable
if ($user->rights->fournisseur->commande->creer) if ($user->rights->fournisseur->commande->creer)
@ -2276,7 +2276,7 @@ class CommandeFournisseur extends CommonOrder
$this->db->begin(); $this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."commande_fournisseur"; $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; $sql .= " WHERE rowid = ".$this->id;
dol_syslog(__METHOD__, LOG_DEBUG); dol_syslog(__METHOD__, LOG_DEBUG);
@ -2290,7 +2290,7 @@ class CommandeFournisseur extends CommonOrder
if (!$error) if (!$error)
{ {
$this->oldcopy = clone $this; $this->oldcopy = clone $this;
$this->date_livraison = $date_livraison; $this->date_livraison = $delivery_date;
} }
if (!$notrigger && empty($error)) if (!$notrigger && empty($error))
@ -2324,7 +2324,7 @@ class CommandeFournisseur extends CommonOrder
* Set the id projet * Set the id projet
* *
* @param User $user Objet utilisateur qui modifie * @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 * @param int $notrigger 1=Does not execute triggers, 0= execute triggers
* @return int <0 si ko, >0 si ok * @return int <0 si ko, >0 si ok
*/ */

View File

@ -203,7 +203,7 @@ if (empty($reshook))
// date of delivery // date of delivery
if ($action == 'setdate_livraison' && $usercancreate) 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'); if ($result < 0) setEventMessages($object->error, $object->errors, 'errors');
} }
@ -1199,7 +1199,7 @@ if (empty($reshook))
$result = $srcobject->fetch($object->origin_id); $result = $srcobject->fetch($object->origin_id);
if ($result > 0) 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); $object->set_id_projet($user, $srcobject->fk_project);
$lines = $srcobject->lines; $lines = $srcobject->lines;

View File

@ -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; 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_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'; 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 MODIFY COLUMN finished tinyint DEFAULT NULL;
ALTER TABLE llx_product ADD CONSTRAINT fk_product_finished FOREIGN KEY (finished) REFERENCES llx_c_product_nature (code); 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';

View File

@ -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_commande where ref = '';
delete from llx_propaldet where fk_propal in (select rowid from llx_propal 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_propal where ref = '';
delete from llx_livraisondet where fk_livraison in (select rowid from llx_livraison where ref = ''); delete from llx_deliverydet where fk_delivery in (select rowid from llx_delivery where ref = '');
delete from llx_livraison 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_expeditiondet where fk_expedition in (select rowid from llx_expedition where ref = '');
delete 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); 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); 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. -- 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_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_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_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) -- Fix delete element_element orphelins (right side)

View File

@ -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_delivery ADD INDEX idx_delivery_fk_soc (fk_soc);
ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_user_author (fk_user_author); ALTER TABLE llx_delivery ADD INDEX idx_delivery_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_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_delivery ADD CONSTRAINT fk_delivery_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_delivery ADD CONSTRAINT fk_delivery_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_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);

View File

@ -17,7 +17,7 @@
-- --
-- =================================================================== -- ===================================================================
create table llx_livraison create table llx_delivery
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

View File

@ -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);

View File

@ -16,7 +16,7 @@
-- --
-- ======================================================================== -- ========================================================================
create table llx_livraison_extrafields create table llx_delivery_extrafields
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

View File

@ -18,5 +18,5 @@
-- =================================================================== -- ===================================================================
ALTER TABLE llx_livraisondet ADD INDEX idx_livraisondet_fk_expedition (fk_livraison); ALTER TABLE llx_deliverydet ADD INDEX idx_deliverydet_fk_expedition (fk_delivery);
ALTER TABLE llx_livraisondet ADD CONSTRAINT fk_livraisondet_fk_livraison FOREIGN KEY (fk_livraison) REFERENCES llx_livraison (rowid); ALTER TABLE llx_deliverydet ADD CONSTRAINT fk_deliverydet_fk_delivery FOREIGN KEY (fk_delivery) REFERENCES llx_delivery (rowid);

View File

@ -17,10 +17,10 @@
-- --
-- =================================================================== -- ===================================================================
create table llx_livraisondet create table llx_deliverydet
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, 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_origin_line integer, -- Correspondance de la ligne avec le document d'origine (propal, commande)
fk_product integer, fk_product integer,
description text, description text,

View File

@ -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);

View File

@ -16,7 +16,7 @@
-- --
-- =================================================================== -- ===================================================================
create table llx_livraisondet_extrafields create table llx_deliverydet_extrafields
( (
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,

View File

@ -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 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_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_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_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_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(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_mailing FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();

View File

@ -2090,11 +2090,11 @@ function migrate_commande_livraison($db, $langs, $conf)
if ($resql2) if ($resql2)
{ {
$date_livraison = $db->jdate($obj->date_livraison); $delivery_date = $db->jdate($obj->date_livraison);
$sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET"; $sqlu = "UPDATE ".MAIN_DB_PREFIX."livraison SET";
$sqlu .= " ref_client='".$db->escape($obj->ref_client)."'"; $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; $sqlu .= " WHERE rowid = ".$obj->rowid;
$resql3 = $db->query($sqlu); $resql3 = $db->query($sqlu);
if (!$resql3) if (!$resql3)

View File

@ -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')); $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); $object->fetch($id);
$result = $object->set_date_livraison($user, $datedelivery); $result = $object->set_delivery_date($user, $datedelivery);
if ($result < 0) if ($result < 0)
{ {
setEventMessages($object->error, $object->errors, 'errors'); 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 = "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 .= ", 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"; $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.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 .= ', p.description as product_desc';
$sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_dispatch as ed";
$sql .= ", ".MAIN_DB_PREFIX."reception as e"; $sql .= ", ".MAIN_DB_PREFIX."reception as e";
$sql .= ", ".MAIN_DB_PREFIX.$origin."det as obj"; $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 .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON obj.fk_product = p.rowid";
$sql .= " WHERE e.entity IN (".getEntity('reception').")"; $sql .= " WHERE e.entity IN (".getEntity('reception').")";
$sql .= " AND obj.fk_commande = ".$origin_id; $sql .= " AND obj.fk_commande = ".$origin_id;

View File

@ -1224,23 +1224,23 @@ class Reception extends CommonObject
* Set the planned delivery date * Set the planned delivery date
* *
* @param User $user Objet utilisateur qui modifie * @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 * @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 // phpcs:enable
if ($user->rights->reception->creer) if ($user->rights->reception->creer)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."reception"; $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; $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); $resql = $this->db->query($sql);
if ($resql) if ($resql)
{ {
$this->date_delivery = $date_livraison; $this->date_delivery = $delivery_date;
return 1; return 1;
} else { } else {
$this->error = $this->db->error(); $this->error = $this->db->error();

View File

@ -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_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."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."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 if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all
{ {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";

View File

@ -239,7 +239,7 @@ if (empty($reshook))
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php', 'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php', 'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
'ProductFournisseur' => '/fourn/class/fournisseur.product.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', 'Product' => '/product/class/product.class.php',
'Project' => '/projet/class/project.class.php', 'Project' => '/projet/class/project.class.php',
'Ticket' => '/ticket/class/ticket.class.php', 'Ticket' => '/ticket/class/ticket.class.php',

View File

@ -420,7 +420,7 @@ class Thirdparties extends DolibarrApi
'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php', 'FactureFournisseur' => '/fourn/class/fournisseur.facture.class.php',
'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php', 'SupplierProposal' => '/supplier_proposal/class/supplier_proposal.class.php',
'ProductFournisseur' => '/fourn/class/fournisseur.product.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', 'Product' => '/product/class/product.class.php',
'Project' => '/projet/class/project.class.php', 'Project' => '/projet/class/project.class.php',
'Ticket' => '/ticket/class/ticket.class.php', 'Ticket' => '/ticket/class/ticket.class.php',

View File

@ -229,7 +229,7 @@ if (empty($reshook))
else setEventMessages($langs->trans($object->error), null, 'errors'); else setEventMessages($langs->trans($object->error), null, 'errors');
} }
} elseif ($action == 'setdate_livraison' && $usercancreate) { } 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) if ($result < 0)
dol_print_error($db, $object->error); dol_print_error($db, $object->error);
} }

View File

@ -112,7 +112,7 @@ class SupplierProposal extends CommonObject
/** /**
* @var integer|string date_livraison * @var integer|string date_livraison
*/ */
public $date_livraison; public $delivery_date;
/** /**
* @deprecated * @deprecated
@ -1511,25 +1511,25 @@ class SupplierProposal extends CommonObject
* Set delivery date * Set delivery date
* *
* @param User $user Object user that modify * @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 * @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 // phpcs:enable
if (!empty($user->rights->supplier_proposal->creer)) if (!empty($user->rights->supplier_proposal->creer))
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."supplier_proposal "; $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; $sql .= " WHERE rowid = ".$this->id;
if ($this->db->query($sql)) if ($this->db->query($sql))
{ {
$this->date_livraison = $date_livraison; $this->date_livraison = $delivery_date;
return 1; return 1;
} else { } else {
$this->error = $this->db->error(); $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; return -1;
} }
} }

View File

@ -41,7 +41,7 @@ parameters:
- %currentWorkingDirectory%/htdocs/core/modules/facture - %currentWorkingDirectory%/htdocs/core/modules/facture
- %currentWorkingDirectory%/htdocs/core/modules/fichinter - %currentWorkingDirectory%/htdocs/core/modules/fichinter
- %currentWorkingDirectory%/htdocs/core/modules/holiday - %currentWorkingDirectory%/htdocs/core/modules/holiday
- %currentWorkingDirectory%/htdocs/core/modules/livraison - %currentWorkingDirectory%/htdocs/core/modules/delivery
#- %currentWorkingDirectory%/htdocs/core/modules/member #- %currentWorkingDirectory%/htdocs/core/modules/member
- %currentWorkingDirectory%/htdocs/core/modules/payment - %currentWorkingDirectory%/htdocs/core/modules/payment
- %currentWorkingDirectory%/htdocs/core/modules/product - %currentWorkingDirectory%/htdocs/core/modules/product