Jahresberechnung
[kivitendo-erp.git] / bin / mozilla / rp.pl
index 152db95..56e7f49 100644 (file)
@@ -110,9 +110,7 @@ sub report {
   $accrual = ($eur) ? ""        : "checked";
   $cash    = ($eur) ? "checked" : "";
 
-  ($null, $null, $null, $null, $null, $year, $null, $null, $null) =
-    localtime();
-  $year += 1900;
+  $year = (localtime)[5] + 1900;
 
   # get departments
   $form->all_departments(\%myconfig);
@@ -200,7 +198,7 @@ sub report {
     if ($name_1 eq "") {
 
       $button1 = qq|
-         <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
+         <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
       $button1_2 = qq|
         <input type=button name=$name_2 id="$trigger_2" value=|
         . $locale->text('button') . qq|>|;
@@ -210,12 +208,12 @@ sub report {
         Form->write_trigger(\%myconfig, "1", "$name_2", "BR", "$trigger_2");
     } else {
       $button1 = qq|
-         <input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value=$value_1>|;
+         <input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value="$value_1" onBlur=\"check_right_date_format(this)\">|;
       $button1_2 = qq|
         <input type=button name=$name_1 id="$trigger_1" value=|
         . $locale->text('button') . qq|>|;
       $button2 = qq|
-         <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
+         <input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
       $button2_2 = qq|
          <input type=button name=$name_2 id="$trigger_2" value=|
         . $locale->text('button') . qq|>
@@ -231,19 +229,21 @@ sub report {
     # without JavaScript Calendar
     if ($name_1 eq "") {
       $button1 =
-        qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
+        qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
     } else {
       $button1 =
-        qq|<input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value=$value_1>|;
+        qq|<input name=$name_1 id=$id_1 size=11 title="$myconfig{dateformat}" value=$value_1 onBlur=\"check_right_date_format(this)\">|;
       $button2 =
-        qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}">|;
+        qq|<input name=$name_2 id=$id_2 size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">|;
     }
   }
-
+  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
   $form->header;
-
+  $onload = qq|focus()|;
+  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
+  $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|;
   print qq|
-<body>
+<body onLoad="$onload">
 
 <form method=post action=$form->{script}>
 
@@ -1012,7 +1012,7 @@ $jsscript
   $lxdebug->leave_sub();
 }
 
-sub continue { &{ $form->{nextsub} } }
+sub continue { call_sub($form->{"nextsub"}); }
 
 sub get_project {
   $lxdebug->enter_sub();
@@ -2099,6 +2099,7 @@ sub print_form {
   }
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
+    $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
        $form->{addition} = "PRINTED";
        $form->{what_done} = $form->{type};
        $form->save_history($form->dbconnect(\%myconfig));