From 1b054f1b363ba0a627065a4e4467acf06165ef04 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 27 Oct 2018 09:19:02 +0200 Subject: [PATCH 1/4] Fix invoice creation from contract was invoicing closed services #9087 --- htdocs/compta/facture/card.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 993194e0f91..daff7c95f56 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1196,6 +1196,8 @@ if (empty($reshook)) { // Don't add lines with qty 0 when coming from a shipment including all order lines if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue; + // Don't add closed lines when coming from a contract + if($srcobject->element == 'contrat' && $lines[$i]->statut == 5) continue; $label=(! empty($lines[$i]->label)?$lines[$i]->label:''); $desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle); From d1133916e0041406b7341a8fb6888d925c74bb8f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 1 Nov 2018 15:33:14 +0100 Subject: [PATCH 2/4] Fix tracking field in dictionnary should not be mandatory --- htdocs/admin/dict.php | 2 +- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 72ac51e1799..c62595ea8a6 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -629,7 +629,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($value == 'formula' && empty($_POST['formula'])) continue; if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position' if ((! isset($_POST[$value]) || $_POST[$value]=='') - && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy')) // Fields that are not mandatory + && (! in_array($listfield[$f], array('decalage','module','accountancy_code','accountancy_code_sell','accountancy_code_buy','tracking')) // Fields that are not mandatory && (! ($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10 ) ) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index c2e17386488..354bf0743bd 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -716,3 +716,5 @@ ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (f UPDATE llx_cronjob set entity = 1 where entity = 0 and label in ('RecurringInvoices', 'SendEmailsReminders'); UPDATE llx_cronjob set entity = 0 where entity = 1 and label in ('PurgeDeleteTemporaryFilesShort', 'MakeLocalDatabaseDumpShort'); + +ALTER TABLE llx_c_shipment_mode CHANGE COLUMN tracking tracking VARCHAR(255) DEFAULT NULL; \ No newline at end of file From 29c0448a2ed9bc78543b10b0da15778e3c3469c0 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Thu, 1 Nov 2018 15:41:58 +0100 Subject: [PATCH 3/4] Fix parent link was not removed on societe deletion #9106 --- htdocs/societe/class/societe.class.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 2a488aacf44..0a49bb80f1b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1518,6 +1518,19 @@ class Societe extends CommonObject dol_syslog(get_class($this)."::delete error -3 ".$this->error, LOG_ERR); } } + + // Remove links to subsidiaries companies + if (! $error) + { + $sql = "UPDATE ".MAIN_DB_PREFIX."societe"; + $sql.= " SET parent = NULL"; + $sql.= " WHERE parent = " . $id; + if (! $this->db->query($sql)) + { + $error++; + $this->errors[] = $this->db->lasterror(); + } + } // Remove third party if (! $error) From 98a3af620b79b4802892c23a5da6264861baf9c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 5 Nov 2018 09:26:23 +0100 Subject: [PATCH 4/4] FIX #9934 --- htdocs/install/mysql/migration/6.0.0-7.0.0.sql | 3 ++- htdocs/install/mysql/tables/llx_c_shipment_mode.sql | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 354bf0743bd..b8b1b15051c 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -717,4 +717,5 @@ ALTER TABLE llx_facture_rec_extrafields ADD INDEX idx_facture_rec_extrafields (f UPDATE llx_cronjob set entity = 1 where entity = 0 and label in ('RecurringInvoices', 'SendEmailsReminders'); UPDATE llx_cronjob set entity = 0 where entity = 1 and label in ('PurgeDeleteTemporaryFilesShort', 'MakeLocalDatabaseDumpShort'); -ALTER TABLE llx_c_shipment_mode CHANGE COLUMN tracking tracking VARCHAR(255) DEFAULT NULL; \ No newline at end of file +-- VMYSQL4.3 ALTER TABLE llx_c_shipment_mode MODIFY COLUMN tracking varchar(255) NULL; +-- VPGSQL8.2 ALTER TABLE llx_c_shipment_mode ALTER COLUMN tracking DROP NOT NULL; diff --git a/htdocs/install/mysql/tables/llx_c_shipment_mode.sql b/htdocs/install/mysql/tables/llx_c_shipment_mode.sql index b94936c7461..7945c9f9fb0 100644 --- a/htdocs/install/mysql/tables/llx_c_shipment_mode.sql +++ b/htdocs/install/mysql/tables/llx_c_shipment_mode.sql @@ -23,7 +23,7 @@ create table llx_c_shipment_mode code varchar(30) NOT NULL, libelle varchar(50) NOT NULL, description text, - tracking varchar(255) NOT NULL, + tracking varchar(255) NULL, active tinyint DEFAULT 0, module varchar(32) NULL )ENGINE=innodb;