Skip to content

Commit

Permalink
Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 5.0
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/contact/document.php
	htdocs/core/tpl/objectline_create.tpl.php
	htdocs/install/mysql/migration/repair.sql
  • Loading branch information
eldy committed May 4, 2017
2 parents 3917bdf + 1096177 commit 8009370
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion htdocs/core/lib/functions2.lib.php
Expand Up @@ -1161,7 +1161,7 @@ function check_value($mask,$value)

// If an offset is asked
if (! empty($reg[2]) && preg_match('/^\+/',$reg[2])) $maskoffset=preg_replace('/^\+/','',$reg[2]);
if (! empty($reg[3]) && preg_match('^\+',$reg[3])) $maskoffset=preg_replace('/^\+/','',$reg[3]);
if (! empty($reg[3]) && preg_match('/^\+/',$reg[3])) $maskoffset=preg_replace('/^\+/','',$reg[3]);

// Define $sqlwhere

Expand Down
13 changes: 13 additions & 0 deletions htdocs/install/mysql/migration/repair.sql
Expand Up @@ -306,6 +306,18 @@ DELETE FROM llx_c_shipment_mode where code IN (select code from tmp_c_shipment_m
drop table tmp_c_shipment_mode;


-- Clean product prices
--delete from llx_product_price where date_price between '2017-04-20 06:51:00' and '2017-04-20 06:51:05';
-- Set product prices into llx_product with last price into llx_product_prices
--update llx_product as p set
-- p.price = (select pp.price from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1),
-- p.price_ttc = (select pp.price_ttc from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1),
-- p.price_min = (select pp.price_min from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1),
-- p.price_min_ttc = (select pp.price_min_ttc from llx_product_price as pp where pp.price_level = 1 and pp.fk_product = p.rowid order by pp.tms desc limit 1),
-- p.tva_tx = 0
-- where price = 17.5


-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
-- VMYSQL4.1 update llx_expensereport set date_debut = date_create where DATE(STR_TO_DATE(date_debut, '%Y-%m-%d')) IS NULL;
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
Expand All @@ -324,3 +336,4 @@ drop table tmp_c_shipment_mode;
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
-- VMYSQL4.1 update llx_expensereport_det as ed set date = (select date_debut from llx_expensereport as e where ed.fk_expensereport = e.rowid) where DATE(STR_TO_DATE(date, '%Y-%m-%d')) < '1000-00-00';
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';

9 changes: 6 additions & 3 deletions htdocs/product/admin/product_tools.php
Expand Up @@ -42,8 +42,6 @@
$newvatrate=GETPOST('newvatrate');
//$price_base_type=GETPOST('price_base_type');

$objectstatic = new Product($db);
$objectstatic2 = new ProductFournisseur($db);


/*
Expand Down Expand Up @@ -87,6 +85,7 @@
{
$obj = $db->fetch_object($resql);

$objectstatic = new Product($db); // Object init must be into loop to avoid to get value of previous step
$ret=$objectstatic->fetch($obj->rowid);
if ($ret > 0)
{
Expand Down Expand Up @@ -150,7 +149,8 @@
if ($ret < 0 || $retm < 0) $error++;
else $nbrecordsmodified++;
}

unset($objectstatic);

$i++;
}
}
Expand All @@ -176,6 +176,7 @@
{
$obj = $db->fetch_object($resql);

$objectstatic2 = new ProductFournisseur($db); // Object init must be into loop to avoid to get value of previous step
$ret=$objectstatic2->fetch_product_fournisseur_price($obj->rowid);
if ($ret > 0)
{
Expand Down Expand Up @@ -207,6 +208,8 @@
if ($ret < 0 || $retm < 0) $error++;
else $nbrecordsmodified++;
}
unset($objectstatic2);

$i++;
}
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/supplier_proposal/class/supplier_proposal.class.php
Expand Up @@ -2838,7 +2838,7 @@ function insert($notrigger=0)
$sql.= " ".price2num($this->localtax2_tx).",";
$sql.= " '".$this->localtax1_type."',";
$sql.= " '".$this->localtax2_type."',";
$sql.= " ".($this->subprice?price2num($this->subprice):"null").",";
$sql.= " ".price2num($this->subprice).",";
$sql.= " ".price2num($this->remise_percent).",";
$sql.= " ".(isset($this->info_bits)?"'".$this->info_bits."'":"null").",";
$sql.= " ".price2num($this->total_ht).",";
Expand Down

0 comments on commit 8009370

Please sign in to comment.