Lines 30-35
use C4::Reports;
Link Here
|
30 |
use C4::Circulation; |
30 |
use C4::Circulation; |
31 |
use C4::Biblio qw/GetMarcSubfieldStructureFromKohaField/; |
31 |
use C4::Biblio qw/GetMarcSubfieldStructureFromKohaField/; |
32 |
|
32 |
|
|
|
33 |
use Koha::AuthorisedValues; |
33 |
use Koha::DateUtils; |
34 |
use Koha::DateUtils; |
34 |
|
35 |
|
35 |
=head1 NAME |
36 |
=head1 NAME |
Lines 122-138
if ($do_it) {
Link Here
|
122 |
|
123 |
|
123 |
my $itemtypes = GetItemTypes( style => 'array' ); |
124 |
my $itemtypes = GetItemTypes( style => 'array' ); |
124 |
|
125 |
|
125 |
my $authvals = GetKohaAuthorisedValues("items.ccode"); |
126 |
my @authvals = map { { code => $_->authorised_value, description => $_->lib } } Koha::AuthorisedValues->search_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' }, { order_by => ['description'] } ); |
126 |
my @authvals; |
127 |
my @locations = map { { code => $_->authorised_value, description => $_->lib } } Koha::AuthorisedValues->search_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ); |
127 |
foreach ( sort { $authvals->{$a} cmp $authvals->{$b} || $a cmp $b } keys %$authvals ) { |
|
|
128 |
push @authvals, { code => $_, description => $authvals->{$_} }; |
129 |
} |
130 |
|
131 |
my $locations = GetKohaAuthorisedValues("items.location"); |
132 |
my @locations; |
133 |
foreach ( sort keys %$locations ) { |
134 |
push @locations, { code => $_, description => "$_ - " . $locations->{$_} }; |
135 |
} |
136 |
|
128 |
|
137 |
foreach my $kohafield (qw(items.notforloan items.materials)) { |
129 |
foreach my $kohafield (qw(items.notforloan items.materials)) { |
138 |
my $subfield_structure = GetMarcSubfieldStructureFromKohaField($kohafield); |
130 |
my $subfield_structure = GetMarcSubfieldStructureFromKohaField($kohafield); |
Lines 324-330
sub calculate {
Link Here
|
324 |
} else { |
316 |
} else { |
325 |
$sth->execute(); |
317 |
$sth->execute(); |
326 |
} |
318 |
} |
327 |
my $rowauthvals = GetKohaAuthorisedValues($origline); |
319 |
my $rowauthvals = { map { $_->authorised_value => $_->lib } Koha::AuthorisedValues->search_by_koha_field( { frameworkcode => '', kohafield => $origline } ) }; |
328 |
while ( my ($celvalue) = $sth->fetchrow ) { |
320 |
while ( my ($celvalue) = $sth->fetchrow ) { |
329 |
my %cell; |
321 |
my %cell; |
330 |
if (defined $celvalue and $celvalue ne '') { |
322 |
if (defined $celvalue and $celvalue ne '') { |
Lines 387-393
sub calculate {
Link Here
|
387 |
} else { |
379 |
} else { |
388 |
$sth2->execute(); |
380 |
$sth2->execute(); |
389 |
} |
381 |
} |
390 |
my $colauthvals = GetKohaAuthorisedValues($origcolumn); |
382 |
my $colauthvals = { map { $_->authorised_value => $_->lib } Koha::AuthorisedValues->search_by_koha_field( { frameworkcode => '', kohafield => $origcolumn } ) }; |
391 |
while ( my ($celvalue) = $sth2->fetchrow ) { |
383 |
while ( my ($celvalue) = $sth2->fetchrow ) { |
392 |
my %cell; |
384 |
my %cell; |
393 |
if (defined $celvalue and $celvalue ne '') { |
385 |
if (defined $celvalue and $celvalue ne '') { |