When selecting orders from a staged file, we should check that a fund is set. - We only want to check entries that have been selected for order (checkbox) - We only want to complain, when the fund entry on the selected entry is empty and there is also no default fund set on the accounting details tab
- MarcItemFieldsToOrder also needs to be taken into account
So basically, we need to check, in order that a) All checked records with MarcItemFieldsToOrder have a fund selected, OR b) All checked records have a fund selected, OR c) The account tab has a fund selected We also know that C will cascade to B, but does C *or* B cascade to A? If not, I imagine it should! To do otherwise seems like it would be counter-intuitive to librarians.
Hello, In our Koha (17.11.13 where BZ20798 is applied), we have seen that if no fund is selected when ordering from staged file, it 's fund from inactive budget that are choosen and saved in the order. It's really a big problem. To reply to Kyle : - If MarcItemFieldsToOrder is set and there's a fund found, it will be automatically selected in /cgi-bin/koha/acqui/addorderiso2709.pl?import_batch_id=xxx (I've just tested it on a master version). So, I don't think we need the A step. I don't know how Koha choose the fund to save if there a fund in the "select to import" tab and an another in "Default accounting details". In my opinion, it's the "Default accounting details" that should be taken in account if it's filled. Sonia
Created attachment 85911 [details] [review] bug 20830: Make sure a fund is selected when ordering from staged file I simply took again bug 20798 code with a little modification to set the checking only on selected items of "Select to import" tab. Seems to do the trick (patch done on version 17.11.13). Test Plan: 1) Add records to a basket from an import batch 2) Select only some of those items in the batch and don't select any fund for them. 3) Save : you get the message "Some budgets are no defined .." 4) Apply this patch 5) Select some items and choose a fund for each of them 6) Save : no more message. Olivier Crouzet
More precise Test : 1) Add records to a basket from an import batch 2) Select only some of those items in the batch and don't select any fund for them. 3) Save : you get the message "Some budgets are no defined .." 4) Select a fund for each of them 5) click on Save again : you still get the message "Some budgets are no defined .." 6) Apply this patch 7) Redo steps 2,3 and 4 8) Click on Save again : no more message;. The records are imported. Olivier Crouzet
When I try to apply, I have this error message : Applying: Bug 20830: Make sure a fund is selected when ordering from staged file Using index info to reconstruct a base tree... M koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/acqui/addorderiso2709.tt error: Failed to merge in the changes.
Created attachment 86455 [details] [review] Bug 20830 : Make sure a fund is selected (master) patch done for master. previous one apply to 17.11.13
Created attachment 87285 [details] [review] Bug 20830: Make sure a fund is selected when ordering from a stage file Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Swapped tabs for spaces to keep the QA script happy. Tested and works as expected, though perhaps we should also be validating we're getting good data on the serverside too.. I didn't check if this was already the case. Signing off.
Created attachment 87967 [details] [review] Bug 20830: Make sure a fund is selected when ordering from a stage file Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Awesome work all! Pushed to master for 19.05
Pushed to 18.11.x for 18.11.05
not backporting to 18.05.x . Needs rebase