$self->js->show('#subtotal_row_id');
}
+ if ($self->order->is_sales) {
+ my $is_neg = $self->order->marge_total < 0;
+ $self->js
+ ->html('#marge_total_id', $::form->format_amount(\%::myconfig, $self->order->marge_total, 2))
+ ->html('#marge_percent_id', $::form->format_amount(\%::myconfig, $self->order->marge_percent, 2))
+ ->action_if( $is_neg, 'addClass', '#marge_total_id', 'plus0')
+ ->action_if( $is_neg, 'addClass', '#marge_percent_id', 'plus0')
+ ->action_if( $is_neg, 'addClass', '#marge_percent_sign_id', 'plus0')
+ ->action_if(!$is_neg, 'removeClass', '#marge_total_id', 'plus0')
+ ->action_if(!$is_neg, 'removeClass', '#marge_percent_id', 'plus0')
+ ->action_if(!$is_neg, 'removeClass', '#marge_percent_sign_id', 'plus0');
+ }
+
$self->js
->html('#netamount_id', $::form->format_amount(\%::myconfig, $self->order->netamount, -2))
->html('#amount_id', $::form->format_amount(\%::myconfig, $self->order->amount, -2))
</table>
</td>
+ [%- IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") -%]
+ [%- SET marge_class = (SELF.order.marge_total < 0) ? 'plus0' : '' -%]
+ <td>
+ <table>
+ <tr>
+ <th align="left">[% 'Ertrag' | $T8 %]</th>
+ <td align="right">
+ [%- L.div_tag(SELF.order.marge_total_as_number, id='marge_total_id', class=marge_class) %]
+ </td>
+ </tr>
+ <tr>
+ <th align="left">[% 'Ertrag prozentual' | $T8 %]</th>
+ <td align="right">
+ [%- L.div_tag(LxERP.format_amount(SELF.order.marge_percent, 2), id='marge_percent_id', class=marge_class) %]
+ </td>
+ <td>[%- L.div_tag('%', id='marge_percent_sign_id', class=marge_class) %]</td>
+ </tr>
+ </table>
+ </td>
+ [%- END %]
+
<td align="right">
<table>
<tr id="taxincluded_row_id" [%- IF !SELF.taxes.size %]style="display:none"[%- END %]>