use SL::RC;
+require "bin/mozilla/common.pl";
+
1;
# end of main
sub reconciliation {
$lxdebug->enter_sub();
+ $auth->assert('cash');
+
RC->paymentaccounts(\%myconfig, \%$form);
$selection = "";
@{ $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}>
</tr>
<tr>
<th align=right>| . $locale->text('From') . qq|</th>
- <td><input name=fromdate size=11 title="$myconfig{dateformat}"></td>
- <th align=right>| . $locale->text('To') . qq|</th>
- <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ <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}" onBlur=\"check_right_date_format(this)\">
+ <input type="button" name="todate" id="trigger_todate" value="?"></td>
</tr>
</table>
</td>
</tr>
</table>
+| . $form->write_trigger(\%myconfig, 2,
+ "fromdate", "BL", "trigger_fromdate",
+ "todate", "BL", "trigger_todate") . qq|
+
<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|">
$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);
sub display_form {
$lxdebug->enter_sub();
+ $auth->assert('cash');
+
@column_index = qw(cleared transdate source name credit debit balance);
$column_header{cleared} = "<th> </th>";
$option .= "\n<br>" if ($option);
$option .=
$locale->text('From') . " "
- . $locale->date(\%myconfig, $form->{fromdate}, 1);
+ . $locale->date(\%myconfig, $form->{fromdate}, 0);
}
if ($form->{todate}) {
$option .= "\n<br>" if ($option);
$option .=
- $locale->text('To') . " "
- . $locale->date(\%myconfig, $form->{todate}, 1);
+ $locale->text('Until') . " "
+ . $locale->date(\%myconfig, $form->{todate}, 0);
}
$form->{title} = "$form->{accno}--$form->{account}";
$clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0);
if ($fx) {
- $fx = $form->format_amount(\%myconfig, $fx, 2, 0);
+ $fx = $form->format_amount(\%myconfig, $fx, 2, 0);
$exchdiff = qq|
<th align=right nowrap>|
- . $locale->text('Exchangerate Difference')
- . qq|</th>
+ . $locale->text('Exchangerate Difference') . qq|</th>
<td width=10%></td>
<td align=right>$fx</td>
|;
<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>
sub update {
$lxdebug->enter_sub();
+ $auth->assert('cash');
+
RC->payment_transactions(\%myconfig, \%$form);
foreach $ref (@{ $form->{PR} }) {
sub select_all {
$lxdebug->enter_sub();
+ $auth->assert('cash');
+
RC->payment_transactions(\%myconfig, \%$form);
map { $_->{cleared} = "checked" unless $_->{fx_transaction} }
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);