|
@@ -800,9 +800,11 @@ class pdf_sponge extends ModelePDFFactures
|
|
|
// Situation progress
|
|
|
if ($this->getColumnStatus('progress')) {
|
|
|
$progress = pdf_getlineprogress($object, $i, $outputlangs, $hidedetails);
|
|
|
- // MMI Hack
|
|
|
- if (!empty($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF) && $progress != ' ' && $object->lines[$i]->situation_percent>0) {
|
|
|
- $progress2 = $progress;
|
|
|
+ // MMI Hack : Hooks does not permit to retrieve infos
|
|
|
+ if ($conf->mmidocuments->enabled && !empty($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF) && $progress != ' ' && $object->lines[$i]->situation_percent>0) {
|
|
|
+ if ($progress>0) {
|
|
|
+ $progress = '+'.$progress;
|
|
|
+ }
|
|
|
$progress = $progress.'<br />('.$object->lines[$i]->situation_percent.'%)';
|
|
|
}
|
|
|
$this->printStdColumnContent($pdf, $curY, 'progress', $progress);
|
|
@@ -826,9 +828,14 @@ class pdf_sponge extends ModelePDFFactures
|
|
|
// Total excl tax line (HT)
|
|
|
if ($this->getColumnStatus('totalexcltax')) {
|
|
|
$total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
|
|
|
- // MMI Hack
|
|
|
- if (!empty($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF) && $total_excl_tax != ' ' && $object->lines[$i]->situation_percent>0) {
|
|
|
- $total_excl_tax = $total_excl_tax.'<br />('.round($qty*$up_excl_tax*$object->lines[$i]->situation_percent/100, 2).'€)';
|
|
|
+ // MMI Hack : Hooks does not permit to retrieve infos
|
|
|
+ if ($conf->mmidocuments->enabled && $total_excl_tax != ' ' && $object->lines[$i]->situation_percent>0) {
|
|
|
+ if (!empty($conf->global->SITUATION_DISPLAY_DIFF_ON_PDF)) {
|
|
|
+ $total_excl_tax = $total_excl_tax.'<br />('.number_format(round(str_replace(',', '.', $qty)*str_replace([' ', ','], ['', '.'], $up_excl_tax)*str_replace(',', '.', $object->lines[$i]->situation_percent)/100, 2), 2, ',', ' ').')';
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ $total_excl_tax = number_format(round($object->lines[$i]->total_ht, 2), 2, ',', ' ');
|
|
|
+ }
|
|
|
}
|
|
|
$this->printStdColumnContent($pdf, $curY, 'totalexcltax', $total_excl_tax);
|
|
|
$nexY = max($pdf->GetY(), $nexY);
|