Bugzilla – Attachment 179462 Details for
Bug 39369
Button "generate discharge" should not validate again a validated discharge
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39369: Generating a discharge should not validate again a generated discharge
Bug-39369-Generating-a-discharge-should-not-valida.patch (text/plain), 1.62 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-03-18 16:16:06 UTC
(
hide
)
Description:
Bug 39369: Generating a discharge should not validate again a generated discharge
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-03-18 16:16:06 UTC
Size:
1.62 KB
patch
obsolete
>From 879147393d939a921ab7bddbc321b88a9f9633b9 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Tue, 18 Mar 2025 16:50:16 +0100 >Subject: [PATCH] Bug 39369: Generating a discharge should not validate again a > generated discharge > >Test plan: >1 - Apply Bug 37344 >2 - Go on discharge.pl, click on "generate discharge" >3 - Drink a coffee (or do something during 1 min) >4 - Click again on the button - notice the date has changed >5 - Cancel the discharge >6 - Click again on the button - notice the cancelled discharge has been > updated >7 - Apply patch >8 - Repeat 2 to 6 with following changes: > 4 - Notice you simply print again the discharge > 5 - Notice you create a new discharge > 3 - If your tolerance to caffein is low, drink something else than > coffee >--- > Koha/Patron/Discharge.pm | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > >diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm >index d1a256e3..2ab6cce8 100644 >--- a/Koha/Patron/Discharge.pm >+++ b/Koha/Patron/Discharge.pm >@@ -142,7 +142,16 @@ sub discharge { > > # Generate the discharge > my $rs = Koha::Database->new->schema->resultset('Discharge'); >- my $discharge = $rs->search( { borrower => $borrowernumber }, { order_by => { -desc => 'needed' }, rows => 1 } ); >+ my $discharge = $rs->search( >+ { >+ borrower => $borrowernumber, >+ validated => undef, >+ }, >+ { >+ order_by => { -desc => 'needed' }, >+ rows => 1 >+ } >+ ); > if ( $discharge->count > 0 ) { > $discharge->update( > { >-- >2.30.2
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 39369
:
179462
|
179463