From 590bb2353295daa2eaa72b0fbe8ca2cc246a5860 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 20 Sep 2011 11:53:41 +0200 Subject: [PATCH] =?utf8?q?Den=20Rest=20von=20rc.pl=20auch=20noch=20aufger?= =?utf8?q?=C3=A4umt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - select_all funktion durch checkall jquery ersetzt - update gefixt. --- bin/mozilla/rc.pl | 78 ++++++++++---------------------- templates/webpages/rc/step2.html | 6 +-- 2 files changed, 26 insertions(+), 58 deletions(-) diff --git a/bin/mozilla/rc.pl b/bin/mozilla/rc.pl index e07829528..7d4245bfe 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,34 @@ sub display_form { } sub update { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('cash'); + $::lxdebug->enter_sub; + $::auth->assert('cash'); - 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(); - - 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; + 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; } diff --git a/templates/webpages/rc/step2.html b/templates/webpages/rc/step2.html index 75ec83cae..b292f85a5 100644 --- a/templates/webpages/rc/step2.html +++ b/templates/webpages/rc/step2.html @@ -2,6 +2,7 @@ [%- USE L %] [%- USE T8 %] [%- USE LxERP %] +[%- L.javascript_tag('jquery.checkall') %]

[% accno | html %]--[% account | html %]

@@ -12,7 +13,7 @@ - + @@ -40,7 +41,7 @@ [%- IF row.fx_transaction %] [% L.hidden_tag('fxoid_' _ row.i, row.oid) %] [%- ELSE %] - [% L.checkbox_tag('cleared_' _ row.i, checked=row.cleared) %] + [% L.checkbox_tag('cleared_' _ row.i, class='checkall', checked=row.cleared) %] [% L.hidden_tag('oid_' _ row.i, row.oid) %] [%- END %] @@ -111,7 +112,6 @@
- -- 2.20.1
 [% L.checkbox_tag('checkall_checkboxes', checkall='input.checkall') %] [% 'Date' | $T8 %] [% 'Source' | $T8 %] [% 'Description' | $T8 %]