The pref ReportsExportFormatODS should be true for exporting
to ODS in Reporting.
Test plan:
Set pref to false value.
Check if option is no longer available on report's Download menu.
Manipulate URL with op=export&format=ods. No data expected.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
Set pref ReportsExportLimit to some positive integer.
Test if exporting a report respects that limit.
Run t/db_dependent/Koha/Reports.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Just attaching this to start.
Sponsored-by: Waikato Institute of Technology
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch corrects an error where the SQL editor screen would appear
after the report results when using 'Update and run SQL' when editing
reports.
This also corrects a related issue where the saved_sql.id of the report
would be repeatedly appended to SQL code when using 'Update and run
SQL'.
To test:
1) Login to staff client
2) Navigate to Reports -> Create from SQL
3) Create a short report (SELECT * FROM items), name it and SAVE it.
4) On the resulting "Edit SQL report' page, click 'Update and run SQL'
5) See the report runs, but at the 'Edit SQL report' screen shows at the
bottom.
6) Apply Patch
7) Return to Reports -> Saved Reports and Edit the report you created.
8) On "Edit SQL report' page, click 'Update and run SQL'
9) Verify that the report runs, but the 'Edit SQL report' section is
gone.
Sponsored-by: Westlake Porter Public Library
Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch removes escaping of ampersands in the part of
guided_reports.pl that builds information for the pagination routine.
The information is going to be escaped in a later step.
To test, apply the patch and go to Reports.
- If necessary, create a report which will return more than 20 results.
- Run the report. You should see a pagination bar at the top of the
table of results.
- View the page source and look for the markup for the pagination menu.
Searching for 'rel="start"' works well.
- Confirm that you see '&' between the link parameters instead of
'&amp;', e.g.
guided_reports.pl?id=347&op=run&limit=20&want_full_chart=0&page=1
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
When exporting a report in tab delimited format, the downloaded file
would have the header rows but no data results.
Also, misc files are created on the server file system in koha/reports
with data that should have been in the .tab file.
This patch fixes both of these issues.
To test:
1. Login to staff client
2. Go to Reports and create a report from SQL - sample report
SELECT i.barcode, b.title, b.biblionumber, i.itemnumber
FROM items i
LEFT JOIN biblio b on i.biblionumber = b.biblionumber
WHERE i.itemnumber < 50
3. Run the report
4. Click 'Download'->'Tab separated text'
5. Download file
6. Open file in a text editor or favorite spreadsheet app
File will have headers rows, but no other item data
6a. If able, check the server filesystem in koha/reports
There may be files there related to report data. Remove.
7. Apply Patch
8. Repeat steps 3-6,
File will now have the table data, hooray!
8a. If able, check the server filesystem in koha/reports
No new files should be created.
Signed-off-by: Laura ONeil <laura@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test:
1 - Create a report like:
SELECT "a"
FROM borrowers
WHERE <<Test>> != ''
2 - Run report
3 - Enter "password"
4 - Internal server error / stacktrace
5 - Apply patch
6 - Repeat
7 - Get a yellow warning box
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
With this patch, it displays now the accountlines branchcode and not the
manager's branchcode.
(cr: Marie-Luce test plan)
Setup - before test
Staff accounts
- have a superlibrarian account
- create 2 limited access staff accounts, one by branches:
e.g.
- staff 1 - attached to branch A
- staff 2 - attached to branch B
Both restricted staff accounts should have the following permissions:
- (circulate) ,
- (borrowers),
- in the patron fines: (manual_invoice), and (remaining_permissions)
- ***ability to switch login library (loggedinlibrary)
Debit type
- Add few debit types in your Koha (administration > debit types) to ease transactions search.
e.g: "printing cost", "new card", "lost item"
***Ensure that each debit type is configured to "can be manually invoiced"
Test plan
1. Login with "staff 1" in the intranet
--> Koha should connect to branch A
2. Find a "branch A" patron
3. Add a manual invoice (e.g printing -- 2.50$ )
4. Pay this invoice
5. Log out of the intranet
6. Login with "staff2"
--> Koha should connect to branch B
7. Find a "branch B" patron
8. Add a manual invoice with a unique debit type and amount (e.g. lost item - 12.80$ )
9. Pay this invoice
10. Stay connect with "staff2" account, and switch to "branch A" at the top right corner of the screen
11. Find another "branch A" patron
12. Add a manual invoice with a unique debit type and amount (e.g. new card - 5.00$ )
13. Pay this invoice
14. Log out
15. Login with a "superlibrarian" account
16. Run the "Cash register" statistics wizards for "branch A"
- Go to (Reports > Statistics wizards > Cash Registers )
- dates: select the current date
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Test plan:
1) Go to reports and select "Patrons"
2) Select some filters (patron category, library,..) and run it
3) Normally you will see filters selected but with blank value like
"branch code = "
4) Apply this patch
5) Refresh
Sponsored by: BibLibre
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
To test:
- apply patch, restart all
- run a report
- export results
- confirm file name is the report ID, followed by report name
Signed-off-by: Barbara Johnson <barbara.johnson@bedfordtx.gov>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
We already have a scrubber module we can use; This patch switches us
from the newly introduced dependancy to using the existing and well
respected Scrubber we already have.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This patch uses HTML::Restrict to strip out HTML tags from the CSV
download of reports.
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Replacing wantarray by always returning all mappings.
In a few cases only we expect multiple ones.
Changing two calls to pick the first hit, and add comment about
the implicit assumption being made (as before, no behavior change).
Test plan:
Look at results of git grep GetMarcSubfieldStructureFromKohaField
Run t/db_dependent/Biblio.t
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Rebased for changes to guided_reports_start.tt
This patch adds the ability to use multi select in report dropdowns.
It uses syntax similar to using a list and when using the :all option
WHERE i.homebranch in <<Select libraries|brnaches:in>>
Test plan:
1. Create an SQL report with with new syntax for multi select
SELECT
i.homebranch,
count(*)
FROM items i
WHERE i.homebranch in <<Select libraries|branches:in>>
GROUP BY i.homebranch
2. Save the report
3. Note that you get the error
The authorized value category (branches:in) you selected does not exist.
4. Apply the patch and repeat steps 1 and 2
5. Note the report saves successfully
6. Run the report
7. Note the select dropdown is now a multiselect
8. Run the report with multiple selections
10. Click show SQL and note that multi select parameters get inserted into the query like:
WHERE i.homebranch in ('CPL', 'FFL', 'FPL')
11. Test other types of queries with multiple multi selects and lists etc
Sponsored-by: CLAMS
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This "plugin system" is only used for the itemtypes report. We can
simply remove the reports/manager.pl script and this plugin in favor of
a dedicated report.
Test plan:
Same behaviour expected before and after this patch
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Andrew Fuerste Henry <andrewfh@dubcolib.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Bug 34478: [TO SQUASH] Add 'op' to reports/guided_reports
Found bug 36071 when working on this. This is not a regression from this
patch.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Bug 34136 adds the ability to render a report using a notice template rather than displaying data in a table. It would be even more useful to be able to download the contents as a file where the notice subject can be used as the filename so the filename can be generated dynamically ( such as adding the current date as part of the filename ).
Test Plan:
1) Follow the test plan for Bug 34136
2) Run your report
3) Note under the Download menu the new item "Download as" with the
subject line for your template
4) Click that link, note the file contains the contents of your report!
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Sometimes it is useful to display the results of a report in a non-table format. We should be able to create notice templates to render reports.
Test Plan:
1) Apply this patch
2) Restart all the things!
3) Create a new notice template using the new "Report" option from the
"New notice" pulldown.
4) In the "Print" area, paste the following template:
[% FOREACH b IN data %]
<div class="panel panel-default">
<div class="panel-heading">[% b.surname %], [% b.firstname %]</div>
<div class="panel-body">Expiration: [% b.dateexpiry %]</div>
<div class="panel-footer">ID: [% b.borrowernumber %]</div>
</div>
[% END %]
5) Create a report with the query: SELECT * FROM borrowers
6) Once the report is saved, use the new "Run with template" option to
select the template you just created.
7) Note that instead of the results being a paged table, you instead
see the results rendered as cards!
Signed-off-by: Sam Lau <samalau@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
This patch does the following:
[1] Go back to four statuses: Cancelled, Filled, Waiting or Placed.
Placed is used as collective name for all other statuses: pending
(placed), processing (found==P) or transit (found==T). Placed before
anyway.
[2] Allow translation of these statuses in the template. Remove the sub
reservestatushuman.
[3] The output of changeifreservestatus is considerably shorter and less
ugly in the constructed sql statement.
Test plan:
[1] Use reservestatus as row, as column and only as filter (clicking few
statuses).
[2] Verify that the shown statistics meet your expectations.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This change removes unnecessary syspref template parameters
and tidies the code.
Test plan:
0. Apply the patch and koha-plack --reload kohadev
1. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=IntranetNav
2. Add the following and save:
<li><a href="#">Awesome</a></li>
3. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetstylesheet
4. Add the following and save:
http://bad
5. Go to
/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=intranetcolorstylesheet
6. Add the following and save:
http://bad2
7. Go to /cgi-bin/koha/reports/reports-home.pl
8. Note the "Awesome" link in the top navbar
9. Note in the console that there are two errors where http://bad
and http://bad2 can't be resolved
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Bug 29664 removed payments with a void status, however, the query also
removed any payments with no status set
Test Plan:
1 - Set up your cash registers and enable POS and add a debit type that is able to be sold
2 - Take 2 payments via POS
3 - Void one payment
4 - Go to Reports->Statistics wizards->Cash register
4) Verify neither shows for the "All payments to the library" and
"Payment" transaction type filters
5) Apply this patch
6) Restart all the things!
7) Verify the non-voided fee shows for the "All payments to the library" and
"Payment" transaction type filters and the voided fee does not
Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Test Plan:
1) Set up your cash register
2) Take a payment
3) Void that payment
4) Verify the voided fee shows for the "All payments to the library" and
"Payment" transaction type filters
5) Apply this patch
6) Restart all the things!
7) Verify the voided fee no longer shows for the "All payments to the library" and
"Payment" transaction type filters
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Andrii Nugged <nugged@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This will save one click every time you want to save and then run
a report.
To test:
- Apply this patch
- Create a new report
- Click the new "Update and run SQL" button
- Verify the report was saved and the results are displayed
Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch adds the TT variable 'notes' to the variables
that guided_reports.pl passes to the template guided_reports_start.tt
during SQL parameters entry in the phase 'Run this report'.
To test:
1. apply the patch
2. navigate to Reports -> Guided Reports -> Create from SQL
3. create an SQL report that includes at least one parameter, e.g.:
SELECT barcode FROM items WHERE homebranch=<<Select library|branches>>
the actual SQL and name of the report doesn't matter much, just make
sure that you also put a note e.g. "Test text for display" in the
field "Notes:" before you save the report.
4. run the report
5. the note you entered should now be displayed below the heading
"Enter parameters for report..."
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This shouldn't be expected to change, except maybe after an upgrade,
seems worth caching.
To test:
1 - Apply patch
2 - Confirm the feature still works
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch adds a database call to get the table and column names in the
database and parse them into the autocomplete engine.
Test Plan:
As previous commit but also check for column/table names in the
autocomplete popup
Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This makes the filters on top of the 'items with no checkouts' report
translatable. The descriptions of the filters used the wrong terms and
were also pulled from the .pl file, making them untranslatable.
To test:
* Without patch: Run the 'items with no checkouts' report with various
settigs.
* Verify, that the display on top doesn't use standard terminology
Doc type = item type, Branch = library
* Apply patch
* Verify display is improved and standard terminology is used
If you know how to, you can also confirm strings show up nicely in
translations:
https://wiki.koha-community.org/wiki/Translating_Koha#Updating_the_po_files_in_your_installation
Signed-off-by: Frédéric Demians <f.demians@tamil.fr>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
When IndependentBranches is activated and a non-superlibrarian user looks at the "Patrons with no checkouts" report, it shows patrons from other libraries.
To recreate:
1) Activate IndependentBranches, IndependentBranchesPatronModifications and IndependentBranchesTransfers
2) Create a staff user with limited permissions (NOT a superlibrarian), including reports permissions. Here are mine as an example
- circulate (all)
- catalogue
- borrowers
- delete_borrowers
- edit_borrowers
- reserveforothers (all)
- reports (all)
3) Create (or make sure you already have) a patron in another branch (if using an existing patron, make sure they have no checkouts or checkout history)
4) Log in as your limited staff patron
5) Go to Reports > Inactive > Patrons who haven't checked out
6) Don't put in any limitations and click Submit
-- The patron from the other library appears in the list
7) Try to search for that other patron in the patron module
-- The patron from the other library is inaccessible
8) Apply the patch
9) Notice that the limited patron can only see patrons from his own
library
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
System preference 'CSVdelimiter' has a special case for tabulation.
Preference value contains string 'tabulation' but string '\t' must be used in CSV file.
This is OK in many places, for exemple Bug 17590.
This patch adds C4::Context->csv_delimiter to add a uniq metod dealing
with this behavior.
Also create Koha::Template::Plugin::Koha->CSVDelimiter for calls from
Toolkit Templates.
Test plan :
1) Set system preference 'CSVdelimiter' = 'tabs'.
2) Create CSV export in impacted pages
3) Check columns are separated by tabulation character and not string 'tabulation'
4) Check with another delimiter
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
The idea rely on the KohaDates TT plugin for the date formatting. We
should not have any output_pref calls in pl or pm (there are some
exceptions, for ILSDI for instance).
Also flatpickr will deal with the places where dates are inputed. We
will pass the raw SQL value (what we call 'iso' in Koha::DateUtils), and
the controller will receive the same value, no need to additional
conversion.
Note that DBIC has the capability to auto-deflate DateTime objects,
which makes things way easier. We can either pass the value we receive
from the controller, or pass a DT object to our methods.
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
By default statistic assistant filter is set on the
existing items and doesn't mind about deleted items.
The patch corrects this. Items belong to the same library.
Test plan:
1)Make sure to have at least 1 or more item(s) in deleteditems database table
2)Home > Reports > Circulation statistics
3)Fill up 'Issuing library', 'Home library' and 'Holding library'
4)Submit
5)Notice that only statistics for active items are shown
6)Apply patch and repeat from 2) to 5)
7)Now active items and deleted items are shown
Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
When choosing tabulation as the delimiter for a CSV profile
for the lost item report, the tabs appear in the file as \t
instead of as proper tabs.
title\tauthor\tstocknumber\tcallnumber
"E Street shuffle :"\"Heylin, Clinton."\\
To test:
* Upate the existing sample lost item CSV profile to use tabs as
separator
* Make sure you have some lost items in your database or create some
* Go to Reports > Lost items
* Run the report
* Check all or some of the checkboxes in the result list
* Export using the link on top and the CSV profile
* Verify the tabs are not exported correctly
* Apply patch
* Verify tabs now are proper tabs instead of \t
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This patch makes it so cash register reports puts branchcode from the
cash register where the payment was made into "Transaction library"
column instead of taking the branchcode of the manager.
Test plan:
1- Use cash registers (administration > system preferences > UseCashRegisters)
2- Create another library if you only have one (administration > libraries > new library)
3- Create a cash register in each library if they don't already have one (administration > cash registers > new cash register)
4- Create a fee on your own account and pay it right after in both libraries.
5- Go to reports > cash register and generate the statistics.
6- Notice "transaction library" in both rows are the same even though the fees were paid in two different libraries and two different cash registers.
7- Apply the patch and click submit to re-generate statistics
8- Notice it now shows the correct library where the transactions were done
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
We got
Can't call method "value" on unblessed reference at /kohadevbox/koha/opac/opac-messaging.pl line 86
$cookie can be an arrayref, we should retrieve the session id using
CGI->cookie('CGISESSID')
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
The last run of a report is updated only if method execute_query() is
called with report_id.
This whas missing for :
- when report is run publicly
- when report is sent by email
- when report is exported
Patch changes the method signature to use a hash of params, in order to
easily avoid some params.
Test plan :
1) Create a report.
2) Run report.
3) Check the report listing. Confirm that the last run info on the report is updated.
4) Make report public.
5) Run report via public url.
6) Check the report listing. Confirm that the last run info on the report IS NOT updated.
7) Schedule the report to run at a given time and e-mailed to an address.
8) After the report runs at the scheduled time, check the report listing. Confirm that the last run info on the report IS NOT updated.
9) Run report.
10) Export results.
11) Check the report listing. Confirm that the last run info on the report IS NOT updated AT THE TIME OF THE EXPORT.
Questionable (I don't know if this is addressed):
12) Run report on backend through a cron job and send results via e-mail.
13) Check the report listing. Confirm that the last run info on the report IS NOT updated.
14) Apply patch.
15) Rerun steps 2-13. Confirm that steps 3, 6, 8, 11, and 13 DO UPDATE the last run info.
Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Séverine Queune <severine.queune@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Remove the line without the scalar.
Test plan:
Just look at the code.
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
'Insert runtime parameter' has now more options for the SQL reports : 'cash register', 'debit types' and 'credit types'
Test plan:
1)Home > Reports > Create from SQL
2)Click on 'Insert runtime parameter' and notice the current options
3)Apply patch and repeat 2)
4)New parameters are now available
5)A simple SQL request to try 'credit_types' option : SELECT * FROM account_credit_types WHERE code = <<Credit types|credit_types>>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
https://bugs.koha-community.org/show_bug.cgi?id=29796
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
To get the 'Most circulated items' report to run in ONLY_FULL_GROUP_BY
Sql mode.
Test plan:
Turn on strict_sql_modes ( make sure <strict_sql_modes> is 1 in KOHA_CONF )
Go to Reports -> Most circulated items
submit the form.
Without the patch you get an error like:
CGI::Compile::ROOT::usr_local_koha_master_reports_cat_issues_top_2epl::calculate(): DBI Exception: DBD::mysql::st execute failed: Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'koha_main_v4.items.itemcallnumber' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [for Statement "SELECT DISTINCT biblio.title, COUNT(biblio.biblionumber) AS `RANK`, biblio.biblionumber AS ID, itemcallnumber as CALLNUM, ccode as CCODE, location as LOC FROM `old_issues`
LEFT JOIN items USING(itemnumber)
LEFT JOIN biblio USING(biblionumber)
LEFT JOIN biblioitems USING(biblionumber)
LEFT JOIN borrowers USING(borrowernumber)
WHERE 1 AND old_issues.issuedate > '2020-08-03' AND old_issues.issuedate < '2021-05-17' AND old_issues.returndate > '2020-08-27' AND old_issues.returndate < '2021-06-01' AND old_issues.branchcode like '403' AND items.itype like 'F' AND ccode like 'FIC' AND borrowers.categorycode like 'ST' group by biblio.biblionumber order by `RANK` DESC"] at /usr/local/koha_master/reports/cat_issues_top.pl line 67
at /usr/share/perl5/DBIx/Class/Exception.pm line 77
With the patch you will see the report results view.
Signed-off-by: David Nind <david@davidnind.com>
JD Amended patch - adjust commit's title
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
On bug 29844 we decided to remove wantarray from Koha::Objects->search.
Reviewing the difference occurrences I found some unnecessary uses of ->as_list,
where iterators should be used instead.
This patch only removes the obvious places, not the tricky ones.
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>