Skip to content

Commit

Permalink
BWS-PKG - Create 'offline circ' log file
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemhall committed Jun 3, 2024
1 parent d9da8a1 commit a0af099
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions C4/Circulation.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1728,6 +1728,10 @@ sub AddIssue {
undef, $item_object->id
);
}

my $logger = Koha::Logger->get({ prefix => 0, interface => 'offlinecirc', category => 'issue' });
$logger->error("\tissue\t" . $patron->cardnumber . "\t" . $item_object->barcode . "\t" . C4::Context->userenv->{branch} . "\n");

$issue->discard_changes;
$patron->update_lastseen('check_out');
if ( $item_object->location && $item_object->location eq 'CART'
Expand Down Expand Up @@ -2258,6 +2262,9 @@ sub AddReturn {
die "The item is not issed and cannot be returned" unless $issue; # Just in case...
$patron or warn "AddReturn without current borrower";

my $logger = Koha::Logger->get({ prefix => 0, interface => 'offlinecirc', category => 'issue' });
$logger->error("\treturn\t" . $item->barcode . "\t$branch" . "\n");

if ($patron) {
eval {
MarkIssueReturned( $borrowernumber, $item->itemnumber, $return_date, $patron->privacy, { skip_record_index => 1, skip_holds_queue => 1} );
Expand Down
6 changes: 6 additions & 0 deletions Koha/Account.pm
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,12 @@ sub payin_amount {
# Add payin credit
$credit = $self->add_credit($params);

if ( $params->{type} eq 'PAYMENT' ) {
my $logger = Koha::Logger->get({ prefix => 0, interface => 'offlinecirc', category => 'issue' });
my $b = C4::Context->userenv ? C4::Context->userenv->{branch} : "NOBRANCH";
$logger->error("\tpayment\t" . Koha::Patrons->find($self->{patron_id})->cardnumber . "\t" . $amount . "\t" . $b . "\n");
}

# Offset debts passed first
if ( exists( $params->{debits} ) ) {
$credit = $credit->apply(
Expand Down

0 comments on commit a0af099

Please sign in to comment.