[Bug 42605] New: Acquisition Items not listed during receipt
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 Bug ID: 42605 Summary: Acquisition Items not listed during receipt Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: major Priority: P5 - low Component: Acquisitions Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org To recreate: 1 - Ensure AcqCreateItem is set to 'placing an order' at syspref or on basket 2 - Open a basket, add an order, and add several items 3 - Close the basket and receive shipments 4 - Select the order and 'Receive selected' or click 'Receive' on the order 5 - No items are listed in the items section -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=43211 Assignee|koha-bugs@lists.koha-commun |nugged@gmail.com |ity.org | Depends on| |41563 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41563 [Bug 41563] Tidy kohaTable block - acqui -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #1 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203731 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203731&action=edit Bug 42605: Preserve acquisition preference string values Bug 41563 converted AcqCreateItem and UniqueItemFields to booleans when adding them to Koha.prefs. Both preferences are strings: AcqCreateItem controls where items are created, while UniqueItemFields contains a pipe-separated list. When a basket inherits AcqCreateItem=ordering, the boolean value matches none of the receiving page branches and existing items are hidden. When items are created on receiving, the numeric UniqueItemFields value also fails when the page calls split(). Preserve both string values in Koha.prefs. Add a Cypress regression test which renders orderreceive.pl and verifies the values exposed to JavaScript. Test plan: 1. Set AcqCreateItem to "placing an order". 2. Create a basket which uses the system preference, add an order with an item, close the basket, and receive a shipment. 3. Confirm the existing item and its Receive checkbox are displayed. 4. Set the basket to create items when receiving and confirm the item creation form opens without a UniqueItemFields.split error. 5. Run: yarn cypress run --spec \ t/cypress/integration/Acquisitions/OrderReceivePreferences_spec.ts Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203731|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #2 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203732 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203732&action=edit Bug 42605: Preserve acquisition preference string values Bug 41563 converted AcqCreateItem and UniqueItemFields to booleans when adding them to Koha.prefs. Both preferences are strings: AcqCreateItem controls where items are created, while UniqueItemFields contains a pipe-separated list. When a basket inherits AcqCreateItem=ordering, the boolean value matches none of the receiving page branches and existing items are hidden. When items are created on receiving, the numeric UniqueItemFields value also fails when the page calls split(). Preserve both string values in Koha.prefs. Add a Cypress regression test which renders orderreceive.pl and verifies the values exposed to JavaScript. Test plan: Before applying the patch: 1. Set AcqCreateItem to "placing an order" and UniqueItemFields to "barcode". 2. Create a basket that inherits the system preference. Add an order with one item, close the basket, and start receiving it. 3. Confirm that the Items table has no existing item row and no Receive checkbox. 4. Set AcqCreateItem to "receiving an order" and open the same order for receiving. 5. Confirm that the Items section is empty: no item-entry fields and no Add item button are shown. Apply the patch. After applying the patch: 1. Set AcqCreateItem back to "placing an order" and open the order for receiving again. 2. Confirm that its existing item is listed and has a Receive checkbox. 3. Set AcqCreateItem to "receiving an order" and open the same order again. 4. Confirm that the Items section contains item-entry fields and an Add item button. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203732|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 203760 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203760&action=edit Bug 42605: Preserve acquisition preference string values Bug 41563 converted AcqCreateItem and UniqueItemFields to booleans when adding them to Koha.prefs. Both preferences are strings: AcqCreateItem controls where items are created, while UniqueItemFields contains a pipe-separated list. When a basket inherits AcqCreateItem=ordering, the boolean value matches none of the receiving page branches and existing items are hidden. When items are created on receiving, the numeric UniqueItemFields value also fails when the page calls split(). Preserve both string values in Koha.prefs. Add a Cypress regression test which renders orderreceive.pl and verifies the values exposed to JavaScript. Test plan: Before applying the patch: 1. Set AcqCreateItem to "placing an order" and UniqueItemFields to "barcode". 2. Create a basket that inherits the system preference. Add an order with one item, close the basket, and start receiving it. 3. Confirm that the Items table has no existing item row and no Receive checkbox. 4. Set AcqCreateItem to "receiving an order" and open the same order for receiving. 5. Confirm that the Items section is empty: no item-entry fields and no Add item button are shown. Apply the patch. After applying the patch: 1. Set AcqCreateItem back to "placing an order" and open the order for receiving again. 2. Confirm that its existing item is listed and has a Receive checkbox. 3. Set AcqCreateItem to "receiving an order" and open the same order again. 4. Confirm that the Items section contains item-entry fields and an Add item button. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m QA Contact|testopia@bugs.koha-communit |blawlor@clamsnet.org |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #4 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203821 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203821&action=edit Bug 42605: Test order receiving preference behavior The existing regression test checks the values exposed through Koha.prefs, but does not exercise the receiving UI. It also stores row arrays returned by cy.task("query") and passes them back to cy.set_syspref(), which restores both preferences as "[object Object]" instead of their original values. Store the scalar preference values and clean up the invoice explicitly. Exercise the rendered receiving behavior for a basket that inherits AcqCreateItem, one that explicitly overrides it with "ordering", and a basket that creates items on receiving. The explicit "ordering" case is a control: it does not use the broken system-preference fallback and already works without the production fix. The empty items table occurs when the basket uses the system preference, while the receiving case covers the UniqueItemFields split path. This changes tests only. Test plan: Before applying the patches: 1. Set AcqCreateItem to "placing an order" and UniqueItemFields to "barcode". 2. Create one basket that uses the system preference and another basket explicitly set to create items when placing an order. Add an order with an item to each basket, close both baskets, and receive the orders. 3. Confirm that the inherited basket has no existing item row or Receive checkbox, while the explicitly configured basket displays both. 4. Create a basket set to create items when receiving. Add an order, close the basket, and receive the order. 5. Confirm that no item-entry fields or Add item button are displayed. Apply both patches on this bug. After applying the patches: 1. Receive the order from the inherited basket again. 2. Confirm that its existing item and Receive checkbox are displayed. 3. Confirm that the explicitly configured basket still displays its item and Receive checkbox. 4. Receive the order from the basket that creates items when receiving. 5. Confirm that the item-entry fields and Add item button are displayed. Co-Authored-By: Loontik <loontik@nugged.team> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203760|0 |1 is obsolete| | Attachment #203821|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #5 from David Nind <david@davidnind.com> --- Created attachment 203824 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203824&action=edit Bug 42605: Preserve acquisition preference string values Bug 41563 converted AcqCreateItem and UniqueItemFields to booleans when adding them to Koha.prefs. Both preferences are strings: AcqCreateItem controls where items are created, while UniqueItemFields contains a pipe-separated list. When a basket inherits AcqCreateItem=ordering, the boolean value matches none of the receiving page branches and existing items are hidden. When items are created on receiving, the numeric UniqueItemFields value also fails when the page calls split(). Preserve both string values in Koha.prefs. Add a Cypress regression test which renders orderreceive.pl and verifies the values exposed to JavaScript. Test plan: Before applying the patch: 1. Set AcqCreateItem to "placing an order" and UniqueItemFields to "barcode". 2. Create a basket that inherits the system preference. Add an order with one item, close the basket, and start receiving it. 3. Confirm that the Items table has no existing item row and no Receive checkbox. 4. Set AcqCreateItem to "receiving an order" and open the same order for receiving. 5. Confirm that the Items section is empty: no item-entry fields and no Add item button are shown. Apply the patch. After applying the patch: 1. Set AcqCreateItem back to "placing an order" and open the order for receiving again. 2. Confirm that its existing item is listed and has a Receive checkbox. 3. Set AcqCreateItem to "receiving an order" and open the same order again. 4. Confirm that the Items section contains item-entry fields and an Add item button. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #6 from David Nind <david@davidnind.com> --- Created attachment 203825 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203825&action=edit Bug 42605: Test order receiving preference behavior The existing regression test checks the values exposed through Koha.prefs, but does not exercise the receiving UI. It also stores row arrays returned by cy.task("query") and passes them back to cy.set_syspref(), which restores both preferences as "[object Object]" instead of their original values. Store the scalar preference values and clean up the invoice explicitly. Exercise the rendered receiving behavior for a basket that inherits AcqCreateItem, one that explicitly overrides it with "ordering", and a basket that creates items on receiving. The explicit "ordering" case is a control: it does not use the broken system-preference fallback and already works without the production fix. The empty items table occurs when the basket uses the system preference, while the receiving case covers the UniqueItemFields split path. This changes tests only. Test plan: Before applying the patches: 1. Set AcqCreateItem to "placing an order" and UniqueItemFields to "barcode". 2. Create one basket that uses the system preference and another basket explicitly set to create items when placing an order. Add an order with an item to each basket, close both baskets, and receive the orders. 3. Confirm that the inherited basket has no existing item row or Receive checkbox, while the explicitly configured basket displays both. 4. Create a basket set to create items when receiving. Add an order, close the basket, and receive the order. 5. Confirm that no item-entry fields or Add item button are displayed. Apply both patches on this bug. After applying the patches: 1. Receive the order from the inherited basket again. 2. Confirm that its existing item and Receive checkbox are displayed. 3. Confirm that the explicitly configured basket still displays its item and Receive checkbox. 4. Receive the order from the basket that creates items when receiving. 5. Confirm that the item-entry fields and Add item button are displayed. Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com --- Comment #7 from David Nind <david@davidnind.com> --- I've signed off, but I think the commit message for the second patch should reflect the patch, not just repeat the first patch. Suggested commit message: Bug 42605: Update tests Updates Cypress tests. Test plan: 1. Tests should pass: cypress run --spec t/cypress/integration/Acquisitions/OrderReceivePreferences_spec.ts -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #8 from Andrii Nugged <nugged@gmail.com> --- Created attachment 203838 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=203838&action=edit Bug 42605: Add automated tests Store scalar preference values when saving the acquisition preferences and clean up the invoice explicitly. Exercise the rendered receiving behavior for a basket that inherits AcqCreateItem, one that explicitly overrides it with "ordering", and a basket that creates items on receiving. Keep the explicit "ordering" case as a control for behavior that already works without the production fix. This changes tests only. Automated tests: yarn cypress run --spec \ t/cypress/integration/Acquisitions/OrderReceivePreferences_spec.ts Co-Authored-By: Loontik <loontik@nugged.team> Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 Andrii Nugged <nugged@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #203825|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42605 --- Comment #9 from David Nind <david@davidnind.com> --- Thanks Andrii! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org