Bug 40066

Summary: Cannot add order to basket from the baskets view
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: AcquisitionsAssignee: Matt Blenkinsop <matt.blenkinsop>
Status: Needs documenting --- QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: david, fridolin.somers, matt.blenkinsop
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
This fixes adding items to a basket - instead of getting the pop-up window to add to the basket, the message "You can't create any orders unless you first define a budget and a fund." was shown (Acquisitions > [vendor] > Baskets > Add to basket). (This is related to Bug 38010 - Migrate vendors to Vue, added to Koha 25.05.)
Version(s) released in:
25.11.00,25.11.01
Circulation function:
Bug Depends on: 38010    
Bug Blocks:    
Attachments: Bug 40066: Restore budget check to booksellers.pl
Bug 40066: Restore budget check to booksellers.pl
Bug 40066: Restore budget check to booksellers.pl

Description Jonathan Druart 2025-06-04 07:17:51 UTC
http://localhost:8081/cgi-bin/koha/acqui/booksellers.pl?booksellerid=1

Click "add to basket"

=> "You can't create any orders unless you first define a budget and a fund."

This is caused by 
  commit e85ae2c02c84bba134eb2568afaa232c58a2b85b                                                           
  Bug 38010: (QA follow-up) Remove unnecessary code from booksellers.pl   

Which removes the TT var 'has_budgets' used by acquisitions-add-to-basket.inc
Comment 1 Matt Blenkinsop 2025-06-04 09:18:55 UTC
Created attachment 182933 [details] [review]
Bug 40066: Restore budget check to booksellers.pl

Test plan:
1) Navigate to a vendor record and select the baskets view from the left menu
2) Click "add to basket" in the table
3) A modal will display requiring the user to define a budget and fund
4) Apply patch and restart_all
5) Repeat steps 1 and 2
6) You will get the modal to add to the basket
Comment 2 David Nind 2025-06-04 10:19:13 UTC
Created attachment 182935 [details] [review]
Bug 40066: Restore budget check to booksellers.pl

Test plan:
1) Navigate to a vendor record and select the baskets view from the left menu
2) Click "add to basket" in the table
3) A modal will display requiring the user to define a budget and fund
4) Apply patch and restart_all
5) Repeat steps 1 and 2
6) You will get the modal to add to the basket

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Jonathan Druart 2025-06-04 12:38:04 UTC
Created attachment 182948 [details] [review]
Bug 40066: Restore budget check to booksellers.pl

Test plan:
1) Navigate to a vendor record and select the baskets view from the left menu
2) Click "add to basket" in the table
3) A modal will display requiring the user to define a budget and fund
4) Apply patch and restart_all
5) Repeat steps 1 and 2
6) You will get the modal to add to the basket

Signed-off-by: David Nind <david@davidnind.com>

Amended-by: Jonathan Druart
Remove import of GetBudget

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Lucas Gass (lukeg) 2025-06-04 22:08:47 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 5 Fridolin Somers 2025-06-19 07:49:32 UTC
I see in 25.05.x
Comment 6 Fridolin Somers 2025-06-19 07:49:58 UTC
Depends on Bug 38010  not in 24.11.x