Bug 40015

Summary: Exporting budget to Exel has error
Product: Koha Reporter: Päivi Knuutinen <paivi.knuutinen>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P3 CC: dcook, emmi.takkinen
Version: 24.05   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Päivi Knuutinen 2025-05-28 09:55:41 UTC
When you export acquisition data to Excel, and there are negative (minus) amounts in budget, Koha adds wrong symbol (') before the amount. It's not possible to count the rows that include this symbol.
Comment 1 Emmi Takkinen 2025-06-02 07:37:30 UTC
This comes from bug 37727, minus sign is considered as unsafe character and we add ' mark before them. Could we handle minus sign separately to determine if it's used in harmful context e.g. if it's added between strings or end of string or something like that?
Comment 2 David Cook 2025-07-28 01:50:31 UTC
This'll need some more thought.

Bug 37727 is a local workaround because support for "escapeExcelFormula" wasn't added to DataTables Buttons until 3.2.0:
https://github.com/DataTables/Buttons/blob/master/js/dataTables.buttons.js#L1998

I suppose for acquisitions tables or at least money columns that are calculated perhaps it would be possible to do a custom display. 

I've opened bug 40523 because there's a number of DataTables Buttons changes that we need to make to improve things...