Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 590bb235

Von Sven Schöling vor etwa 13 Jahren hinzugefügt

  • ID 590bb2353295daa2eaa72b0fbe8ca2cc246a5860
  • Vorgänger da6943d4
  • Nachfolger 159556ca

Den Rest von rc.pl auch noch aufgeräumt.

- select_all funktion durch checkall jquery ersetzt
- update gefixt.

Unterschiede anzeigen:

bin/mozilla/rc.pl
55 55
  $::lxdebug->leave_sub;
56 56
}
57 57

  
58
sub continue { call_sub($main::form->{"nextsub"}); }
58
sub continue { call_sub($::form->{"nextsub"}); }
59 59

  
60 60
sub get_payments {
61
  $main::lxdebug->enter_sub();
62

  
63
  my $form     = $main::form;
64
  my %myconfig = %main::myconfig;
65

  
66
  $main::auth->assert('cash');
61
  $::lxdebug->enter_sub;
62
  $::auth->assert('cash');
67 63

  
68
  ($form->{accno}, $form->{account}) = split /--/, $form->{accno};
64
  ($::form->{accno}, $::form->{account}) = split /--/, $::form->{accno};
69 65

  
70
  RC->payment_transactions(\%myconfig, \%$form);
66
  RC->payment_transactions(\%::myconfig, $::form);
71 67

  
72
  &display_form;
68
  display_form();
73 69

  
74
  $main::lxdebug->leave_sub();
70
  $::lxdebug->leave_sub;
75 71
}
76 72

  
77 73
sub display_form {
......
129 125
}
130 126

  
131 127
sub update {
132
  $main::lxdebug->enter_sub();
133

  
134
  my $form     = $main::form;
135
  my %myconfig = %main::myconfig;
136

  
137
  $main::auth->assert('cash');
128
  $::lxdebug->enter_sub;
129
  $::auth->assert('cash');
138 130

  
139
  RC->payment_transactions(\%myconfig, \%$form);
131
  RC->payment_transactions(\%::myconfig, $::form);
140 132

  
141 133
  my $i;
142
  foreach my $ref (@{ $form->{PR} }) {
143
    if (!$ref->{fx_transaction}) {
144
      $i++;
145
      $ref->{cleared} = ($form->{"cleared_$i"}) ? "checked" : "";
146
    }
134
  for my $ref (@{ $::form->{PR} }) {
135
    next if $ref->{fx_transaction};
136
    $i++;
137
    $ref->{cleared} = $::form->{"cleared_$i"};
147 138
  }
148 139

  
149
  &display_form;
150

  
151
  $main::lxdebug->leave_sub();
152
}
153

  
154
sub select_all {
155
  $main::lxdebug->enter_sub();
156

  
157
  my $form     = $main::form;
158
  my %myconfig = %main::myconfig;
159

  
160
  $main::auth->assert('cash');
161

  
162
  RC->payment_transactions(\%myconfig, \%$form);
163

  
164
  map { $_->{cleared} = "checked" unless $_->{fx_transaction} }
165
    @{ $form->{PR} };
166

  
167
  &display_form;
140
  display_form();
168 141

  
169
  $main::lxdebug->leave_sub();
142
  $::lxdebug->leave_sub;
170 143
}
171 144

  
172 145
sub done {
173
  $main::lxdebug->enter_sub();
174

  
175
  my $form     = $main::form;
176
  my %myconfig = %main::myconfig;
177
  my $locale   = $main::locale;
178

  
179
  $main::auth->assert('cash');
146
  $::lxdebug->enter_sub;
147
  $::auth->assert('cash');
180 148

  
181
  $form->{callback} = "$form->{script}?action=reconciliation";
149
  $::form->{callback} = "$::form->{script}?action=reconciliation";
182 150

  
183
  $form->error($locale->text('Out of balance!')) if ($form->{difference} *= 1);
151
  $::form->error($::locale->text('Out of balance!')) if $::form->{difference} *= 1;
184 152

  
185
  RC->reconcile(\%myconfig, \%$form);
186
  $form->redirect;
153
  RC->reconcile(\%::myconfig, $::form);
154
  $::form->redirect;
187 155

  
188
  $main::lxdebug->leave_sub();
156
  $::lxdebug->leave_sub;
189 157
}
190 158

  
templates/webpages/rc/step2.html
2 2
[%- USE L  %]
3 3
[%- USE T8 %]
4 4
[%- USE LxERP  %]
5
[%- L.javascript_tag('jquery.checkall')  %]
5 6
<body>
6 7

  
7 8
<h1>[% accno | html %]--[% account | html %]</h1>
......
12 13

  
13 14
<table width=100%>
14 15
  <tr class=listheading>
15
   <th>&nbsp;</th>
16
   <th>[% L.checkbox_tag('checkall_checkboxes', checkall='input.checkall') %]</th>
16 17
   <th>[% 'Date' | $T8 %]</th>
17 18
   <th>[% 'Source' | $T8 %]</th>
18 19
   <th>[% 'Description' | $T8 %]</th>
......
40 41
[%- IF row.fx_transaction %]
41 42
     [% L.hidden_tag('fxoid_' _ row.i, row.oid) %]
42 43
[%- ELSE %]
43
     [% L.checkbox_tag('cleared_' _ row.i, checked=row.cleared) %]
44
     [% L.checkbox_tag('cleared_' _ row.i, class='checkall', checked=row.cleared) %]
44 45
     [% L.hidden_tag('oid_' _ row.i, row.oid) %]
45 46
[%- END %]
46 47
   </td>
......
111 112

  
112 113
<br>
113 114
<input type=submit class=submit name=action value="[% 'Update' | $T8 %]">
114
<input type=submit class=submit name=action value="[% 'Select all' | $T8 %]">
115 115
<input type=submit class=submit name=action value="[% 'Done' | $T8 %]">
116 116

  
117 117
</form>

Auch abrufbar als: Unified diff