Lines 255-287
sub store {
Link Here
|
255 |
$self->add_enrolment_fee_if_needed; |
255 |
$self->add_enrolment_fee_if_needed; |
256 |
} |
256 |
} |
257 |
|
257 |
|
258 |
my $borrowers_log = C4::Context->preference("BorrowersLog"); |
258 |
# Actionlogs |
259 |
my $previous_cardnumber = $self_from_storage->cardnumber; |
259 |
if ( C4::Context->preference("BorrowersLog") ) { |
260 |
if ($borrowers_log |
260 |
my $info; |
261 |
&& ( !defined $previous_cardnumber |
261 |
for my $key ( keys %{ $self_from_storage->unblessed } ) { |
262 |
|| $previous_cardnumber ne $self->cardnumber ) |
262 |
if ( $self_from_storage->$key ne $self->$key ) { |
263 |
) |
263 |
$info->{$key} = { |
264 |
{ |
264 |
before => $self_from_storage->$key, |
265 |
logaction( |
265 |
after => $self->$key |
266 |
"MEMBERS", |
266 |
}; |
267 |
"MODIFY", |
267 |
} |
268 |
$self->borrowernumber, |
268 |
} |
269 |
to_json( |
|
|
270 |
{ |
271 |
cardnumber_replaced => { |
272 |
previous_cardnumber => $previous_cardnumber, |
273 |
new_cardnumber => $self->cardnumber, |
274 |
} |
275 |
}, |
276 |
{ utf8 => 1, pretty => 1 } |
277 |
) |
278 |
); |
279 |
} |
280 |
|
269 |
|
281 |
logaction( "MEMBERS", "MODIFY", $self->borrowernumber, |
270 |
logaction( "MEMBERS", "MODIFY", $self->borrowernumber, |
282 |
"UPDATE (executed w/ arg: " . $self->borrowernumber . ")" ) |
271 |
to_json( $info, { utf8 => 1, pretty => 1, canonical => 1 } ) ); |
283 |
if $borrowers_log; |
272 |
} |
284 |
|
273 |
|
|
|
274 |
# Final store |
285 |
$self = $self->SUPER::store; |
275 |
$self = $self->SUPER::store; |
286 |
} |
276 |
} |
287 |
} |
277 |
} |
288 |
- |
|
|