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

(-)a/C4/Circulation.pm (-1 / +4 lines)
Lines 835-841 sub CanBookBeIssued { Link Here
835
                     itemnumber => $item_object->itemnumber,
835
                     itemnumber => $item_object->itemnumber,
836
                     itemtype => $effective_itemtype,
836
                     itemtype => $effective_itemtype,
837
                     borrowernumber => $patron->borrowernumber,
837
                     borrowernumber => $patron->borrowernumber,
838
                     ccode => $item_object->ccode}
838
                     ccode => $item_object->ccode},
839
                     usercode => $patron->categorycode,
839
                    );
840
                    );
840
        ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item
841
        ModDateLastSeen( $item_object->itemnumber ); # FIXME Move to Koha::Item
841
        return( { STATS => 1 }, {});
842
        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 3223-3228 sub AddRenewal { Link Here
3223
                location       => $item_object->location,
3225
                location       => $item_object->location,
3224
                borrowernumber => $borrowernumber,
3226
                borrowernumber => $borrowernumber,
3225
                ccode          => $item_object->ccode,
3227
                ccode          => $item_object->ccode,
3228
                usercode       => $patron->categorycode,
3226
            }
3229
            }
3227
        );
3230
        );
3228
3231
(-)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 4759-4764 CREATE TABLE `statistics` ( Link Here
4759
  `location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4759
  `location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
4760
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower',
4760
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key from the borrowers table, links transaction to a specific borrower',
4761
  `ccode` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the items table, links transaction to a specific collection code',
4761
  `ccode` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the items table, links transaction to a specific collection code',
4762
  `usercode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
4762
  KEY `timeidx` (`datetime`),
4763
  KEY `timeidx` (`datetime`),
4763
  KEY `branch_idx` (`branch`),
4764
  KEY `branch_idx` (`branch`),
4764
  KEY `type_idx` (`type`),
4765
  KEY `type_idx` (`type`),
4765
- 

Return to bug 7021