]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Form.pm
und die restlichen .pm Module.
[mfinanz.git] / SL / Form.pm
index d5bb9c3d3a19ddeab86e565e06cd302f5ef3a905..17273ec5023ad76358e6064dec30bc8027ae06b2 100644 (file)
@@ -37,8 +37,6 @@
 
 package Form;
 
-#use strict;
-
 use Data::Dumper;
 
 use CGI;
@@ -59,6 +57,8 @@ use Template;
 use List::Util qw(first max min sum);
 use List::MoreUtils qw(any);
 
+use strict;
+
 my $standard_dbh;
 
 END {
@@ -314,7 +314,7 @@ sub new {
       _recode_recursively($iconv, $self);
     }
 
-    delete $self{INPUT_ENCODING};
+    delete $self->{INPUT_ENCODING};
   }
 
   $self->{action}  =  lc $self->{action};
@@ -674,13 +674,22 @@ sub header {
                         </style>|;
     }
 
-    my $fokus = qq|  document.$self->{fokus}.focus();| if ($self->{"fokus"});
+    my $fokus = qq|
+    <script type="text/javascript">
+    <!--
+      function fokus() {
+        document.$self->{fokus}.focus();
+      }
+    //-->
+    </script>
+    | if $self->{"fokus"};
 
     #Set Calendar
     my $jsscript = "";
     if ($self->{jsscript} == 1) {
 
       $jsscript = qq|
+        <script type="text/javascript" src="js/jquery.js"></script>
         <script type="text/javascript" src="js/common.js"></script>
         <style type="text/css">\@import url(js/jscalendar/calendar-win2k-1.css);</style>
         <script type="text/javascript" src="js/jscalendar/calendar.js"></script>
@@ -711,13 +720,7 @@ sub header {
   $jsscript
   $ajax
 
-  <script type="text/javascript">
-  <!--
-    function focus() {
-      $fokus
-    }
-  //-->
-  </script>
+  $fokus
 
   <meta name="robots" content="noindex,nofollow" />
   <script type="text/javascript" src="js/highlight_input.js"></script>
@@ -1585,7 +1588,7 @@ sub get_standard_dbh {
   my ($self, $myconfig) = @_;
 
   if ($standard_dbh && !$standard_dbh->{Active}) {
-    $main::lxdebug->message(LXDebug::INFO, "get_standard_dbh: \$standard_dbh is defined but not Active anymore");
+    $main::lxdebug->message(LXDebug->INFO(), "get_standard_dbh: \$standard_dbh is defined but not Active anymore");
     undef $standard_dbh;
   }
 
@@ -2065,11 +2068,11 @@ sub get_duedate {
 
   my ($self, $myconfig, $reference_date) = @_;
 
-  my $reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date';
+  $reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date';
 
-  my $dbh            = $self->get_standard_dbh($myconfig);
-  my $query          = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|;
-  my ($duedate)      = selectrow_query($self, $dbh, $query, $self->{payment_id});
+  my $dbh         = $self->get_standard_dbh($myconfig);
+  my $query       = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|;
+  my ($duedate)   = selectrow_query($self, $dbh, $query, $self->{payment_id});
 
   $main::lxdebug->leave_sub();
 
@@ -2196,7 +2199,7 @@ sub _get_charts {
   my $transdate = quote_db_date($params->{transdate});
 
   my $query =
-    qq|SELECT c.id, c.accno, c.description, c.link, tk.taxkey_id, tk.tax_id | .
+    qq|SELECT c.id, c.accno, c.description, c.link, c.charttype, tk.taxkey_id, tk.tax_id | .
     qq|FROM chart c | .
     qq|LEFT JOIN taxkeys tk ON | .
     qq|(tk.id = (SELECT id FROM taxkeys | .