Bug 15348 - Change/Edit estimated delivery date per order line
Summary: Change/Edit estimated delivery date per order line
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Martin Renvoize
URL:
Keywords:
: 31273 (view as bug list)
Depends on: 29955
Blocks: 32504
  Show dependency treegraph
 
Reported: 2015-12-10 09:05 UTC by Katrin Fischer
Modified: 2023-12-28 20:42 UTC (History)
12 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Large patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/665
Text to go in the release notes:
This enhancement allows you to specify an estimated delivery date per order line. The specified estimated delivery date is also considered (alongside the calculated estimated delivery date, if no date has been specified) when searching for late orders and exporting late orders. You can also edit the estimated delivery date from the late orders page.
Version(s) released in:
22.11.00


Attachments
Bug 15348: Add estimated_delivey_date column to aqorders table (1.96 KB, patch)
2020-12-16 05:58 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: WIP (6.32 KB, patch)
2020-12-22 03:58 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (8.40 KB, patch)
2020-12-22 21:22 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (25.39 KB, patch)
2021-01-14 01:20 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Updated schema files (1.51 KB, patch)
2021-01-14 01:20 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.18 KB, patch)
2021-01-14 02:36 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Updated schema files (1.51 KB, patch)
2021-01-14 02:36 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.29 KB, patch)
2021-02-08 16:21 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.31 KB, patch)
2021-03-25 12:33 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.24 KB, patch)
2021-03-25 12:33 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.24 KB, patch)
2021-04-07 14:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.24 KB, patch)
2021-04-07 14:01 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15348: trivial code simplification (1.05 KB, patch)
2021-04-07 14:07 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.22 KB, patch)
2021-05-07 03:03 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.24 KB, patch)
2021-05-07 03:03 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: trivial code simplification (1.05 KB, patch)
2021-05-07 03:03 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions (4.50 KB, patch)
2021-05-07 03:03 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.20 KB, patch)
2022-06-27 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.15 KB, patch)
2022-06-27 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: trivial code simplification (1.05 KB, patch)
2022-06-27 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions (4.97 KB, patch)
2022-06-27 02:47 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix TT filters from html to uri (1.45 KB, patch)
2022-07-04 12:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix export of dt_from_string (898 bytes, patch)
2022-07-04 12:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Fix useless use of proviate variable in void context (1.01 KB, patch)
2022-07-04 13:09 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl (1.10 KB, patch)
2022-07-04 15:27 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Update calendar widget to flatpickr (2.51 KB, patch)
2022-07-04 15:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix calendar widget, translateability, etc (10.62 KB, patch)
2022-07-15 02:13 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: DBIC changes DO NOT PUSH (1.53 KB, patch)
2022-07-15 02:14 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix calendar widget, translateability, etc (10.58 KB, patch)
2022-07-15 02:20 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: DBIC changes DO NOT PUSH (1.53 KB, patch)
2022-07-15 02:20 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix modal to edit delivery date (3.04 KB, patch)
2022-07-26 05:09 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix filtering results on estimated delivery date (1.62 KB, patch)
2022-08-02 04:58 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.17 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.31 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: trivial code simplification (1.21 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions (5.10 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix TT filters from html to uri (1.61 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix export of dt_from_string (1.04 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl (1.26 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Update calendar widget to flatpickr (2.67 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix calendar widget, translateability, etc (10.72 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: DBIC changes DO NOT PUSH (1.69 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix modal to edit delivery date (3.20 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix filtering results on estimated delivery date (1.79 KB, patch)
2022-08-03 12:21 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings (4.29 KB, patch)
2022-08-17 10:04 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page (2.55 KB, patch)
2022-08-17 11:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page (2.75 KB, patch)
2022-08-17 17:57 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.23 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.37 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: trivial code simplification (1.27 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions (5.16 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix TT filters from html to uri (1.67 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix export of dt_from_string (1.10 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl (1.32 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Update calendar widget to flatpickr (2.73 KB, patch)
2022-08-18 07:53 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix calendar widget, translateability, etc (10.78 KB, patch)
2022-08-18 07:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: DBIC changes DO NOT PUSH (1.75 KB, patch)
2022-08-18 07:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix modal to edit delivery date (3.25 KB, patch)
2022-08-18 07:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix filtering results on estimated delivery date (1.85 KB, patch)
2022-08-18 07:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings (4.35 KB, patch)
2022-08-18 07:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page (2.62 KB, patch)
2022-08-18 07:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page (2.80 KB, patch)
2022-08-18 07:54 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.29 KB, patch)
2022-08-18 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.43 KB, patch)
2022-08-18 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: trivial code simplification (1.33 KB, patch)
2022-08-18 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions (5.22 KB, patch)
2022-08-18 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix TT filters from html to uri (1.73 KB, patch)
2022-08-18 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix export of dt_from_string (1.16 KB, patch)
2022-08-18 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl (1.38 KB, patch)
2022-08-18 10:57 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Update calendar widget to flatpickr (2.79 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix calendar widget, translateability, etc (10.84 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: DBIC changes DO NOT PUSH (1.81 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix modal to edit delivery date (3.32 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix filtering results on estimated delivery date (1.91 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings (4.41 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page (2.68 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page (2.87 KB, patch)
2022-08-18 10:58 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15348: Add estimated delivery date field to individual orders (28.43 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) Remove superflous filters (2.43 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: trivial code simplification (1.33 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions (5.22 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix TT filters from html to uri (1.73 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix export of dt_from_string (1.16 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl (1.38 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Update calendar widget to flatpickr (2.79 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix calendar widget, translateability, etc (10.84 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: DBIC changes DO NOT PUSH (1.81 KB, patch)
2022-08-26 16:31 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix modal to edit delivery date (3.32 KB, patch)
2022-08-26 16:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix filtering results on estimated delivery date (1.91 KB, patch)
2022-08-26 16:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings (4.41 KB, patch)
2022-08-26 16:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page (2.68 KB, patch)
2022-08-26 16:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page (2.87 KB, patch)
2022-08-26 16:32 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (QA follow-up) DB update fixes (3.04 KB, patch)
2022-09-16 13:55 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 15348: Add estimated_delivery_date to object spec (909 bytes, patch)
2022-09-16 20:11 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix filters on input fields (4.64 KB, patch)
2022-11-15 11:37 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: Store estimated delivery date when adding an order (1.52 KB, patch)
2022-11-15 12:25 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix modals to pre-set input with stored date (5.10 KB, patch)
2022-11-15 13:36 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 15348: (follow-up) Fix modals to pre-set input with stored date (5.38 KB, patch)
2022-11-15 14:04 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 Katrin Fischer 2015-12-10 09:05:45 UTC
Currently the estimated delivery date appears to be calculated from the date of the basket was closed and the delivery time defined for the bookseller.

Sometimes the library will want to change this date by order line, as it's known that the item will have a later delivery date and they don't want it to be shown on the late orders page. 

There is currently no way to achieve this as we don't store a delivery date in the order. It would be nice if there was a way to overwrite the calculated delivery date with a manual one.
Comment 1 Katrin Fischer 2016-12-28 10:09:08 UTC
This would still be very helpful in order to be able to react to feedback from the supplier and not send them unwanted claims.
Comment 2 Sandre Cunha 2017-08-16 22:01:30 UTC
It would also be helpful when one is ordering items months in advance of the publication date. For example, if it is July, and you are ordering something that won't be published until October 24, it would be nice to be able to set the delivery time based on the expected publication date.
Comment 3 Aleisha Amohia 2020-12-16 05:58:47 UTC
Created attachment 114430 [details] [review]
Bug 15348: Add estimated_delivey_date column to aqorders table
Comment 4 Aleisha Amohia 2020-12-22 03:58:05 UTC
Created attachment 114583 [details] [review]
Bug 15348: WIP

Working on pre-filling values
Comment 5 Aleisha Amohia 2020-12-22 21:22:00 UTC
Created attachment 114623 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.

Work to do:
- Make the Late Orders page check the estimated delivery date field
- Make the Late Orders export functionality handle this
- Edit the estimated delivery date from Late Orders page

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Comment 6 Aleisha Amohia 2021-01-14 01:20:41 UTC
Created attachment 115121 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Comment 7 Aleisha Amohia 2021-01-14 01:20:45 UTC
Created attachment 115122 [details] [review]
Bug 15348: Updated schema files
Comment 8 Aleisha Amohia 2021-01-14 02:36:38 UTC
Created attachment 115123 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Comment 9 Aleisha Amohia 2021-01-14 02:36:42 UTC
Created attachment 115124 [details] [review]
Bug 15348: Updated schema files
Comment 10 Christian Stelzenmüller 2021-02-08 15:10:54 UTC
tested with ptfs-e sandbox, everything fine, sign-off didn't work :-(
Comment 11 Katrin Fischer 2021-02-08 16:21:32 UTC
Created attachment 116517 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)

Signed-off-by: Christian Stelzenmüller <christian.stelzenmüller@bsz-bw.de>
Comment 12 Katrin Fischer 2021-02-08 16:23:41 UTC
I added Christian's sign-off line. I also had to fix a minor conflict in kohastructure.sql and I have removed the Schema file update as this would no longer apply. We used the "Refresh schema" action from the sandbox to achieve that step.
Comment 13 Martin Renvoize 2021-03-25 12:33:10 UTC
Created attachment 118788 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2021-03-25 12:33:14 UTC
Created attachment 118789 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.
Comment 15 Martin Renvoize 2021-03-25 12:34:56 UTC
No regressions found, all appears to work as expected.

QA script is happy and tests pass.

Passing QA
Comment 16 Jonathan Druart 2021-04-07 14:01:24 UTC
Created attachment 119297 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 17 Jonathan Druart 2021-04-07 14:01:32 UTC
Created attachment 119298 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.
Comment 18 Jonathan Druart 2021-04-07 14:01:49 UTC
Patches rebased.
Comment 19 Jonathan Druart 2021-04-07 14:06:40 UTC
1. 
https://snipboard.io/xZtHsv.jpg

MariaDB [koha_kohadev]> select ordernumber, estimated_delivery_date from aqorders;
+-------------+-------------------------+
| ordernumber | estimated_delivery_date |
+-------------+-------------------------+
|           7 | NULL                    |
|           8 | 2021-04-14              |
|           9 | NULL                    |
|          10 | NULL                    |
+-------------+-------------------------+

If I set a "from" date:
https://snipboard.io/sGRCWS.jpg

I am expecting to see the same 4 orders.

2. There is a JS error on lateorders.pl
  Uncaught TypeError: f is undefined

3. The CSV export does not work but it's certainly caused by the JS error.

4. Permissions for acqui/moddeliverydate.pl is acquisition => *, shouldn't it be acquisition => order_manage?

5. (not blocker) please keep in mind that new variables must be named in snaked_case, as well as new files.
Comment 20 Jonathan Druart 2021-04-07 14:07:37 UTC
Created attachment 119299 [details] [review]
Bug 15348: trivial code simplification
Comment 21 Jonathan Druart 2021-04-07 15:36:16 UTC
Note: check breadcrumb and title (bug 27846 and bug 26703).
Comment 22 Aleisha Amohia 2021-05-06 03:41:26 UTC
I'm stuck on that JS error, and it looks like the internal note and vendor note also no longer open in pop up windows. Any thoughts on the datatables error?
Comment 23 Jonathan Druart 2021-05-06 07:05:29 UTC
(In reply to Aleisha Amohia from comment #22)
> I'm stuck on that JS error, and it looks like the internal note and vendor
> note also no longer open in pop up windows. Any thoughts on the datatables
> error?

-            <th colspan="6">Total</th>
+            <th colspan="7">Total</th>

Why? You are not adding a new column.
Comment 24 Aleisha Amohia 2021-05-07 03:03:37 UTC
Created attachment 120653 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 25 Aleisha Amohia 2021-05-07 03:03:42 UTC
Created attachment 120654 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.
Comment 26 Aleisha Amohia 2021-05-07 03:03:46 UTC
Created attachment 120655 [details] [review]
Bug 15348: trivial code simplification
Comment 27 Aleisha Amohia 2021-05-07 03:03:51 UTC
Created attachment 120656 [details] [review]
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions
Comment 28 Jonathan Druart 2021-05-07 06:48:27 UTC
(In reply to Jonathan Druart from comment #19)
> 1. 
> https://snipboard.io/xZtHsv.jpg
> 
> MariaDB [koha_kohadev]> select ordernumber, estimated_delivery_date from
> aqorders;
> +-------------+-------------------------+
> | ordernumber | estimated_delivery_date |
> +-------------+-------------------------+
> |           7 | NULL                    |
> |           8 | 2021-04-14              |
> |           9 | NULL                    |
> |          10 | NULL                    |
> +-------------+-------------------------+
> 
> If I set a "from" date:
> https://snipboard.io/sGRCWS.jpg
> 
> I am expecting to see the same 4 orders.

Did you fix that, Aleisha?
Comment 29 Aleisha Amohia 2021-05-09 20:53:54 UTC
I couldn't reproduce your bug. Is someone else about to reproduce it?
Comment 30 Christian Stelzenmüller 2021-11-04 08:22:21 UTC
I don't know if it's the mentioned bug, but im getting an error on step 5 from the test plan.

Error trace

Undefined subroutine &CGI::Compile::ROOT::kohadevbox_koha_acqui_addorder_2epl::dt_from_string called at /kohadevbox/koha/acqui/addorder.pl line 318

    in (eval) at /kohadevbox/koha/acqui/addorder.pl line 318

      315:         }
      316:     );
      317: 
      318:     $orderinfo->{estimated_delivery_date} = $orderinfo->{estimated_delivery_date} ? dt_from_string($orderinfo->{estimated_delivery_date}) : undef;
      319: 
      320:     # if we already have $ordernumber, then it's an ordermodif
      321:     my $order = Koha::Acquisition::Order->new($orderinfo);
Comment 31 Katrin Fischer 2022-05-06 07:15:39 UTC
Hi Aleisha,

I tried to have a look at this patch set too, but it currently doesn't apply. I fixed the first conflict, but got stuck at the second.

Could you please rebase and have a look at the problem Christian noted in comment#30?

Thx!
Comment 32 Katrin Fischer 2022-05-06 07:31:34 UTC
I tried to look at the patch set, but it's a little confusing like that in Bugzilla. Noticed that the first patch has a @hotmail.com address, not sure if that was intentional or if you want to fix.
Comment 33 Aleisha Amohia 2022-06-27 02:47:44 UTC
Created attachment 136560 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 34 Aleisha Amohia 2022-06-27 02:47:49 UTC
Created attachment 136561 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.
Comment 35 Aleisha Amohia 2022-06-27 02:47:54 UTC
Created attachment 136562 [details] [review]
Bug 15348: trivial code simplification
Comment 36 Aleisha Amohia 2022-06-27 02:47:59 UTC
Created attachment 136563 [details] [review]
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions
Comment 37 Aleisha Amohia 2022-06-27 02:48:52 UTC
Have hopefully fixed up the error and fixed the author email address on my two patches.
Comment 38 Katrin Fischer 2022-07-04 12:25:25 UTC
Created attachment 137057 [details] [review]
Bug 15348: (follow-up) Fix TT filters from html to uri
Comment 39 Katrin Fischer 2022-07-04 12:53:44 UTC
Created attachment 137058 [details] [review]
Bug 15348: (follow-up) Fix export of dt_from_string

FAIL	acqui/addorder.pl
   FAIL	  valid
          " dt_from_string " is not exported by the Koha::DateUtils module
	  Can't continue after import errors
Comment 40 Katrin Fischer 2022-07-04 13:09:09 UTC
Created attachment 137061 [details] [review]
Bug 15348: (QA follow-up) Fix useless use of proviate variable in void context

FAIL	acqui/moddeliverydate.pl
   FAIL	  valid
	  Useless use of private variable in void context
Comment 41 Katrin Fischer 2022-07-04 15:27:51 UTC
Created attachment 137098 [details] [review]
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl
Comment 42 Katrin Fischer 2022-07-04 15:36:24 UTC
Created attachment 137099 [details] [review]
Bug 15348: (follow-up) Update calendar widget to flatpickr
Comment 43 Katrin Fischer 2022-07-04 15:51:28 UTC
Hi Aleisha, 

1) there were several complaints by the QA tools that I have fixed 2 in separate follow-up patches. Could you please fix the third one? I have not been able to figure this one out:

 FAIL	acqui/moddeliverydate.pl
   FAIL	  valid
		Useless use of private variable in void context

2) This bit here is not translatable:

var modalTitle = $(this).attr("title") + " (order number " + ordernumber + ")";

3) When adding a new order, there is no calendar widget for the estimated delivery date column. I have tried to do an update to flatpickr in a follow-up, but I think it's not complete yet. 

I believe these type of lines need to be removed from the files as well:
$("#estimated_delivery_date").datepicker();

4) Looking for 'datepicker' in the code, I saw that there is code for a modal in lateorders.tt, but it doesn't appear to be used, it looks like moddeliverdatey.tt is used instead. A modal like the edit notes one on the same page would really nice and more consistent:

            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="dateEditorLabel">Estimated delivery date</h4>
                </div>
                <div class="modal-body">
                <input type="text" id="estimated_delivery_date" size="10" name="estimated_delivery_date" class="datepicker" value="[% estimated_delivery_date | html %]"/>
                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
                <input type="hidden" id="date_ordernumber" name="ordernumber" value="" />
                <input type="hidden" name="op" value="save" />
            </div>

5) It's not possible to edit the estimated delivery date from a closed basket. If you reopen and close the basket, the close date will be updated, that is also used as the order date. So we need to be able to update this without reopening.

6) When editing the delivery date from the late orders page, things would explode. I fixed the import statements in a follow-up. Hope I caught them all.
Comment 44 Aleisha Amohia 2022-07-15 02:13:58 UTC
Created attachment 137740 [details] [review]
Bug 15348: (follow-up) Fix calendar widget, translateability, etc

Also add functionality to edit the estimated delivery date from a closed
basket.
Comment 45 Aleisha Amohia 2022-07-15 02:14:03 UTC
Created attachment 137741 [details] [review]
Bug 15348: DBIC changes DO NOT PUSH

For testing purposes
Comment 46 Aleisha Amohia 2022-07-15 02:20:10 UTC
Created attachment 137742 [details] [review]
Bug 15348: (follow-up) Fix calendar widget, translateability, etc

Also add functionality to edit the estimated delivery date from a closed
basket.
Comment 47 Aleisha Amohia 2022-07-15 02:20:15 UTC
Created attachment 137743 [details] [review]
Bug 15348: DBIC changes DO NOT PUSH

For testing purposes
Comment 48 Katrin Fischer 2022-07-19 15:52:08 UTC
Hi Aleisha,

thanks a lot for the follow-ups! The modals look really nice now.

Found a small glitch: you cannot empty the estimated delivery date from the modal on the basket summary page once it has been set. When emptying the field using the red X next to the field, the field empties, but today's date will be saved. It's always today's date, independent of the setting for the vendor.

I have created 3 orders:
2022-07-30
2022-07-19
NULL - calculated from 10 days in vendor: 2022-07-29

When I search for:
- 2022-07-01 - 2022-07-30  - OK, all show
- 2022-07-01 - 2022-07-29  - NOT OK, still all three show, but 30 should not
- 2022-07-01 - 2022-07-27  - NOT OK, 30t and 19 show, but 29, the calculated one does not

I've tried the dd.mm.yyyy and the yyyy-mm-dd Dateformat settings and the behaviour is the same. Can you help?

Are moddelivery.tt/.pl fallbacks for no JavaScript?
Comment 49 Aleisha Amohia 2022-07-26 05:09:20 UTC
Created attachment 138110 [details] [review]
Bug 15348: (follow-up) Fix modal to edit delivery date

This allows you to empty the delivery date and ensures the current date
shows
Comment 50 Aleisha Amohia 2022-07-26 05:10:55 UTC
(In reply to Katrin Fischer from comment #48)

> I have created 3 orders:
> 2022-07-30
> 2022-07-19
> NULL - calculated from 10 days in vendor: 2022-07-29
> 
> When I search for:
> - 2022-07-01 - 2022-07-30  - OK, all show
> - 2022-07-01 - 2022-07-29  - NOT OK, still all three show, but 30 should not
> - 2022-07-01 - 2022-07-27  - NOT OK, 30t and 19 show, but 29, the calculated
> one does not
> 
> I've tried the dd.mm.yyyy and the yyyy-mm-dd Dateformat settings and the
> behaviour is the same. Can you help?
> 

Still working on this

> Are moddelivery.tt/.pl fallbacks for no JavaScript?

Yes, it matches the behaviour of the internal and vendor notes
Comment 51 David Cook 2022-08-01 23:52:33 UTC
*** Bug 31273 has been marked as a duplicate of this bug. ***
Comment 52 Aleisha Amohia 2022-08-02 04:58:14 UTC
Created attachment 138491 [details] [review]
Bug 15348: (follow-up) Fix filtering results on estimated delivery date

Adding another clause to the SQL so that the specified estimated
delivery date is used for filtering first, and the calculated delivery
date is used if there is no specified estimated delivery date.
Comment 53 Biblibre Sandboxes 2022-08-03 12:21:01 UTC
Created attachment 138529 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 54 Biblibre Sandboxes 2022-08-03 12:21:06 UTC
Created attachment 138530 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 55 Biblibre Sandboxes 2022-08-03 12:21:11 UTC
Created attachment 138531 [details] [review]
Bug 15348: trivial code simplification

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 56 Biblibre Sandboxes 2022-08-03 12:21:16 UTC
Created attachment 138532 [details] [review]
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 57 Biblibre Sandboxes 2022-08-03 12:21:21 UTC
Created attachment 138533 [details] [review]
Bug 15348: (follow-up) Fix TT filters from html to uri

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 58 Biblibre Sandboxes 2022-08-03 12:21:26 UTC
Created attachment 138534 [details] [review]
Bug 15348: (follow-up) Fix export of dt_from_string

 FAIL	acqui/addorder.pl
   FAIL	  valid
          " dt_from_string " is not exported by the Koha::DateUtils module
	  Can't continue after import errors

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 59 Biblibre Sandboxes 2022-08-03 12:21:32 UTC
Created attachment 138535 [details] [review]
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 60 Biblibre Sandboxes 2022-08-03 12:21:37 UTC
Created attachment 138536 [details] [review]
Bug 15348: (follow-up) Update calendar widget to flatpickr

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 61 Biblibre Sandboxes 2022-08-03 12:21:42 UTC
Created attachment 138537 [details] [review]
Bug 15348: (follow-up) Fix calendar widget, translateability, etc

Also add functionality to edit the estimated delivery date from a closed
basket.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 62 Biblibre Sandboxes 2022-08-03 12:21:47 UTC
Created attachment 138538 [details] [review]
Bug 15348: DBIC changes DO NOT PUSH

For testing purposes

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 63 Biblibre Sandboxes 2022-08-03 12:21:52 UTC
Created attachment 138539 [details] [review]
Bug 15348: (follow-up) Fix modal to edit delivery date

This allows you to empty the delivery date and ensures the current date
shows

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 64 Biblibre Sandboxes 2022-08-03 12:21:56 UTC
Created attachment 138540 [details] [review]
Bug 15348: (follow-up) Fix filtering results on estimated delivery date

Adding another clause to the SQL so that the specified estimated
delivery date is used for filtering first, and the calculated delivery
date is used if there is no specified estimated delivery date.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Comment 65 Aleisha Amohia 2022-08-03 20:32:09 UTC
Changing status to reflect signoffs from Christian
Comment 66 Katrin Fischer 2022-08-17 10:04:56 UTC
Created attachment 139245 [details] [review]
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings

On the basket summary page the estimated delivery date column was
moved before the supplier report column, that is only visible
when EDIFACT has been activated.

It also adds the new column to the table configuration.
Comment 67 Katrin Fischer 2022-08-17 11:32:16 UTC
Created attachment 139274 [details] [review]
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page

Also removes some unneded variables from the table footers that
are used to display amount totals.
Comment 68 Katrin Fischer 2022-08-17 17:57:05 UTC
Created attachment 139301 [details] [review]
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page

When editing the estimated delivery date from the late orders page,
with multiple late orders, the selected date in the edit form would
always be the same, not matching the edited date.

With this page, the edited date will match what is shown in the form.
Comment 69 Katrin Fischer 2022-08-17 17:58:06 UTC
Handing over to Martin for final QA.
Comment 70 Katrin Fischer 2022-08-18 07:53:19 UTC
Created attachment 139329 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 71 Katrin Fischer 2022-08-18 07:53:24 UTC
Created attachment 139330 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 72 Katrin Fischer 2022-08-18 07:53:29 UTC
Created attachment 139331 [details] [review]
Bug 15348: trivial code simplification

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 73 Katrin Fischer 2022-08-18 07:53:34 UTC
Created attachment 139332 [details] [review]
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 74 Katrin Fischer 2022-08-18 07:53:40 UTC
Created attachment 139333 [details] [review]
Bug 15348: (follow-up) Fix TT filters from html to uri

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 75 Katrin Fischer 2022-08-18 07:53:46 UTC
Created attachment 139334 [details] [review]
Bug 15348: (follow-up) Fix export of dt_from_string

 FAIL	acqui/addorder.pl
   FAIL	  valid
          " dt_from_string " is not exported by the Koha::DateUtils module
	  Can't continue after import errors

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 76 Katrin Fischer 2022-08-18 07:53:52 UTC
Created attachment 139335 [details] [review]
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 77 Katrin Fischer 2022-08-18 07:53:59 UTC
Created attachment 139336 [details] [review]
Bug 15348: (follow-up) Update calendar widget to flatpickr

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 78 Katrin Fischer 2022-08-18 07:54:06 UTC
Created attachment 139337 [details] [review]
Bug 15348: (follow-up) Fix calendar widget, translateability, etc

Also add functionality to edit the estimated delivery date from a closed
basket.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 79 Katrin Fischer 2022-08-18 07:54:10 UTC
Created attachment 139338 [details] [review]
Bug 15348: DBIC changes DO NOT PUSH

For testing purposes

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 80 Katrin Fischer 2022-08-18 07:54:17 UTC
Created attachment 139339 [details] [review]
Bug 15348: (follow-up) Fix modal to edit delivery date

This allows you to empty the delivery date and ensures the current date
shows

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 81 Katrin Fischer 2022-08-18 07:54:23 UTC
Created attachment 139340 [details] [review]
Bug 15348: (follow-up) Fix filtering results on estimated delivery date

Adding another clause to the SQL so that the specified estimated
delivery date is used for filtering first, and the calculated delivery
date is used if there is no specified estimated delivery date.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 82 Katrin Fischer 2022-08-18 07:54:28 UTC
Created attachment 139341 [details] [review]
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings

On the basket summary page the estimated delivery date column was
moved before the supplier report column, that is only visible
when EDIFACT has been activated.

It also adds the new column to the table configuration.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 83 Katrin Fischer 2022-08-18 07:54:32 UTC
Created attachment 139342 [details] [review]
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page

Also removes some unneded variables from the table footers that
are used to display amount totals.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 84 Katrin Fischer 2022-08-18 07:54:39 UTC
Created attachment 139343 [details] [review]
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page

When editing the estimated delivery date from the late orders page,
with multiple late orders, the selected date in the edit form would
always be the same, not matching the edited date.

With this page, the edited date will match what is shown in the form.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Comment 85 Martin Renvoize 2022-08-18 10:57:21 UTC
Created attachment 139351 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 86 Martin Renvoize 2022-08-18 10:57:26 UTC
Created attachment 139352 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 87 Martin Renvoize 2022-08-18 10:57:31 UTC
Created attachment 139353 [details] [review]
Bug 15348: trivial code simplification

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 88 Martin Renvoize 2022-08-18 10:57:35 UTC
Created attachment 139354 [details] [review]
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 89 Martin Renvoize 2022-08-18 10:57:40 UTC
Created attachment 139355 [details] [review]
Bug 15348: (follow-up) Fix TT filters from html to uri

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 90 Martin Renvoize 2022-08-18 10:57:45 UTC
Created attachment 139356 [details] [review]
Bug 15348: (follow-up) Fix export of dt_from_string

 FAIL	acqui/addorder.pl
   FAIL	  valid
          " dt_from_string " is not exported by the Koha::DateUtils module
	  Can't continue after import errors

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 91 Martin Renvoize 2022-08-18 10:57:54 UTC
Created attachment 139357 [details] [review]
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 92 Martin Renvoize 2022-08-18 10:58:00 UTC
Created attachment 139358 [details] [review]
Bug 15348: (follow-up) Update calendar widget to flatpickr

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 93 Martin Renvoize 2022-08-18 10:58:07 UTC
Created attachment 139359 [details] [review]
Bug 15348: (follow-up) Fix calendar widget, translateability, etc

Also add functionality to edit the estimated delivery date from a closed
basket.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 94 Martin Renvoize 2022-08-18 10:58:15 UTC
Created attachment 139360 [details] [review]
Bug 15348: DBIC changes DO NOT PUSH

For testing purposes

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 95 Martin Renvoize 2022-08-18 10:58:21 UTC
Created attachment 139361 [details] [review]
Bug 15348: (follow-up) Fix modal to edit delivery date

This allows you to empty the delivery date and ensures the current date
shows

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 96 Martin Renvoize 2022-08-18 10:58:28 UTC
Created attachment 139362 [details] [review]
Bug 15348: (follow-up) Fix filtering results on estimated delivery date

Adding another clause to the SQL so that the specified estimated
delivery date is used for filtering first, and the calculated delivery
date is used if there is no specified estimated delivery date.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 97 Martin Renvoize 2022-08-18 10:58:33 UTC
Created attachment 139363 [details] [review]
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings

On the basket summary page the estimated delivery date column was
moved before the supplier report column, that is only visible
when EDIFACT has been activated.

It also adds the new column to the table configuration.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 98 Martin Renvoize 2022-08-18 10:58:39 UTC
Created attachment 139364 [details] [review]
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page

Also removes some unneded variables from the table footers that
are used to display amount totals.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 99 Martin Renvoize 2022-08-18 10:58:45 UTC
Created attachment 139365 [details] [review]
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page

When editing the estimated delivery date from the late orders page,
with multiple late orders, the selected date in the edit form would
always be the same, not matching the edited date.

With this page, the edited date will match what is shown in the form.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 100 Martin Renvoize 2022-08-18 11:03:29 UTC
The code works and there are no obvious regressions.. QA scripts are also happy..

I don't really understand why we introduce a new controller here where an API would have made more sense.. code only appears to have been submitted in 2020 and the API was already starting to get a lot more use.

Passing QA however.. it just means more work for someone down the line to update it to use API's.
Comment 101 Martin Renvoize 2022-08-18 11:39:40 UTC
Happy to coach on converting to API later btw.. it would be good to get more devs up to speed on it.. I'm under no illusions there are certainly rough edges still ;P
Comment 102 Katrin Fischer 2022-08-18 12:23:24 UTC
(In reply to Martin Renvoize from comment #101)
> Happy to coach on converting to API later btw.. it would be good to get more
> devs up to speed on it.. I'm under no illusions there are certainly rough
> edges still ;P

Planning to 'harass' you guys for helping me sort the API related pages in the wiki once the update has happened, we have a lot of pages but I have no idea which information is actually current.
Comment 103 Tomás Cohen Arazi 2022-08-22 16:41:57 UTC
Hi, please rebase. Bug 29955 made a small change that makes the first patch fail to apply.
Comment 104 Katrin Fischer 2022-08-26 16:31:06 UTC
Created attachment 139831 [details] [review]
Bug 15348: Add estimated delivery date field to individual orders

This patch allows you to specify an estimated delivery date per order.
The specified estimated delivery date is also considered when searching
for late orders and exporting late orders. You can also edit the
estimated delivery date from the late orders page.

Test plan:
1. Update database, rebuild schema, restart services
2. Go to Acquisitions, search for a vendor, and create a new basket
3. Add an order to the basket. When filling in the accounting details,
notice the new 'estimated delivery date' field, but don't add a date.
Save the order.
4. Confirm no date shows in the estimated delivery date column in the
orders table.
5. Modify the order. Add a date in the estimated delivery date field and
save the order.
6. Confirm the date now shows in the orders table.
7. Close the basket.
8. Go to the Late Orders page.
9. Put estimated delivery date from and to parameters in the search
filters on the left. Ensure the from and to dates encapsulate the date
you entered in the estimated delivery date field for the order.
10. Click Filter and ensure the order shows.
11. Select the checkbox next to the order. Click the Export as CSV button.
12. Open the CSV and confirm the estimated delivery date that you
entered shows as expected in the file.
13. Click Edit under the estimated delivery date. Confirm the estimated
delivery date modal pops up with the correct order line number in the
modal header.
14. Remove the estimated delivery date and click Save.
15. Confirm that the estimated delivery date calculated by Koha now
shows in the late orders table.
16. Select the checkbox next to the order. Click the Export as CSV button.
17. Open the CSV and confirm the calculated estimated delivery date
shows in the CSV.
18. Confirm tests pass: t/db_dependent/Koha/Acquisition/Order.t

Sponsored-by: Bibliotheksservice-Zentrum Baden-Württemberg (BSZ)
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 105 Katrin Fischer 2022-08-26 16:31:12 UTC
Created attachment 139832 [details] [review]
Bug 15348: (QA follow-up) Remove superflous filters

The QA script highlighted the addition of some unneeded extra TT
filters.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 106 Katrin Fischer 2022-08-26 16:31:18 UTC
Created attachment 139833 [details] [review]
Bug 15348: trivial code simplification

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 107 Katrin Fischer 2022-08-26 16:31:23 UTC
Created attachment 139834 [details] [review]
Bug 15348: (follow-up) Fix breadcrumbs, title, JS error, permissions

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 108 Katrin Fischer 2022-08-26 16:31:29 UTC
Created attachment 139835 [details] [review]
Bug 15348: (follow-up) Fix TT filters from html to uri

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 109 Katrin Fischer 2022-08-26 16:31:34 UTC
Created attachment 139836 [details] [review]
Bug 15348: (follow-up) Fix export of dt_from_string

 FAIL	acqui/addorder.pl
   FAIL	  valid
          " dt_from_string " is not exported by the Koha::DateUtils module
	  Can't continue after import errors

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 110 Katrin Fischer 2022-08-26 16:31:39 UTC
Created attachment 139837 [details] [review]
Bug 15348: (follow-up) Fix imports in moddeliverydate.pl

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 111 Katrin Fischer 2022-08-26 16:31:46 UTC
Created attachment 139838 [details] [review]
Bug 15348: (follow-up) Update calendar widget to flatpickr

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 112 Katrin Fischer 2022-08-26 16:31:52 UTC
Created attachment 139839 [details] [review]
Bug 15348: (follow-up) Fix calendar widget, translateability, etc

Also add functionality to edit the estimated delivery date from a closed
basket.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 113 Katrin Fischer 2022-08-26 16:31:58 UTC
Created attachment 139840 [details] [review]
Bug 15348: DBIC changes DO NOT PUSH

For testing purposes

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 114 Katrin Fischer 2022-08-26 16:32:03 UTC
Created attachment 139841 [details] [review]
Bug 15348: (follow-up) Fix modal to edit delivery date

This allows you to empty the delivery date and ensures the current date
shows

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 115 Katrin Fischer 2022-08-26 16:32:08 UTC
Created attachment 139842 [details] [review]
Bug 15348: (follow-up) Fix filtering results on estimated delivery date

Adding another clause to the SQL so that the specified estimated
delivery date is used for filtering first, and the calculated delivery
date is used if there is no specified estimated delivery date.

Signed-off-by: Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 116 Katrin Fischer 2022-08-26 16:32:13 UTC
Created attachment 139843 [details] [review]
Bug 15348: (follow-up) Move estimated delivery date before supplier report and fix column settings

On the basket summary page the estimated delivery date column was
moved before the supplier report column, that is only visible
when EDIFACT has been activated.

It also adds the new column to the table configuration.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 117 Katrin Fischer 2022-08-26 16:32:18 UTC
Created attachment 139844 [details] [review]
Bug 15348: (follow-up) Fix sorting of estimated delivery date on basket summary page

Also removes some unneded variables from the table footers that
are used to display amount totals.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 118 Katrin Fischer 2022-08-26 16:32:23 UTC
Created attachment 139845 [details] [review]
Bug 15348: (follow-up) Fix pre-selected date when editing from late orders page

When editing the estimated delivery date from the late orders page,
with multiple late orders, the selected date in the edit form would
always be the same, not matching the edited date.

With this page, the edited date will match what is shown in the form.

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 119 Katrin Fischer 2022-08-26 16:33:21 UTC
Rebased, tests pass and retested functionality on addorder.pl
Comment 120 Tomás Cohen Arazi 2022-09-16 13:55:27 UTC
Created attachment 140708 [details] [review]
Bug 15348: (QA follow-up) DB update fixes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 121 Tomás Cohen Arazi 2022-09-16 14:07:26 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 122 Tomás Cohen Arazi 2022-09-16 20:11:17 UTC
Created attachment 140735 [details] [review]
Bug 15348: Add estimated_delivery_date to object spec

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 123 Lucas Gass 2022-10-31 21:51:46 UTC
Enchancement will not be backported to 22.05.x series
Comment 124 Jonathan Druart 2022-11-15 09:17:32 UTC
This does not work.

Because of bug 30718 you don't need the KohaDates filter on the flatpickr's input.
The commit "Fix calendar widget" is actually messing with the date.

The bug I found appears when you edit an order.
Comment 125 Katrin Fischer 2022-11-15 10:20:46 UTC
(In reply to Jonathan Druart from comment #124)
> This does not work.
> 
> Because of bug 30718 you don't need the KohaDates filter on the flatpickr's
> input.
> The commit "Fix calendar widget" is actually messing with the date.
> 
> The bug I found appears when you edit an order.

I think there was an overlap in development/time gap between this passing and being pushed. 

Can you explain more what needs to be fixed/what is broken?
Comment 126 Katrin Fischer 2022-11-15 11:37:19 UTC
Created attachment 143896 [details] [review]
Bug 15348: (follow-up) Fix filters on input fields

With bug 30718 we on longer need the KohaDates TT filter
on the inputs. This patch removes them.
Comment 127 Katrin Fischer 2022-11-15 12:25:52 UTC
Created attachment 143900 [details] [review]
Bug 15348: Store estimated delivery date when adding an order

When the estimated delivery date was entered on adding or modifying
and order, it was not saved to the database.

To test:
* Add new order, fill in estimated delivery date
* Save
* Verify the estimated delivery date is empty
* Modify order line, date will also not be saved
* Apply patch
* The date should now save and update correctly
Comment 128 Katrin Fischer 2022-11-15 12:33:17 UTC
I believe the first fix is what Joubu asked for and the second is something I found while testing.

I have a remaining issue: when clicking on 'edit' from basket, the date in the modal is no longer pre-set with the stored date. This might also appear in other spots where the modal is used (late orders).
Comment 129 Katrin Fischer 2022-11-15 13:36:22 UTC
Created attachment 143903 [details] [review]
Bug 15348: (follow-up) Fix modals to pre-set input with stored date

Makes sure that when an estimated delivery day is edited using
the modals on the basket summary or late order pages, the
date input is pre-set to the stored estimated delivery date.

To test:
* Create some order lines with and without estimated delivery date set
* Make sure that on the basket summary the edit link comes up with an
  empty modal
* Close the basket
* Check that on late orders the dates are pre-filled incorrectly as well
* Apply patch
* Refresh basket summary and late order pages
* All edit links now should bring up the modal with the correct date filled in
Comment 130 Katrin Fischer 2022-11-15 13:37:15 UTC
Thanks Owen for the hints and explanations!
Comment 131 Katrin Fischer 2022-11-15 14:04:17 UTC
Created attachment 143904 [details] [review]
Bug 15348: (follow-up) Fix modals to pre-set input with stored date

Makes sure that when an estimated delivery day is edited using
the modals on the basket summary or late order pages, the
date input is pre-set to the stored estimated delivery date.

To test:
* Create some order lines with and without estimated delivery date set
* Make sure that on the basket summary the edit link comes up with an
  empty modal
* Close the basket
* Check that on late orders the dates are pre-filled incorrectly as well
* Apply patch
* Refresh basket summary and late order pages
* All edit links now should bring up the modal with the correct date filled in
Comment 132 Katrin Fischer 2022-11-24 18:54:54 UTC
Hi Tomas, did you miss these?
Comment 133 Katrin Fischer 2022-11-24 19:01:23 UTC
Last 3 commits haven't been pushed yet.
Comment 134 Katrin Fischer 2022-11-24 19:57:41 UTC
Follow-ups have been pushed now.
Comment 135 Katrin Fischer 2023-04-23 15:55:28 UTC
Should this be needs documenting?
Comment 136 Caroline Cyr La Rose 2023-04-24 13:10:36 UTC
(In reply to Katrin Fischer from comment #135)
> Should this be needs documenting?

I don,t think so. I already submitted something to the manual for this last week.
I left it "Pushed to master" because to me, that means release maintainers haven't decided to backport it or not. If they have decided not to backport it, it can be set to resolved.