Skip to content

Commit

Permalink
Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 5, 2018
2 parents d130e79 + e1e0001 commit 2900947
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion htdocs/admin/dict.php
Expand Up @@ -618,7 +618,7 @@
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
)
)
Expand Down
2 changes: 2 additions & 0 deletions htdocs/compta/facture/card.php
Expand Up @@ -1364,6 +1364,8 @@
{
// 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);
Expand Down
3 changes: 3 additions & 0 deletions htdocs/install/mysql/migration/6.0.0-7.0.0.sql
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion htdocs/install/mysql/tables/llx_c_shipment_mode.sql
Expand Up @@ -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 changes: 13 additions & 0 deletions htdocs/societe/class/societe.class.php
Expand Up @@ -1534,6 +1534,19 @@ function delete($id, User $fuser=null, $call_trigger=1)
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)
Expand Down

0 comments on commit 2900947

Please sign in to comment.