diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 676bbd5bfa5..449a2a73c23 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -96,6 +96,7 @@ class Propal extends CommonObject
var $demand_reason_code;
var $products=array();
+ var $extraparams=array();
var $lines = array();
var $line;
@@ -945,25 +946,25 @@ class Propal extends CommonObject
{
global $conf;
- $sql = "SELECT p.rowid,ref,remise,remise_percent,remise_absolue,fk_soc";
- $sql.= ", total, tva, localtax1, localtax2, total_ht";
- $sql.= ", datec";
- $sql.= ", date_valid as datev";
- $sql.= ", datep as dp";
- $sql.= ", fin_validite as dfv";
- $sql.= ", date_livraison as date_livraison";
- $sql.= ", ca.code as availability_code, ca.label as availability";
- $sql.= ", dr.code as demand_reason_code, dr.label as demand_reason";
- $sql.= ", model_pdf, ref_client";
- $sql.= ", note as note_private, note_public";
- $sql.= ", fk_projet, fk_statut";
- $sql.= ", fk_user_author, fk_user_valid, fk_user_cloture";
- $sql.= ", fk_adresse_livraison";
+ $sql = "SELECT p.rowid, p.ref, p.remise, p.remise_percent, p.remise_absolue, p.fk_soc";
+ $sql.= ", p.total, p.tva, p.localtax1, p.localtax2, p.total_ht";
+ $sql.= ", p.datec";
+ $sql.= ", p.date_valid as datev";
+ $sql.= ", p.datep as dp";
+ $sql.= ", p.fin_validite as dfv";
+ $sql.= ", p.date_livraison as date_livraison";
+ $sql.= ", p.model_pdf, p.ref_client, p.extraparams";
+ $sql.= ", p.note as note_private, p.note_public";
+ $sql.= ", p.fk_projet, p.fk_statut";
+ $sql.= ", p.fk_user_author, p.fk_user_valid, p.fk_user_cloture";
+ $sql.= ", p.fk_adresse_livraison";
$sql.= ", p.fk_availability";
$sql.= ", p.fk_demand_reason";
$sql.= ", p.fk_cond_reglement";
$sql.= ", p.fk_mode_reglement";
$sql.= ", c.label as statut_label";
+ $sql.= ", ca.code as availability_code, ca.label as availability";
+ $sql.= ", dr.code as demand_reason_code, dr.label as demand_reason";
$sql.= ", cr.code as cond_reglement_code, cr.libelle as cond_reglement, cr.libelle_facture as cond_reglement_libelle_doc";
$sql.= ", cp.code as mode_reglement_code, cp.libelle as mode_reglement";
$sql.= " FROM ".MAIN_DB_PREFIX."c_propalst as c, ".MAIN_DB_PREFIX."propal as p";
@@ -1023,13 +1024,15 @@ class Propal extends CommonObject
$this->fk_delivery_address = $obj->fk_adresse_livraison; // TODO obsolete
$this->fk_address = $obj->fk_adresse_livraison;
- $this->mode_reglement_id = $obj->fk_mode_reglement;
- $this->mode_reglement_code = $obj->mode_reglement_code;
- $this->mode_reglement = $obj->mode_reglement;
- $this->cond_reglement_id = $obj->fk_cond_reglement;
- $this->cond_reglement_code = $obj->cond_reglement_code;
- $this->cond_reglement = $obj->cond_reglement;
- $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
+ $this->mode_reglement_id = $obj->fk_mode_reglement;
+ $this->mode_reglement_code = $obj->mode_reglement_code;
+ $this->mode_reglement = $obj->mode_reglement;
+ $this->cond_reglement_id = $obj->fk_cond_reglement;
+ $this->cond_reglement_code = $obj->cond_reglement_code;
+ $this->cond_reglement = $obj->cond_reglement;
+ $this->cond_reglement_doc = $obj->cond_reglement_libelle_doc;
+
+ $this->extraparams = (array) dol_json_decode($obj->extraparams, true);
$this->user_author_id = $obj->fk_user_author;
$this->user_valid_id = $obj->fk_user_valid;
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 87274fc46fe..6e7ef80e739 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -86,6 +86,7 @@ class Commande extends CommonObject
var $note; // deprecated
var $note_private;
var $note_public;
+ var $extraparams=array();
var $origin;
var $origin_id;
@@ -1224,7 +1225,7 @@ class Commande extends CommonObject
$sql.= ', c.date_commande';
$sql.= ', c.date_livraison';
$sql.= ', c.fk_projet, c.remise_percent, c.remise, c.remise_absolue, c.source, c.facture as facturee';
- $sql.= ', c.note as note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.fk_adresse_livraison';
+ $sql.= ', c.note as note_private, c.note_public, c.ref_client, c.ref_ext, c.ref_int, c.model_pdf, c.fk_adresse_livraison, c.extraparams';
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql.= ', cr.code as cond_reglement_code, cr.libelle as cond_reglement_libelle, cr.libelle_facture as cond_reglement_libelle_doc';
$sql.= ', ca.code as availability_code';
@@ -1288,6 +1289,8 @@ class Commande extends CommonObject
$this->date_livraison = $this->db->jdate($obj->date_livraison);
$this->fk_delivery_address = $obj->fk_adresse_livraison;
$this->propale_id = $obj->fk_source;
+
+ $this->extraparams = (array) dol_json_decode($obj->extraparams, true);
$this->lines = array();
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index d6765742f7e..5e5bc8892f4 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -102,6 +102,7 @@ class Facture extends CommonObject
var $products=array(); // deprecated
var $lines=array();
var $line;
+ var $extraparams=array();
//! Pour board
var $nbtodo;
var $nbtodolate;
@@ -766,7 +767,7 @@ class Facture extends CommonObject
$sql.= ', f.tms as datem';
$sql.= ', f.note as note_private, f.note_public, f.fk_statut, f.paye, f.close_code, f.close_note, f.fk_user_author, f.fk_user_valid, f.model_pdf';
$sql.= ', f.fk_facture_source';
- $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet';
+ $sql.= ', f.fk_mode_reglement, f.fk_cond_reglement, f.fk_projet, f.extraparams';
$sql.= ', p.code as mode_reglement_code, p.libelle as mode_reglement_libelle';
$sql.= ', c.code as cond_reglement_code, c.libelle as cond_reglement_libelle, c.libelle_facture as cond_reglement_libelle_doc';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture as f';
@@ -825,6 +826,8 @@ class Facture extends CommonObject
$this->user_author = $obj->fk_user_author;
$this->user_valid = $obj->fk_user_valid;
$this->modelpdf = $obj->model_pdf;
+
+ $this->extraparams = (array) dol_json_decode($obj->extraparams, true);
if ($this->statut == 0) $this->brouillon = 1;
diff --git a/htdocs/core/ajax/extraparams.php b/htdocs/core/ajax/extraparams.php
new file mode 100644
index 00000000000..484f8165723
--- /dev/null
+++ b/htdocs/core/ajax/extraparams.php
@@ -0,0 +1,70 @@
+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
| diff --git a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql index 193bcfd22b1..ee814704d27 100755 --- a/htdocs/install/mysql/migration/3.1.0-3.2.0.sql +++ b/htdocs/install/mysql/migration/3.1.0-3.2.0.sql @@ -434,4 +434,10 @@ ALTER TABLE llx_product_fournisseur_price DROP INDEX idx_product_fournisseur_pri --ALTER TABLE llx_product_fournisseur_price DROP COLUMN fk_product_fournisseur; ALTER TABLE llx_product_fournisseur_price ADD COLUMN tva_tx double(6,3) NOT NULL DEFAULT 0 AFTER unitprice; -UPDATE llx_c_departements SET ncc='JUJUY', nom = 'Jujuy' WHERE code_departement='2302' and fk_region='2301'; \ No newline at end of file +UPDATE llx_c_departements SET ncc='JUJUY', nom = 'Jujuy' WHERE code_departement='2302' and fk_region='2301'; + +ALTER TABLE llx_propal ADD COLUMN import_key varchar(14) AFTER fk_demand_reason; +ALTER TABLE llx_propal ADD COLUMN extraparams varchar(255) AFTER import_key; +ALTER TABLE llx_commande ADD COLUMN extraparams varchar(255) AFTER import_key; +ALTER TABLE llx_facture ADD COLUMN extraparams varchar(255) AFTER import_key; + diff --git a/htdocs/install/mysql/tables/llx_commande.sql b/htdocs/install/mysql/tables/llx_commande.sql index 826c6dd9b9a..86fa9b19964 100644 --- a/htdocs/install/mysql/tables/llx_commande.sql +++ b/htdocs/install/mysql/tables/llx_commande.sql @@ -64,6 +64,7 @@ create table llx_commande fk_availability integer NULL, fk_demand_reason integer, -- should be named fk_input_reason fk_adresse_livraison integer, -- delivery address (deprecated) - import_key varchar(14) + import_key varchar(14), + extraparams varchar(255) -- for stock other parameters with json format )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_facture.sql b/htdocs/install/mysql/tables/llx_facture.sql index 040e10c1f6a..9d1663d0a0d 100644 --- a/htdocs/install/mysql/tables/llx_facture.sql +++ b/htdocs/install/mysql/tables/llx_facture.sql @@ -70,6 +70,7 @@ create table llx_facture note text, note_public text, model_pdf varchar(255), - import_key varchar(14) + import_key varchar(14), + extraparams varchar(255) -- for stock other parameters with json format )ENGINE=innodb; diff --git a/htdocs/install/mysql/tables/llx_propal.sql b/htdocs/install/mysql/tables/llx_propal.sql index 6379fe101b6..26aee3ff99c 100644 --- a/htdocs/install/mysql/tables/llx_propal.sql +++ b/htdocs/install/mysql/tables/llx_propal.sql @@ -63,5 +63,8 @@ create table llx_propal date_livraison date DEFAULT NULL, -- delivery date fk_availability integer NULL, fk_demand_reason integer, + import_key varchar(14), + extraparams varchar(255), -- for stock other parameters with json format fk_adresse_livraison integer -- delivery address (deprecated) + )ENGINE=innodb; |