Merge pull request #24331 from hregis/develop

NEW show supplier name in getNomUrl of supplier order
This commit is contained in:
Laurent Destailleur 2023-03-23 14:30:18 +01:00 committed by GitHub
commit 9dbe0074c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

View File

@ -721,7 +721,7 @@ abstract class CommonObject
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate') {
$datas[$key]= '<br><b><u>'. $labelextra . '</u></b>';
} else {
$value = $this->array_options['options_' . $key];
$value = (empty($this->array_options['options_' . $key]) ? '' : $this->array_options['options_' . $key]);
$datas[$key]= '<br><b>'. $labelextra . ':</b> ' . $extrafields->showOutputField($key, $value, '', $this->table_element);
}
}

View File

@ -85,12 +85,13 @@ if (empty($conf->dol_no_mouse_hover)) {
tooltipClass: "mytooltip",
open: function (event, ui) {
var elem = $(this);
var params = $(this).attr("data-params");
var params = JSON.parse($(this).attr("data-params"));
params.token = "'.currentToken().'";
$.ajax({
url:"' . dol_buildpath('/core/ajax/ajaxtooltip.php', 1) . '",
type: "post",
async: false,
data: JSON.parse(params),
data: params,
success: function(response){
// Setting content option
elem.tooltip("option","content",response);

View File

@ -873,6 +873,8 @@ class CommandeFournisseur extends CommonOrder
$langs->loadLangs(['bills', 'orders']);
$datas = [];
$nofetch = !empty($params['nofetch']);
if ($user->hasRight("fournisseur", "commande", "read")) {
$datas['picto'] = '<u class="paddingrightonly">'.$langs->trans("SupplierOrder").'</u>';
if (isset($this->statut)) {
@ -884,6 +886,13 @@ class CommandeFournisseur extends CommonOrder
if (!empty($this->ref_supplier)) {
$datas['refsupplier'] = '<br><b>'.$langs->trans('RefSupplier').':</b> '.$this->ref_supplier;
}
if (!$nofetch) {
$langs->load('companies');
if (empty($this->thirdparty)) {
$this->fetch_thirdparty();
}
$datas['supplier'] = '<br><b>'.$langs->trans('Supplier').':</b> '.$this->thirdparty->getNomUrl(1, '', 0, 1);
}
if (!empty($this->total_ht)) {
$datas['totalht'] = '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
}
@ -922,6 +931,7 @@ class CommandeFournisseur extends CommonOrder
'id' => $this->id,
'objecttype' => $this->element,
'option' => $option,
'nofetch' => 1
];
$classfortooltip = 'classfortooltip';
$dataparams = '';