Budget codes are not unique (duplicated on rollover) currently if you have two codes two will be marked selected
Created attachment 70638 [details] [review] Bug 20014: Preselect item budget based on id not code To test: 1 - Have the same fund code in two budgets 2 - Have budget code defined in MarcItemFieldsToOrder 3 - Stage a file with some order items as defined above 4 - Inspect the fuinds drop down in the item, notice two lines are marked selected 5 - Apply patch 6 - Repeat 7 - Only one field should be selected, with a preference for active budget
We couldn't reproduce the bug we have tried putting two funds with the same code in one budget and two funds with the same code in two separate budgets and both times nothing was selected in the drop down.
Retested on master, I can recreate: Setup a budget with some funds Duplicate the budget,make one of them inactive MarcFieldsToOrder: price: 975$p quantity: 975$q budget_code: 975$h MarcItemFieldsToOrder: homebranch: 975$a holdingbranch: 975$b itype: 975$y nonpublic_note: 975$x public_note: 975$z loc: 975$c ccode: 975$8 notforloan: 975$7 quantity: 975$q price: 975$g replacementprice: 975$v uri: 975$u 975 from record: =975 \\$7-1$8b$cO$g8.90$hSHOES$p8.90$q1$u14.95$v14.95$yBOOK You will need to adjust subfield $h to the name of on of your funds that is duplicated
> 975 from record: > =975 \\$7-1$8b$cO$g8.90$hSHOES$p8.90$q1$u14.95$v14.95$yBOOK > > You will need to adjust subfield $h to the name of on of your funds that is > duplicated This will definitely have to be rephrased, because like Zoe Bennett, I couldn't reproduce the issue. I did as you said, created two budgets, with one fund that had the same code, and yet, when I used the staged file to add items to a new basket, there was only one budget name in the dropdown menu.
Created attachment 76113 [details] Budget setup Example budgets/funds to illustrate issues
Created attachment 76114 [details] View of double selected elements on adding to basket View of the issue when adding from staged to basket
Created attachment 76115 [details] Example marc file for staging
(In reply to Charles Farmer from comment #4) > > 975 from record: > > =975 \\$7-1$8b$cO$g8.90$hSHOES$p8.90$q1$u14.95$v14.95$yBOOK > > > > You will need to adjust subfield $h to the name of on of your funds that is > > duplicated > > This will definitely have to be rephrased, because like Zoe Bennett, I > couldn't reproduce the issue. > > I did as you said, created two budgets, with one fund that had the same > code, and yet, when I used the staged file to add items to a new basket, > there was only one budget name in the dropdown menu. I added an example file and screenshots, I changed the fund name to show that both are selected, the problem persists if the names are the same or different
If I am not mistaken it will use the last added fund from an active budget when you have multiple active budgets with the same fund codes. This might still cause a surprise for people with a strange budget/fund creation history, but I don't see a better way to pick 'one' fund.
Wish our code was less confusing - budget should be fund.
Created attachment 77872 [details] [review] Bug 20014: Preselect item budget based on id not code To test: 1 - Have the same fund code in two budgets 2 - Have budget code defined in MarcItemFieldsToOrder 3 - Stage a file with some order items as defined above 4 - Inspect the fuinds drop down in the item, notice two lines are marked selected 5 - Apply patch 6 - Repeat 7 - Only one field should be selected, with a preference for active budget Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 78039 [details] [review] Bug 20014: Preselect item budget based on id not code To test: 1 - Have the same fund code in two budgets 2 - Have budget code defined in MarcItemFieldsToOrder 3 - Stage a file with some order items as defined above 4 - Inspect the fuinds drop down in the item, notice two lines are marked selected 5 - Apply patch 6 - Repeat 7 - Only one field should be selected, with a preference for active budget Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Awesome work all! Pushed to master for 18.11
Pushed to 18.05.x for 18.05.03
Pushed to 17.11.x for 17.11.09
Pushed to 17.05.x for 17.05.14
*** Bug 12652 has been marked as a duplicate of this bug. ***