Revision aea28303
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
307 | 307 |
|
308 | 308 |
# marge calculations |
309 | 309 |
my ($marge_font_start, $marge_font_end); |
310 |
|
|
310 | 311 |
$form->{"lastcost_$i"} *= 1; |
312 |
|
|
311 | 313 |
if ($real_sellprice && ($form->{"qty_$i"} * 1)) { |
312 |
$form->{"marge_percent_$i"} =
|
|
313 |
($real_sellprice - $form->{"lastcost_$i"}) * 100 / $real_sellprice;
|
|
314 |
$form->{"marge_percent_$i"} = ($real_sellprice - $form->{"lastcost_$i"}) * 100 / $real_sellprice;
|
|
315 |
$myconfig{"marge_percent_warn"} = 15 unless (defined($myconfig{"marge_percent_warn"}));
|
|
314 | 316 |
|
315 |
$myconfig{"marge_percent_warn"} = 15 |
|
316 |
unless (defined($myconfig{"marge_percent_warn"})); |
|
317 | 317 |
if ($form->{"id_$i"} && |
318 |
($form->{"marge_percent_$i"} < |
|
319 |
(1 * $myconfig{"marge_percent_warn"}))) { |
|
318 |
($form->{"marge_percent_$i"} < (1 * $myconfig{"marge_percent_warn"}))) { |
|
320 | 319 |
$marge_font_start = "<font color=\"#ff0000\">"; |
321 |
$marge_font_end = "</font>"; |
|
320 |
$marge_font_end = "</font>";
|
|
322 | 321 |
} |
322 |
|
|
323 | 323 |
} else { |
324 | 324 |
$form->{"marge_percent_$i"} = 0; |
325 | 325 |
} |
326 |
$form->{"marge_absolut_$i"} = |
|
327 |
($real_sellprice - $form->{"lastcost_$i"}) * $form->{"qty_$i"}; |
|
328 |
$form->{"marge_total"} += $form->{"marge_absolut_$i"}; |
|
329 |
$form->{"lastcost_total"} += $form->{"lastcost_$i"} * $form->{"qty_$i"}; |
|
330 |
$form->{"sellprice_total"} += $real_sellprice * $form->{"qty_$i"}; |
|
331 | 326 |
|
332 |
map { |
|
333 |
$form->{"${_}_$i"} = |
|
334 |
$form->format_amount(\%myconfig, $form->{"${_}_$i"}, |
|
335 |
2) |
|
336 |
} qw(marge_absolut marge_percent); |
|
327 |
$form->{"marge_absolut_$i"} = ($real_sellprice - $form->{"lastcost_$i"}) * $form->{"qty_$i"}; |
|
328 |
$form->{"marge_total"} += $form->{"marge_absolut_$i"}; |
|
329 |
$form->{"lastcost_total"} += $form->{"lastcost_$i"} * $form->{"qty_$i"}; |
|
330 |
$form->{"sellprice_total"} += $real_sellprice * $form->{"qty_$i"}; |
|
331 |
|
|
332 |
map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(marge_absolut marge_percent); |
|
337 | 333 |
|
338 | 334 |
# convert " to " |
339 | 335 |
map { $form->{"${_}_$i"} =~ s/\"/"/g } |
Auch abrufbar als: Unified diff
Kosmetik.