]> wagnertech.de Git - kivitendo-erp.git/blobdiff - bin/mozilla/oe.pl
Consolidation and extended test runs
[kivitendo-erp.git] / bin / mozilla / oe.pl
index ad119c477af13ae579c47d92dae8d90cba2fa585..565a40310df835fa240976e3ccebfe8145d8c293 100644 (file)
@@ -535,9 +535,6 @@ sub form_footer {
               </tr> |;
       }
     }
-
-#    $form->{invsubtotal} = $form->format_amount(\%myconfig, $form->{invsubtotal}, 2, 0); # template does this
-
   } else {
     foreach my $item (split / /, $form->{taxaccounts}) {
       if ($form->{"${item}_base"}) {
@@ -559,7 +556,10 @@ sub form_footer {
     }
   }
 
-  $form->{oldinvtotal} = $form->{invtotal};
+  # beware numeric effects
+  $form->{oldinvtotal} = $form->round_amount( $form->{invtotal},2,1 );
+  $form->{rounding} = $form->round_amount( $form->{oldinvtotal}-$form->{invtotal}, 2 );
+  $form->{invtotal} = $form->{oldinvtotal};
 
   $TMPL_VAR{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
 
@@ -625,7 +625,7 @@ sub update {
     if ($form->{type} =~ /^sales/) {
       IS->retrieve_item(\%myconfig, \%$form);
       $mode = 'IS';
-    } else {
+  } else {
       IR->retrieve_item(\%myconfig, \%$form);
       $mode = 'IR';
     }
@@ -1794,9 +1794,8 @@ sub sales_order {
   my $locale   = $main::locale;
 
   check_oe_access();
-
-  $form->mtime_ischanged('oe');
   $main::auth->assert('sales_order_edit');
+  $form->mtime_ischanged('oe');
 
   if ($form->{type} eq "purchase_order") {
     delete($form->{ordnumber});
@@ -1944,7 +1943,6 @@ sub e_mail {
   $main::lxdebug->enter_sub();
 
   my $form     = $main::form;
-  my $locale   = $main::locale;
 
   check_oe_access();