]> wagnertech.de Git - mfinanz.git/commitdiff
Merge branch 'master' of vc.linet-services.de:public/lx-office-erp
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 9 Nov 2012 14:37:43 +0000 (15:37 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 9 Nov 2012 14:37:43 +0000 (15:37 +0100)
SL/IS.pm
SL/OE.pm
SL/RP.pm
bin/mozilla/oe.pl

index 616e2bf6ffec4193dd96762ddb0c7ba1bdad614b..554bddc4dc8cd40cd4d77c6047a4a2eed072b44d 100644 (file)
--- a/SL/IS.pm
+++ b/SL/IS.pm
@@ -222,12 +222,18 @@ sub invoice_details {
       my ($dec)         = ($sellprice =~ /\.(\d+)/);
       my $decimalplaces = max 2, length($dec);
 
-      my $parsed_discount      = $form->parse_amount($myconfig, $form->{"discount_$i"});
-      my $linetotal_exact      =                     $form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor};
-      my $linetotal            = $form->round_amount($linetotal_exact, 2);
-      my $discount             = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor} - ($linetotal - $linetotal_exact),
-                                                     $decimalplaces);
-      my $nodiscount_linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice / $price_factor->{factor}, 2);
+      my $parsed_discount            = $form->parse_amount($myconfig, $form->{"discount_$i"});
+
+      my $linetotal_exact            = $form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor};
+      my $linetotal                  = $form->round_amount($linetotal_exact, 2);
+
+      my $nodiscount_exact_linetotal = $form->{"qty_$i"} * $sellprice                                  / $price_factor->{factor};
+      my $nodiscount_linetotal       = $form->round_amount($nodiscount_exact_linetotal,2);
+
+      my $discount                   = $nodiscount_linetotal - $linetotal; # is always rounded because $nodiscount_linetotal and $linetotal are rounded
+
+      my $discount_round_error       = $discount + ($linetotal_exact - $nodiscount_exact_linetotal); # not used
+
       $form->{"netprice_$i"}   = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, 2);
 
       push @{ $form->{TEMPLATE_ARRAYS}->{netprice} },       ($form->{"netprice_$i"} != 0) ? $form->format_amount($myconfig, $form->{"netprice_$i"}, $decimalplaces) : '';
index 6648e22428b36433bc7ff2b4989811a993f0ae00..b6816c138564b5125dbec271469776eaa5799ec2 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -1181,12 +1181,18 @@ sub order_details {
       my ($dec)         = ($sellprice =~ /\.(\d+)/);
       my $decimalplaces = max 2, length($dec);
 
-      my $parsed_discount      = $form->parse_amount($myconfig, $form->{"discount_$i"});
-      my $linetotal_exact      =                     $form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor};
-      my $linetotal            = $form->round_amount($linetotal_exact, 2);
-      my $discount             = $form->round_amount($form->{"qty_$i"} * $sellprice * $parsed_discount / 100 / $price_factor->{factor} - ($linetotal - $linetotal_exact),
-                                                     $decimalplaces);
-      my $nodiscount_linetotal = $form->round_amount($form->{"qty_$i"} * $sellprice / $price_factor->{factor}, 2);
+      my $parsed_discount            = $form->parse_amount($myconfig, $form->{"discount_$i"});
+
+      my $linetotal_exact            = $form->{"qty_$i"} * $sellprice * (100 - $parsed_discount) / 100 / $price_factor->{factor};
+      my $linetotal                  = $form->round_amount($linetotal_exact, 2);
+
+      my $nodiscount_exact_linetotal = $form->{"qty_$i"} * $sellprice                                  / $price_factor->{factor};
+      my $nodiscount_linetotal       = $form->round_amount($nodiscount_exact_linetotal,2);
+
+      my $discount                   = $nodiscount_linetotal - $linetotal; # is always rounded because $nodiscount_linetotal and $linetotal are rounded
+
+      my $discount_round_error       = $discount + ($linetotal_exact - $nodiscount_exact_linetotal); # not used
+
       $form->{"netprice_$i"}   = $form->round_amount($form->{"qty_$i"} ? ($linetotal / $form->{"qty_$i"}) : 0, 2);
 
       push @{ $form->{TEMPLATE_ARRAYS}->{netprice} },       ($form->{"netprice_$i"} != 0) ? $form->format_amount($myconfig, $form->{"netprice_$i"}, $decimalplaces) : '';
index 0ea40ec02340da7873f07bff908c372fab46929d..a319cf59d50090e0efddaa3be72eb152b0590eb1 100644 (file)
--- a/SL/RP.pm
+++ b/SL/RP.pm
@@ -1649,7 +1649,7 @@ sub bwa {
 
   my @periods        = qw(jetzt kumm);
   my @gesamtleistung = qw(1 3);
-  my @gesamtkosten   = qw (10 11 12 13 14 15 16 17 18 19 20);
+  my @gesamtkosten   = qw (10 11 12 13 14 15 16 17 18 20);
   my @ergebnisse     =
     qw (rohertrag betriebrohertrag betriebsergebnis neutraleraufwand neutralerertrag ergebnisvorsteuern ergebnis gesamtleistung gesamtkosten);
 
@@ -1684,7 +1684,7 @@ sub bwa {
       $form->{ "$key" . "betriebrohertrag" } -
       $form->{ "$key" . "gesamtkosten" };
     $form->{ "$key" . "neutraleraufwand" } =
-      $form->{30}{$key} + $form->{31}{$key};
+      $form->{19}{$key} + $form->{30}{$key} + $form->{31}{$key};
     $form->{ "$key" . "neutralerertrag" } =
       $form->{32}{$key} + $form->{33}{$key} + $form->{34}{$key};
     $form->{ "$key" . "ergebnisvorsteuern" } =
index c7309dc8692f8f71bc4925b6926fa489e7aa0f61..5df518fc7da8df88bc932166cc4e479211bb86fb 100644 (file)
@@ -409,7 +409,6 @@ sub form_header {
   } elsif ($form->{resubmit}) {
     # emulate click for resubmitting actions
     $dispatch_to_popup  = "document.oe.${_}.click(); " for grep { /^action_/ } keys %$form;
-    $dispatch_to_popup .= "document.oe.submit();";
   } elsif ($creditwarning) {
     $::request->{layout}->add_javascripts_inline("alert('$credittext')");
   }