From cf976a2b98ab13405df470ec3cb0b1ffc0e563eb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 8 Jun 2020 17:00:58 +0200 Subject: [PATCH] Fix translation --- htdocs/langs/en_US/projects.lang | 1 + htdocs/projet/element.php | 27 ++++++++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index e145647baa4..1a35eda4b9c 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -265,3 +265,4 @@ NewInvoice=New invoice OneLinePerTask=One line per task OneLinePerPeriod=One line per period RefTaskParent=Ref. Parent Task +ProfitIsCalculatedWith=Profit is calculated using \ No newline at end of file diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 23fa6551656..0b46d14a7fa 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -526,7 +526,7 @@ $listofreferent = array( */ ); -// Change rules for benefit calculation +// Change rules for profit/benefit calculation if (! empty($conf->global->PROJECT_ELEMENTS_FOR_PLUS_MARGIN)) { foreach($listofreferent as $key => $element) { if ($listofreferent[$key]['margin'] == 'add') { @@ -624,7 +624,28 @@ print load_fiche_titre($langs->trans("Profit"), '', 'title_accountancy'); print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; @@ -640,7 +661,7 @@ foreach ($listofreferent as $key => $value) $qualified = $value['test']; $margin = $value['margin']; $project_field = $value['project_field']; - if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'plus') + if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'add') { $element = new $classname($db);
'.$langs->trans("Element").''; +$tooltiponprofit = $langs->trans("ProfitIsCalculatedWith")."
\n"; +$tooltiponprofitplus = $tooltiponprofitminus = ''; +foreach($listofreferent as $key => $value) +{ + $name = $langs->trans($value['name']); + $qualified = $value['test']; + $margin = $value['margin']; + if ($qualified && isset($margin)) // If this element must be included into profit calculation ($margin is 'minus' or 'add') + { + if ($margin == 'add') { + $tooltiponprofitplus.=' + '.$name."
\n"; + } + if ($margin == 'minus') { + $tooltiponprofitminus.=' - '.$name."
\n"; + } + } +} +$tooltiponprofit .= $tooltiponprofitplus; +$tooltiponprofit .= $tooltiponprofitminus; +print $form->textwithpicto($langs->trans("Element"), $tooltiponprofit); +print '
'.$langs->trans("Number").''.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").'