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

This commit is contained in:
Laurent Destailleur 2022-10-24 19:11:59 +02:00
commit 064f3dd209
3 changed files with 5 additions and 26 deletions

View File

@ -74,17 +74,6 @@ $hookmanager->initHooks(array('taxvatcard', 'globalcard'));
// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// Initialize array of search criterias
$search_all = GETPOST("search_all", 'alpha');
$search = array();
foreach ($object->fields as $key => $val) {
if (GETPOST('search_'.$key, 'alpha')) {
$search[$key] = GETPOST('search_'.$key, 'alpha');
}
}
if (empty($action) && empty($id) && empty($ref)) {
$action = 'view';
}

View File

@ -650,16 +650,7 @@ class modProduct extends DolibarrModules
}
// End add extra fields
$this->import_fieldshidden_array[$r] = array('extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'product'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_regex_array[$r] = array(
'p.ref'=>'[^ ]',
'p.price_base_type' => 'HT|TTC',
'p.tosell'=>'^[0|1]$',
'p.tobuy'=>'^[0|1]$',
'p.fk_product_type'=>'^[0|1]$',
'p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$',
'p.recuperableonly' => '^[0|1]$',
'p.finished' => '^[0|1]$'
);
// field order as per structure of table llx_product
$import_sample = array(
'p.ref' => "ref:PREF123456",

View File

@ -1084,7 +1084,7 @@ class Thirdparties extends DolibarrApi
$invoice = new Facture($this->db);
$result = $invoice->list_replacable_invoices($id);
if ($result < 0) {
throw new RestException(405, $this->thirdparty->error);
throw new RestException(405, $invoice->error);
}
return $result;
@ -1127,7 +1127,7 @@ class Thirdparties extends DolibarrApi
$invoice = new Facture($this->db);
$result = $invoice->list_qualified_avoir_invoices($id);
if ($result < 0) {
throw new RestException(405, $this->thirdparty->error);
throw new RestException(405, $invoice->error);
}
return $result;
@ -1166,10 +1166,9 @@ class Thirdparties extends DolibarrApi
$sql .= " WHERE fk_soc = ".((int) $id);
}
$result = $this->db->query($sql);
if ($result->num_rows == 0) {
if ($this->db->num_rows($result) == 0) {
throw new RestException(404, 'Account not found');
}
@ -1411,7 +1410,7 @@ class Thirdparties extends DolibarrApi
if ($result > 0) {
return array("success" => $result);
} else {
throw new RestException(500, 'Error generating the document '.$this->error);
throw new RestException(500, 'Error generating the document '.$this->company->error);
}
}