|
Lines 181-186
sub calculate {
Link Here
|
| 181 |
# extract parameters |
181 |
# extract parameters |
| 182 |
my $dbh = C4::Context->dbh; |
182 |
my $dbh = C4::Context->dbh; |
| 183 |
|
183 |
|
|
|
184 |
my @valid_names = qw(categorycode zipcode branchcode sex sort1 sort2); |
| 185 |
return unless (grep /^$line$/, @valid_names or $line =~ /^patron_attr\./); |
| 186 |
return unless (grep /^$column$/, @valid_names or $column =~ /^patron_attr\./); |
| 187 |
return if ($digits and $digits !~ /^\d+$/); |
| 188 |
return if ($status and (grep /^$status$/, qw(debarred gonenoaddress lost)) == 0); |
| 189 |
return if ($activity and (grep /^$activity$/, qw(active nonactive)) == 0); |
| 190 |
|
| 184 |
# Filters |
191 |
# Filters |
| 185 |
my $linefilter; |
192 |
my $linefilter; |
| 186 |
given ($line) { |
193 |
given ($line) { |
|
Lines 207-213
sub calculate {
Link Here
|
| 207 |
} |
214 |
} |
| 208 |
|
215 |
|
| 209 |
my @loopfilter; |
216 |
my @loopfilter; |
| 210 |
for (my $i = 0; $i <= scalar @$filters; $i++) { |
217 |
foreach my $i (0 .. scalar @$filters) { |
| 211 |
my %cell; |
218 |
my %cell; |
| 212 |
if ( @$filters[$i] ) { |
219 |
if ( @$filters[$i] ) { |
| 213 |
if ($i == 3 or $i == 4) { |
220 |
if ($i == 3 or $i == 4) { |
|
Lines 249-255
sub calculate {
Link Here
|
| 249 |
my $linefield; |
256 |
my $linefield; |
| 250 |
|
257 |
|
| 251 |
my $line_attribute_type; |
258 |
my $line_attribute_type; |
| 252 |
if ($line =~/^patron_attr.(.*)$/) { |
259 |
if ($line =~/^patron_attr\.(.*)$/) { |
| 253 |
$line_attribute_type = $1; |
260 |
$line_attribute_type = $1; |
| 254 |
$line = 'borrower_attributes.attribute'; |
261 |
$line = 'borrower_attributes.attribute'; |
| 255 |
} |
262 |
} |
|
Lines 305-315
sub calculate {
Link Here
|
| 305 |
$column = 'borrower_attributes.attribute'; |
312 |
$column = 'borrower_attributes.attribute'; |
| 306 |
} |
313 |
} |
| 307 |
|
314 |
|
| 308 |
if (($column =~/zipcode/) and ($digits)) { |
315 |
if (($column =~/zipcode/) and ($digits)) { |
| 309 |
$colfield = "left($column,$digits)"; |
316 |
$colfield = "left($column,$digits)"; |
| 310 |
} else { |
317 |
} else { |
| 311 |
$colfield = $column; |
318 |
$colfield = $column; |
| 312 |
} |
319 |
} |
| 313 |
|
320 |
|
| 314 |
my $strsth2; |
321 |
my $strsth2; |
| 315 |
my @strparams2; # bind parameters for the query |
322 |
my @strparams2; # bind parameters for the query |
| 316 |
- |
|
|