Bug 34375

Summary: Shipping fund in an invoice defaults to the first fund from the list rather than 'no fund' after receiving
Product: Koha Reporter: Lucy Vaux-Harvey <lucy.vaux-harvey>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, g.newman, martin.renvoize, matt.blenkinsop, r.delahunty, s.graham4
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.11.00,23.05.06,22.11.12
Circulation function:
Attachments: Screen grabs
Bug 34375: Fix the option to provide no fund in budget dropdown
Bug 34375: Fix the option to provide no fund in budget dropdown
Bug 34375: Fix the option to provide no fund in budget dropdown

Description Lucy Vaux-Harvey 2023-07-25 16:16:48 UTC
To recreate:
Go to a vendor record in Acquisitions and then Receive Shipment
Enter an invoice number
Leave the Shipping cost empty and Shipping Fund as 'No fund'
Receive some orders or go straight to Finish receiving
Notice the Shipping fund has defaulted to the first fund in the alphabetical list of funds.  It is not possible to select 'No fund' and the selected fund is recorded in shipmentcost_budgetid incorrectly.
Comment 1 Matt Blenkinsop 2023-09-06 11:05:41 UTC
Caused by a local customer customisation, no need for a bug report :)
Comment 2 Matt Blenkinsop 2023-09-06 13:33:25 UTC
Ignore previous comment, there was an issue in 22.11.06 - now fixed as of 22.11.07 onwards
Comment 3 Katrin Fischer 2023-11-02 12:44:53 UTC
Hi Ray, are you already on version 22.11.07 as Matt mentioned and the bug is still present?
Comment 4 Ray Delahunty 2023-11-02 14:51:54 UTC
Created attachment 158266 [details]
Screen grabs
Comment 5 Ray Delahunty 2023-11-02 14:52:38 UTC
We moved from 21.11 to 22.11.07 in July. We have taken 2 monthly patches and are now on 22.11.09 but we have stopped taking monthly patches as we have had some local fixes undone by the patches. The problem is visible in 22.11.09 but either the fix wasn’t right in 22.11.07 or one of the patches may have broken it. Yes, ‘No fund’ appears at the top of the pulldown when the invoice is created and no items have been received but once the receiving is finished, the ‘No fund’ is replaced with the alphabetically highest fund (ASCC, in our case).
Comment 6 Katrin Fischer 2023-11-02 15:14:40 UTC
I can this is still a bug in 22.11.10.
Comment 7 Matt Blenkinsop 2023-11-02 15:39:58 UTC
Hi Ray,

I put a fix onto your test server in ticket 48643 to see if this resolved the issue - for some reason the ticket was set to "Paused" so I'm not sure if that response ever got through to your end. Could you or Steven have a play on the test server and see if the patch gives you the expected behaviour? If it does then I'll upload it here and we can get it pushed through.

Thanks!
Comment 8 Matt Blenkinsop 2023-11-03 13:56:49 UTC
Apologies, I have just realised that ticket 48643 was a different customer raising the same issue! I've added the same fix into your test server Ray - let me know if it fixes the issue :)
Comment 9 Matt Blenkinsop 2023-11-06 10:43:56 UTC
Created attachment 158497 [details] [review]
Bug 34375: Fix the option to provide no fund in budget dropdown

Currently it is not possible to use the No fund option as the dropwdown will default to the first budget in the list. This patch re-adds this option so that the defaulting behaviour is fixed

Test plan:
1) Go to a vendor record in Acquisitions and then Receive Shipment
2) Enter an invoice number
3) Leave the Shipping cost empty and Shipping Fund as 'No fund'
4) Receive some orders or go straight to Finish receiving
5) Notice the Shipping fund has defaulted to the first fund in the alphabetical list of funds.  It is not possible to select 'No fund' and the selected fund is recorded in shipmentcost_budgetid incorrectly.
6) Apply patch
7) Repeat steps 1-5 and this time the No fund option should be used correctly
Comment 10 PTFS Europe Sandboxes 2023-11-06 11:51:13 UTC
Created attachment 158513 [details] [review]
Bug 34375: Fix the option to provide no fund in budget dropdown

Currently it is not possible to use the No fund option as the dropwdown will default to the first budget in the list. This patch re-adds this option so that the defaulting behaviour is fixed

Test plan:
1) Go to a vendor record in Acquisitions and then Receive Shipment
2) Enter an invoice number
3) Leave the Shipping cost empty and Shipping Fund as 'No fund'
4) Receive some orders or go straight to Finish receiving
5) Notice the Shipping fund has defaulted to the first fund in the alphabetical list of funds.  It is not possible to select 'No fund' and the selected fund is recorded in shipmentcost_budgetid incorrectly.
6) Apply patch
7) Repeat steps 1-5 and this time the No fund option should be used correctly

Signed-off-by: Georgia Newman <g.newman@arts.ac.uk>
Comment 11 Katrin Fischer 2023-11-06 19:56:39 UTC
Created attachment 158557 [details] [review]
Bug 34375: Fix the option to provide no fund in budget dropdown

Currently it is not possible to use the No fund option as the dropwdown will default to the first budget in the list. This patch re-adds this option so that the defaulting behaviour is fixed

Test plan:
1) Go to a vendor record in Acquisitions and then Receive Shipment
2) Enter an invoice number
3) Leave the Shipping cost empty and Shipping Fund as 'No fund'
4) Receive some orders or go straight to Finish receiving
5) Notice the Shipping fund has defaulted to the first fund in the alphabetical list of funds.  It is not possible to select 'No fund' and the selected fund is recorded in shipmentcost_budgetid incorrectly.
6) Apply patch
7) Repeat steps 1-5 and this time the No fund option should be used correctly

Signed-off-by: Georgia Newman <g.newman@arts.ac.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Tomás Cohen Arazi (tcohen) 2023-11-08 12:59:58 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 13 Fridolin Somers 2023-11-10 08:00:08 UTC
Pushed to 23.05.x for 23.05.06
Comment 14 Pedro Amorim 2023-11-14 14:49:55 UTC
Nice work everyone!

Pushed to 22.11.x for next release