This commit is contained in:
Laurent Destailleur 2017-11-12 20:12:56 +01:00
parent 6eb2204c2b
commit 356525730d

View File

@ -1842,8 +1842,12 @@ function pdf_getlineprogress($object, $i, $outputlangs, $hidedetails = 0, $hookm
if (empty($hidedetails) || $hidedetails > 1) if (empty($hidedetails) || $hidedetails > 1)
{ {
if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF) if ($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)
{
$prev_progress = 0;
if (method_exists($object, 'get_prev_progress'))
{ {
$prev_progress = $object->lines[$i]->get_prev_progress($object->id); $prev_progress = $object->lines[$i]->get_prev_progress($object->id);
}
$result = ($object->lines[$i]->situation_percent - $prev_progress) . '%'; $result = ($object->lines[$i]->situation_percent - $prev_progress) . '%';
} }
else else
@ -1892,9 +1896,14 @@ function pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails=0)
{ {
$total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht); $total_ht = ($conf->multicurrency->enabled && $object->multicurrency_tx != 1 ? $object->lines[$i]->multicurrency_total_ht : $object->lines[$i]->total_ht);
if ($object->lines[$i]->situation_percent > 0) if ($object->lines[$i]->situation_percent > 0)
{
$prev_progress = 0;
$progress = 1;
if (method_exists($object, 'get_prev_progress'))
{ {
$prev_progress = $object->lines[$i]->get_prev_progress($object->id); $prev_progress = $object->lines[$i]->get_prev_progress($object->id);
$progress = ($object->lines[$i]->situation_percent - $prev_progress) / 100; $progress = ($object->lines[$i]->situation_percent - $prev_progress) / 100;
}
$result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs); $result.=price($sign * ($total_ht/($object->lines[$i]->situation_percent/100)) * $progress, 0, $outputlangs);
} }
else else