Merge pull request #2530 from aspangaro/develop-project1
New: In project - Elements - Show detail of amounts with a minus when the amount decrease margin
This commit is contained in:
commit
10de082a60
@ -623,13 +623,8 @@ foreach ($listofreferent as $key => $value)
|
|||||||
$total_ht = $total_ht + $element->total_ht;
|
$total_ht = $total_ht + $element->total_ht;
|
||||||
$total_ttc = $total_ttc + $element->total_ttc;
|
$total_ttc = $total_ttc + $element->total_ttc;
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<tr >';
|
// Calculate margin
|
||||||
print '<td align="left" >'.$name.'</td>';
|
|
||||||
print '<td align="right">'.$i.'</td>';
|
|
||||||
print '<td align="right">'.price($total_ht).'</td>';
|
|
||||||
print '<td align="right">'.price($total_ttc).'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
if ($margin=="add")
|
if ($margin=="add")
|
||||||
{
|
{
|
||||||
$margin_ht+= $total_ht;
|
$margin_ht+= $total_ht;
|
||||||
@ -640,8 +635,21 @@ foreach ($listofreferent as $key => $value)
|
|||||||
$margin_ht-= $total_ht;
|
$margin_ht-= $total_ht;
|
||||||
$margin_ttc-= $total_ttc;
|
$margin_ttc-= $total_ttc;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Show $total_ht & $total_ttc -- add a minus when necessary
|
||||||
|
if ($margin!="add")
|
||||||
|
{
|
||||||
|
$total_ht = -$total_ht;
|
||||||
|
$total_ttc = -$total_ttc;
|
||||||
|
}
|
||||||
|
|
||||||
|
print '<tr >';
|
||||||
|
print '<td align="left" >'.$name.'</td>';
|
||||||
|
print '<td align="right">'.$i.'</td>';
|
||||||
|
print '<td align="right">'.price($total_ht).'</td>';
|
||||||
|
print '<td align="right">'.price($total_ttc).'</td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// and the margin amount total
|
// and the margin amount total
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user