Bugzilla – Attachment 183445 Details for
Bug 40225
The --send-all option in the stockrotation job fails if there are no items to rotate at all
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40225: Send stockrotation report even when all items are stationary
Bug-40225-Send-stockrotation-report-even-when-all-.patch (text/plain), 2.01 KB, created by
Martin Renvoize (ashimema)
on 2025-06-24 12:06:10 UTC
(
hide
)
Description:
Bug 40225: Send stockrotation report even when all items are stationary
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-06-24 12:06:10 UTC
Size:
2.01 KB
patch
obsolete
>From 647e541a723b2f5336638475efac17bdebf8f49f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Tue, 24 Jun 2025 13:01:41 +0100 >Subject: [PATCH] Bug 40225: Send stockrotation report even when all items are > stationary > >The stockrotation cronjob was only sending email reports when there were >actionable items (items that needed to be moved between branches). This >meant that libraries would not receive any notification when all items >in their rotation were stationary, even when the --send-all flag was >passed to the script. > >This patch modifies the report logic to also send reports when there are >only stationary items, ensuring libraries have visibility into the complete >status of their stock rotation items. > >Test plan: >1. Set up a stock rotation rota with items that are all stationary > (items that should stay at their current branch) >2. Run the stockrotation cronjob: perl misc/cronjobs/stockrotation.pl >3. Without this patch: No email report is generated >4. Apply this patch >5. Run the cronjob again >6. Verify that an email report is now generated showing the stationary items >7. Test with mixed scenarios (some actionable, some stationary items) >8. Confirm reports are sent in all cases where items exist in the rotation >--- > misc/cronjobs/stockrotation.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/misc/cronjobs/stockrotation.pl b/misc/cronjobs/stockrotation.pl >index 94f100c59c8..b416c2f8cec 100755 >--- a/misc/cronjobs/stockrotation.pl >+++ b/misc/cronjobs/stockrotation.pl >@@ -318,7 +318,7 @@ sub report_by_branch { > > if ($branch) { # Branch limited report > push @{$out}, _report_per_branch( $branched->{ $branch->branchcode } ); >- } elsif ( $data->{actionable} ) { # Full email report >+ } elsif ( $data->{actionable} || $data->{stationary} ) { # Full email report > while ( my ( $branchcode_id, $details ) = each %{$branched} ) { > push @{$out}, _report_per_branch($details) > if ( @{ $details->{items} } ); >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40225
:
183444
| 183445