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

Conflicts:
	htdocs/install/mysql/data/llx_c_shipment_mode.sql
This commit is contained in:
Laurent Destailleur 2020-12-04 18:14:57 +01:00
commit aeda250df4
3 changed files with 38 additions and 35 deletions

View File

@ -134,7 +134,7 @@ if (!$sortfield)
} }
// Products // Products
$TRes = $form->select_produits_list('', '', '', 20, 0, '', 1, 2, 1, 0, '', 1); $TRes = $form->select_produits_list('', '', '', '', 0, '', 1, 2, 1, 0, '', 1);
$TProducts = array(); $TProducts = array();
foreach ($TRes as $prod) { foreach ($TRes as $prod) {

View File

@ -128,6 +128,7 @@ class Opensurveysondage extends CommonObject
*/ */
public function create(User $user, $notrigger = 0) public function create(User $user, $notrigger = 0)
{ {
global $conf;
$error = 0; $error = 0;
// Clean parameters // Clean parameters
@ -153,7 +154,8 @@ class Opensurveysondage extends CommonObject
$sql .= "mailsonde,"; $sql .= "mailsonde,";
$sql .= "allow_comments,"; $sql .= "allow_comments,";
$sql .= "allow_spy,"; $sql .= "allow_spy,";
$sql .= "sujet"; $sql .= "sujet,";
$sql .= "entity";
$sql .= ") VALUES ("; $sql .= ") VALUES (";
$sql .= "'".$this->db->escape($this->id_sondage)."',"; $sql .= "'".$this->db->escape($this->id_sondage)."',";
$sql .= " ".(empty($this->commentaires) ? 'NULL' : "'".$this->db->escape($this->commentaires)."'").","; $sql .= " ".(empty($this->commentaires) ? 'NULL' : "'".$this->db->escape($this->commentaires)."'").",";
@ -165,7 +167,8 @@ class Opensurveysondage extends CommonObject
$sql .= " ".$this->db->escape($this->mailsonde).","; $sql .= " ".$this->db->escape($this->mailsonde).",";
$sql .= " ".$this->db->escape($this->allow_comments).","; $sql .= " ".$this->db->escape($this->allow_comments).",";
$sql .= " ".$this->db->escape($this->allow_spy).","; $sql .= " ".$this->db->escape($this->allow_spy).",";
$sql .= " '".$this->db->escape($this->sujet)."'"; $sql .= " '".$this->db->escape($this->sujet)."',";
$sql .= " ".$conf->entity;
$sql .= ")"; $sql .= ")";
$this->db->begin(); $this->db->begin();

View File

@ -554,8 +554,8 @@ if (empty($reshook))
} }
else else
{ {
$idprod = GETPOST('idprod', 'int'); $idprod = GETPOST('idprod', 'int');
$price_ht = ''; $price_ht = GETPOST('price_ht');
$tva_tx = ''; $tva_tx = '';
} }
@ -589,8 +589,8 @@ if (empty($reshook))
$error++; $error++;
} }
if (!$error && ($qty >= 0)) { if (!$error && ($qty >= 0)) {
$pu_ht = 0; $pu_ht = price2num($price_ht, 'MU');
$pu_ttc = 0; $pu_ttc = price2num(GETPOST('price_ttc'), 'MU');
$price_min = 0; $price_min = 0;
$price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT'); $price_base_type = (GETPOST('price_base_type', 'alpha') ? GETPOST('price_base_type', 'alpha') : 'HT');
@ -658,41 +658,41 @@ if (empty($reshook))
$localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr); $localtax1_tx = get_localtax($tva_tx, 1, $mysoc, $object->thirdparty, $tva_npr);
$localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr); $localtax2_tx = get_localtax($tva_tx, 2, $mysoc, $object->thirdparty, $tva_npr);
$pu_ht = $productsupplier->fourn_pu;
if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value if (empty($pu_ht)) $pu_ht = 0; // If pu is '' or null, we force to have a numeric value
// If GETPOST('idprodfournprice') is a numeric, we can use it. If it is empty or if it is 'idprod_123', we should use -1 (not used) // If GETPOST('idprodfournprice') is a numeric, we can use it. If it is empty or if it is 'idprod_123', we should use -1 (not used)
$fournprice = (is_numeric(GETPOST('idprodfournprice', 'alpha')) ? GETPOST('idprodfournprice', 'alpha') : -1); $fournprice = (is_numeric(GETPOST('idprodfournprice', 'alpha')) ? GETPOST('idprodfournprice', 'alpha') : -1);
$buyingprice = 0; $buyingprice = 0;
$pu_ht_devise = price2num($price_ht_devise, 'MU');
$result = $object->addline( $result = $object->addline(
$desc, $desc,
$pu_ht, $pu_ht,
$qty, $qty,
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$productsupplier->id, $productsupplier->id,
$remise_percent, $remise_percent,
$price_base_type, $price_base_type,
$pu_ttc, $pu_ttc,
$tva_npr, $tva_npr,
$type, $type,
-1, -1,
0, 0,
GETPOST('fk_parent_line'), GETPOST('fk_parent_line'),
$fournprice, $fournprice,
$buyingprice, $buyingprice,
$label, $label,
$array_options, $array_options,
$ref_supplier, $ref_supplier,
$productsupplier->fk_unit, $productsupplier->fk_unit,
'', '',
0, 0,
$productsupplier->fourn_multicurrency_unitprice, $pu_ht_devise,
$date_start, $date_start,
$date_end $date_end
); );
//var_dump($tva_tx);var_dump($productsupplier->fourn_pu);var_dump($price_base_type);exit; //var_dump($tva_tx);var_dump($productsupplier->fourn_pu);var_dump($price_base_type);exit;
if ($result < 0) if ($result < 0)