Beim Anlegen von Wiedervorlagen die Kunden- bzw. Lieferanten-ID nicht mit als Referen...
[kivitendo-erp.git] / bin / mozilla / rc.pl
index ed87581..4734433 100644 (file)
@@ -33,6 +33,8 @@
 
 use SL::RC;
 
+require "bin/mozilla/common.pl";
+
 1;
 
 # end of main
@@ -40,6 +42,8 @@ use SL::RC;
 sub reconciliation {
   $lxdebug->enter_sub();
 
+  $auth->assert('cash');
+
   RC->paymentaccounts(\%myconfig, \%$form);
 
   $selection = "";
@@ -47,12 +51,14 @@ sub reconciliation {
     @{ $form->{PR} };
 
   $form->{title} = $locale->text('Reconciliation');
-
+  $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
   $form->{"jsscript"} = 1;
   $form->header;
+  $onload = qq|focus()|;
+  $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
 
   print qq|
-<body>
+<body onLoad="$onload">
 
 <form method=post action=$form->{script}>
 
@@ -71,10 +77,10 @@ sub reconciliation {
        </tr>
        <tr>
          <th align=right>| . $locale->text('From') . qq|</th>
-         <td><input name=fromdate id=fromdate size=11 title="$myconfig{dateformat}">
+         <td><input name=fromdate id=fromdate size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
      <input type="button" name="fromdate" id="trigger_fromdate" value="?"></td>
          <th align=right>| . $locale->text('Until') . qq|</th>
-         <td><input name=todate id=todate size=11 title="$myconfig{dateformat}">
+         <td><input name=todate id=todate size=11 title="$myconfig{dateformat}" onBlur=\"check_right_date_format(this)\">
      <input type="button" name="todate" id="trigger_todate" value="?"></td>
        </tr>
       </table>
@@ -92,10 +98,6 @@ sub reconciliation {
 <br>
 <input type=hidden name=nextsub value=get_payments>
 
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
 <input type=submit class=submit name=action value="|
     . $locale->text('Continue') . qq|">
 
@@ -108,11 +110,13 @@ sub reconciliation {
   $lxdebug->leave_sub();
 }
 
-sub continue { &{ $form->{nextsub} } }
+sub continue { call_sub($form->{"nextsub"}); }
 
 sub get_payments {
   $lxdebug->enter_sub();
 
+  $auth->assert('cash');
+
   ($form->{accno}, $form->{account}) = split /--/, $form->{accno};
 
   RC->payment_transactions(\%myconfig, \%$form);
@@ -125,6 +129,8 @@ sub get_payments {
 sub display_form {
   $lxdebug->enter_sub();
 
+  $auth->assert('cash');
+
   @column_index = qw(cleared transdate source name credit debit balance);
 
   $column_header{cleared} = "<th>&nbsp;</th>";
@@ -366,24 +372,14 @@ sub display_form {
 <input type=hidden name=fromdate value=$form->{fromdate}>
 <input type=hidden name=todate value=$form->{todate}>
 
-<input type=hidden name=path value=$form->{path}>
-<input type=hidden name=login value=$form->{login}>
-<input type=hidden name=password value=$form->{password}>
-
 <br>
 <input type=submit class=submit name=action value="|
     . $locale->text('Update') . qq|">
 <input type=submit class=submit name=action value="|
     . $locale->text('Select all') . qq|">
 <input type=submit class=submit name=action value="|
-    . $locale->text('Done') . qq|">|;
-
-  if ($form->{menubar}) {
-    require "$form->{path}/menu.pl";
-    &menubar;
-  }
+    . $locale->text('Done') . qq|">
 
-  print qq|
 </form>
 
 </body>
@@ -396,6 +392,8 @@ sub display_form {
 sub update {
   $lxdebug->enter_sub();
 
+  $auth->assert('cash');
+
   RC->payment_transactions(\%myconfig, \%$form);
 
   foreach $ref (@{ $form->{PR} }) {
@@ -413,6 +411,8 @@ sub update {
 sub select_all {
   $lxdebug->enter_sub();
 
+  $auth->assert('cash');
+
   RC->payment_transactions(\%myconfig, \%$form);
 
   map { $_->{cleared} = "checked" unless $_->{fx_transaction} }
@@ -426,8 +426,9 @@ sub select_all {
 sub done {
   $lxdebug->enter_sub();
 
-  $form->{callback} =
-    "$form->{script}?path=$form->{path}&action=reconciliation&login=$form->{login}&password=$form->{password}";
+  $auth->assert('cash');
+
+  $form->{callback} = "$form->{script}?action=reconciliation";
 
   $form->error($locale->text('Out of balance!')) if ($form->{difference} *= 1);