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); |
87 |
my @allowed_circulation_types = qw (renew issue localuse return onsite_checkout); |
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 |
|