Bug 21811 - Add warning when order receive form is saved without entering 'quantity received'
Summary: Add warning when order receive form is saved without entering 'quantity recei...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords: Academy
: 26081 (view as bug list)
Depends on: 23376
Blocks:
  Show dependency treegraph
 
Reported: 2018-11-12 14:54 UTC by Katrin Fischer
Modified: 2021-06-14 21:33 UTC (History)
5 users (show)

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


Attachments
Bug 21811: Add JS confirmation when receiving - at least 1 item to receive (1.34 KB, patch)
2020-07-31 08:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 21811: Add JS confirmation when receiving - at least 1 item to receive (1.48 KB, patch)
2020-10-20 16:50 UTC, Séverine Queune
Details | Diff | Splinter Review
Bug 21811: Add JS confirmation when receiving - at least 1 item to receive (1.55 KB, patch)
2020-10-21 15:45 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2018-11-12 14:54:46 UTC
A common mistake in training the acquisition module is that the 'quantity received' field is not changed before saving the order receive form. There is no warning or other indication, that this field is needed in order to make the receive happen. I think usability woudl be better with a visual clue or warning there. I am not sure if the field coudl be made mandatory.
Comment 1 Jonathan Druart 2020-07-31 08:24:24 UTC
Created attachment 107619 [details] [review]
Bug 21811: Add JS confirmation when receiving - at least 1 item to receive

When receiving, the "receive items" form should not be submitted if no
items are going to be received

Test plan:
Create an order, close the basket, receive some items
On the "receive items" form, do not select item (if items are created
when placing the order) and submit the form
=> You must get a JS alert that prevent the form to be submitted
Select at least one item, submit again
=> Now it's submitted
Comment 2 Jonathan Druart 2020-08-03 10:41:20 UTC
*** Bug 26081 has been marked as a duplicate of this bug. ***
Comment 3 Jonathan Druart 2020-08-03 15:08:37 UTC
Before this patch we were able to save, and (reading the code) some info were used to update the items' order (like price, datelastseen, etc.)

What is the expected behaviour here?
Comment 4 Katrin Fischer 2020-10-18 17:00:42 UTC
(In reply to Jonathan Druart from comment #3)
> Before this patch we were able to save, and (reading the code) some info
> were used to update the items' order (like price, datelastseen, etc.)
> 
> What is the expected behaviour here?

I am not sure if that behaviour (changing the items when nothing was actually received) was correct at all. I cannot think of a use case right now where you'd want that at this point. I think this should not block this patch.

Patch still applied - resetting status in hope to get some more feedback next week from people testing.
Comment 5 Séverine Queune 2020-10-20 14:34:00 UTC
I get this error each time there is 1 item left to receive.

Software error:
Template process failed: undef error - The method Koha::Item->size is not covered by tests!

Trace begun at /var/repositories/koha/Koha/Object.pm line 827
Koha::Object::AUTOLOAD('Koha::Item=HASH(0xb30e228)') called at /var/repositories/koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt line 234
eval {...} at /var/repositories/koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt line 234
eval {...} at /var/repositories/koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt line 18
Template::Provider::__ANON__('Template::Context=HASH(0xabeb380)') called at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Document.pm line 163
eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Document.pm line 161
Template::Document::process('Template::Document=HASH(0xb1a5fb0)', 'Template::Context=HASH(0xabeb380)') called at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Context.pm line 351
eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Context.pm line 321
Template::Context::process('Template::Context=HASH(0xabeb380)', 'Template::Document=HASH(0xb1a5fb0)') called at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Service.pm line 94
eval {...} at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template/Service.pm line 91
Template::Service::process('Template::Service=HASH(0xa8433f0)', '/var/repositories/koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt', 'HASH(0xb0bc8f0)') called at /usr/lib/x86_64-linux-gnu/perl5/5.20/Template.pm line 66
Template::process('Template=HASH(0xaba15d8)', '/var/repositories/koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt', 'HASH(0xb0bc8f0)', 'SCALAR(0x41ad5b0)') called at /var/repositories/koha/C4/Templates.pm line 122
C4::Templates::output('C4::Templates=HASH(0x88fcd30)') called at /var/repositories/koha/acqui/orderreceive.pl line 214
Comment 6 Joonas Kylmälä 2020-10-20 14:36:45 UTC
(In reply to Séverine Queune from comment #5)
> I get this error each time there is 1 item left to receive.
> 
> Software error:
> Template process failed: undef error - The method Koha::Item->size is not
> covered by tests!

hmm, this doesn't look to be related to the patch here. Have you done koha-plack --restart <instance> and do you have the latest koha master version?
Comment 7 Katrin Fischer 2020-10-20 14:39:44 UTC
That's another bug, I am finding it, sec!
Comment 8 Séverine Queune 2020-10-20 14:42:13 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2020-10-20 14:44:43 UTC
We are missing the last follow-up patch from bug 23376. Adding a dependency.
Comment 10 Séverine Queune 2020-10-20 16:50:24 UTC
Created attachment 112055 [details] [review]
Bug 21811: Add JS confirmation when receiving - at least 1 item to receive

When receiving, the "receive items" form should not be submitted if no
items are going to be received

Test plan:
Create an order, close the basket, receive some items
On the "receive items" form, do not select item (if items are created
when placing the order) and submit the form
=> You must get a JS alert that prevent the form to be submitted
Select at least one item, submit again
=> Now it's submitted

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 11 Martin Renvoize 2020-10-21 15:45:45 UTC
Created attachment 112111 [details] [review]
Bug 21811: Add JS confirmation when receiving - at least 1 item to receive

When receiving, the "receive items" form should not be submitted if no
items are going to be received

Test plan:
Create an order, close the basket, receive some items
On the "receive items" form, do not select item (if items are created
when placing the order) and submit the form
=> You must get a JS alert that prevent the form to be submitted
Select at least one item, submit again
=> Now it's submitted

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2020-10-21 15:46:25 UTC
Nice fix, works as expected, no QA failures.

Passing QA
Comment 13 Jonathan Druart 2020-10-25 23:05:43 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 14 Lucas Gass 2020-11-13 18:58:45 UTC
missing dependencies for 20.05.x, no backport