diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php
index 2ba0097af33..335bd6b2df4 100644
--- a/htdocs/fourn/class/fournisseur.commande.class.php
+++ b/htdocs/fourn/class/fournisseur.commande.class.php
@@ -100,14 +100,37 @@ class CommandeFournisseur extends CommonOrder
*/
public $ref;
+ /**
+ * @var string ref supplier
+ */
public $ref_supplier;
+
+ /**
+ * @var string ref supplier
+ * @deprecated
+ * @see $ref_supplier
+ */
+ public $ref_fourn;
+
public $brouillon;
+ /**
+ * @var int
+ */
public $statut; // 0=Draft -> 1=Validated -> 2=Approved -> 3=Ordered/Process runing -> 4=Received partially -> 5=Received totally -> (reopen) 4=Received partially
// -> 7=Canceled/Never received -> (reopen) 3=Process runing
// -> 6=Canceled -> (reopen) 2=Approved
// -> 9=Refused -> (reopen) 1=Validated
// Note: billed or not is on another field "billed"
- public $statuts; // List of status
+
+ /**
+ * @var array List of status
+ */
+ public $statuts;
+
+ /**
+ * @var array List of status short
+ */
+ public $statuts_short;
public $billed;
@@ -169,7 +192,12 @@ class CommandeFournisseur extends CommonOrder
*/
public $lines = array();
- //Add for supplier_proposal
+ /**
+ * @var CommandeFournisseurLigne
+ */
+ public $line;
+
+ // Add for supplier_proposal
public $origin;
public $origin_id;
public $linked_objects = array();
@@ -389,9 +417,9 @@ class CommandeFournisseur extends CommonOrder
$this->ref_supplier = $obj->ref_supplier;
$this->socid = $obj->fk_soc;
$this->fourn_id = $obj->fk_soc;
- $this->statut = $obj->fk_statut;
- $this->status = $obj->fk_statut;
- $this->billed = $obj->billed;
+ $this->statut = $obj->fk_statut;
+ $this->status = $obj->fk_statut;
+ $this->billed = $obj->billed;
$this->user_author_id = $obj->fk_user_author;
$this->user_valid_id = $obj->fk_user_valid;
$this->user_approve_id = $obj->fk_user_approve;
@@ -587,10 +615,10 @@ class CommandeFournisseur extends CommonOrder
// Multicurrency
$line->fk_multicurrency = $objp->fk_multicurrency;
$line->multicurrency_code = $objp->multicurrency_code;
- $line->multicurrency_subprice = $objp->multicurrency_subprice;
- $line->multicurrency_total_ht = $objp->multicurrency_total_ht;
- $line->multicurrency_total_tva = $objp->multicurrency_total_tva;
- $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
+ $line->multicurrency_subprice = $objp->multicurrency_subprice;
+ $line->multicurrency_total_ht = $objp->multicurrency_total_ht;
+ $line->multicurrency_total_tva = $objp->multicurrency_total_tva;
+ $line->multicurrency_total_ttc = $objp->multicurrency_total_ttc;
$line->special_code = $objp->special_code;
$line->fk_parent_line = $objp->fk_parent_line;
@@ -877,38 +905,21 @@ class CommandeFournisseur extends CommonOrder
global $langs, $conf, $user, $hookmanager;
$result = '';
-
- $label = '';
-
- if ($user->hasRight("fournisseur", "commande", "read")) {
- $label = ''.$langs->trans("SupplierOrder").'';
- if (isset($this->statut)) {
- $label .= ' '.$this->getLibStatut(5);
- }
- if (!empty($this->ref)) {
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
- }
- if (!empty($this->ref_supplier)) {
- $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier;
- }
- if (!empty($this->total_ht)) {
- $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if (!empty($this->total_tva)) {
- $label .= '
'.$langs->trans('VAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if (!empty($this->total_ttc)) {
- $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if (!empty($this->date)) {
- $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day');
- }
- if (!empty($this->delivery_date)) {
- $label .= '
'.$langs->trans('DeliveryDate').': '.dol_print_date($this->delivery_date, 'dayhour');
- }
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ ];
+ $classfortooltip = 'classfortooltip';
+ $dataparams = '';
+ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
+ $classfortooltip = 'classforajaxtooltip';
+ $dataparams = ' data-params='.json_encode($params);
+ // $label = $langs->trans('Loading');
}
- $picto = 'order';
+ $label = implode($this->getTooltipContentArray($params));
+
$url = DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id;
if ($option !== 'nolink') {
@@ -923,18 +934,6 @@ class CommandeFournisseur extends CommonOrder
}
$linkclose = '';
- $classfortooltip = 'classfortooltip';
- $dataparams = '';
- if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
- $params = [
- 'id' => $this->id,
- 'objecttype' => $this->element,
- 'option' => $option,
- ];
- $classfortooltip = 'classforajaxtooltip';
- $dataparams = ' data-params='.json_encode($params);
- // $label = $langs->trans('Loading');
- }
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("ShowOrder");
@@ -3702,6 +3701,14 @@ class CommandeFournisseurLigne extends CommonOrderLine
* @var string
*/
public $ref_supplier;
+
+ /**
+ * @var string ref supplier
+ * @deprecated
+ * @see $ref_supplier
+ */
+ public $ref_fourn;
+
public $remise;
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 6572fc29cbb..c6cc2acc722 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -2821,47 +2821,21 @@ class FactureFournisseur extends CommonInvoice
if ($this->type == self::TYPE_DEPOSIT) {
$picto .= 'd'; // Deposit invoice
}
+ $params = [
+ 'id' => $this->id,
+ 'objecttype' => $this->element,
+ 'option' => $option,
+ 'moretitle' => $moretitle,
+ ];
+ $classfortooltip = 'classfortooltip';
+ $dataparams = '';
+ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
+ $classfortooltip = 'classforajaxtooltip';
+ $dataparams = ' data-params='.json_encode($params);
+ // $label = $langs->trans('Loading');
+ }
- $label = img_picto('', $this->picto).' '.$langs->trans("SupplierInvoice").'';
- if ($this->type == self::TYPE_REPLACEMENT) {
- $label = ''.$langs->transnoentitiesnoconv("InvoiceReplace").'';
- } elseif ($this->type == self::TYPE_CREDIT_NOTE) {
- $label = ''.$langs->transnoentitiesnoconv("CreditNote").'';
- } elseif ($this->type == self::TYPE_DEPOSIT) {
- $label = ''.$langs->transnoentitiesnoconv("Deposit").'';
- }
- if (isset($this->status)) {
- $alreadypaid = -1;
- if (isset($this->alreadypaid)) {
- $alreadypaid = $this->alreadypaid;
- }
-
- $label .= ' '.$this->getLibStatut(5, $alreadypaid);
- }
- if (!empty($this->ref)) {
- $label .= '
'.$langs->trans('Ref').': '.$this->ref;
- }
- if (!empty($this->ref_supplier)) {
- $label .= '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier;
- }
- if (!empty($this->label)) {
- $label .= '
'.$langs->trans('Label').': '.$this->label;
- }
- if (!empty($this->date)) {
- $label .= '
'.$langs->trans('Date').': '.dol_print_date($this->date, 'day');
- }
- if (!empty($this->total_ht)) {
- $label .= '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if (!empty($this->total_tva)) {
- $label .= '
'.$langs->trans('AmountVAT').': '.price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if (!empty($this->total_ttc)) {
- $label .= '
'.$langs->trans('AmountTTC').': '.price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
- }
- if ($moretitle) {
- $label .= ' - '.$moretitle;
- }
+ $label = implode($this->getTooltipContentArray($params));
$ref = $this->ref;
if (empty($ref)) {
@@ -2869,19 +2843,6 @@ class FactureFournisseur extends CommonInvoice
}
$linkclose = '';
- $classfortooltip = 'classfortooltip';
- $dataparams = '';
- if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
- $params = [
- 'id' => $this->id,
- 'objecttype' => $this->element,
- 'option' => $option,
- 'moretitle' => $moretitle,
- ];
- $classfortooltip = 'classforajaxtooltip';
- $dataparams = ' data-params='.json_encode($params);
- // $label = $langs->trans('Loading');
- }
if (empty($notooltip)) {
if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$label = $langs->trans("ShowSupplierInvoice");
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 7860ef161c3..bc0e8cff3bd 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2607,7 +2607,7 @@ class Societe extends CommonObject
{
global $conf, $langs, $user;
- $langs->loadLangs(['companies, commercial']);
+ $langs->loadLangs(['companies', 'commercial']);
$datas = [];
@@ -2621,9 +2621,6 @@ class Societe extends CommonObject
return ['optimize' => $langs->trans("ShowCompany")];
}
- $label = '';
- $label2 = '';
-
if (!empty($this->logo) && class_exists('Form')) {
$photo = '