diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 4d5471b1aa8..5d83a78ed17 100644 --- a/htdocs/admin/dict.php +++ b/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 ) ) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 727d5b7c2bd..7366a091056 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1357,6 +1357,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); 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 570bd340146..62d31da5c88 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 @@ -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; 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; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 96e1ebb415f..4221e35706a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -1509,6 +1509,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) diff --git a/htdocs/ticket/index.php b/htdocs/ticket/index.php index 9acfd66c3bb..1f01e335a7c 100644 --- a/htdocs/ticket/index.php +++ b/htdocs/ticket/index.php @@ -184,15 +184,14 @@ if ($result) { $dataseries[] = array('label' => $langs->trans("Assigned"), 'data' => round($tick['assigned'])); $dataseries[] = array('label' => $langs->trans("InProgress"), 'data' => round($tick['inprogress'])); $dataseries[] = array('label' => $langs->trans("Waiting"), 'data' => round($tick['waiting'])); - $dataseries[] = array('label' => $langs->trans("Closed"), 'data' => round($tick['Closed'])); - $dataseries[] = array('label' => $langs->trans("Deleted"), 'data' => round($tick['Deleted'])); + $dataseries[] = array('label' => $langs->trans("Closed"), 'data' => round($tick['closed'])); + $dataseries[] = array('label' => $langs->trans("Deleted"), 'data' => round($tick['deleted'])); } } else { dol_print_error($db); } -$stringtoshow = ''; -$stringtoshow .= '