View | Details | Raw Unified | Return to bug 7021
Collapse All | Expand All

(-)a/C4/Circulation.pm (-1 / +4 lines)
Lines 819-825 sub CanBookBeIssued { Link Here
819
                     itemnumber => $item_object->itemnumber,
819
                     itemnumber => $item_object->itemnumber,
820
                     itemtype => $effective_itemtype,
820
                     itemtype => $effective_itemtype,
821
                     borrowernumber => $patron->borrowernumber,
821
                     borrowernumber => $patron->borrowernumber,
822
                     ccode => $item_object->ccode}
822
                     ccode => $item_object->ccode},
823
                     usercode => $patron->categorycode,
823
                    );
824
                    );
824
        ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item
825
        ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item
825
        return( { STATS => 1 }, {});
826
        return( { STATS => 1 }, {});
Lines 1740-1745 sub AddIssue { Link Here
1740
                    location       => $item_object->location,
1741
                    location       => $item_object->location,
1741
                    borrowernumber => $borrower->{'borrowernumber'},
1742
                    borrowernumber => $borrower->{'borrowernumber'},
1742
                    ccode          => $item_object->ccode,
1743
                    ccode          => $item_object->ccode,
1744
                    usercode       => $borrower->{'categorycode'}
1743
                }
1745
                }
1744
            );
1746
            );
1745
1747
Lines 3188-3193 sub AddRenewal { Link Here
3188
                location       => $item_object->location,
3190
                location       => $item_object->location,
3189
                borrowernumber => $borrowernumber,
3191
                borrowernumber => $borrowernumber,
3190
                ccode          => $item_object->ccode,
3192
                ccode          => $item_object->ccode,
3193
                usercode       => $patron->categorycode,
3191
            }
3194
            }
3192
        );
3195
        );
3193
3196
(-)a/C4/Stats.pm (-1 / +4 lines)
Lines 65-70 C<$params> is an hashref whose expected keys are: Link Here
65
    other              : sipmode
65
    other              : sipmode
66
    itemtype           : the type of the item
66
    itemtype           : the type of the item
67
    ccode              : the collection code of the item
67
    ccode              : the collection code of the item
68
    usercode           : the categorycode of the patron
68
69
69
type key is mandatory.
70
type key is mandatory.
70
For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory:
71
For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory:
Lines 82-88 sub UpdateStats { Link Here
82
# make some controls
83
# make some controls
83
    return () if ! defined $params;
84
    return () if ! defined $params;
84
# change these arrays if new types of transaction or new parameters are allowed
85
# change these arrays if new types of transaction or new parameters are allowed
85
    my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location);
86
    my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location usercode);
86
    my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout recall);
87
    my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout recall);
87
    my @allowed_accounts_types = qw (writeoff payment);
88
    my @allowed_accounts_types = qw (writeoff payment);
88
    my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype);
89
    my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype);
Lines 123-128 sub UpdateStats { Link Here
123
    my $itemtype          = exists $params->{itemtype}       ? $params->{itemtype}       : '';
124
    my $itemtype          = exists $params->{itemtype}       ? $params->{itemtype}       : '';
124
    my $location          = exists $params->{location}       ? $params->{location}       : undef;
125
    my $location          = exists $params->{location}       ? $params->{location}       : undef;
125
    my $ccode             = exists $params->{ccode}          ? $params->{ccode}          : '';
126
    my $ccode             = exists $params->{ccode}          ? $params->{ccode}          : '';
127
    my $usercode          = exists $params->{usercode}       ? $params->{usercode}       : undef;
126
128
127
    my $dtf = Koha::Database->new->schema->storage->datetime_parser;
129
    my $dtf = Koha::Database->new->schema->storage->datetime_parser;
128
    my $statistic = Koha::Statistic->new(
130
    my $statistic = Koha::Statistic->new(
Lines 137-142 sub UpdateStats { Link Here
137
            location       => $location,
139
            location       => $location,
138
            borrowernumber => $borrowernumber,
140
            borrowernumber => $borrowernumber,
139
            ccode          => $ccode,
141
            ccode          => $ccode,
142
            usercode       => $usercode,
140
        }
143
        }
141
    )->store;
144
    )->store;
142
145
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 4937-4942 CREATE TABLE `statistics` ( Link Here
4937
  `location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4937
  `location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4938
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower',
4938
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower',
4939
  `ccode` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the items table, links transaction to a specific collection code',
4939
  `ccode` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the items table, links transaction to a specific collection code',
4940
  `usercode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
4940
  KEY `timeidx` (`datetime`),
4941
  KEY `timeidx` (`datetime`),
4941
  KEY `branch_idx` (`branch`),
4942
  KEY `branch_idx` (`branch`),
4942
  KEY `type_idx` (`type`),
4943
  KEY `type_idx` (`type`),
4943
- 

Return to bug 7021