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