* add doc

* fix

* fix

* fix

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Frédéric FRANCE
2025-08-26 04:33:05 +02:00
committed by GitHub
parent af68f7c8a5
commit 3a23318ed8
2 changed files with 12 additions and 2 deletions

View File

@@ -3362,12 +3362,14 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
if ($object->element == 'societe') {
/** @var Societe $object */
if (!empty($conf->use_javascript_ajax) && $user->hasRight('societe', 'creer') && getDolGlobalString('MAIN_DIRECT_STATUS_UPDATE')) {
$morehtmlstatus .= ajax_object_onoff($object, 'status', 'status', 'InActivity', 'ActivityCeased');
} else {
$morehtmlstatus .= $object->getLibStatut(6);
}
} elseif ($object->element == 'product') {
/** @var Product $object */
//$morehtmlstatus.=$langs->trans("Status").' ('.$langs->trans("Sell").') ';
if (!empty($conf->use_javascript_ajax) && $user->hasRight('produit', 'creer') && getDolGlobalString('MAIN_DIRECT_STATUS_UPDATE')) {
$morehtmlstatus .= ajax_object_onoff($object, 'status', 'tosell', 'ProductStatusOnSell', 'ProductStatusNotOnSell');
@@ -3382,6 +3384,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$morehtmlstatus .= '<span class="statusrefbuy">' . $object->getLibStatut(6, 1) . '</span>';
}
} elseif (in_array($object->element, array('salary'))) {
/** @var Salary $object */
'@phan-var-force Salary $object';
$tmptxt = $object->getLibStatut(6, $object->alreadypaid);
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
@@ -3389,6 +3392,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
$morehtmlstatus .= $tmptxt;
} elseif (in_array($object->element, array('facture', 'invoice', 'invoice_supplier'))) { // TODO Move this to use ->alreadypaid
/** @var Facture|FactureFournisseur|CommonInvoice $object */
'@phan-var-force Facture|FactureFournisseur|CommonInvoice $object';
$totalallpayments = $object->getSommePaiement(0);
$totalallpayments += $object->getSumCreditNotesUsed(0);
@@ -3399,6 +3403,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
$morehtmlstatus .= $tmptxt;
} elseif (in_array($object->element, array('chargesociales', 'loan', 'tva'))) { // TODO Move this to use ->alreadypaid
/** @var ChargeSociales|Loan|Tva $object */
'@phan-var-force ChargeSociales|Loan|Tva $object';
$tmptxt = $object->getLibStatut(6, $object->totalpaid);
if (empty($tmptxt) || $tmptxt == $object->getLibStatut(3)) {
@@ -3406,12 +3411,14 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
}
$morehtmlstatus .= $tmptxt;
} elseif ($object->element == 'contrat' || $object->element == 'contract') {
if ($object->statut == 0) {
/** @var Contrat $object */
if ($object->status == 0) {
$morehtmlstatus .= $object->getLibStatut(5);
} else {
$morehtmlstatus .= $object->getLibStatut(4);
}
} elseif ($object->element == 'facturerec') {
/** @var FactureRec $object */
'@phan-var-force FactureRec $object';
if ($object->frequency == 0) {
$morehtmlstatus .= $object->getLibStatut(2);
@@ -3419,6 +3426,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
$morehtmlstatus .= $object->getLibStatut(5);
}
} elseif ($object->element == 'project_task') {
/** @var Task $object */
$tmptxt = $object->getLibStatut(4);
$morehtmlstatus .= $tmptxt;
} elseif (method_exists($object, 'getLibStatut')) { // Generic case for status
@@ -3441,12 +3449,14 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi
// Add alias for thirdparty
if (!empty($object->name_alias)) {
/** @var Societe $object */
'@phan-var-force Societe $object';
$morehtmlref .= '<div class="refidno opacitymedium">' . dol_escape_htmltag($object->name_alias) . '</div>';
}
// Add label
if (in_array($object->element, array('product', 'bank_account', 'project_task'))) {
/** @var Product|Account|Task $object */
if (!empty($object->label)) {
$morehtmlref .= '<div class="refidno opacitymedium">' . $object->label . '</div>';
}