X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fio.pl;h=07db7eac6010f7706f806d86d22f7bc9e7d1a4a5;hb=45cc8d1e638a2f31529da78a49e00bf2e8937201;hp=d799a0c1c382cb0195a179f90aef02a392fd7bb8;hpb=5fc6bb3cff8e471bddfabe258afb4a9b8c8a3df5;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index d799a0c1c..07db7eac6 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -317,24 +317,24 @@ sub display_row { $locale->text('Subtotal'), $form->{"subtotal_$i"} ? 'checked' : '' }; # begin marge calculations - my $marge_color; - my $real_sellprice = ($form->{"sellprice_$i"} - $discount) / $price_factor; - my $marge_price_factor = $form->{"marge_price_factor_$i"} * 1 || 1; - - $form->{"lastcost_$i"} *= 1; + $form->{"lastcost_$i"} *= 1; $form->{"marge_percent_$i"} = 0; - if ($real_sellprice && ($form->{"qty_$i"} * 1)) { - $form->{"marge_percent_$i"} = ($real_sellprice - $form->{"lastcost_$i"} / $marge_price_factor) * 100 / $real_sellprice; - $myconfig{marge_percent_warn} ||= 15; - $marge_color = 'color="#ff0000"' if $form->{"id_$i"} && ($form->{"marge_percent_$i"} < (1 * $myconfig{marge_percent_warn})); + my $marge_color; + my $real_sellprice = $linetotal; + my $real_lastcost = $form->{"lastcost_$i"} * $form->{"qty_$i"} / ( $form->{"marge_price_factor_$i"} || 1 ); + my $marge_percent_warn = $myconfig{marge_percent_warn} * 1 || 15; + my $marge_adjust_credit_note = $form->{type} eq 'credit_note' ? -1 : 1; + + if ($real_sellprice * 1 && ($form->{"qty_$i"} * 1)) { + $form->{"marge_percent_$i"} = ($real_sellprice - $real_lastcost) * 100 / $real_sellprice; + $marge_color = 'color="#ff0000"' if $form->{"id_$i"} && $form->{"marge_percent_$i"} < $marge_percent_warn; } - my $marge_adjust_credit_note = $form->{type} eq 'credit_note' ? -1 : 1; - $form->{"marge_absolut_$i"} = ($real_sellprice - $form->{"lastcost_$i"} / $marge_price_factor) * $form->{"qty_$i"} * $marge_adjust_credit_note; + $form->{"marge_absolut_$i"} = ($real_sellprice - $real_lastcost) * $marge_adjust_credit_note; $form->{"marge_total"} += $form->{"marge_absolut_$i"}; - $form->{"lastcost_total"} += $form->{"lastcost_$i"} * $form->{"qty_$i"} / $marge_price_factor; - $form->{"sellprice_total"} += $real_sellprice * $form->{"qty_$i"}; + $form->{"lastcost_total"} += $real_lastcost; + $form->{"sellprice_total"} += $real_sellprice; map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(marge_absolut marge_percent); @@ -750,7 +750,7 @@ sub check_form { #($form->{"sellprice_$i"},$form->{"$pricegroup_old_$i"}) = split /--/, $form->{"sellprice_$i"}; # fuer assemblies auskommentiert. siehe oben - # $form->{sellprice} += ($form->{"qty_$i"} * $form->{"sellprice_$i"} / ($form->{"price_factor_$i"} || 1)); + # $form->{sellprice} += ($form->{"qty_$i"} * $form->{"sellprice_$i"} / ($form->{"price_factor_$i"} || 1)); $form->{weight} += ($form->{"qty_$i"} * $form->{"weight_$i"} / ($form->{"price_factor_$i"} || 1)); $count++; } @@ -1421,10 +1421,10 @@ sub print_form { call_sub($display_form); # saving the history - if(!exists $form->{addition}) { + if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "PRINTED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "PRINTED"; + $form->save_history($form->dbconnect(\%myconfig)); } # /saving the history exit; @@ -1641,16 +1641,16 @@ sub print_form { if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; if($form->{media} =~ /printer/) { - $form->{addition} = "PRINTED"; + $form->{addition} = "PRINTED"; } elsif($form->{media} =~ /email/) { - $form->{addition} = "MAILED"; + $form->{addition} = "MAILED"; } elsif($form->{media} =~ /queue/) { - $form->{addition} = "QUEUED"; + $form->{addition} = "QUEUED"; } elsif($form->{media} =~ /screen/) { - $form->{addition} = "SCREENED"; + $form->{addition} = "SCREENED"; } $form->save_history($form->dbconnect(\%myconfig)); } @@ -1809,72 +1809,72 @@ sub ship_to {
| + | |||
---|---|---|---|
| . $locale->text('Billing Address') . qq| | -| + | | . $locale->text('Shipping Address') . qq| | -|
$number | -$form->{"$form->{vc}number"} | -||
| . $locale->text('Company Name') . qq| | -$form->{name} | -- | |
| . $locale->text('Department') . qq| | -$form->{department_1} | -- | |
- | $form->{department_2} | -- | |
| . $locale->text('Street') . qq| | -$form->{street} | -- | |
| . $locale->text('Zipcode') . qq| | -$form->{zipcode} | -- | |
| . $locale->text('City') . qq| | -$form->{city} | -- | |
| . $locale->text('Country') . qq| | -$form->{country} | -- | |
| . $locale->text('Contact') . qq| | -$form->{contact} | -- | |
| . $locale->text('Phone') . qq| | -$form->{phone} | -- | |
| . $locale->text('Fax') . qq| | -$form->{fax} | -- | |
| . $locale->text('E-mail') . qq| | -$form->{email} | -- | |
$number | +$form->{"$form->{vc}number"} | +||
| . $locale->text('Company Name') . qq| | +$form->{name} | ++ | |
| . $locale->text('Department') . qq| | +$form->{department_1} | ++ | |
+ | $form->{department_2} | ++ | |
| . $locale->text('Street') . qq| | +$form->{street} | ++ | |
| . $locale->text('Zipcode') . qq| | +$form->{zipcode} | ++ | |
| . $locale->text('City') . qq| | +$form->{city} | ++ | |
| . $locale->text('Country') . qq| | +$form->{country} | ++ | |
| . $locale->text('Contact') . qq| | +$form->{contact} | ++ | |
| . $locale->text('Phone') . qq| | +$form->{phone} | ++ | |
| . $locale->text('Fax') . qq| | +$form->{fax} | ++ | |
| . $locale->text('E-mail') . qq| | +$form->{email} | ++ |