Bug 22180 - SERIAL_ALERT email does not send if the status is claimed before arrived
Summary: SERIAL_ALERT email does not send if the status is claimed before arrived
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-21 20:04 UTC by Marjorie Barry-Vila
Modified: 2022-06-14 09:06 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marjorie Barry-Vila 2019-01-21 20:04:42 UTC
Hi,

SERIAL_ALERT email sends itself correctly when the status of the issue changes from Expected to Arrived.
But the issues goes from Expected to Claimed and then to Arrived, the email does not send.
I also tested it with other status. Only the way Expected> Arrived works.
Is it normal?
Version tested: 18.05.04

REgards,
Marjorie
Comment 1 Marjorie Barry-Vila 2022-02-24 20:04:46 UTC
still valid in 21.05
Comment 2 Katrin Fischer 2022-06-14 08:45:41 UTC
I've just verified this on master:

Expected - Arrived - Sends email
Late - Arrived - NO email
Missing - Arrived - NO email

I believe every time an issue changes to Arrived, we should send the email. If a late issue arrives, the user should be informed, also if a missing one is found or made available.
Comment 3 Katrin Fischer 2022-06-14 09:02:39 UTC
ModSerialStatus has 2 checks:

# create new expected entry if needed (ie : was "expected" and has changed)
my $otherIssueExpected = scalar findSerialsByStatus(EXPECTED, $subscriptionid);
if ( !$otherIssueExpected && $oldstatus == EXPECTED && $status != EXPECTED ) {

And within:

if ( $subscription->{letter} && $status == ARRIVED && $oldstatus != ARRIVED ) {
 require C4::Letters;
 C4::Letters::SendAlerts( 'issue', $serialid, $subscription->{letter} );
}

I am tempted to move the second if outside of the first one that has the expected check... might do that for testing.
Comment 4 Katrin Fischer 2022-06-14 09:06:48 UTC
If I understand the code correctly:

As soon as there is another 'Expected' issue, changing any of the old issues to 'Arrived' will no longer create an email.

If you are using the cron to automatically set issues late, which always creates the next issue as well, you are possibly going to miss out on a lot of emails to patrons that they expected/have waited for.

Same if you set an issue to missing - it auto-creates the next issue, taking the changed one out of the email loop.

I'd be interested to hear if people agree that this should be changed and how it should work for older (not the currently expected) issues.