$lxdebug->enter_sub();
my $numrows = shift;
+ my $is_sales =
+ (substr($form->{type}, 0, 6) eq "sales_")
+ || (($form->{type} eq "invoice") && ($form->{script} eq "is.pl"))
+ || ($form->{type} eq 'credit_note');
+
if ($lizenzen && $form->{vc} eq "customer") {
if ($form->{type} =~ /sales_order/) {
@column_index = (runningnumber, partnumber, description, ship, qty);
<b>|.$locale->text('Subtotal').qq|</b> <input type="checkbox" name="subtotal_$i" value="1" "$subtotalchecked">
|;
+ if ($form->{"id_$i"} && $is_sales) {
+ print qq|
+ ${marge_font_start}<b>| . $locale->text('Ertrag') . qq|</b> $form->{"marge_absolut_$i"} $form->{"marge_percent_$i"} % ${marge_font_end}
+ <b>| . $locale->text('LP') . qq|</b> | . $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2) . qq|
+ <b>| . $locale->text('EK') . qq|</b> | . $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, 2);
+ }
+
print qq|
- ${marge_font_start}<b>|.$locale->text('Ertrag').qq|</b> $form->{"marge_absolut_$i"} $form->{"marge_percent_$i"} % ${marge_font_end}
- <b>|.$locale->text('LP').qq|</b> |.$form->format_amount(\%myconfig,$form->{"listprice_$i"},2).qq|
- <b>|.$locale->text('EK').qq|</b> |.$form->format_amount(\%myconfig,$form->{"lastcost_$i"},2).qq|
</td>
</tr>
|;
</td>
<td>
<table>
+|;
+
+ if ($form->{type} =~ /^sales_/) {
+ print qq|
<tr>
<th align=left>| . $locale->text('Ertrag') . qq|</th>
<td>| . $form->format_amount(\%myconfig, $form->{marge_total}, 2, 0) . qq|</td>
<th align=left>| . $locale->text('Ertrag prozentual') . qq|</th>
<td>| . $form->format_amount(\%myconfig, $form->{marge_percent}, 2, 0) . qq| %</td>
</tr>
+|;
+ }
+
+ print qq|
<input type=hidden name="marge_total" value="$form->{"marge_total"}">
<input type=hidden name="marge_percent" value="$form->{"marge_percent"}">
</table>