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

This commit is contained in:
Laurent Destailleur 2026-05-10 18:43:28 +02:00
commit 3a9b2bc5ef
4 changed files with 31 additions and 8 deletions

View file

@ -762,6 +762,16 @@ if (empty($reshook)) {
$result = $object->addline($desc, $pu_ht, (float) $qty, $tva_tx, $localtax1_tx, $localtax2_tx, $idprod, $remise_percent, $price_base_type, $info_bits, 0, $pu_ttc, $type, -1, $special_code, $label, (int) $fk_unit, 0, $date_start_fill, $date_end_fill, (int) $fournprice, (float) $buyingprice, $fk_parent_line);
if ($result > 0) {
// TODO add "insert" function into FactureLigneRec or add "invoicerecline.class.php" (same of "factureligne.class.php")
$objectline = new FactureLigneRec($db);
if ($objectline->fetch($result)) {
$objectline->array_options = $array_options;
$result = $objectline->insertExtraFields();
if ($result < 0) {
setEventMessages($langs->trans('Error').$result, null, 'errors');
}
}
// Define output language and generate document
/*if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE))
{

View file

@ -121,8 +121,6 @@ class Canvas
*/
public function getCanvas($module, $card, $canvas)
{
global $conf, $langs;
// Set properties with value specific to dolibarr core: this->targetmodule, this->card, this->canvas
$this->targetmodule = $module;
$this->canvas = $canvas;
@ -190,7 +188,12 @@ class Canvas
return 0;
}
if (file_exists($this->template_dir.(!empty($this->card) ? $this->card.'_' : '').$this->_cleanaction($action).'.tpl.php')) {
$newaction = $action;
if ($action && !in_array($action, array('create', 'view', 'edit', 'list'))) {
$newaction = 'view';
}
if (file_exists($this->template_dir.(!empty($this->card) ? $this->card.'_' : '').$this->_cleanaction($newaction).'.tpl.php')) {
return 1;
} else {
return 0;
@ -208,11 +211,16 @@ class Canvas
public function display_canvas($action)
{
// phpcs:enable
global $db, $conf, $langs, $user, $canvas;
global $form, $formfile;
global $db, $conf, $langs, $user, $canvas; // used into include
global $form, $formfile; // used into include
$newaction = $action;
if ($action && !in_array($action, array('create', 'view', 'edit', 'list'))) {
$newaction = 'view';
}
//var_dump($this->card.'-'.$action);
include $this->template_dir.(!empty($this->card) ? $this->card.'_' : '').$this->_cleanaction($action).'.tpl.php'; // Include native PHP template
include $this->template_dir.(!empty($this->card) ? $this->card.'_' : '').$this->_cleanaction($newaction).'.tpl.php'; // Include native PHP template
}

View file

@ -4626,9 +4626,12 @@ class Form
}
$optstart = '<option value="' . $outkey . '"';
if ($selected && $selected == $objp->idprodfournprice) {
if ($selected && preg_match('/^idprod_/', (string) $selected) && (string) $selected == 'idprod_'.$objp->rowid) {
$optstart .= ' selected';
} elseif ($selected && (string) $selected == (string) $objp->idprodfournprice) {
$optstart .= ' selected';
}
if (empty($objp->idprodfournprice) && empty($alsoproductwithnosupplierprice)) {
$optstart .= ' disabled';
}

View file

@ -742,9 +742,10 @@ class Mo extends CommonObject
$moline = new MoLine($this->db);
// Line to produce
$moline->fk_mo = $this->id;
$moline->fk_mo = (int) $this->id;
$moline->qty = (float) $this->qty;
$moline->fk_product = (int) $this->fk_product;
$moline->fk_warehouse = (int) $this->fk_warehouse;
$moline->position = 1;
include_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@ -834,6 +835,7 @@ class Mo extends CommonObject
$this->errors[] = $this->error;
} else {
$moline->fk_product = $line->fk_product;
$moline->fk_warehouse = !empty($line->fk_warehouse) ? $line->fk_warehouse : (!empty($bom->fk_warehouse) ? $bom->fk_warehouse : $this->fk_warehouse);
$moline->role = $role;
$moline->position = $line->position;
$moline->qty_frozen = $line->qty_frozen;