Lines 124-132
sub UpdateStats {
Link Here
|
124 |
my $location = exists $params->{location} ? $params->{location} : undef; |
124 |
my $location = exists $params->{location} ? $params->{location} : undef; |
125 |
my $ccode = exists $params->{ccode} ? $params->{ccode} : ''; |
125 |
my $ccode = exists $params->{ccode} ? $params->{ccode} : ''; |
126 |
|
126 |
|
127 |
# If $branch is set to an invalid branchcode, like 'OPACRenew' |
|
|
128 |
$branch = undef if $branch && ! Koha::Libraries->find($branch); |
129 |
|
130 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
127 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
131 |
my $statistic = Koha::Statistic->new( |
128 |
my $statistic = Koha::Statistic->new( |
132 |
{ |
129 |
{ |
Lines 143-148
sub UpdateStats {
Link Here
|
143 |
} |
140 |
} |
144 |
)->store; |
141 |
)->store; |
145 |
|
142 |
|
|
|
143 |
|
144 |
# If $branch is set to an invalid branchcode, like 'OPACRenew' |
145 |
$statistic->branch(undef) if $branch && ! Koha::Libraries->find($branch); |
146 |
|
146 |
Koha::PseudonymizedTransaction->new_from_statistic($statistic)->store |
147 |
Koha::PseudonymizedTransaction->new_from_statistic($statistic)->store |
147 |
if C4::Context->preference('Pseudonymization') |
148 |
if C4::Context->preference('Pseudonymization') |
148 |
&& $borrowernumber # Not a real transaction if the patron does not exist |
149 |
&& $borrowernumber # Not a real transaction if the patron does not exist |