Lines 66-71
C<$params> is an hashref whose expected keys are:
Link Here
|
66 |
other : sipmode |
66 |
other : sipmode |
67 |
itemtype : the type of the item |
67 |
itemtype : the type of the item |
68 |
ccode : the collection code of the item |
68 |
ccode : the collection code of the item |
|
|
69 |
usercode : the categorycode of the patron |
69 |
|
70 |
|
70 |
type key is mandatory. |
71 |
type key is mandatory. |
71 |
For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory: |
72 |
For types used in C4::Circulation (renew,issue,localuse,return), the following other keys are mandatory: |
Lines 83-89
sub UpdateStats {
Link Here
|
83 |
# make some controls |
84 |
# make some controls |
84 |
return () if ! defined $params; |
85 |
return () if ! defined $params; |
85 |
# change these arrays if new types of transaction or new parameters are allowed |
86 |
# change these arrays if new types of transaction or new parameters are allowed |
86 |
my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location); |
87 |
my @allowed_keys = qw (type branch amount other itemnumber itemtype borrowernumber ccode location usercode); |
87 |
my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout); |
88 |
my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout); |
88 |
my @allowed_accounts_types = qw (writeoff payment); |
89 |
my @allowed_accounts_types = qw (writeoff payment); |
89 |
my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype); |
90 |
my @circulation_mandatory_keys = qw (type branch borrowernumber itemnumber ccode itemtype); |
Lines 124-129
sub UpdateStats {
Link Here
|
124 |
my $itemtype = exists $params->{itemtype} ? $params->{itemtype} : ''; |
125 |
my $itemtype = exists $params->{itemtype} ? $params->{itemtype} : ''; |
125 |
my $location = exists $params->{location} ? $params->{location} : undef; |
126 |
my $location = exists $params->{location} ? $params->{location} : undef; |
126 |
my $ccode = exists $params->{ccode} ? $params->{ccode} : ''; |
127 |
my $ccode = exists $params->{ccode} ? $params->{ccode} : ''; |
|
|
128 |
my $usercode = exists $params->{usercode} ? $params->{usercode} : undef; |
127 |
|
129 |
|
128 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
130 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
129 |
my $statistic = Koha::Statistic->new( |
131 |
my $statistic = Koha::Statistic->new( |
Lines 138-143
sub UpdateStats {
Link Here
|
138 |
location => $location, |
140 |
location => $location, |
139 |
borrowernumber => $borrowernumber, |
141 |
borrowernumber => $borrowernumber, |
140 |
ccode => $ccode, |
142 |
ccode => $ccode, |
|
|
143 |
usercode => $usercode, |
141 |
} |
144 |
} |
142 |
)->store; |
145 |
)->store; |
143 |
|
146 |
|