X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Frc.pl;h=f1aeb47f29e06709896567a8b2e660b2928cf670;hb=7e19c2165ee3b934f4e685b256bb3a261d59a915;hp=e078295283d87909ba84592752dd6658ba734756;hpb=da6943d46ec5b1aee6e69f928ac6f1417166e5ce;p=kivitendo-erp.git diff --git a/bin/mozilla/rc.pl b/bin/mozilla/rc.pl index e07829528..f1aeb47f2 100644 --- a/bin/mozilla/rc.pl +++ b/bin/mozilla/rc.pl @@ -55,23 +55,19 @@ sub reconciliation { $::lxdebug->leave_sub; } -sub continue { call_sub($main::form->{"nextsub"}); } +sub continue { call_sub($::form->{"nextsub"}); } sub get_payments { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('cash'); + $::lxdebug->enter_sub; + $::auth->assert('cash'); - ($form->{accno}, $form->{account}) = split /--/, $form->{accno}; + ($::form->{accno}, $::form->{account}) = split /--/, $::form->{accno}; - RC->payment_transactions(\%myconfig, \%$form); + RC->payment_transactions(\%::myconfig, $::form); - &display_form; + display_form(); - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub display_form { @@ -129,62 +125,37 @@ sub display_form { } sub update { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; + $::lxdebug->enter_sub; + $::auth->assert('cash'); - $main::auth->assert('cash'); + # reset difference as it doesn't always arrive here empty + $::form->{difference} = 0; - RC->payment_transactions(\%myconfig, \%$form); + RC->payment_transactions(\%::myconfig, $::form); my $i; - foreach my $ref (@{ $form->{PR} }) { - if (!$ref->{fx_transaction}) { - $i++; - $ref->{cleared} = ($form->{"cleared_$i"}) ? "checked" : ""; - } + for my $ref (@{ $::form->{PR} }) { + next if $ref->{fx_transaction}; + $i++; + $ref->{cleared} = $::form->{"cleared_$i"}; } - &display_form; - - $main::lxdebug->leave_sub(); -} - -sub select_all { - $main::lxdebug->enter_sub(); + display_form(); - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('cash'); - - RC->payment_transactions(\%myconfig, \%$form); - - map { $_->{cleared} = "checked" unless $_->{fx_transaction} } - @{ $form->{PR} }; - - &display_form; - - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub done { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('cash'); + $::lxdebug->enter_sub; + $::auth->assert('cash'); - $form->{callback} = "$form->{script}?action=reconciliation"; + $::form->{callback} = "$::form->{script}?action=reconciliation"; - $form->error($locale->text('Out of balance!')) if ($form->{difference} *= 1); + $::form->error($::locale->text('Out of balance!')) if $::form->{difference} *= 1; - RC->reconcile(\%myconfig, \%$form); - $form->redirect; + RC->reconcile(\%::myconfig, $::form); + $::form->redirect; - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; }