Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into 12.0

This commit is contained in:
Laurent Destailleur 2021-05-17 10:31:25 +02:00
commit 985301939d
2 changed files with 5 additions and 8 deletions

View File

@ -9,7 +9,7 @@
* Copyright (C) 2012-2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@ltairis.fr>
* Copyright (C) 2011-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015-2021 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2015 Ferran Marcet <fmarcet@2byte.es>
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
*
@ -781,10 +781,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) {
$sql .= (int) GETPOST($keycode, 'int');
}
elseif ($keycode == 'localtax2') {
$sql .= "'".GETPOST($keycode, 'alpha')."'";
}
else {
else {
$sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'";
}
@ -853,9 +850,6 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
elseif (in_array($keycode, array('private', 'position', 'scale'))) {
$sql .= (int) GETPOST($keycode, 'int');
}
elseif ($keycode == 'localtax2') {
$sql .= "'".GETPOST($keycode, 'alpha')."'";
}
else {
$sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'";
}

View File

@ -213,7 +213,9 @@ if ($action == 'order' && isset($_POST['valid']))
if ($resql && $db->num_rows($resql) > 0) {
$obj = $db->fetch_object($resql);
$order->fetch($obj->rowid);
$order->fetch_thirdparty();
foreach ($supplier['lines'] as $line) {
if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent;
$result = $order->addline(
$line->desc,
$line->subprice,
@ -250,6 +252,7 @@ if ($action == 'order' && isset($_POST['valid']))
//trick to know which orders have been generated this way
$order->source = 42;
foreach ($supplier['lines'] as $line) {
if(empty($line->remise_percent)) $line->remise_percent = $order->thirdparty->remise_supplier_percent;
$order->lines[] = $line;
}
$order->cond_reglement_id = $order->thirdparty->cond_reglement_supplier_id;