X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Frc.pl;h=4df612cc57ad353a70d0230d29fb5184402512d9;hb=2d6988532a665bd7e42bb88a38a8b52cbb352646;hp=09a830a1d21c20e0c9aa7fe962921424913e1ec2;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git diff --git a/bin/mozilla/rc.pl b/bin/mozilla/rc.pl index 09a830a1d..4df612cc5 100644 --- a/bin/mozilla/rc.pl +++ b/bin/mozilla/rc.pl @@ -31,28 +31,32 @@ # #====================================================================== - use SL::RC; +require "bin/mozilla/common.pl"; 1; -# end of main +# end of main sub reconciliation { $lxdebug->enter_sub(); - + RC->paymentaccounts(\%myconfig, \%$form); $selection = ""; - map { $selection .= "$_->{accno}--$_->{description}\n" } @{ $form->{PR} }; + map { $selection .= "$_->{accno}--$_->{description}\n" } + @{ $form->{PR} }; $form->{title} = $locale->text('Reconciliation'); - + $form->{javascript} .= qq||; + $form->{"jsscript"} = 1; $form->header; + $onload = qq|focus()|; + $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; print qq| - + {script}> @@ -65,15 +69,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 +89,18 @@ sub reconciliation { +| . $form->write_trigger(\%myconfig, 2, + "fromdate", "BL", "trigger_fromdate", + "todate", "BL", "trigger_todate") . qq| + -{path}> {login}> {password}> - + @@ -101,9 +111,7 @@ sub reconciliation { $lxdebug->leave_sub(); } - -sub continue { &{ $form->{nextsub} } }; - +sub continue { call_sub($form->{"nextsub"}); } sub get_payments { $lxdebug->enter_sub(); @@ -111,44 +119,55 @@ sub get_payments { ($form->{accno}, $form->{account}) = split /--/, $form->{accno}; RC->payment_transactions(\%myconfig, \%$form); - + &display_form; $lxdebug->leave_sub(); } - sub display_form { $lxdebug->enter_sub(); - + @column_index = qw(cleared transdate source name credit debit balance); - + $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') . ""; 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| @@ -179,11 +198,14 @@ sub display_form { $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).""; + $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; print qq| @@ -195,29 +217,36 @@ sub display_form { |; - foreach $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 +265,8 @@ sub display_form { } $id = $ref->{id}; - $j++; $j %= 2; + $j++; + $j %= 2; print qq| |; @@ -252,26 +282,36 @@ 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}); + $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); - + 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 +329,7 @@ sub display_form { - |.$locale->text('Cleared Balance').qq| + | . $locale->text('Cleared Balance') . qq| $clearedbalance @@ -301,12 +341,12 @@ sub display_form { - |.$locale->text('Statement Balance').qq| + | . $locale->text('Statement Balance') . qq| {statementbalance}> - |.$locale->text('Difference').qq| + | . $locale->text('Difference') . qq| @@ -329,21 +369,17 @@ sub display_form { {fromdate}> {todate}> -{path}> {login}> {password}> - - -|; + + + - if ($form->{menubar}) { - require "$form->{path}/menu.pl"; - &menubar; - } - - print qq| @@ -353,10 +389,9 @@ sub display_form { $lxdebug->leave_sub(); } - sub update { $lxdebug->enter_sub(); - + RC->payment_transactions(\%myconfig, \%$form); foreach $ref (@{ $form->{PR} }) { @@ -367,35 +402,34 @@ sub update { } &display_form; - + $lxdebug->leave_sub(); } - sub select_all { $lxdebug->enter_sub(); - + RC->payment_transactions(\%myconfig, \%$form); - map { $_->{cleared} = "checked" unless $_->{fx_transaction} } @{ $form->{PR} }; + map { $_->{cleared} = "checked" unless $_->{fx_transaction} } + @{ $form->{PR} }; &display_form; - + $lxdebug->leave_sub(); } - sub done { $lxdebug->enter_sub(); - $form->{callback} = "$form->{script}?path=$form->{path}&action=reconciliation&login=$form->{login}&password=$form->{password}"; + $form->{callback} = + "$form->{script}?action=reconciliation&login=$form->{login}&password=$form->{password}"; $form->error($locale->text('Out of balance!')) if ($form->{difference} *= 1); RC->reconcile(\%myconfig, \%$form); $form->redirect; - + $lxdebug->leave_sub(); } -