Skip to content

Commit

Permalink
flip supplier proposal and orders to show up as negative in the proje…
Browse files Browse the repository at this point in the history
…ct Profit overview
  • Loading branch information
Jon Bendtsen committed Nov 21, 2024
1 parent 888e8d7 commit 86eb75e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion htdocs/projet/element.php
Original file line number Diff line number Diff line change
Expand Up @@ -903,14 +903,20 @@
$total_ttc_by_line = $element->total_ttc;
}

// Change sign of $total_ht_by_line and $total_ttc_by_line for some cases
// Change sign of $total_ht_by_line and $total_ttc_by_line for various payments
if ($tablename == 'payment_various') {
if ($element->sens == 1) {
$total_ht_by_line = -$total_ht_by_line;
$total_ttc_by_line = -$total_ttc_by_line;
}
}

// Change sign of $total_ht_by_line and $total_ttc_by_line for supplier proposal and supplier order
if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_proposal') {
$total_ht_by_line = -$total_ht_by_line;
$total_ttc_by_line = -$total_ttc_by_line;
}

// Add total if we have to
if ($qualifiedfortotal) {
$total_ht = $total_ht + $total_ht_by_line;
Expand Down

0 comments on commit 86eb75e

Please sign in to comment.