Merge branch '12.0' of git@github.com:Dolibarr/dolibarr.git into develop

Conflicts:
	htdocs/projet/element.php
This commit is contained in:
Laurent Destailleur 2020-06-24 09:59:08 +02:00
commit b6c1cdad7c
5 changed files with 33 additions and 22 deletions

View File

@ -530,13 +530,6 @@ if (!in_array($conf->browser->name, array('chrome', 'opera', 'safari', 'firefox'
}
print '<br>';
// Database statistics update
/*
print '<br>';
print '<strong>'.$langs->trans("DatabaseStatistics").'</strong>: ';
print '<br>';
*/
// End of page
llxFooter();
$db->close();

View File

@ -895,7 +895,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
$boxstat .= '<!-- Database statistics -->'."\n";
$boxstat .= '<div class="box">';
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover" width="100%">';
$boxstat .= '<table summary="'.dol_escape_htmltag($langs->trans("DolibarrStateBoard")).'" class="noborder boxtable boxtablenobottom nohover widgetstats" width="100%">';
$boxstat .= '<tr class="liste_titre box_titre">';
$boxstat .= '<td class="liste_titre">';
$boxstat .= '<div class="inline-block valignmiddle">'.$langs->trans("DolibarrStateBoard").'</div>';

View File

@ -53,7 +53,10 @@ if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/master.i
if (!$res && file_exists("../master.inc.php")) $res = @include "../master.inc.php";
if (!$res && file_exists("../../master.inc.php")) $res = @include "../../master.inc.php";
if (!$res && file_exists("../../../master.inc.php")) $res = @include "../../../master.inc.php";
if (!$res) die("Include of master fails");
if (!$res) {
print "Include of master fails";
exit(-1);
}
// After this $db, $mysoc, $langs, $conf and $hookmanager are defined (Opened $db handler to database will be closed at end of file).
// $user is created but empty.

View File

@ -535,18 +535,18 @@ if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) {
}
$newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN);
foreach ($newelementforplusmargin as $value) {
$listofreferent[$value]['margin']='add';
$listofreferent[trim($value)]['margin']='add';
}
}
if (! empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) {
foreach ($listofreferent as $key => $element) {
if ($listofreferent[$key]['margin'] == 'add') {
if ($listofreferent[$key]['margin'] == 'minus') {
unset($listofreferent[$key]['margin']);
}
}
$newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN);
foreach ($newelementforplusmargin as $value) {
$listofreferent[$value]['margin']='minus';
$newelementforminusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN);
foreach ($newelementforminusmargin as $value) {
$listofreferent[trim($value)]['margin']='minus';
}
}
@ -650,6 +650,8 @@ print '<td class="right" width="100">'.$langs->trans("AmountHT").'</td>';
print '<td class="right" width="100">'.$langs->trans("AmountTTC").'</td>';
print '</tr>';
$total_revenue_ht = 0;
foreach ($listofreferent as $key => $value)
{
$name = $langs->trans($value['name']);
@ -772,7 +774,11 @@ foreach ($listofreferent as $key => $value)
// Calculate margin
if ($qualifiedforfinalprofit)
{
if ($margin != "add")
if ($margin == 'add') {
$total_revenue_ht += $total_ht;
}
if ($margin != "add") // Revert sign
{
$total_ht = -$total_ht;
$total_ttc = -$total_ttc;
@ -803,11 +809,20 @@ foreach ($listofreferent as $key => $value)
}
// and the final balance
print '<tr class="liste_total">';
print '<td class="right" colspan=2 >'.$langs->trans("Profit").'</td>';
print '<td class="right" >'.price(price2num($balance_ht, 'MT')).'</td>';
print '<td class="right" >'.price(price2num($balance_ttc, 'MT')).'</td>';
print '<td class="right" colspan="2">'.$langs->trans("Profit").'</td>';
print '<td class="right">'.price(price2num($balance_ht, 'MT')).'</td>';
print '<td class="right">'.price(price2num($balance_ttc, 'MT')).'</td>';
print '</tr>';
// and the margin (profit / revenues)
if ($total_revenue_ht) {
print '<tr class="liste_total">';
print '<td class="right" colspan="2">'.$langs->trans("Margin").'</td>';
print '<td class="right">'.round(100 * $balance_ht / $total_revenue_ht, 1).'%</td>';
print '<td class="right"></td>';
print '</tr>';
}
print "</table>";

View File

@ -1729,7 +1729,7 @@ div.heightref {
min-height: 80px;
}
div.divphotoref {
padding-<?php echo $right; ?>: 20px;
padding-<?php echo $right; ?>: 30px;
}
div.paginationref {
padding-bottom: 10px;
@ -3116,7 +3116,7 @@ table.listwithfilterbefore {
/* Pagination */
div.refidpadding {
padding-top: 3px;
/* padding-top: 3px; */
}
div.refid {
font-weight: bold;
@ -3158,7 +3158,7 @@ div.pagination li {
display: inline-block;
padding-left: 0px;
padding-right: 0px;
padding-top: 10px;
/* padding-top: 10px; */
padding-bottom: 5px;
font-size: 1.1em;
}
@ -3633,7 +3633,7 @@ ul.noborder li:nth-child(even):not(.liste_titre) {
width: 118px;
}
td.tdboxstats .boxstats {
.boxtable:not(.widgetstats) td.tdboxstats .boxstats {
box-shadow: 1px 1px 8px var(--colorboxstatsborder);
}