Browse Source

Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0

Laurent Destailleur 6 years ago
parent
commit
2900947019

+ 1 - 1
htdocs/admin/dict.php

@@ -618,7 +618,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
         	)
 		)

+ 2 - 0
htdocs/compta/facture/card.php

@@ -1364,6 +1364,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);

+ 3 - 0
htdocs/install/mysql/migration/6.0.0-7.0.0.sql

@@ -725,3 +725,6 @@ DROP TABLE llx_c_accountancy_category;
 
 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');
+
+-- 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;

+ 1 - 1
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;

+ 13 - 0
htdocs/societe/class/societe.class.php

@@ -1534,6 +1534,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)