Summary: | Can't add to basket from staged file if base-level allocated is zero | ||
---|---|---|---|
Product: | Koha | Reporter: | Ray Delahunty <r.delahunty> |
Component: | Acquisitions | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | aleisha, andrew, bwsdonna, emma.ternrud, jonathan.druart, lucas |
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: |
20.11.00, 20.05.03
|
|
Circulation function: | |||
Attachments: |
Bug 21268: Don't remove 0 allocated funds from fund list
Bug 21268: Don't remove 0 allocated funds from fund list Bug 21268: Don't remove 0 allocated funds from fund list |
Description
Ray Delahunty
2018-08-24 14:27:49 UTC
(In reply to Ray Delahunty from comment #0) > Since the fiscal period close we have been able to > add to baskets using options OTHER than from a staged file. Sure about that? It is not what I see: acqui/addorderiso2709.pl: if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) { acqui/basket.pl: if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) { acqui/booksellers.pl: if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) { acqui/neworderbiblio.pl: if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) { acqui/neworderempty.pl: if (!defined $r->{budget_amount} || $r->{budget_amount} <0) { acqui/orderreceive.pl: if ( !defined $r->{budget_amount} || $r->{budget_amount} == 0 ) { acqui/parcels.pl: if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) { It's '== 0' vs '< 0' So we we should fix neworderempty and replace '<0' with '== 0' We have seen the issue for normal ordering as well after migrations where the amounts hadn't been set yet or for funds that are set up purely for handling donations or 'exchanged' items. I tested a bit on master: the funds = 0 now show when adding a new order, but are for example not in the fund pull down on receiving the order.
> acqui/addorderiso2709.pl: if ( !defined $r->{budget_amount} ||
> $r->{budget_amount} == 0 ) {
> acqui/basket.pl: if (!defined $r->{budget_amount} ||
> $r->{budget_amount} == 0) {
> acqui/booksellers.pl: if (!defined $r->{budget_amount} ||
> $r->{budget_amount} == 0) {
> acqui/neworderbiblio.pl: if (!defined $r->{budget_amount} ||
> $r->{budget_amount} == 0) {
> acqui/neworderempty.pl: if (!defined $r->{budget_amount} ||
> $r->{budget_amount} <0) {
> acqui/orderreceive.pl: if ( !defined $r->{budget_amount} ||
> $r->{budget_amount} == 0 ) {
> acqui/parcels.pl: if (!defined $r->{budget_amount} || $r->{budget_amount}
> == 0) {
>
>
> It's '== 0' vs '< 0'
>
> So we we should fix neworderempty and replace '<0' with '== 0'
I am not sure what would be the right behaviour here. I think having to add 0.01 just to make a fund you want to use for handling 'free' orders is a bit clumsy right now. I wonder if the cleaner solution would be to just check if the fund exists and omit testing for the amount in all places. Or: Only test for negative with <0 everywhere.
I'm seeing this error when adding to a basket via a staged file on 19.11. We do have libraries using funds with $0 allocated to track donations and other situations where there is not an expected amount for the year. I'm in favor of Katrin's suggestion to simply check whether a fund exists and is active, rather then checking for an amount allocated. This is still an issue in 20.05 and is blocking workflows for libraries. The base fund allocation of 0.00 is becoming more common for libraries, so I expect this will be brought up more and more. If I can add an item directly into a basket using a 0.00 fund then that same behavior should be permitted using staged or new files. I think that expected behavior is just look to see if there is an active fund. Increasing the importance level as it blocks workflows. Created attachment 107455 [details] [review] Bug 21268: Don't remove 0 allocated funds from fund list If a fund is created with a amount of 0, it will not appear in the fund list (when a new order is created for instance). 0 allocated funds can be used to track donations and other situations where there is not an expected amount for the year. Test plan: 0. Do not apply the patch 1. Create 1 active and 1 inactive budgets 2. Create some funds for each budgets, with amount > 0 and amount == 0 3. Add orders to basket => Note that the funds with amount == 0 are not displayed 4. Apply the patch 5. Add orders to basket (using the different possible ways we have) => Note that the funds with amount == 0 are displayed This change is applied to the different views of the acquisition module. Without this patch, I can select a $0 fund for all methods of adding to a basket except: - duplicating an order (duplicate_orders.pl) - from a new file (addorderiso2709.pl) - from a staged file (also addorderiso2709.pl) Additionally, if I try to set my $0 fund via a budget code in the field set by MARCItemFieldstoOrder, it is not selected. Created attachment 107466 [details] [review] Bug 21268: Don't remove 0 allocated funds from fund list If a fund is created with a amount of 0, it will not appear in the fund list (when a new order is created for instance). 0 allocated funds can be used to track donations and other situations where there is not an expected amount for the year. Test plan: 0. Do not apply the patch 1. Create 1 active and 1 inactive budgets 2. Create some funds for each budgets, with amount > 0 and amount == 0 3. Add orders to basket => Note that the funds with amount == 0 are not displayed 4. Apply the patch 5. Add orders to basket (using the different possible ways we have) => Note that the funds with amount == 0 are displayed This change is applied to the different views of the acquisition module. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Created attachment 107491 [details] [review] Bug 21268: Don't remove 0 allocated funds from fund list If a fund is created with a amount of 0, it will not appear in the fund list (when a new order is created for instance). 0 allocated funds can be used to track donations and other situations where there is not an expected amount for the year. Test plan: 0. Do not apply the patch 1. Create 1 active and 1 inactive budgets 2. Create some funds for each budgets, with amount > 0 and amount == 0 3. Add orders to basket => Note that the funds with amount == 0 are not displayed 4. Apply the patch 5. Add orders to basket (using the different possible ways we have) => Note that the funds with amount == 0 are displayed This change is applied to the different views of the acquisition module. Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> *** Bug 26029 has been marked as a duplicate of this bug. *** Pushed to master for 20.11, thanks to everybody involved! backported to 20.05.x for 20.05.03 I cannot recreate the bug in 19.11.x, all funds show in the fund list. Not backported. |