projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pricegruppen in Verkaufsrechnungen anzeigen.
[kivitendo-erp.git]
/
bin
/
mozilla
/
rc.pl
diff --git
a/bin/mozilla/rc.pl
b/bin/mozilla/rc.pl
index
3d93be7
..
df360ad
100644
(file)
--- a/
bin/mozilla/rc.pl
+++ b/
bin/mozilla/rc.pl
@@
-33,25
+33,38
@@
use SL::RC;
use SL::RC;
+require "bin/mozilla/common.pl";
+
+use strict;
+
1;
# end of main
sub reconciliation {
1;
# end of main
sub reconciliation {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
+ $main::auth->assert('cash');
RC->paymentaccounts(\%myconfig, \%$form);
RC->paymentaccounts(\%myconfig, \%$form);
- $selection = "";
+
my
$selection = "";
map { $selection .= "<option>$_->{accno}--$_->{description}\n" }
@{ $form->{PR} };
$form->{title} = $locale->text('Reconciliation');
map { $selection .= "<option>$_->{accno}--$_->{description}\n" }
@{ $form->{PR} };
$form->{title} = $locale->text('Reconciliation');
-
+ $form->{javascript} .= qq|<script type="text/javascript" src="js/common.js"></script>|;
+ $form->{"jsscript"} = 1;
$form->header;
$form->header;
+ my $onload = qq|focus()|;
+ $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|;
print qq|
print qq|
-<body>
+<body
onLoad="$onload"
>
<form method=post action=$form->{script}>
<form method=post action=$form->{script}>
@@
-70,9
+83,11
@@
sub reconciliation {
</tr>
<tr>
<th align=right>| . $locale->text('From') . qq|</th>
</tr>
<tr>
<th align=right>| . $locale->text('From') . qq|</th>
- <td><input name=fromdate 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>
<th align=right>| . $locale->text('Until') . qq|</th>
- <td><input name=todate size=11 title="$myconfig{dateformat}"></td>
+ <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>
</td>
@@
-82,13
+97,13
@@
sub reconciliation {
</tr>
</table>
</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>
<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|">
<input type=submit class=submit name=action value="|
. $locale->text('Continue') . qq|">
@@
-98,13
+113,18
@@
sub reconciliation {
</html>
|;
</html>
|;
- $lxdebug->leave_sub();
+ $
main::
lxdebug->leave_sub();
}
}
-sub continue {
&{ $form->{nextsub} }
}
+sub continue {
call_sub($main::form->{"nextsub"});
}
sub get_payments {
sub get_payments {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ $main::auth->assert('cash');
($form->{accno}, $form->{account}) = split /--/, $form->{accno};
($form->{accno}, $form->{account}) = split /--/, $form->{accno};
@@
-112,14
+132,20
@@
sub get_payments {
&display_form;
&display_form;
- $lxdebug->leave_sub();
+ $
main::
lxdebug->leave_sub();
}
sub display_form {
}
sub display_form {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
-
@column_index = qw(cleared transdate source name credit debit balance
);
+
$main::auth->assert('cash'
);
+ my @column_index = qw(cleared transdate source name credit debit balance);
+ my %column_header;
$column_header{cleared} = "<th> </th>";
$column_header{source} =
"<th class=listheading>" . $locale->text('Source') . "</a></th>";
$column_header{cleared} = "<th> </th>";
$column_header{source} =
"<th class=listheading>" . $locale->text('Source') . "</a></th>";
@@
-143,6
+169,7
@@
sub display_form {
$column_header{balance} =
"<th class=listheading>" . $locale->text('Balance') . "</a></th>";
$column_header{balance} =
"<th class=listheading>" . $locale->text('Balance') . "</a></th>";
+ my $option;
if ($form->{fromdate}) {
$option .= "\n<br>" if ($option);
$option .=
if ($form->{fromdate}) {
$option .= "\n<br>" if ($option);
$option .=
@@
-185,18
+212,20
@@
sub display_form {
</tr>
|;
</tr>
|;
- $ml = ($form->{category} eq 'A') ? -1 : 1;
+
my
$ml = ($form->{category} eq 'A') ? -1 : 1;
$form->{beginningbalance} *= $ml;
$form->{beginningbalance} *= $ml;
- $clearedbalance = $balance = $form->{beginningbalance};
- $i = 0;
- $id = 0;
+ my $balance = $form->{beginningbalance};
+ my $clearedbalance = $balance;
+ my $i = 0;
+ my $id = 0;
+ my %column_data;
map { $column_data{$_} = "<td> </td>" }
qw(cleared transdate source name debit credit);
$column_data{balance} =
"<td align=right>"
. $form->format_amount(\%myconfig, $balance, 2, 0) . "</td>";
map { $column_data{$_} = "<td> </td>" }
qw(cleared transdate source name debit credit);
$column_data{balance} =
"<td align=right>"
. $form->format_amount(\%myconfig, $balance, 2, 0) . "</td>";
- $j = 0;
+
my
$j = 0;
print qq|
<tr class=listrow$j>
|;
print qq|
<tr class=listrow$j>
|;
@@
-207,7
+236,12
@@
sub display_form {
</tr>
|;
</tr>
|;
- foreach $ref (@{ $form->{PR} }) {
+ my $cleared;
+ my $totaldebits;
+ my $totalcredits;
+ my $fx_transaction;
+ my $fx;
+ foreach my $ref (@{ $form->{PR} }) {
$balance += $ref->{amount} * $ml;
$cleared += $ref->{amount} * $ml if $ref->{cleared};
$balance += $ref->{amount} * $ml;
$cleared += $ref->{amount} * $ml if $ref->{cleared};
@@
-287,7
+321,7
@@
sub display_form {
$form->{statementbalance} =
$form->parse_amount(\%myconfig, $form->{statementbalance});
$form->{statementbalance} =
$form->parse_amount(\%myconfig, $form->{statementbalance});
- $difference =
+
my
$difference =
$form->format_amount(\%myconfig,
$form->{statementbalance} - $clearedbalance - $cleared,
2, 0);
$form->format_amount(\%myconfig,
$form->{statementbalance} - $clearedbalance - $cleared,
2, 0);
@@
-297,6
+331,7
@@
sub display_form {
$clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0);
$clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0);
+ my $exchdiff;
if ($fx) {
$fx = $form->format_amount(\%myconfig, $fx, 2, 0);
$exchdiff = qq|
if ($fx) {
$fx = $form->format_amount(\%myconfig, $fx, 2, 0);
$exchdiff = qq|
@@
-359,39
+394,35
@@
sub display_form {
<input type=hidden name=fromdate value=$form->{fromdate}>
<input type=hidden name=todate value=$form->{todate}>
<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="|
<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>
</html>
|;
</form>
</body>
</html>
|;
- $lxdebug->leave_sub();
+ $
main::
lxdebug->leave_sub();
}
sub update {
}
sub update {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ $main::auth->assert('cash');
RC->payment_transactions(\%myconfig, \%$form);
RC->payment_transactions(\%myconfig, \%$form);
- foreach $ref (@{ $form->{PR} }) {
+ my $i;
+ foreach my $ref (@{ $form->{PR} }) {
if (!$ref->{fx_transaction}) {
$i++;
$ref->{cleared} = ($form->{"cleared_$i"}) ? "checked" : "";
if (!$ref->{fx_transaction}) {
$i++;
$ref->{cleared} = ($form->{"cleared_$i"}) ? "checked" : "";
@@
-400,11
+431,16
@@
sub update {
&display_form;
&display_form;
- $lxdebug->leave_sub();
+ $
main::
lxdebug->leave_sub();
}
sub select_all {
}
sub select_all {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+
+ $main::auth->assert('cash');
RC->payment_transactions(\%myconfig, \%$form);
RC->payment_transactions(\%myconfig, \%$form);
@@
-413,20
+449,25
@@
sub select_all {
&display_form;
&display_form;
- $lxdebug->leave_sub();
+ $
main::
lxdebug->leave_sub();
}
sub done {
}
sub done {
- $lxdebug->enter_sub();
+ $main::lxdebug->enter_sub();
+
+ my $form = $main::form;
+ my %myconfig = %main::myconfig;
+ my $locale = $main::locale;
+
+ $main::auth->assert('cash');
- $form->{callback} =
- "$form->{script}?path=$form->{path}&action=reconciliation&login=$form->{login}&password=$form->{password}";
+ $form->{callback} = "$form->{script}?action=reconciliation";
$form->error($locale->text('Out of balance!')) if ($form->{difference} *= 1);
RC->reconcile(\%myconfig, \%$form);
$form->redirect;
$form->error($locale->text('Out of balance!')) if ($form->{difference} *= 1);
RC->reconcile(\%myconfig, \%$form);
$form->redirect;
- $lxdebug->leave_sub();
+ $
main::
lxdebug->leave_sub();
}
}