]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/is.pl
new precision to round the total amount of sales invoices
[mfinanz.git] / bin / mozilla / is.pl
index 41d7e31571fdc4f69f899787325c082a5ba05adc..fdcf5e1c4ffb9273d208c307d6acfa728c3efce8 100644 (file)
@@ -292,6 +292,10 @@ sub form_header {
   my %TMPL_VAR = ();
   my @custom_hiddens;
 
+  if ($form->{id}) {
+    require SL::DB::Invoice;
+    $TMPL_VAR{invoice_obj} = SL::DB::Invoice->new(id => $form->{id})->load;
+  }
   $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
   $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
 
@@ -458,6 +462,7 @@ sub form_footer {
       }
     }
   }
+  $form->{invtotal} = $form->round_amount($form->{invtotal}, 2, 1);
 
   # follow ups
   if ($form->{id}) {
@@ -678,6 +683,7 @@ sub post_payment {
 
   $main::auth->assert('invoice_edit');
 
+  $form->mtime_ischanged('ar') ;
   my $invdate = $form->datetonum($form->{invdate}, \%myconfig);
 
   $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
@@ -733,6 +739,7 @@ sub post {
   my $locale   = $main::locale;
 
   $main::auth->assert('invoice_edit');
+  $form->mtime_ischanged('ar');
 
   $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
   $form->isblank("invdate",  $locale->text('Invoice Date missing!'));