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>'; print '<br>';
// Database statistics update
/*
print '<br>';
print '<strong>'.$langs->trans("DatabaseStatistics").'</strong>: ';
print '<br>';
*/
// End of page // End of page
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -895,7 +895,7 @@ if (empty($user->socid) && empty($conf->global->MAIN_DISABLE_GLOBAL_BOXSTATS))
if (!empty($boxstatFromHook) || !empty($boxstatItems)) { if (!empty($boxstatFromHook) || !empty($boxstatItems)) {
$boxstat .= '<!-- Database statistics -->'."\n"; $boxstat .= '<!-- Database statistics -->'."\n";
$boxstat .= '<div class="box">'; $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 .= '<tr class="liste_titre box_titre">';
$boxstat .= '<td class="liste_titre">'; $boxstat .= '<td class="liste_titre">';
$boxstat .= '<div class="inline-block valignmiddle">'.$langs->trans("DolibarrStateBoard").'</div>'; $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 && 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). // 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. // $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); $newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN);
foreach ($newelementforplusmargin as $value) { foreach ($newelementforplusmargin as $value) {
$listofreferent[$value]['margin']='add'; $listofreferent[trim($value)]['margin']='add';
} }
} }
if (! empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) { if (! empty($conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN)) {
foreach ($listofreferent as $key => $element) { foreach ($listofreferent as $key => $element) {
if ($listofreferent[$key]['margin'] == 'add') { if ($listofreferent[$key]['margin'] == 'minus') {
unset($listofreferent[$key]['margin']); unset($listofreferent[$key]['margin']);
} }
} }
$newelementforplusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN); $newelementforminusmargin = explode(',', $conf->global->PROJECT_ELEMENTS_FOR_MINUS_MARGIN);
foreach ($newelementforplusmargin as $value) { foreach ($newelementforminusmargin as $value) {
$listofreferent[$value]['margin']='minus'; $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 '<td class="right" width="100">'.$langs->trans("AmountTTC").'</td>';
print '</tr>'; print '</tr>';
$total_revenue_ht = 0;
foreach ($listofreferent as $key => $value) foreach ($listofreferent as $key => $value)
{ {
$name = $langs->trans($value['name']); $name = $langs->trans($value['name']);
@ -772,7 +774,11 @@ foreach ($listofreferent as $key => $value)
// Calculate margin // Calculate margin
if ($qualifiedforfinalprofit) if ($qualifiedforfinalprofit)
{ {
if ($margin != "add") if ($margin == 'add') {
$total_revenue_ht += $total_ht;
}
if ($margin != "add") // Revert sign
{ {
$total_ht = -$total_ht; $total_ht = -$total_ht;
$total_ttc = -$total_ttc; $total_ttc = -$total_ttc;
@ -803,11 +809,20 @@ foreach ($listofreferent as $key => $value)
} }
// and the final balance // and the final balance
print '<tr class="liste_total">'; print '<tr class="liste_total">';
print '<td class="right" colspan=2 >'.$langs->trans("Profit").'</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_ht, 'MT')).'</td>';
print '<td class="right">'.price(price2num($balance_ttc, 'MT')).'</td>'; print '<td class="right">'.price(price2num($balance_ttc, 'MT')).'</td>';
print '</tr>'; 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>"; print "</table>";

View File

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