Bug 34109: Check mandatory item fields when creating during recipt
authorNick Clemens <nick@bywatersolutions.com>
Fri, 4 Aug 2023 14:13:25 +0000 (14:13 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 8 Sep 2023 19:11:07 +0000 (09:11 -1000)
commitebd986ad3e41660f88e5036b1dff226fdf0b399f
tree9b9b889af4f7c54eccafe879b45fb522a2125b1c
parent708cc3bccf84eaab2754b32974c80b326754d0f0
Bug 34109: Check mandatory item fields when creating during recipt

This patch adds a check of mandatory item fields before saving during order receipt.
We check both when adding the item initially, and when submitting the order, as it will use
the values from the open form.

To test:
* Go to administration > frameworks > ACQ > MARC structure > 952
* Set callnumber (o) or barcode (p) to mandatory
* In acquisition:
* Create a basket with "create items on order" and "is standing"
  "standing" helps as you can do multiple receives testing different things,
  but is optional
* Add an order line
* Receive shipment
* Verify the mandatory fields show in the item form
* Set itemtype = Music
* Save with the fields blank
* Item row is added, no warning
* Edit the item, change the item type to blank
* Click 'Confirm' for the order without closing the item edit form
* Verify the item was added with itemtype Books (on sample data) and empty mandatory field
* Apply patch
* Repeat above, however, you should not be able to submit the item or order until mandatory fields are filled

Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit eaab32eb0ee100752bee8822a367144157c69c51)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/js/additem.js