Merge pull request #12924 from aspangaro/12.0_a9

NEW: Add hook on margin list page
This commit is contained in:
Laurent Destailleur 2020-01-26 22:34:12 +01:00 committed by GitHub
commit 009264a46b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View File

@ -74,6 +74,9 @@ if ($user->rights->margins->read->all) {
}
$result = restrictedArea($user, 'margins');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new User($db);
$hookmanager->initHooks(array('marginagentlist'));
/*
* Actions
@ -205,8 +208,11 @@ if ($result)
else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice';
$moreforfilter = '';
$i = 0;
print "<table class=\"noborder\" width=\"100%\">";
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">';
if ($agentid > 0)
@ -299,7 +305,8 @@ if ($result)
print "</tr>\n";
}
}
print "</table>";
print "</table>";
print '</div>';
}
else
{

View File

@ -62,6 +62,9 @@ if (!empty($_POST['startdatemonth']))
if (!empty($_POST['enddatemonth']))
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Societe($db);
$hookmanager->initHooks(array('margincustomerlist'));
/*
* View
@ -255,8 +258,11 @@ if ($result)
else // value is 'costprice' or 'pmp'
$labelcostprice = 'CostPrice';
$moreforfilter = '';
$i = 0;
print "<table class=\"noborder\" width=\"100%\">";
print '<div class="div-table-responsive">';
print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
print '<tr class="liste_titre">';
if (!empty($client)) {
@ -359,7 +365,8 @@ if ($result)
print "<td class=\"right\">".(($markRate === '') ? 'n/a' : price($markRate, null, null, null, null, $rounding)."%")."</td>\n";
print "</tr>\n";
print "</table>";
print "</table>";
print '</div>';
}
else
{

View File

@ -76,6 +76,9 @@ if (!empty($_POST['startdatemonth']))
if (!empty($_POST['enddatemonth']))
$enddate = dol_mktime(23, 59, 59, $_POST['enddatemonth'], $_POST['enddateday'], $_POST['enddateyear']);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$object = new Product($db);
$hookmanager->initHooks(array('marginproductlist'));
/*
* View