[Bug 43981] New: Numeric barcodes can lose trailing zeroes in ODS export of reports
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Bug ID: 43981 Summary: Numeric barcodes can lose trailing zeroes in ODS export of reports Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Reports Assignee: koha-bugs@lists.koha-community.org Reporter: nick@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: lisette@bywatersolutions.com Target Milestone: --- Bug 12757 removed the leading quote from reports output - this quote/apostrophe marked the column as text in ODS - it is now difficult to preserve leading zeroes in a numeric column - we should have a way to specify a column as text -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |12757 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12757 [Bug 12757] Integers in saved SQL report ODT export prepended with single quote -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |olivia.reynolds@openfifth.c |ity.org |o.uk CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Olivia Reynolds <olivia.reynolds@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Patch complexity|--- |Small patch Comma delimited| |Open Fifth list of Sponsors| | Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 --- Comment #1 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 210290 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210290&action=edit Bug 43981: Allow specifying numeric ODS columns Bug 12757 was overzealous in giving anything that looked like a number a float type. Many barcodes etc can be entirely numeric but should still be treated as text. This patch returns the default behaviour of generate_ods to only producing text cells, but allows the caller to opt specific columns into being numeric when possible. Test plan: 1. Apply patch. 2. Prove t/Koha/Util/OpenDocument.t, and verify all the tests pass. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 --- Comment #2 from Olivia Reynolds <olivia.reynolds@openfifth.co.uk> --- Created attachment 210291 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210291&action=edit Bug 43981: Use report column types to specify ODS column type As part of generating an ODS spreadsheet from a report, determine whether each column of the result is a numeric SQL type. This information can then be used to give ODS cells for those columns a float type as appropriate. Test plan: 1. Create a SQL report with the following SQL: SELECT 1, '1', '01', 'one' 2. Run this report and download an ODS of the result. 3. Verify that the first three columns have received a float type (often this means they're right-aligned). 4. Verify that the leading zero of the third column has been lost. 5. Apply patch. 6. Repeat step 2. 7. Verify that only the first column now receives a float type. 8. Verify that the leading zero of the third column has been retained. Sponsored-by: Open Fifth -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210290|0 |1 is obsolete| | Attachment #210291|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 --- Comment #3 from David Nind <david@davidnind.com> --- Created attachment 210292 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210292&action=edit Bug 43981: Allow specifying numeric ODS columns Bug 12757 was overzealous in giving anything that looked like a number a float type. Many barcodes etc can be entirely numeric but should still be treated as text. This patch returns the default behaviour of generate_ods to only producing text cells, but allows the caller to opt specific columns into being numeric when possible. Test plan: 1. Apply patch. 2. Prove t/Koha/Util/OpenDocument.t, and verify all the tests pass. Sponsored-by: Open Fifth Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 --- Comment #4 from David Nind <david@davidnind.com> --- Created attachment 210293 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210293&action=edit Bug 43981: Use report column types to specify ODS column type As part of generating an ODS spreadsheet from a report, determine whether each column of the result is a numeric SQL type. This information can then be used to give ODS cells for those columns a float type as appropriate. Test plan: 1. Create a SQL report with the following SQL: SELECT 1, '1', '01', 'one' 2. Run this report and download an ODS of the result. 3. Verify that the first three columns have received a float type (often this means they're right-aligned). 4. Verify that the leading zero of the third column has been lost. 5. Apply patch. 6. Repeat step 2. 7. Verify that only the first column now receives a float type. 8. Verify that the leading zero of the third column has been retained. Sponsored-by: Open Fifth Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Lisette Scheer <lisette@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |nick@bywatersolutions.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #210293|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 --- Comment #5 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 211143 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211143&action=edit Bug 43981: Use report column types to specify ODS column type As part of generating an ODS spreadsheet from a report, determine whether each column of the result is a numeric SQL type. This information can then be used to give ODS cells for those columns a float type as appropriate. Test plan: 1. Create a SQL report with the following SQL: SELECT 1, '1', '01', 'one' 2. Run this report and download an ODS of the result. 3. Verify that the first three columns have received a float type (often this means they're right-aligned). 4. Verify that the leading zero of the third column has been lost. 5. Apply patch. 6. Repeat step 2. 7. Verify that only the first column now receives a float type. 8. Verify that the leading zero of the third column has been retained. Sponsored-by: Open Fifth Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 --- Comment #6 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- Created attachment 211144 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211144&action=edit Bug 43981: (QA follow-up) Use DBI sql_types constants for numeric columns This patch replaces the hard-coded ODBC type codes with the named constants exported by DBI's :sql_types tag, uses a hash lookup instead of a chain of comparisons, and skips columns whose type is undefined to avoid 'uninitialized value' warnings. No behaviour change is expected. Test plan: 1. Apply patches 2. Create a SQL report with: SELECT 1, '1', '01', 'one' 3. Run the report and download the result as ODS 4. Verify only the first column receives a float type 5. Verify the leading zero of the third column is retained Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |januszop@gmail.com --- Comment #7 from Nick Clemens (kidclamp) <nick@bywatersolutions.com> --- *** Bug 43571 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |26.11.00 released in| | Status|Passed QA |Pushed to main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43981 --- Comment #8 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org