X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frc.pl;h=df360adeeb2ec2544e74471f20ffed08c20a2871;hb=fe73e0d261229f181e8133283b530509773d2151;hp=09a830a1d21c20e0c9aa7fe962921424913e1ec2;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/bin/mozilla/rc.pl b/bin/mozilla/rc.pl index 09a830a1d..df360adee 100644 --- a/bin/mozilla/rc.pl +++ b/bin/mozilla/rc.pl @@ -31,28 +31,40 @@ # #====================================================================== - use SL::RC; +require "bin/mozilla/common.pl"; + +use strict; 1; -# end of main +# 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); - $selection = ""; - map { $selection .= "$_->{accno}--$_->{description}\n" } @{ $form->{PR} }; + my $selection = ""; + map { $selection .= "$_->{accno}--$_->{description}\n" } + @{ $form->{PR} }; $form->{title} = $locale->text('Reconciliation'); - + $form->{javascript} .= qq||; + $form->{"jsscript"} = 1; $form->header; + my $onload = qq|focus()|; + $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; print qq| - + {script}> @@ -65,15 +77,17 @@ sub reconciliation { - |.$locale->text('Account').qq| + | . $locale->text('Account') . qq| $selection - |.$locale->text('From').qq| - - |.$locale->text('To').qq| - + | . $locale->text('From') . qq| + + + | . $locale->text('Until') . qq| + + @@ -83,14 +97,15 @@ sub reconciliation { +| . $form->write_trigger(\%myconfig, 2, + "fromdate", "BL", "trigger_fromdate", + "todate", "BL", "trigger_todate") . qq| + -{path}> -{login}> -{password}> - - + @@ -98,57 +113,78 @@ sub reconciliation { |; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } +sub continue { call_sub($main::form->{"nextsub"}); } -sub continue { &{ $form->{nextsub} } }; +sub get_payments { + $main::lxdebug->enter_sub(); + my $form = $main::form; + my %myconfig = %main::myconfig; -sub get_payments { - $lxdebug->enter_sub(); + $main::auth->assert('cash'); ($form->{accno}, $form->{account}) = split /--/, $form->{accno}; RC->payment_transactions(\%myconfig, \%$form); - + &display_form; - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } - sub display_form { - $lxdebug->enter_sub(); - - @column_index = qw(cleared transdate source name credit debit balance); - + $main::lxdebug->enter_sub(); + + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + + $main::auth->assert('cash'); + + my @column_index = qw(cleared transdate source name credit debit balance); + my %column_header; $column_header{cleared} = " "; - $column_header{source} = "".$locale->text('Source').""; - $column_header{name} = "".$locale->text('Description').""; - $column_header{transdate} = "".$locale->text('Date').""; + $column_header{source} = + "" . $locale->text('Source') . ""; + $column_header{name} = + "" . $locale->text('Description') . ""; + $column_header{transdate} = + "" . $locale->text('Date') . ""; if ($form->{category} eq 'A') { - $column_header{debit} = "".$locale->text('Deposit').""; - $column_header{credit} = "".$locale->text('Payment').""; + $column_header{debit} = + "" . $locale->text('Deposit') . ""; + $column_header{credit} = + "" . $locale->text('Payment') . ""; } else { - $column_header{debit} = "".$locale->text('Decrease').""; - $column_header{credit} = "".$locale->text('Increase').""; + $column_header{debit} = + "" . $locale->text('Decrease') . ""; + $column_header{credit} = + "" . $locale->text('Increase') . ""; } - $column_header{balance} = "".$locale->text('Balance').""; + $column_header{balance} = + "" . $locale->text('Balance') . ""; + my $option; if ($form->{fromdate}) { $option .= "\n" if ($option); - $option .= $locale->text('From')." ".$locale->date(\%myconfig, $form->{fromdate}, 1); + $option .= + $locale->text('From') . " " + . $locale->date(\%myconfig, $form->{fromdate}, 0); } if ($form->{todate}) { $option .= "\n" if ($option); - $option .= $locale->text('To')." ".$locale->date(\%myconfig, $form->{todate}, 1); + $option .= + $locale->text('Until') . " " + . $locale->date(\%myconfig, $form->{todate}, 0); } $form->{title} = "$form->{accno}--$form->{account}"; - + $form->header; print qq| @@ -176,15 +212,20 @@ sub display_form { |; - $ml = ($form->{category} eq 'A') ? -1 : 1; + my $ml = ($form->{category} eq 'A') ? -1 : 1; $form->{beginningbalance} *= $ml; - $clearedbalance = $balance = $form->{beginningbalance}; - $i = 0; - $id = 0; - - map { $column_data{$_} = " " } qw(cleared transdate source name debit credit); - $column_data{balance} = "".$form->format_amount(\%myconfig, $balance, 2, 0).""; - $j = 0; + my $balance = $form->{beginningbalance}; + my $clearedbalance = $balance; + my $i = 0; + my $id = 0; + + my %column_data; + map { $column_data{$_} = " " } + qw(cleared transdate source name debit credit); + $column_data{balance} = + "" + . $form->format_amount(\%myconfig, $balance, 2, 0) . ""; + my $j = 0; print qq| |; @@ -195,29 +236,41 @@ sub display_form { |; - - 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}; - $column_data{name} = "$ref->{name} "; + $column_data{name} = "$ref->{name} "; $column_data{source} = qq|$ref->{source} |; $column_data{transdate} = "$ref->{transdate} "; - - $column_data{debit} = " "; + + $column_data{debit} = " "; $column_data{credit} = " "; - + if ($ref->{amount} < 0) { $totaldebits += $ref->{amount} * -1; - $column_data{debit} = "".$form->format_amount(\%myconfig, $ref->{amount} * -1, 2, " ").""; + $column_data{debit} = + "" + . $form->format_amount(\%myconfig, $ref->{amount} * -1, 2, " ") + . ""; } else { $totalcredits += $ref->{amount}; - $column_data{credit} = "".$form->format_amount(\%myconfig, $ref->{amount}, 2, " ").""; + $column_data{credit} = + "" + . $form->format_amount(\%myconfig, $ref->{amount}, 2, " ") + . ""; } - - $column_data{balance} = "".$form->format_amount(\%myconfig, $balance, 2, 0).""; + + $column_data{balance} = + "" + . $form->format_amount(\%myconfig, $balance, 2, 0) . ""; if ($ref->{fx_transaction}) { $i++ unless $id == $ref->{id}; @@ -236,7 +289,8 @@ sub display_form { } $id = $ref->{id}; - $j++; $j %= 2; + $j++; + $j %= 2; print qq| |; @@ -252,26 +306,37 @@ sub display_form { # print totals map { $column_data{$_} = " " } @column_index; - $column_data{debit} = "".$form->format_amount(\%myconfig, $totaldebits, 2, " ").""; - $column_data{credit} = "".$form->format_amount(\%myconfig, $totalcredits, 2, " ").""; - + $column_data{debit} = + "" + . $form->format_amount(\%myconfig, $totaldebits, 2, " ") . ""; + $column_data{credit} = + "" + . $form->format_amount(\%myconfig, $totalcredits, 2, " ") . ""; + print qq| |; map { print "\n$column_data{$_}" } @column_index; - $form->{statementbalance} = $form->parse_amount(\%myconfig, $form->{statementbalance}); - $difference = $form->format_amount(\%myconfig, $form->{statementbalance} - $clearedbalance - $cleared, 2, 0); - - $form->{statementbalance} = $form->format_amount(\%myconfig, $form->{statementbalance}, 2, 0); + $form->{statementbalance} = + $form->parse_amount(\%myconfig, $form->{statementbalance}); + my $difference = + $form->format_amount(\%myconfig, + $form->{statementbalance} - $clearedbalance - $cleared, + 2, 0); + + $form->{statementbalance} = + $form->format_amount(\%myconfig, $form->{statementbalance}, 2, 0); $clearedbalance = $form->format_amount(\%myconfig, $clearedbalance, 2, 0); - + + my $exchdiff; if ($fx) { - $fx = $form->format_amount(\%myconfig, $fx, 2, 0); + $fx = $form->format_amount(\%myconfig, $fx, 2, 0); $exchdiff = qq| - |.$locale->text('Exchangerate Difference').qq| + | + . $locale->text('Exchangerate Difference') . qq| $fx |; @@ -289,7 +354,7 @@ sub display_form { - |.$locale->text('Cleared Balance').qq| + | . $locale->text('Cleared Balance') . qq| $clearedbalance @@ -301,12 +366,12 @@ sub display_form { - |.$locale->text('Statement Balance').qq| + | . $locale->text('Statement Balance') . qq| {statementbalance}> - |.$locale->text('Difference').qq| + | . $locale->text('Difference') . qq| @@ -329,37 +394,35 @@ sub display_form { {fromdate}> {todate}> -{path}> -{login}> -{password}> - - - -|; - - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } + + + - print qq|