Bug 27776 - Point of Sale 'This sale' table should not be sorted by default
Summary: Point of Sale 'This sale' table should not be sorted by default
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff Client (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
: 28060 (view as bug list)
Depends on:
Blocks: 13985
  Show dependency treegraph
 
Reported: 2021-02-24 15:50 UTC by Martin Renvoize
Modified: 2021-04-02 15:24 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
21.05.00,20.11.04,20.05.10


Attachments
Bug 27776: Remove default sort order of sales table (2.23 KB, patch)
2021-02-24 15:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27776: Remove default sort order of sales table (1.98 KB, patch)
2021-02-26 08:37 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27776: Remove default sort order of sales table (2.05 KB, patch)
2021-03-04 10:16 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 27776: Remove default sort order of sales table (2.11 KB, patch)
2021-03-04 12:20 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2021-02-24 15:50:07 UTC
The 'This sale' table on the point of sale page is currently sorted by price by default. This can cause unexpected sorting when updating prices and quantities.. as such, we should remove the default sort.
Comment 1 Martin Renvoize 2021-02-24 15:57:32 UTC
Created attachment 117278 [details] [review]
Bug 27776: Remove default sort order of sales table

This patch drops the default sort on table initialisation so that the
table remains sorted in the order in which items are added unless the
user explicitly chooses to apply a sort order.

We also correct a mistake in the targets for disabling sorting on the
'Actions' column and update the hidden 'CODE' column to use the same
syntax as the other definitions for consistency.

Test plan
1/ Enable the point of sale system and set some debit types to allow
sale.
2/ Navigate to the point of sale page and added some items to sell
3/ Update the price for a few lines and note the sort order does not
change.
4/ Update the quantity for a few lines and note the sort order does not
change.
5/ Sort a column using the headers and note it works
6/ Signoff
Comment 2 Owen Leonard 2021-02-25 15:53:42 UTC
Given the status of Bug 25777 I think you should probably take out the changes to the DataTables option names which aren't directly related to the patch's functionality:

-                "targets": [-1],
-                "visible": false,
-                "searchable": false
+                "aTargets": [-1],
+                "bVisible": false,
+                "bSearchable": false,
Comment 3 Martin Renvoize 2021-02-26 08:37:32 UTC
Created attachment 117364 [details] [review]
Bug 27776: Remove default sort order of sales table

This patch drops the default sort on table initialisation so that the
table remains sorted in the order in which items are added unless the
user explicitly chooses to apply a sort order.

We also correct a mistake in the targets for disabling sorting on the
'Actions' column and update the hidden 'CODE' column to use the same
syntax as the other definitions for consistency.

Test plan
1/ Enable the point of sale system and set some debit types to allow
sale.
2/ Navigate to the point of sale page and added some items to sell
3/ Update the price for a few lines and note the sort order does not
change.
4/ Update the quantity for a few lines and note the sort order does not
change.
5/ Sort a column using the headers and note it works
6/ Signoff
Comment 4 Martin Renvoize 2021-02-26 08:38:28 UTC
Thanks Owen, I hadn't realised that trying to move towards consistency within a file had become so contentious :(.

Fixed the patch ad re-attached.
Comment 5 ByWater Sandboxes 2021-03-04 10:16:57 UTC
Created attachment 117668 [details] [review]
Bug 27776: Remove default sort order of sales table

This patch drops the default sort on table initialisation so that the
table remains sorted in the order in which items are added unless the
user explicitly chooses to apply a sort order.

We also correct a mistake in the targets for disabling sorting on the
'Actions' column and update the hidden 'CODE' column to use the same
syntax as the other definitions for consistency.

Test plan
1/ Enable the point of sale system and set some debit types to allow
sale.
2/ Navigate to the point of sale page and added some items to sell
3/ Update the price for a few lines and note the sort order does not
change.
4/ Update the quantity for a few lines and note the sort order does not
change.
5/ Sort a column using the headers and note it works
6/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 6 Sally 2021-03-04 10:17:24 UTC
Works perfectly - signed off.
Comment 7 Katrin Fischer 2021-03-04 12:20:09 UTC
Created attachment 117699 [details] [review]
Bug 27776: Remove default sort order of sales table

This patch drops the default sort on table initialisation so that the
table remains sorted in the order in which items are added unless the
user explicitly chooses to apply a sort order.

We also correct a mistake in the targets for disabling sorting on the
'Actions' column and update the hidden 'CODE' column to use the same
syntax as the other definitions for consistency.

Test plan
1/ Enable the point of sale system and set some debit types to allow
sale.
2/ Navigate to the point of sale page and added some items to sell
3/ Update the price for a few lines and note the sort order does not
change.
4/ Update the quantity for a few lines and note the sort order does not
change.
5/ Sort a column using the headers and note it works
6/ Signoff

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 8 Jonathan Druart 2021-03-05 12:52:08 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 9 Fridolin Somers 2021-03-08 15:52:33 UTC
Pushed to 20.11.x for 20.11.04
Comment 10 Andrew Fuerste-Henry 2021-03-14 19:34:38 UTC
Pushed to 20.05.x for 20.05.10
Comment 11 Victor Grousset/tuxayo 2021-03-23 06:25:29 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.
Comment 12 Katrin Fischer 2021-04-02 15:24:06 UTC
*** Bug 28060 has been marked as a duplicate of this bug. ***