diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index eb1342ad119..6750180ec0e 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Marcos García + * Copyright (C) 2015 Marcos García * * 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 @@ -64,7 +64,12 @@ class Bookmark extends CommonObject */ public $fk_user; - public $datec; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; public $url; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index bd0e43b8461..dbb52137c27 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1693,13 +1693,27 @@ class AccountLine extends CommonObject */ public $ref; - public $datec; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + + /** + * Date (dateo) + * + * @var integer + */ public $dateo; /** - * Value date - */ + * Date value (datev) + * + * @var integer + */ public $datev; + public $amount; /** diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php index ae1360ff633..dbe35f5fa3e 100644 --- a/htdocs/compta/deplacement/class/deplacement.class.php +++ b/htdocs/compta/deplacement/class/deplacement.class.php @@ -57,7 +57,18 @@ class Deplacement extends CommonObject */ public $ismultientitymanaged = 0; - public $datec; // Creation date + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + + /** + * Date (dated) + * + * @var integer + */ public $dated; /** diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php index 1bf7a4eb9db..0b4fc9cc58d 100644 --- a/htdocs/core/class/comment.class.php +++ b/htdocs/core/class/comment.class.php @@ -42,10 +42,20 @@ class Comment extends CommonObject * @var string description */ public $description; - + + /** + * Date modification record (tms) + * + * @var integer + */ public $tms; - public $datec; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; /** * @var int ID diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php index 0a681b95b18..93b51d0ddf8 100644 --- a/htdocs/core/class/discount.class.php +++ b/htdocs/core/class/discount.class.php @@ -73,7 +73,12 @@ class DiscountAbsolute */ public $description; - public $datec; // Date creation + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; /** * @var int ID invoice line when a discount is used into an invoice line (for absolute discounts) diff --git a/htdocs/core/class/fiscalyear.class.php b/htdocs/core/class/fiscalyear.class.php index 014946434be..5c6a5b4cf4d 100644 --- a/htdocs/core/class/fiscalyear.class.php +++ b/htdocs/core/class/fiscalyear.class.php @@ -63,10 +63,28 @@ class Fiscalyear extends CommonObject * @var string fiscal year label */ public $label; - + + /** + * Date start (date_start) + * + * @var integer + */ public $date_start; + + /** + * Date end (date_end) + * + * @var integer + */ public $date_end; - public $datec; + + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + public $statut; // 0=open, 1=closed /** diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index d306a2f2b7d..ba0262e69b4 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -5,8 +5,8 @@ * Copyright (C) 2011-2013 Juanjo Menent * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Charlie Benke - * Copyright (C) 2018 Nicolas ZABOURI - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Nicolas ZABOURI + * Copyright (C) 2018 Frédéric France * * 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 @@ -69,12 +69,26 @@ class Fichinter extends CommonObject public $socid; // Id client public $author; - public $datec; + + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + public $datev; public $dateo; public $datee; public $datet; - public $datem; + + /** + * Date modification record (tms) + * + * @var integer + */ + public $datem; + public $duration; public $statut = 0; // 0=draft, 1=validated, 2=invoiced, 3=Terminate diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 425ef686b1c..f1380b00e6f 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2017 Juanjo Menent - * Copyright (C) 2013-2018 Philippe Grand + * Copyright (C) 2013-2019 Philippe Grand * Copyright (C) 2013 Florian Henry * Copyright (C) 2014-2016 Marcos García * Copyright (C) 2015 Bahfir Abbes @@ -113,10 +113,35 @@ class FactureFournisseur extends CommonInvoice public $author; public $libelle; - public $datec; // Creation date - public $tms; // Last update date - public $date; // Invoice date - public $date_echeance; // Max payment date + + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + + /** + * Date modification record (tms) + * + * @var integer + */ + public $tms; + + /** + * Invoice date (date) + * + * @var integer + */ + public $date; + + /** + * Max payment date (date_echeance) + * + * @var integer + */ + public $date_echeance; + public $amount=0; public $remise=0; public $tva=0; diff --git a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql index 219deef6dc2..52b52a5f342 100644 --- a/htdocs/install/mysql/migration/9.0.0-10.0.0.sql +++ b/htdocs/install/mysql/migration/9.0.0-10.0.0.sql @@ -271,3 +271,7 @@ ALTER TABLE llx_expensereport_det ADD COLUMN subprice double(24,8) DEFAULT 0 NOT ALTER TABLE llx_product_attribute_combination ADD INDEX idx_product_att_com_product_parent (fk_product_parent); ALTER TABLE llx_product_attribute_combination ADD INDEX idx_product_att_com_product_child (fk_product_child); +ALTER TABLE llx_product ADD COLUMN fk_project integer DEFAULT NULL; +ALTER TABLE llx_product ADD INDEX idx_product_fk_project (fk_project); + +ALTER TABLE llx_actioncomm ADD COLUMN calling_duration integer; diff --git a/htdocs/install/mysql/tables/llx_product.key.sql b/htdocs/install/mysql/tables/llx_product.key.sql index d339f2082ee..bd48aa99cd4 100644 --- a/htdocs/install/mysql/tables/llx_product.key.sql +++ b/htdocs/install/mysql/tables/llx_product.key.sql @@ -30,6 +30,7 @@ ALTER TABLE llx_product ADD INDEX idx_product_seuil_stock_alerte (seuil_stock_al ALTER TABLE llx_product ADD INDEX idx_product_fk_country (fk_country); ALTER TABLE llx_product ADD INDEX idx_product_fk_user_author (fk_user_author); ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type); +ALTER TABLE llx_product ADD INDEX idx_product_fk_project (fk_project); ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode_type, entity); ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_unit FOREIGN KEY (fk_unit) REFERENCES llx_c_units (rowid); diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 8569c6e28d2..fb6e4cf5f1a 100755 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -94,5 +94,6 @@ create table llx_product fk_price_expression integer, -- Link to the rule for dynamic price calculation desiredstock integer DEFAULT 0, fk_unit integer DEFAULT NULL, - price_autogen tinyint DEFAULT 0 + price_autogen tinyint DEFAULT 0, + fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project )ENGINE=innodb; diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 60fb6a2a4c7..0c4da8aa103 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -40,8 +40,19 @@ class CompanyBankAccount extends Account public $rum; public $date_rum; - public $datec; - public $datem; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + + /** + * Date modification record (tms) + * + * @var integer + */ + public $datem; /** diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php index 5194046e40c..ae9f0a44b32 100644 --- a/htdocs/societe/class/companypaymentmode.class.php +++ b/htdocs/societe/class/companypaymentmode.class.php @@ -169,8 +169,21 @@ class CompanyPaymentMode extends CommonObject public $starting_date; public $ending_date; - public $datec; - public $tms; + + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + + /** + * Date modification record (tms) + * + * @var integer + */ + public $tms; + public $import_key; // END MODULEBUILDER PROPERTIES diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php index 98a40884497..45a65af3f94 100644 --- a/htdocs/takepos/invoice.php +++ b/htdocs/takepos/invoice.php @@ -87,11 +87,12 @@ if (($action=="addline" || $action=="freezone") && $placeid == 0) { $invoice->socid = $conf->global->CASHDESK_ID_THIRDPARTY; $invoice->date = dol_now(); - $invoice->ref = "(PROV-POS-".$place.")"; $invoice->module_source = 'takepos'; $invoice->pos_source = (string) $place; $placeid = $invoice->create($user); + $sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS-".$place.")' where rowid=".$placeid; + $db->query($sql); } if ($action == "addline") { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 4246d27f49e..512696d4758 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -7,7 +7,7 @@ * Copyright (C) 2005-2017 Regis Houssin * Copyright (C) 2005 Lionel Cousteix * Copyright (C) 2011 Herve Prot - * Copyright (C) 2013-2018 Philippe Grand + * Copyright (C) 2013-2019 Philippe Grand * Copyright (C) 2013-2015 Alexandre Spangaro * Copyright (C) 2015 Marcos García * Copyright (C) 2018 charlene Benke @@ -108,8 +108,19 @@ class User extends CommonObject //! Encrypted password in database (always defined) public $pass_indatabase_crypted; - public $datec; - public $datem; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + + /** + * Date modification record (tms) + * + * @var integer + */ + public $datem; //! If this is defined, it is an external user /** diff --git a/htdocs/user/class/userbankaccount.class.php b/htdocs/user/class/userbankaccount.class.php index 18c1ab742a1..8bba66ac497 100644 --- a/htdocs/user/class/userbankaccount.class.php +++ b/htdocs/user/class/userbankaccount.class.php @@ -36,7 +36,18 @@ class UserBankAccount extends Account { public $socid; - public $datec; + /** + * Date creation record (datec) + * + * @var integer + */ + public $datec; + + /** + * Date modification record (tms) + * + * @var integer + */ public $datem;