From b7f1e74f6f347697bb4b1e7efe3723cf0701f7d4 Mon Sep 17 00:00:00 2001 From: BENKE Charlie Date: Thu, 20 Apr 2017 10:27:44 +0200 Subject: [PATCH] New SITUATION_DISPLAY_DIFF_ON_PDF feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit allow to display or the progress situation percent value the diférential situation percent value --- htdocs/core/lib/pdf.lib.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 282bdec690e..d1a5e64dce2 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -1808,8 +1808,17 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm } if (empty($reshook)) { - if ($object->lines[$i]->special_code == 3) return ''; - if (empty($hidedetails) || $hidedetails > 1) $result.=$object->lines[$i]->situation_percent . '%'; + if ($object->lines[$i]->special_code == 3) return ''; + if (empty($hidedetails) || $hidedetails > 1) + { + if($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF) + { + $prev_progress = $object->lines[$i]->get_prev_progress($object->id); + $result = ($prev_progress - $object->lines[$i]->situation_percent) . '%'; + } + else + $result = $object->lines[$i]->situation_percent . '%'; + } } return $result; }