From c9f89f3854a08d4f22ab86d90546595e915094cc Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Fri, 15 Mar 2019 20:28:28 +0100 Subject: [PATCH 01/17] Add fk_project to product table Prepare the generation of a product from a project. --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 2 ++ 1 file changed, 2 insertions(+) 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 a7f5ca87c9a..d3c5af09506 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 @@ -254,3 +254,5 @@ 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_actioncomm ADD COLUMN calling_duration integer; From 5ee749c19d6245a2158e2073152bc566caff74e2 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Fri, 15 Mar 2019 20:46:38 +0100 Subject: [PATCH 02/17] Update 9.0.0-10.0.0.sql --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 1 + 1 file changed, 1 insertion(+) 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 d3c5af09506..bd3b3aa34b7 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 @@ -254,5 +254,6 @@ 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, ADD INDEX fk_project (fk_project); ALTER TABLE llx_actioncomm ADD COLUMN calling_duration integer; From cf0bc886011bfd25f7791882d917e4516a846bc7 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Mon, 18 Mar 2019 20:19:30 +0100 Subject: [PATCH 03/17] Update llx_product.sql --- htdocs/install/mysql/tables/llx_product.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 8569c6e28d2..b665dc911fa 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 )ENGINE=innodb; From 56bee8a20fed0e44f6aba5f7d01030571ceb0e2d Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Mon, 18 Mar 2019 20:23:45 +0100 Subject: [PATCH 04/17] Update llx_product.key.sql --- htdocs/install/mysql/tables/llx_product.key.sql | 1 + 1 file changed, 1 insertion(+) 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); From 3665e9137a4d9c0435aae67ecf12d4e9d68fff46 Mon Sep 17 00:00:00 2001 From: andreubisquerra Date: Tue, 19 Mar 2019 23:05:08 +0100 Subject: [PATCH 05/17] In a previous commit the command to change 'ref' has been deleted. And now TakePOS don't work. In Dolibarr the next command not work on draft invoice: $invoice->ref = "(PROV-POS-".$place.")"; So I return to the previous command: $sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS-".$place.")' where rowid=".$placeid; --- htdocs/takepos/invoice.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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") { From d498dce9cae76ebbfb4f1e3a6dc5ad1f098a01e4 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 14:54:18 +0100 Subject: [PATCH 06/17] add some comments --- htdocs/bookmarks/class/bookmark.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; From 86c3b1a5b0570558dc9a3b29a54631b09238e7fb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 14:59:21 +0100 Subject: [PATCH 07/17] add some comments --- htdocs/compta/bank/class/account.class.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) 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; /** From cb59f52a550168182d2591e32b91563bc3bbcfdb Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:01:09 +0100 Subject: [PATCH 08/17] add some comments --- .../compta/deplacement/class/deplacement.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; /** From 96893315b5acb2be7af28aaa9850bf67aafcd21c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:03:01 +0100 Subject: [PATCH 09/17] add some comments --- htdocs/core/class/comment.class.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 From 79884816888d91322b01a51e6319b522c463ca59 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:06:14 +0100 Subject: [PATCH 10/17] add some comments --- htdocs/core/class/discount.class.php | 7 ++++++- htdocs/core/class/fiscalyear.class.php | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) 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 /** From c906820a51637a32a9bdce927ef5cefad2b1c0da Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:08:09 +0100 Subject: [PATCH 11/17] add some comments --- htdocs/fichinter/class/fichinter.class.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 43cd79bfe70..2e51d97079c 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 From 6babf88968d22087f70735b2db4b6ba6e90df589 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:11:28 +0100 Subject: [PATCH 12/17] add some comments --- .../fourn/class/fournisseur.facture.class.php | 35 ++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 4450ee611f8..11b88b2d110 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; From e8721fdd07dff45e4d96ff98b987ccf7ad429454 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:14:09 +0100 Subject: [PATCH 13/17] add some comments --- htdocs/societe/class/companybankaccount.class.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) 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; /** From 2ad649eaeaf4d918e414e15cbd85e5704a12a6c8 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:18:05 +0100 Subject: [PATCH 14/17] add some comments --- .../societe/class/companypaymentmode.class.php | 17 +++++++++++++++-- htdocs/user/class/user.class.php | 17 ++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) 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/user/class/user.class.php b/htdocs/user/class/user.class.php index db0632be486..fdb77068ba3 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 /** From efc393e13cccb2fad3d726ddc42c07402d29c952 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Thu, 21 Mar 2019 15:19:01 +0100 Subject: [PATCH 15/17] add some comments --- htdocs/user/class/userbankaccount.class.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; From 52b91499baaf6ac69b955af68e9523eb46cd41f6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Mar 2019 18:31:13 +0100 Subject: [PATCH 16/17] Update 9.0.0-10.0.0.sql --- htdocs/install/mysql/migration/9.0.0-10.0.0.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 bd3b3aa34b7..7f882c0be97 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 @@ -254,6 +254,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, ADD INDEX fk_project (fk_project); +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; From ae2f76f6bde058ec448554a0c53b50a17747524b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Mar 2019 18:32:40 +0100 Subject: [PATCH 17/17] Update llx_product.sql --- htdocs/install/mysql/tables/llx_product.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index b665dc911fa..fb6e4cf5f1a 100755 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -95,5 +95,5 @@ create table llx_product desiredstock integer DEFAULT 0, fk_unit integer DEFAULT NULL, price_autogen tinyint DEFAULT 0, - fk_project integer DEFAULT NULL + fk_project integer DEFAULT NULL -- Used when product was generated by a project or is specifif to a project )ENGINE=innodb;