diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php
index 118e451ba30..4ee82891e2c 100644
--- a/htdocs/commande/commande.class.php
+++ b/htdocs/commande/commande.class.php
@@ -546,7 +546,14 @@ class Commande extends CommonObject
$this->lines[$i]->fk_product,
$this->lines[$i]->remise_percent,
$this->lines[$i]->fk_remise_except,
- $this->lines[$i]->info_bits
+ $this->lines[$i]->info_bits,
+ 0,
+ 'HT',
+ 0,
+ // Added by Matelli (http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Add start and end dates to the new line
+ $this->lines[$i]->date_start,
+ $this->lines[$i]->date_end
);
if ($resql < 0)
@@ -627,6 +634,8 @@ class Commande extends CommonObject
* \param fk_remise_exscept Id remise
* \param price_base_type HT or TTC
* \param pu_ttc Prix unitaire TTC
+ * \param date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ * \param date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* \return int >0 si ok, <0 si ko
* \see add_product
* \remarks Les parametres sont deja cense etre juste et avec valeurs finales a l'appel
@@ -634,9 +643,9 @@ class Commande extends CommonObject
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,taux_produit)
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue)
*/
- function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0)
+ function addline($commandeid, $desc, $pu_ht, $qty, $txtva, $fk_product=0, $remise_percent=0, $info_bits=0, $fk_remise_except=0, $price_base_type='HT', $pu_ttc=0, $date_start='', $date_end='')
{
- dolibarr_syslog("Commande::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc");
+ dolibarr_syslog("Commande::addline commandeid=$commandeid, desc=$desc, pu_ht=$pu_ht, qty=$qty, txtva=$txtva, fk_product=$fk_product, remise_percent=$remise_percent, info_bits=$info_bits, fk_remise_except=$fk_remise_except, price_base_type=$price_base_type, pu_ttc=$pu_ttc, date_start=$date_start, date_end=$date_end", LOG_DEBUG);
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
// Clean parameters
@@ -700,6 +709,11 @@ class Commande extends CommonObject
// \TODO Ne plus utiliser
$ligne->price=$price;
$ligne->remise=$remise;
+
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Save the start and end date of the new line in the object
+ $ligne->date_start=$date_start;
+ $ligne->date_end=$date_end;
$result=$ligne->insert();
if ($result > 0)
@@ -734,13 +748,15 @@ class Commande extends CommonObject
* \brief Ajoute une ligne dans tableau lines
* \param idproduct Id du produit a ajouter
* \param qty Quantite
+ * \param date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ * \param date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* \remise_percent remise_percent Remise relative effectuee sur le produit
* \return void
* \remarks $this->client doit etre charge
* \TODO Remplacer les appels a cette fonction par generation objet Ligne
* insere dans tableau $this->products
*/
- function add_product($idproduct, $qty, $remise_percent=0)
+ function add_product($idproduct, $qty, $remise_percent=0, $date_start='', $date_end='')
{
global $conf, $mysoc;
@@ -768,6 +784,11 @@ class Commande extends CommonObject
$line->ref=$prod->ref;
$line->libelle=$prod->libelle;
$line->product_desc=$prod->description;
+
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Save the start and end date of the line in the object
+ if ($date_start) { $line->date_start = $date_start; }
+ if ($date_end) { $line->date_end = $date_end; }
$this->lines[] = $line;
@@ -987,6 +1008,9 @@ class Commande extends CommonObject
$sql.= ' l.fk_remise_except, l.remise_percent, l.subprice, l.marge_tx, l.marque_tx, l.rang, l.info_bits,';
$sql.= ' l.total_ht, l.total_ttc, l.total_tva,';
$sql.= ' p.ref as product_ref, p.description as product_desc, p.fk_product_type, p.label';
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Load from the database the start and end date
+ $sql.= ','.$this->db->pdate('l.date_start').' as date_start,'.$this->db->pdate('l.date_end').' as date_end';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON (p.rowid = l.fk_product)';
$sql.= ' WHERE l.fk_commande = '.$this->id;
@@ -1029,6 +1053,11 @@ class Commande extends CommonObject
$ligne->libelle = $objp->label;
$ligne->product_desc = $objp->product_desc; // Description produit
$ligne->fk_product_type = $objp->fk_product_type; // Produit ou service
+
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Save the start and end date of the line in the object
+ $ligne->date_start = $objp->date_start;
+ $ligne->date_end = $objp->date_end;
$this->lignes[$i] = $ligne;
$i++;
@@ -1581,11 +1610,13 @@ class Commande extends CommonObject
* \param tva_tx Taux TVA
* \param price_base_type HT or TTC
* \param info_bits Miscellanous informations on line
+ * \param date_start Start date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ * \param date_end End date of the line - Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
* \return int < 0 si erreur, > 0 si ok
*/
- function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $price_base_type='HT', $info_bits=0)
+ function updateline($rowid, $desc, $pu, $qty, $remise_percent=0, $txtva, $price_base_type='HT', $info_bits=0, $date_start='', $date_end='')
{
- dolibarr_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits");
+ dolibarr_syslog("Commande::UpdateLine $rowid, $desc, $pu, $qty, $remise_percent, $txtva, $price_base_type, $info_bits, $date_start, $date_end");
include_once(DOL_DOCUMENT_ROOT.'/lib/price.lib.php');
if ($this->brouillon)
@@ -1641,6 +1672,14 @@ class Commande extends CommonObject
$sql.= ",total_ht='".price2num($total_ht)."'";
$sql.= ",total_tva='".price2num($total_tva)."'";
$sql.= ",total_ttc='".price2num($total_ttc)."'";
+
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Save the start and end date in the database
+ if ($date_start) { $sql.= ",date_start='".$date_start."'"; }
+ else { $sql.=',date_start=null'; }
+ if ($date_end) { $sql.= ",date_end='".$date_end."'"; }
+ else { $sql.=',date_end=null'; }
+
$sql.= " WHERE rowid = ".$rowid;
$result = $this->db->query($sql);
@@ -2127,6 +2166,11 @@ class CommandeLigne
var $ref; // Reference produit
var $product_libelle; // Label produit
var $product_desc; // Description produit
+
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Start and end date of the line
+ var $date_start;
+ var $date_end;
/**
@@ -2148,6 +2192,9 @@ class CommandeLigne
$sql.= ' cd.remise, cd.remise_percent, cd.fk_remise_except, cd.subprice,';
$sql.= ' cd.info_bits, cd.total_ht, cd.total_tva, cd.total_ttc, cd.marge_tx, cd.marque_tx, cd.rang,';
$sql.= ' p.ref as product_ref, p.label as product_libelle, p.description as product_desc';
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Load start and end dates from the database
+ $sql.= ','.$this->db->pdate('cd.date_start').' as date_start,'.$this->db->pdate('cd.date_end').' as date_end';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as cd';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
$sql.= ' WHERE cd.rowid = '.$rowid;
@@ -2177,6 +2224,11 @@ class CommandeLigne
$this->ref = $objp->product_ref;
$this->product_libelle = $objp->product_libelle;
$this->product_desc = $objp->product_desc;
+
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Save the start and end dates of the line in the object
+ $this->date_start = $objp->date_start;
+ $this->date_end = $objp->date_end;
$this->db->free($result);
}
@@ -2255,7 +2307,9 @@ class CommandeLigne
$sql.= ' (fk_commande, description, qty, tva_tx,';
$sql.= ' fk_product, remise_percent, subprice, price, remise, fk_remise_except,';
$sql.= ' rang, marge_tx, marque_tx,';
- $sql.= ' info_bits, total_ht, total_tva, total_ttc)';
+ // Updated by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Insert in the database the start and end dates
+ $sql.= ' info_bits, total_ht, total_tva, total_ttc, date_start, date_end)';
$sql.= " VALUES (".$this->fk_commande.",";
$sql.= " '".addslashes($this->desc)."',";
$sql.= " '".price2num($this->qty)."',";
@@ -2276,7 +2330,13 @@ class CommandeLigne
$sql.= " '".$this->info_bits."',";
$sql.= " '".price2num($this->total_ht)."',";
$sql.= " '".price2num($this->total_tva)."',";
- $sql.= " '".price2num($this->total_ttc)."'";
+ // Updated by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Insert in the database the start and end dates
+ $sql.= " '".price2num($this->total_ttc)."',";
+ if ($this->date_start) { $sql.= "'".$this->date_start."',"; }
+ else { $sql.='null,'; }
+ if ($this->date_end) { $sql.= "'".$this->date_end."'"; }
+ else { $sql.='null'; }
$sql.= ')';
if ($this->fk_product)
diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index 18a892bd53d..0ae84ac997a 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -48,20 +48,13 @@ $langs->load('products');
if (!$user->rights->commande->lire) accessforbidden();
-// Securite acces client
+// Security check
$socid=0;
-if ($user->societe_id > 0)
-{
- $socid = $user->societe_id;
-}
-if ($user->societe_id >0 && isset($_GET["id"]) && $_GET["id"]>0)
-{
- $commande = new Commande($db);
- $commande->fetch((int)$_GET['id']);
- if ($user->societe_id != $commande->socid) {
- accessforbidden();
- }
-}
+$contratid = isset($_GET["id"])?$_GET["id"]:'';
+if ($user->societe_id) $socid=$user->societe_id;
+$result=restrictedArea($user,'commande',$contratid,'commande');
+
+$usehm=$conf->global->MAIN_USE_HOURMIN_IN_DATE_RANGE;
// Recuperation de l'id de projet
$projetid = 0;
@@ -303,6 +296,26 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
exit;
}
$ret=$commande->fetch_client();
+
+ $suffixe = $_POST['idprod'] ? '_prod' : '';
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Retrieve start and end date (for product/service lines or customizable lines)
+ $date_start='';
+ $date_end='';
+ if ($_POST['date_start'.$suffixe.'year'] && $_POST['date_start'.$suffixe.'month'] && $_POST['date_start'.$suffixe.'day'])
+ {
+ $date_start=$_POST['date_start'.$suffixe.'year'].'-'.$_POST['date_start'.$suffixe.'month'].'-'.$_POST['date_start'.$suffixe.'day'];
+ // If hour/minute are specified, append them
+ if (($_POST['date_start'.$suffixe.'hour']) && ($_POST['date_start'.$suffixe.'min']))
+ $date_start.=' '.$_POST['date_start'.$suffixe.'hour'].':'.$_POST['date_start'.$suffixe.'min'];
+ }
+ if ($_POST['date_end'.$suffixe.'year'] && $_POST['date_end'.$suffixe.'month'] && $_POST['date_end'.$suffixe.'day'])
+ {
+ $date_end=$_POST['date_end'.$suffixe.'year'].'-'.$_POST['date_end'.$suffixe.'month'].'-'.$_POST['date_end'.$suffixe.'day'];
+ // If hour/minute are specified, append them
+ if (($_POST['date_end'.$suffixe.'hour']) && ($_POST['date_end'.$suffixe.'min']))
+ $date_end.=' '.$_POST['date_end'.$suffixe.'hour'].':'.$_POST['date_end'.$suffixe.'min'];
+ }
$price_base_type = 'HT';
@@ -376,9 +389,13 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
$_POST['idprod'],
$_POST['remise_percent'],
$info_bits,
- '',
+ 0,
$price_base_type,
- $pu_ttc
+ $pu_ttc,
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Add the start and end dates
+ $date_start,
+ $date_end
);
if ($result > 0)
@@ -405,6 +422,26 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
{
$commande = new Commande($db,'',$_POST['id']);
if (! $commande->fetch($_POST['id']) > 0) dolibarr_print_error($db);
+
+
+ $date_start='';
+ $date_end='';
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Retrieve start and end date (for product/service lines or customizable lines)
+ if ($_POST['date_startyear'] && $_POST['date_startmonth'] && $_POST['date_startday'])
+ {
+ $date_start=$_POST['date_startyear'].'-'.$_POST['date_startmonth'].'-'.$_POST['date_startday'];
+ // If hour/minute are specified, append them
+ if (($_POST['date_starthour']) && ($_POST['date_startmin']))
+ $date_start.=' '.$_POST['date_starthour'].':'.$_POST['date_startmin'];
+ }
+ if ($_POST['date_endyear'] && $_POST['date_endmonth'] && $_POST['date_endday'])
+ {
+ $date_end=$_POST['date_endyear'].'-'.$_POST['date_endmonth'].'-'.$_POST['date_endday'];
+ // If hour/minute are specified, append them
+ if (($_POST['date_endhour']) && ($_POST['date_endmin']))
+ $date_end.=' '.$_POST['date_endhour'].':'.$_POST['date_endmin'];
+ }
// Define info_bits
$info_bits=0;
@@ -426,8 +463,12 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
$_POST['qty'],
$_POST['elremise_percent'],
$vat_rate,
- 'HT',
- $info_bits
+ 'HT',
+ $info_bits,
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Add the start and end dates
+ $date_start,
+ $date_end
);
if ($result >= 0)
@@ -1393,6 +1434,10 @@ else
$sql.= ' l.total_ht, l.total_tva, l.total_ttc,';
$sql.= ' p.label as product, p.ref, p.fk_product_type, p.rowid as prodid, ';
$sql.= ' p.description as product_desc';
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Load start and end dates
+ $sql.= ','.$db->pdate('l.date_start').' as date_start,';
+ $sql.= ' '.$db->pdate('l.date_end').' as date_end';
$sql.= ' FROM '.MAIN_DB_PREFIX.'commandedet as l';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON l.fk_product=p.rowid';
$sql.= ' WHERE l.fk_commande = '.$commande->id;
@@ -1440,8 +1485,9 @@ else
$text.= ' - '.$objp->product;
$description=($conf->global->PRODUIT_DESC_IN_FORM?'':dol_htmlentitiesbr($objp->description));
print $html->textwithtooltip($text,$description,3,'','',$i);
- // Todo: voir si on insert ou pas en option les dates de debut et de fin de service
- //print_date_range($objp->date_start,$objp->date_end);
+ // Updated by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Print the start and end dates
+ print_date_range($objp->date_start,$objp->date_end);
if ($conf->global->PRODUIT_DESC_IN_FORM)
{
print ($objp->description && $objp->description!=$objp->product)?' '.dol_htmlentitiesbr($objp->description):'';
@@ -1476,6 +1522,9 @@ else
else
{
print nl2br($objp->description);
+ // Updated by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Print the start and end dates
+ print_date_range($objp->date_start,$objp->date_end,'dayhour');
}
print '';
}
@@ -1614,6 +1663,17 @@ else
print '
';
print '
';
print '';
+
+ // Added by Matelli (See http://matelli.fr/showcases/patchs-dolibarr/add-dates-in-order-lines.html)
+ // Start and end dates selector
+ print '
';
diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php
index 1ff83e98972..50acef6bebe 100644
--- a/htdocs/html.form.class.php
+++ b/htdocs/html.form.class.php
@@ -2627,19 +2627,19 @@ class Form
/**
- * \brief Affiche zone de selection de date
- * Liste deroulante pour les jours, mois, annee et eventuellement heurs et minutes
- * Les champs sont pré-sélectionnés avec:
+ * Affiche zone de selection de date
+ * Liste deroulante pour les jours, mois, annee et eventuellement heurs et minutes
+ * Les champs sont pré-sélectionnés avec:
* - La date set_time (timestamps ou date au format YYYY-MM-DD ou YYYY-MM-DD HH:MM)
* - La date du jour si set_time vaut ''
* - Aucune date (champs vides) si set_time vaut -1 (dans ce cas empty doit valoir 1)
- * \param set_time Date de pré-sélection
- * \param prefix Prefix pour nom champ
- * \param h 1=Affiche aussi les heures
- * \param m 1=Affiche aussi les minutes
- * \param empty 0=Champ obligatoire, 1=Permet une saisie vide
- * \param form_name Nom du formulaire de provenance. Utilisé pour les dates en popup style andre.
- * \param d 1=Affiche aussi les jours, mois, annees
+ * @param set_time Date de pré-sélection
+ * @param prefix Prefix pour nom champ
+ * @param h 1=Affiche aussi les heures
+ * @param m 1=Affiche aussi les minutes
+ * @param empty 0=Champ obligatoire, 1=Permet une saisie vide
+ * @param form_name Nom du formulaire de provenance. Utilisé pour les dates en popup style andre.
+ * @param d 1=Affiche aussi les jours, mois, annees
*/
function select_date($set_time='', $prefix='re', $h=0, $m=0, $empty=0, $form_name="", $d=1)
{
diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index b144918b7d5..9a1b908801f 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -542,32 +542,37 @@ function dolibarr_getdate($timestamp,$fast=false)
}
/**
- \brief Retourne une date fabriquee depuis infos.
- Remplace la fonction mktime non implementee sous Windows si annee < 1970
- \param hour Hour
- \param minute Minute
- \param second Second
- \param month Month
- \param day Day
- \param year Year
- \param gm Time gm
- \param check No check on parameters (Can use day 32, etc...)
- \return timestamp Date en timestamp, '' if error
- \remarks PHP mktime is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
+ * Retourne une date fabriquee depuis infos.
+ * Remplace la fonction mktime non implementee sous Windows si annee < 1970
+ * @param hour Hour (can be -1 for undefined)
+ * @param minute Minute (can be -1 for undefined)
+ * @param second Second (can be -1 for undefined)
+ * @param month Month
+ * @param day Day
+ * @param year Year
+ * @param gm Time gm
+ * @param check No check on parameters (Can use day 32, etc...)
+ * @return timestamp Date en timestamp, '' if error
+ * @remarks PHP mktime is restricted to the years 1901-2038 on Unix and 1970-2038 on Windows
*/
function dolibarr_mktime($hour,$minute,$second,$month,$day,$year,$gm=0,$check=1)
{
//print "- ".$hour.",".$minute.",".$second.",".$month.",".$day.",".$year.",".$_SERVER["WINDIR"]." -";
+ // Clean parameters
+ if ($hour == -1) $hour=0;
+ if ($minute == -1) $minute=0;
+ if ($second == -1) $second=0;
+
// Check parameters
if ($check)
{
if (! $month || ! $day) return '';
if ($day > 31) return '';
if ($month > 12) return '';
- if ($min < 0 || $min > 60) return '';
- if ($hour < 0 || $hour > 24) return '';
- if ($min < 0 || $min > 60) return '';
+ if ($hour < 0 || $hour > 24) return '';
+ if ($minute< 0 || $minute > 60) return '';
+ if ($second< 0 || $second > 60) return '';
}
$usealternatemethod=false;
@@ -1431,7 +1436,7 @@ function restrictedArea($user, $feature='societe', $objectid=0, $dbtablename='',
}
else
{
- if (!$dbtablename) $dbtablename = $feature; // Si dbtable non d�fini, meme nom que le module
+ if (!$dbtablename) $dbtablename = $feature; // Si dbtable non defini, meme nom que le module
$sql = "SELECT sc.fk_soc";
$sql.= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
diff --git a/mysql/migration/2.4.0-2.5.0.sql b/mysql/migration/2.4.0-2.5.0.sql
index 34691577ec5..287282a5d62 100644
--- a/mysql/migration/2.4.0-2.5.0.sql
+++ b/mysql/migration/2.4.0-2.5.0.sql
@@ -16,7 +16,7 @@ alter table llx_societe add column gencod varchar(255);
delete from llx_user_param where page <> '';
-alter table llx_expedition add tracking_number varchar(50) after fk_expedition_methode;
+alter table llx_expedition add column tracking_number varchar(50) after fk_expedition_methode;
alter table llx_actioncomm add column location varchar(128) after percent;
@@ -32,5 +32,6 @@ alter table llx_projet_task_actors modify column role varchar(5) DEFAU
alter table llx_projet_task modify column statut varchar(6) DEFAULT 'open';
alter table llx_rights_def modify column type varchar(1);
+ALTER TABLE `llx_commandedet` ADD column `date_start` DATETIME DEFAULT NULL, ADD `date_end` DATETIME DEFAULT NULL ;
diff --git a/mysql/tables/llx_commandedet.sql b/mysql/tables/llx_commandedet.sql
index dae1ff6e51a..5ab2caa902b 100644
--- a/mysql/tables/llx_commandedet.sql
+++ b/mysql/tables/llx_commandedet.sql
@@ -25,7 +25,7 @@ create table llx_commandedet
fk_commande integer,
fk_product integer,
description text,
- tva_tx double(6,3), -- taux tva
+ tva_tx double(6,3), -- taux tva
qty real, -- quantité
remise_percent real DEFAULT 0, -- pourcentage de remise
remise real DEFAULT 0, -- montant de la remise
@@ -35,7 +35,9 @@ create table llx_commandedet
total_ht double(24,8) DEFAULT 0, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
total_tva double(24,8) DEFAULT 0, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale
total_ttc double(24,8) DEFAULT 0, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
- info_bits integer DEFAULT 0, -- TVA NPR ou non
+ date_start datetime DEFAULT NULL, -- date debut si service
+ date_end datetime DEFAULT NULL, -- date fin si service
+ info_bits integer DEFAULT 0, -- TVA NPR ou non
marge_tx double(6,3) DEFAULT 0, -- taux de marge (marge sur prix d'achat)
marque_tx double(6,3) DEFAULT 0, -- taux de marque (marge sur prix de vente)
special_code tinyint(4) UNSIGNED DEFAULT 0, -- code pour les lignes speciales
diff --git a/mysql/tables/llx_facturedet.sql b/mysql/tables/llx_facturedet.sql
index 44dbaacfd8c..83d84cea930 100644
--- a/mysql/tables/llx_facturedet.sql
+++ b/mysql/tables/llx_facturedet.sql
@@ -36,10 +36,10 @@ create table llx_facturedet
total_ht real, -- Total HT de la ligne toute quantité et incluant remise ligne et globale
total_tva real, -- Total TVA de la ligne toute quantité et incluant remise ligne et globale
total_ttc real, -- Total TTC de la ligne toute quantité et incluant remise ligne et globale
- product_type integer DEFAULT 0,
- date_start datetime, -- date debut si service
- date_end datetime, -- date fin si service
- info_bits integer DEFAULT 0, -- TVA NPR ou non
+ product_type integer DEFAULT 0,
+ date_start datetime DEFAULT NULL, -- date debut si service
+ date_end datetime DEFAULT NULL, -- date fin si service
+ info_bits integer DEFAULT 0, -- TVA NPR ou non
fk_code_ventilation integer DEFAULT 0 NOT NULL,
fk_export_compta integer DEFAULT 0 NOT NULL,
special_code tinyint(4) UNSIGNED DEFAULT 0, -- code pour les lignes speciales