@@ -, +, @@
- Possibility to select for line and column: items.homebranch and
items.ccode
- Possibility to filter on these fields
- Possibility to count unique biblios (count(distinct biblionumber)),
ordered amount and spent amount (based on aqorders.datereceived)
---
C4/Biblio.pm | 33 ++
.../prog/en/modules/reports/acquisitions_stats.tt | 61 +++-
reports/acquisitions_stats.pl | 430 ++++++++++----------
3 files changed, 306 insertions(+), 218 deletions(-)
--- a/C4/Biblio.pm
+++ a/C4/Biblio.pm
@@ -88,6 +88,7 @@ BEGIN {
&GetAuthorisedValueDesc
&GetMarcStructure
&GetMarcFromKohaField
+ &GetMarcSubfieldStructureFromKohaField
&GetFrameworkCode
&TransformKohaToMarc
&PrepHostMarcField
@@ -1177,6 +1178,38 @@ sub GetMarcFromKohaField {
return (0, undef);
}
+=head2 GetMarcSubfieldStructureFromKohaField
+
+ my $subfield_structure = &GetMarcSubfieldStructureFromKohaField($kohafield, $frameworkcode);
+
+Returns a hashref where keys are marc_subfield_structure column names for the
+row where kohafield=$kohafield for the given framework code.
+
+$frameworkcode is optional. If not given, then the default framework is used.
+
+=cut
+
+sub GetMarcSubfieldStructureFromKohaField {
+ my ($kohafield, $frameworkcode) = @_;
+
+ return undef unless $kohafield;
+ $frameworkcode //= '';
+
+ my $dbh = C4::Context->dbh;
+ my $query = qq{
+ SELECT *
+ FROM marc_subfield_structure
+ WHERE kohafield = ?
+ AND frameworkcode = ?
+ };
+ my $sth = $dbh->prepare($query);
+ $sth->execute($kohafield, $frameworkcode);
+ my $result = $sth->fetchrow_hashref;
+ $sth->finish;
+
+ return $result;
+}
+
=head2 GetMarcBiblio
my $record = GetMarcBiblio($biblionumber, [$embeditems]);
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt
@@ -18,7 +18,7 @@
[% IF ( do_it ) %]
[% FOREACH mainloo IN mainloop %]
Acquisitions statistics
- [% IF ( mainloo.loopfilter ) %]
+ [% IF ( mainloo.loopfilter.size ) %]
Filtered on:
[% FOREACH loopfilte IN mainloo.loopfilter %]
[% loopfilte.crit %]: [% loopfilte.filter %]
@@ -244,6 +244,42 @@
|
[% CGIBookSeller %] |
+
+ Home branch |
+ |
+ |
+
+
+ |
+
+
+
+ [% IF ccode_label %]
+ [% ccode_label %]
+ [% ELSE %]
+ Collection
+ [% END %]
+ |
+ |
+ |
+
+ [% IF ccode_avlist.size %]
+
+ [% ELSE %]
+
+ [% END %]
+ |
+
Item Type |
|
@@ -278,9 +314,26 @@
-
+