Merge pull request #17532 from ibuiv/ibuiv-status-suppliers-hooks

New Hooks to rename Supplier Orders statuses
This commit is contained in:
Laurent Destailleur 2021-06-05 02:11:29 +02:00 committed by GitHub
commit 703001c625
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -697,7 +697,7 @@ class CommandeFournisseur extends CommonOrder
public function LibStatut($status, $mode = 0, $billed = 0)
{
// phpcs:enable
global $conf, $langs;
global $conf, $langs, $hookmanager;
if (empty($this->statuts) || empty($this->statutshort)) {
$langs->load('orders');
@ -756,6 +756,11 @@ class CommandeFournisseur extends CommonOrder
$statusLong = $langs->transnoentitiesnoconv($this->statuts[$status]).$billedtext;
$statusShort = $langs->transnoentitiesnoconv($this->statutshort[$status]);
$parameters = array('status' => $status, 'mode' => $mode, 'billed' => $billed);
$reshook = $hookmanager->executeHooks('LibStatut', $parameters, $this); // Note that $action and $object may have been modified by hook
if ($reshook > 0) {
return $hookmanager->resPrint;
}
return dolGetStatus($statusLong, $statusShort, '', $statusClass, $mode);
}

View File

@ -1287,6 +1287,7 @@ if ($resql) {
$objectstatic->id = $obj->rowid;
$objectstatic->ref = $obj->ref;
$objectstatic->socid = $obj->socid;
$objectstatic->ref_supplier = $obj->ref_supplier;
$objectstatic->socid = $obj->socid;
$objectstatic->total_ht = $obj->total_ht;