Clean code

This commit is contained in:
Laurent Destailleur 2022-09-02 08:53:13 +02:00
parent a865388b9c
commit 3d9b57ac3f
9 changed files with 123 additions and 153 deletions

View File

@ -682,9 +682,6 @@ class Categories extends DolibarrApi
unset($object->total_ttc); unset($object->total_ttc);
unset($object->total_tva); unset($object->total_tva);
unset($object->lines); unset($object->lines);
unset($object->fk_incoterms);
unset($object->label_incoterms);
unset($object->location_incoterms);
unset($object->civility_id); unset($object->civility_id);
unset($object->name); unset($object->name);
unset($object->lastname); unset($object->lastname);

View File

@ -25,7 +25,7 @@
/** /**
* \file htdocs/compta/facture/class/facture-rec.class.php * \file htdocs/compta/facture/class/facture-rec.class.php
* \ingroup facture * \ingroup facture
* \brief Fichier de la classe des factures recurentes * \brief File of class to manage recurring invoices
*/ */
require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
@ -462,7 +462,7 @@ class FactureRec extends CommonInvoice
/** /**
* Update a line to invoice_rec. * Update a line invoice_rec.
* *
* @param User $user User * @param User $user User
* @param int $notrigger No trigger * @param int $notrigger No trigger
@ -470,8 +470,6 @@ class FactureRec extends CommonInvoice
*/ */
public function update(User $user, $notrigger = 0) public function update(User $user, $notrigger = 0)
{ {
global $conf;
$error = 0; $error = 0;
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."facture_rec SET";
@ -480,8 +478,8 @@ class FactureRec extends CommonInvoice
$sql .= " suspended = ".((int) $this->suspended).","; $sql .= " suspended = ".((int) $this->suspended).",";
$sql .= " fk_soc = ".((int) $this->socid).","; $sql .= " fk_soc = ".((int) $this->socid).",";
$sql .= " total_tva = ".((float) $this->total_tva).","; $sql .= " total_tva = ".((float) $this->total_tva).",";
$sql .= " localtax1 = ".((float) $this->localtax1).","; $sql .= " localtax1 = ".((float) $this->total_localtax1).",";
$sql .= " localtax2 = ".((float) $this->localtax2).","; $sql .= " localtax2 = ".((float) $this->total_localtax2).",";
$sql .= " total_ht = ".((float) $this->total_ht).","; $sql .= " total_ht = ".((float) $this->total_ht).",";
$sql .= " total_ttc = ".((float) $this->total_ttc).","; $sql .= " total_ttc = ".((float) $this->total_ttc).",";
$sql .= " remise_percent = ".((float) $this->remise_percent); $sql .= " remise_percent = ".((float) $this->remise_percent);

View File

@ -42,30 +42,6 @@ class ExtraFields
*/ */
public $db; public $db;
/**
* @var array Array with type of the extra field
* @deprecated
*/
public $attribute_type;
/**
* @var array Array with label of extra field
* @deprecated
*/
public $attribute_label;
/**
* @var array Array with list of possible values for some types of extra fields
* @deprecated
*/
public $attribute_choice;
/**
* @var array array to store extrafields definition
* @deprecated
*/
public $attribute_list;
/** /**
* @var array New array to store extrafields definition * @var array New array to store extrafields definition
*/ */
@ -128,10 +104,6 @@ class ExtraFields
$this->error = ''; $this->error = '';
$this->errors = array(); $this->errors = array();
$this->attributes = array(); $this->attributes = array();
// For old usage
$this->attribute_type = array();
$this->attribute_label = array();
} }
/** /**
@ -838,7 +810,7 @@ class ExtraFields
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/** /**
* Load array this->attributes (and some old this->attribute_xxx like attribute_label, attribute_type, ... * Load array this->attributes
* *
* @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...). * @param string $elementtype Type of element ('' = all or $object->table_element like 'adherent', 'commande', 'thirdparty', 'facture', 'propal', 'product', ...).
* @param boolean $forceload Force load of extra fields whatever is status of cache. * @param boolean $forceload Force load of extra fields whatever is status of cache.
@ -892,11 +864,6 @@ class ExtraFields
$array_name_label[$tab->name] = $tab->label; $array_name_label[$tab->name] = $tab->label;
} }
// Old usage
$this->attribute_type[$tab->name] = $tab->type;
$this->attribute_label[$tab->name] = $tab->label;
// New usage
$this->attributes[$tab->elementtype]['type'][$tab->name] = $tab->type; $this->attributes[$tab->elementtype]['type'][$tab->name] = $tab->type;
$this->attributes[$tab->elementtype]['label'][$tab->name] = $tab->label; $this->attributes[$tab->elementtype]['label'][$tab->name] = $tab->label;
$this->attributes[$tab->elementtype]['size'][$tab->name] = $tab->size; $this->attributes[$tab->elementtype]['size'][$tab->name] = $tab->size;
@ -946,7 +913,7 @@ class ExtraFields
* @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names) * @param string $keyprefix Suffix string to add before name and id of field (can be used to avoid duplicate names)
* @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric) * @param string $morecss More css (to defined size of field. Old behaviour: may also be a numeric)
* @param int $objectid Current object id * @param int $objectid Current object id
* @param string $extrafieldsobjectkey If defined (for example $object->table_element), use the new method to get extrafields data * @param string $extrafieldsobjectkey The key to use to store retreived data (for example $object->table_element)
* @param string $mode 1=Used for search filters * @param string $mode 1=Used for search filters
* @return string * @return string
*/ */
@ -965,7 +932,11 @@ class ExtraFields
$keyprefix = $keyprefix.'options_'; $keyprefix = $keyprefix.'options_';
} }
if (!empty($extrafieldsobjectkey)) { if (empty($extrafieldsobjectkey)) {
dol_syslog(get_class($this).'::showInputField extrafieldsobjectkey required', LOG_ERR);
return 'BadValueForParamExtraFieldsObjectKey';
}
$label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; $label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; $type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; $size = $this->attributes[$extrafieldsobjectkey]['size'][$key];
@ -980,13 +951,6 @@ class ExtraFields
$totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key]; $totalizable = $this->attributes[$extrafieldsobjectkey]['totalizable'][$key];
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) $hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
} else {
// Old usage
$label = $this->attribute_label[$key];
$type = $this->attribute_type[$key];
$list = $this->attribute_list[$key];
$hidden = (empty($list) ? 1 : 0); // If empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
}
if ($computed) { if ($computed) {
if (!preg_match('/^search_/', $keyprefix)) { if (!preg_match('/^search_/', $keyprefix)) {
@ -1591,7 +1555,11 @@ class ExtraFields
{ {
global $conf, $langs; global $conf, $langs;
if (!empty($extrafieldsobjectkey)) { if (empty($extrafieldsobjectkey)) {
dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_ERR);
return 'BadValueForParamExtraFieldsObjectKey';
}
$label = $this->attributes[$extrafieldsobjectkey]['label'][$key]; $label = $this->attributes[$extrafieldsobjectkey]['label'][$key];
$type = $this->attributes[$extrafieldsobjectkey]['type'][$key]; $type = $this->attributes[$extrafieldsobjectkey]['type'][$key];
$size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'... $size = $this->attributes[$extrafieldsobjectkey]['size'][$key]; // Can be '255', '24,8'...
@ -1605,11 +1573,6 @@ class ExtraFields
$list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1'); $list = dol_eval($this->attributes[$extrafieldsobjectkey]['list'][$key], 1, 1, '1');
$help = $this->attributes[$extrafieldsobjectkey]['help'][$key]; $help = $this->attributes[$extrafieldsobjectkey]['help'][$key];
$hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller) $hidden = (empty($list) ? 1 : 0); // If $list empty, we are sure it is hidden, otherwise we show. If it depends on mode (view/create/edit form or list, this must be filtered by caller)
} else {
// Old usage not allowed anymore
dol_syslog(get_class($this).'::showOutputField extrafieldsobjectkey required', LOG_WARNING);
return '';
}
if ($hidden) { if ($hidden) {
return ''; // This is a protection. If field is hidden, we should just not call this method. return ''; // This is a protection. If field is hidden, we should just not call this method.

View File

@ -133,7 +133,7 @@ class Cronjob extends CommonObject
public $status; public $status;
/** /**
* @var int Is job processing * @var int Is job running ?
*/ */
public $processing; public $processing;
@ -143,12 +143,12 @@ class Cronjob extends CommonObject
public $pid; public $pid;
/** /**
* @var int ID * @var int User ID of creation
*/ */
public $fk_user_author; public $fk_user_author;
/** /**
* @var int ID * @var int User ID of last modification
*/ */
public $fk_user_mod; public $fk_user_mod;
@ -1513,10 +1513,12 @@ class Cronjobline
public $datenextrun = ''; public $datenextrun = '';
public $dateend = ''; public $dateend = '';
public $datestart = ''; public $datestart = '';
public $datelastresult = '';
public $lastresult = ''; public $lastresult = '';
public $lastoutput; public $lastoutput;
public $unitfrequency; public $unitfrequency;
public $frequency; public $frequency;
public $processing;
/** /**
* @var int Status * @var int Status
@ -1534,8 +1536,10 @@ class Cronjobline
public $fk_user_mod; public $fk_user_mod;
public $note; public $note;
public $note_private;
public $nbrun; public $nbrun;
public $libname; public $libname;
public $test;
/** /**
* Constructor * Constructor

View File

@ -36,7 +36,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobjectline.class.php';
*/ */
class Fichinter extends CommonObject class Fichinter extends CommonObject
{ {
public $fields = array( public $fields = array(
'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10), 'rowid' =>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>10),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15), 'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>'$conf->societe->enabled', 'visible'=>-1, 'notnull'=>1, 'position'=>15),
@ -66,6 +65,7 @@ class Fichinter extends CommonObject
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130), 'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>130),
'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135), 'extraparams' =>array('type'=>'varchar(255)', 'label'=>'Extraparams', 'enabled'=>1, 'visible'=>-1, 'position'=>135),
); );
/** /**
* @var string ID to identify managed object * @var string ID to identify managed object
*/ */
@ -1267,7 +1267,8 @@ class Fichinter extends CommonObject
$line->fk_fichinter = $fichinterid; $line->fk_fichinter = $fichinterid;
$line->desc = $desc; $line->desc = $desc;
$line->datei = $date_intervention; $line->date = $date_intervention;
$line->datei = $date_intervention; // For backward compatibility
$line->duration = $duration; $line->duration = $duration;
if (is_array($array_options) && count($array_options) > 0) { if (is_array($array_options) && count($array_options) > 0) {
@ -1316,7 +1317,8 @@ class Fichinter extends CommonObject
while ($xnbp < $nbp) { while ($xnbp < $nbp) {
$line = new FichinterLigne($this->db); $line = new FichinterLigne($this->db);
$line->desc = $langs->trans("Description")." ".$xnbp; $line->desc = $langs->trans("Description")." ".$xnbp;
$line->datei = ($now - 3600 * (1 + $xnbp)); $line->date = ($now - 3600 * (1 + $xnbp));
$line->datei = ($now - 3600 * (1 + $xnbp)); // For backward compatibility
$line->duration = 600; $line->duration = 600;
$line->fk_fichinter = 0; $line->fk_fichinter = 0;
$this->lines[$xnbp] = $line; $this->lines[$xnbp] = $line;
@ -1359,7 +1361,7 @@ class Fichinter extends CommonObject
//For invoicing we calculing hours //For invoicing we calculing hours
$line->qty = round($objp->duree / 3600, 2); $line->qty = round($objp->duree / 3600, 2);
$line->date = $this->db->jdate($objp->date); $line->date = $this->db->jdate($objp->date);
$line->datei = $this->db->jdate($objp->date); $line->datei = $this->db->jdate($objp->date); // For backward compatibility
$line->rang = $objp->rang; $line->rang = $objp->rang;
$line->product_type = 1; $line->product_type = 1;
$line->fetch_optionals(); $line->fetch_optionals();
@ -1486,6 +1488,8 @@ class FichinterLigne extends CommonObjectLine
public $duration; // Duration of intervention public $duration; // Duration of intervention
public $rang = 0; public $rang = 0;
public $tva_tx;
public $subprice;
/** /**
* @var string ID to identify managed object * @var string ID to identify managed object
@ -1522,8 +1526,7 @@ class FichinterLigne extends CommonObjectLine
*/ */
public function fetch($rowid) public function fetch($rowid)
{ {
$sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang,'; $sql = 'SELECT ft.rowid, ft.fk_fichinter, ft.description, ft.duree, ft.rang, ft.date';
$sql .= ' ft.date as datei';
$sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft'; $sql .= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
$sql .= ' WHERE ft.rowid = '.((int) $rowid); $sql .= ' WHERE ft.rowid = '.((int) $rowid);
@ -1534,7 +1537,8 @@ class FichinterLigne extends CommonObjectLine
$this->rowid = $objp->rowid; $this->rowid = $objp->rowid;
$this->id = $objp->rowid; $this->id = $objp->rowid;
$this->fk_fichinter = $objp->fk_fichinter; $this->fk_fichinter = $objp->fk_fichinter;
$this->datei = $this->db->jdate($objp->datei); $this->date = $this->db->jdate($objp->date);
$this->datei = $this->db->jdate($objp->date); // For backward compatibility
$this->desc = $objp->description; $this->desc = $objp->description;
$this->duration = $objp->duree; $this->duration = $objp->duree;
$this->rang = $objp->rang; $this->rang = $objp->rang;
@ -1562,6 +1566,10 @@ class FichinterLigne extends CommonObjectLine
dol_syslog("FichinterLigne::insert rang=".$this->rang); dol_syslog("FichinterLigne::insert rang=".$this->rang);
if (empty($this->date) && !empty($this->datei)) { // For backward compatibility
$this->date = $this->datei;
}
$this->db->begin(); $this->db->begin();
$rangToUse = $this->rang; $rangToUse = $this->rang;
@ -1585,7 +1593,7 @@ class FichinterLigne extends CommonObjectLine
$sql .= ' (fk_fichinter, description, date, duree, rang)'; $sql .= ' (fk_fichinter, description, date, duree, rang)';
$sql .= " VALUES (".((int) $this->fk_fichinter).","; $sql .= " VALUES (".((int) $this->fk_fichinter).",";
$sql .= " '".$this->db->escape($this->desc)."',"; $sql .= " '".$this->db->escape($this->desc)."',";
$sql .= " '".$this->db->idate($this->datei)."',"; $sql .= " '".$this->db->idate($this->date)."',";
$sql .= " ".((int) $this->duration).","; $sql .= " ".((int) $this->duration).",";
$sql .= ' '.((int) $rangToUse); $sql .= ' '.((int) $rangToUse);
$sql .= ')'; $sql .= ')';
@ -1647,14 +1655,18 @@ class FichinterLigne extends CommonObjectLine
$error = 0; $error = 0;
if (empty($this->date) && !empty($this->datei)) { // For backward compatibility
$this->date = $this->datei;
}
$this->db->begin(); $this->db->begin();
// Mise a jour ligne en base // Mise a jour ligne en base
$sql = "UPDATE ".MAIN_DB_PREFIX."fichinterdet SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."fichinterdet SET";
$sql .= " description='".$this->db->escape($this->desc)."'"; $sql .= " description = '".$this->db->escape($this->desc)."',";
$sql .= ",date='".$this->db->idate($this->datei)."'"; $sql .= " date = '".$this->db->idate($this->date)."',";
$sql .= ",duree=".$this->duration; $sql .= " duree = ".((int) $this->duration).",";
$sql .= ",rang='".$this->db->escape($this->rang)."'"; $sql .= " rang = ".((int) $this->rang);
$sql .= " WHERE rowid = ".((int) $this->id); $sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog("FichinterLigne::update", LOG_DEBUG); dol_syslog("FichinterLigne::update", LOG_DEBUG);

View File

@ -64,7 +64,6 @@ class FichinterRec extends Fichinter
public $number; public $number;
public $date; public $date;
public $amount; public $amount;
public $remise;
public $tva; public $tva;
public $total; public $total;
@ -222,7 +221,7 @@ class FichinterRec extends Fichinter
$result_insert = $this->addline( $result_insert = $this->addline(
$fichintsrc->lines[$i]->desc, $fichintsrc->lines[$i]->desc,
$fichintsrc->lines[$i]->duration, $fichintsrc->lines[$i]->duration,
$fichintsrc->lines[$i]->datei, $fichintsrc->lines[$i]->date,
$fichintsrc->lines[$i]->rang, $fichintsrc->lines[$i]->rang,
$fichintsrc->lines[$i]->subprice, $fichintsrc->lines[$i]->subprice,
$fichintsrc->lines[$i]->qty, $fichintsrc->lines[$i]->qty,
@ -351,7 +350,7 @@ class FichinterRec extends Fichinter
$this->lines = array(); $this->lines = array();
$sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description,'; $sql = 'SELECT l.rowid, l.fk_product, l.product_type as product_type, l.label as custom_label, l.description,';
$sql .= ' l.price, l.qty, l.tva_tx, l.remise_percent, l.subprice, l.duree, '; $sql .= ' l.price, l.qty, l.tva_tx, l.remise_percent, l.subprice, l.duree, l.date,';
$sql .= ' l.total_ht, l.total_tva, l.total_ttc,'; $sql .= ' l.total_ht, l.total_tva, l.total_ttc,';
$sql .= ' l.rang, l.special_code,'; $sql .= ' l.rang, l.special_code,';
$sql .= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,'; $sql .= ' l.fk_unit, p.ref as product_ref, p.fk_product_type as fk_product_type,';
@ -381,19 +380,16 @@ class FichinterRec extends Fichinter
$line->qty = $objp->qty; $line->qty = $objp->qty;
$line->duree = $objp->duree; $line->duree = $objp->duree;
$line->duration = $objp->duree; $line->duration = $objp->duree;
$line->datei = $objp->date; $line->date = $objp->date;
$line->subprice = $objp->subprice; $line->subprice = $objp->subprice;
$line->tva_tx = $objp->tva_tx; $line->tva_tx = $objp->tva_tx;
$line->remise_percent = $objp->remise_percent; $line->remise_percent = $objp->remise_percent;
$line->fk_remise_except = $objp->fk_remise_except; $line->fk_remise_except = $objp->fk_remise_except;
$line->fk_product = $objp->fk_product; $line->fk_product = $objp->fk_product;
$line->date_start = $objp->date_start;
$line->date_end = $objp->date_end;
$line->info_bits = $objp->info_bits; $line->info_bits = $objp->info_bits;
$line->total_ht = $objp->total_ht; $line->total_ht = $objp->total_ht;
$line->total_tva = $objp->total_tva; $line->total_tva = $objp->total_tva;
$line->total_ttc = $objp->total_ttc; $line->total_ttc = $objp->total_ttc;
$line->code_ventilation = $objp->fk_code_ventilation;
$line->rang = $objp->rang; $line->rang = $objp->rang;
$line->special_code = $objp->special_code; $line->special_code = $objp->special_code;
$line->fk_unit = $objp->fk_unit; $line->fk_unit = $objp->fk_unit;
@ -460,7 +456,7 @@ class FichinterRec extends Fichinter
* *
* @param string $desc Description de la ligne * @param string $desc Description de la ligne
* @param integer $duration Durée * @param integer $duration Durée
* @param string $datei Date * @param string $date Date
* @param int $rang Position of line * @param int $rang Position of line
* @param double $pu_ht Unit price without tax (> 0 even for credit note) * @param double $pu_ht Unit price without tax (> 0 even for credit note)
* @param double $qty Quantity * @param double $qty Quantity
@ -477,7 +473,7 @@ class FichinterRec extends Fichinter
* @param string $fk_unit Unit * @param string $fk_unit Unit
* @return int <0 if KO, Id of line if OK * @return int <0 if KO, Id of line if OK
*/ */
public function addline($desc, $duration, $datei, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null) public function addline($desc, $duration, $date, $rang = -1, $pu_ht = 0, $qty = 0, $txtva = 0, $fk_product = 0, $remise_percent = 0, $price_base_type = 'HT', $info_bits = 0, $fk_remise_except = '', $pu_ttc = 0, $type = 0, $special_code = 0, $label = '', $fk_unit = null)
{ {
global $mysoc; global $mysoc;
@ -520,6 +516,8 @@ class FichinterRec extends Fichinter
$total_tva = $tabprice[1]; $total_tva = $tabprice[1];
$total_ttc = $tabprice[2]; $total_ttc = $tabprice[2];
$pu_ht = $tabprice[3];
$product_type = $type; $product_type = $type;
if ($fk_product) { if ($fk_product) {
$product = new Product($this->db); $product = new Product($this->db);
@ -539,8 +537,7 @@ class FichinterRec extends Fichinter
$sql .= ", fk_product"; $sql .= ", fk_product";
$sql .= ", product_type"; $sql .= ", product_type";
$sql .= ", remise_percent"; $sql .= ", remise_percent";
//$sql.= ", subprice"; $sql .= ", subprice";
$sql .= ", remise";
$sql .= ", total_ht"; $sql .= ", total_ht";
$sql .= ", total_tva"; $sql .= ", total_tva";
$sql .= ", total_ttc"; $sql .= ", total_ttc";
@ -551,7 +548,7 @@ class FichinterRec extends Fichinter
$sql .= (int) $this->id; $sql .= (int) $this->id;
$sql .= ", ".(!empty($label) ? "'".$this->db->escape($label)."'" : "null"); $sql .= ", ".(!empty($label) ? "'".$this->db->escape($label)."'" : "null");
$sql .= ", ".(!empty($desc) ? "'".$this->db->escape($desc)."'" : "null"); $sql .= ", ".(!empty($desc) ? "'".$this->db->escape($desc)."'" : "null");
$sql .= ", ".(!empty($datei) ? "'".$this->db->idate($datei)."'" : "null"); $sql .= ", ".(!empty($date) ? "'".$this->db->idate($date)."'" : "null");
$sql .= ", ".$duration; $sql .= ", ".$duration;
//$sql.= ", ".price2num($pu_ht); //$sql.= ", ".price2num($pu_ht);
//$sql.= ", ".(!empty($qty)? $qty :(!empty($duration)? $duration :"null")); //$sql.= ", ".(!empty($qty)? $qty :(!empty($duration)? $duration :"null"));
@ -559,8 +556,7 @@ class FichinterRec extends Fichinter
$sql .= ", ".(!empty($fk_product) ? $fk_product : "null"); $sql .= ", ".(!empty($fk_product) ? $fk_product : "null");
$sql .= ", ".$product_type; $sql .= ", ".$product_type;
$sql .= ", ".(!empty($remise_percent) ? $remise_percent : "null"); $sql .= ", ".(!empty($remise_percent) ? $remise_percent : "null");
//$sql.= ", '".price2num($pu_ht)."'"; $sql.= ", '".price2num($pu_ht)."'";
$sql .= ", null";
$sql .= ", '".price2num($total_ht)."'"; $sql .= ", '".price2num($total_ht)."'";
$sql .= ", '".price2num($total_tva)."'"; $sql .= ", '".price2num($total_tva)."'";
$sql .= ", '".price2num($total_ttc)."'"; $sql .= ", '".price2num($total_ttc)."'";

View File

@ -61,6 +61,9 @@ ALTER TABLE llx_user DROP COLUMN idpers3;
ALTER TABLE llx_partnership ADD COLUMN ip varchar(250); ALTER TABLE llx_partnership ADD COLUMN ip varchar(250);
ALTER TABLE llx_adherent ADD COLUMN ip varchar(250); ALTER TABLE llx_adherent ADD COLUMN ip varchar(250);
ALTER TABLE llx_fichinterdet_rec DROP COLUMN remise;
ALTER TABLE llx_fichinterdet_rec DROP COLUMN fk_export_commpta;
UPDATE llx_const set name = 'ADHERENT_MAILMAN_ADMIN_PASSWORD' WHERE name = 'ADHERENT_MAILMAN_ADMINPW'; UPDATE llx_const set name = 'ADHERENT_MAILMAN_ADMIN_PASSWORD' WHERE name = 'ADHERENT_MAILMAN_ADMINPW';
ALTER TABLE llx_oauth_token ADD COLUMN state text after tokenstring; ALTER TABLE llx_oauth_token ADD COLUMN state text after tokenstring;

View File

@ -41,7 +41,6 @@ create table llx_fichinterdet_rec
localtax2_type VARCHAR(1) NULL DEFAULT NULL, localtax2_type VARCHAR(1) NULL DEFAULT NULL,
qty double NULL DEFAULT NULL, qty double NULL DEFAULT NULL,
remise_percent double NULL DEFAULT 0, remise_percent double NULL DEFAULT 0,
remise double NULL DEFAULT 0,
fk_remise_except integer NULL DEFAULT NULL, fk_remise_except integer NULL DEFAULT NULL,
price DOUBLE(24, 8) NULL DEFAULT NULL, price DOUBLE(24, 8) NULL DEFAULT NULL,
total_tva DOUBLE(24, 8) NULL DEFAULT NULL, total_tva DOUBLE(24, 8) NULL DEFAULT NULL,
@ -55,7 +54,6 @@ create table llx_fichinterdet_rec
buy_price_ht DOUBLE(24, 8) NULL DEFAULT 0, buy_price_ht DOUBLE(24, 8) NULL DEFAULT 0,
fk_product_fournisseur_price integer NULL DEFAULT NULL, fk_product_fournisseur_price integer NULL DEFAULT NULL,
fk_code_ventilation integer NOT NULL DEFAULT 0, fk_code_ventilation integer NOT NULL DEFAULT 0,
fk_export_commpta integer NOT NULL DEFAULT 0,
special_code integer UNSIGNED NULL DEFAULT 0, special_code integer UNSIGNED NULL DEFAULT 0,
fk_unit integer NULL DEFAULT NULL, fk_unit integer NULL DEFAULT NULL,
import_key varchar(14) NULL DEFAULT NULL import_key varchar(14) NULL DEFAULT NULL

View File

@ -751,7 +751,6 @@ if ($action == 'addcontainer' && $usercanedit) {
$objectpage->content = preg_replace('/^.*<body(\s[^>]*)*>/ims', '', $objectpage->content); $objectpage->content = preg_replace('/^.*<body(\s[^>]*)*>/ims', '', $objectpage->content);
$objectpage->content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $objectpage->content); $objectpage->content = preg_replace('/<\/body(\s[^>]*)*>.*$/ims', '', $objectpage->content);
$absoluteurlinaction = $urltograbdirwithoutslash;
// TODO Replace 'action="$urltograbdirwithoutslash' into action="/" // TODO Replace 'action="$urltograbdirwithoutslash' into action="/"
// TODO Replace 'action="$urltograbdirwithoutslash..."' into action="..." // TODO Replace 'action="$urltograbdirwithoutslash..."' into action="..."
// TODO Replace 'a href="$urltograbdirwithoutslash' into a href="/" // TODO Replace 'a href="$urltograbdirwithoutslash' into a href="/"
@ -908,7 +907,7 @@ if ($action == 'addcontainer' && $usercanedit) {
getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto); getAllImages($object, $objectpage, $urltograbbis, $tmpgeturl['content'], $action, 1, $grabimages, $grabimagesinto);
// We try to convert the CSS we got by adding a prefix .bodywebsite with lessc to avoid conflicit with CSS of Dolibarr. // We try to convert the CSS we got by adding a prefix .bodywebsite with lessc to avoid conflict with CSS of Dolibarr.
include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/lessc.class.php';
$lesscobj = new Lessc(); $lesscobj = new Lessc();
try { try {