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