Summary: | Add option to update dateaccessioned when receiving an order | ||
---|---|---|---|
Product: | Koha | Reporter: | Andrew Fuerste-Henry <andrewfh> |
Component: | Acquisitions | Assignee: | Tomás Cohen Arazi <tomascohen> |
Status: | CLOSED WORKSFORME | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | m.de.rooy, tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Bug Depends on: | 27671 | ||
Bug Blocks: | |||
Attachments: |
Bug 26693: Add AcqItemSetDateAccessionedsWhenReceived syspref
Bug 26693: Add option to update dateaccessioned when receiving an order |
Description
Andrew Fuerste-Henry
2020-10-15 13:03:48 UTC
+1 What about a checkbox about this when adding the items to the orderlines? (In reply to Tomás Cohen Arazi from comment #2) > What about a checkbox about this when adding the items to the orderlines? When you say "adding items to orderlines" do you mean when adding an order to a basket and creating items then? Or do you mean when creating items on receiving? We've got at least those two possible workflows that need to be accommodated. And it really needs to have some global default selection. (In reply to Andrew Fuerste-Henry from comment #3) > (In reply to Tomás Cohen Arazi from comment #2) > > What about a checkbox about this when adding the items to the orderlines? > > When you say "adding items to orderlines" do you mean when adding an order > to a basket and creating items then? Or do you mean when creating items on > receiving? We've got at least those two possible workflows that need to be > accommodated. And it really needs to have some global default selection. I mean in the context items are created, I was thinking when adding items to a basket, but really meant any step in the workflow there items are created. So the user marks the order marked to update the items on receiving. I think it's probably only needed when items are created on order, then we would want to update on receive. So maybe the checkbox should be on the receive page when linked items exist? Also totally agree with Andrew about the global default setting! So a global setting, and the option to change that global default on receiving? (In reply to Tomás Cohen Arazi from comment #6) > So a global setting, and the option to change that global default on > receiving? I think so. Andrew, do you agree or did we miss something? (In reply to Katrin Fischer from comment #7) > (In reply to Tomás Cohen Arazi from comment #6) > > So a global setting, and the option to change that global default on > > receiving? > > I think so. Andrew, do you agree or did we miss something? Sounds good to me! Ok, I implemented this all: - Syspref - Checkboxes per item, set by default using the syspref - Tweaked finishreceive.pl so it reads the checkboxes and updates dateaccessioned when required. Coool. BUT disabling the date didn't work. So I tried without any patches: MariaDB [koha_kohadev]> SELECT items.itemnumber, dateaccessioned FROM items WHERE itemnumber IN (SELECT itemnumber FROM aqorders_items WHERE ordernumber IN (SELECT ordernumber FROM aqorders WHERE basketno=1)); +------------+-----------------+ | itemnumber | dateaccessioned | +------------+-----------------+ | 973 | 2021-02-11 | | 974 | 2021-02-11 | +------------+-----------------+ 2 rows in set (0.00 sec) MariaDB [koha_kohadev]> UPDATE items SET dateaccessioned='2021-02-09' WHERE itemnumber IN (SELECT itemnumber FROM aqorders_items WHERE ordernumber IN (SELECT ordernumber FROM aqorders WHERE basketno=1)); Query OK, 10 rows affected (0.01 sec) Rows matched: 10 Changed: 10 Warnings: 0 MariaDB [koha_kohadev]> SELECT items.itemnumber, dateaccessioned FROM items WHERE itemnumber IN (SELECT itemnumber FROM aqorders_items WHERE ordernumber IN (SELECT ordernumber FROM aqorders WHERE basketno=1)); +------------+-----------------+ | itemnumber | dateaccessioned | +------------+-----------------+ | 973 | 2021-02-09 | | 974 | 2021-02-09 | +------------+-----------------+ 2 rows in set (0.00 sec) MariaDB [koha_kohadev]> SELECT items.itemnumber, dateaccessioned FROM items WHERE itemnumber IN (SELECT itemnumber FROM aqorders_items WHERE ordernumber IN (SELECT ordernumber FROM aqorders WHERE basketno=1)); +------------+-----------------+ | itemnumber | dateaccessioned | +------------+-----------------+ | 973 | 2021-02-11 | | 974 | 2021-02-11 | +------------+-----------------+ 2 rows in set (0.00 sec) BUMMER. So the actual behavior is that dateaccessioned gets updated regardless. I will upload my patches here anyway, just in case this behavior I found is incorrect and gets fixed on another bug report, and then we come back to this! Created attachment 116717 [details] [review] Bug 26693: Add AcqItemSetDateAccessionedsWhenReceived syspref Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 116718 [details] [review] Bug 26693: Add option to update dateaccessioned when receiving an order This patchset adds: - A new syspref: AcqItemSetDateAccessionedsWhenReceived - A new column on the receive page when items are created on ordering, with a checkbox for choosing if they want the date updated - The checkbox default value honours the global syspref. To test: Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> |