Go to file
Martin Renvoize 447b86cad8
Bug 40625: Fix duplicate cashup records via POST/REDIRECT/GET pattern
The cashup functionality on both /pos/register.pl and /pos/registers.pl
pages was using GET requests via anchor tags, which could cause
duplicate cashup records when users refreshed the page after performing
a cashup.

This patch implements proper POST/REDIRECT/GET pattern with CSRF
protection:

1. Convert anchor tag buttons to proper HTML forms with submit buttons
2. Add CSRF token protection to all cashup operations
3. Change operation from 'cashup' to 'cud-cashup' for CSRF compliance
4. Implement redirects after successful cashup operations to prevent
   resubmission
5. Update JavaScript to populate form fields instead of href attributes

This ensures cashup operations follow HTTP semantics properly (POST for
state changes) and prevents duplicate submissions while maintaining the
existing user experience.

Test plan:
1. Apply patch and restart services
2. Go to Point of Sale > Cash registers
3. Click "Record cashup" on any register - should open modal
4. Click "Confirm" - should perform cashup and reload page
5. Refresh the page - should NOT create duplicate cashup record
6. Go to Point of Sale > Register for individual register
7. Click "Record cashup" - should open modal
8. Click "Confirm" - should perform cashup and reload page
9. Refresh the page - should NOT create duplicate cashup record
10. On registers page, try "Cashup all" button - should work correctly
11. Verify all existing functionality (modals, summaries) still works
12. Check browser developer tools - all requests should be POST for
    cashup operations

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 26f1f91a13)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
(cherry picked from commit d4d9a849b5)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2025-12-02 09:52:51 +01:00
.github/workflows Bug 40027: Use GitHub workflow to automatically close PRs opened on the Koha repo there 2025-11-10 14:42:18 +01:00
C4 Bug 40978: Remove warnings from Budgets.t 2025-11-10 16:33:18 +01:00
Koha Bug 39408: Don't attempt to send a message if one is not generated 2025-11-10 15:21:27 +01:00
acqui Bug 39572: Improve EDIFACT order confirmation message 2025-07-31 15:48:37 +02:00
admin Bug 39169: Automatically hide "active" and "budget period" columns on Acquisitions home page 2025-10-08 10:17:00 +02:00
api Bug 40543: Remove pickup_library.branchname embed 2025-10-10 14:11:53 +02:00
authorities Bug 36603: (QA follow-up) Resolve two conditional declarations 2024-11-08 16:42:53 +01:00
basket Bug 31224: Update instances of metadata->record 2024-11-07 16:29:23 +01:00
bin
…
bookings Bug 35574: Bookings tab from biblio details should only require manage_bookings permission 2023-12-18 15:21:04 +01:00
catalogue Bug 39485: Fix wide character in print-warn in opac-export 2025-09-29 09:55:22 +02:00
cataloguing Bug 25015: (QA follow-up) Slide together 2025-08-08 16:26:27 +02:00
circ Bug 40515: Fix regexp for cud-mark_as_lost_and_notify 2025-10-10 15:08:27 +02:00
clubs Bug 34478: Manual fix - add op clubs/templates-add-modify 2024-03-01 10:57:55 +01:00
course_reserves Bug 28762: Use Koha::Course in course-details controller 2024-07-23 16:04:05 +01:00
debian Bug 40812: Move Theke sample plugin repo to GitHub 2025-10-16 10:24:14 +02:00
docs Bug 40022: Add the 25.11 release team (squashed) 2025-07-25 16:39:02 +02:00
erm
…
errors Bug 37741: Do not send cookie back from error pages 2024-08-30 12:45:45 +02:00
etc Bug 40812: Move Theke sample plugin repo to GitHub 2025-10-16 10:24:14 +02:00
ill Bug 40171: Remove extraneous join() 2025-10-31 15:05:58 +00:00
installer Bug 40936: DBRev 24.11.10.001 2025-11-10 15:36:51 +01:00
koha-tmpl Bug 40625: Fix duplicate cashup records via POST/REDIRECT/GET pattern 2025-12-02 09:52:51 +01:00
labels Bug 30745: (QA follow-up) tidy 2024-11-18 17:44:31 +01:00
lib Bug 35681: Use ::Bootstrap version of FromANSI 2024-05-02 16:47:39 +02:00
members Bug 38841: Check non-patron guarantor while deleting patron guarantor 2025-10-03 15:53:43 +02:00
misc Bug 40785: Cronjob cleanup_database.pl remove args in usage first line 2025-11-10 15:04:03 +01:00
offline_circ Bug 34478: Changes for offline_circ 2024-03-01 10:58:34 +01:00
opac Bug 41057: Return 404 if creating backend is not an OPAC backend 2025-11-10 16:22:41 +01:00
patron_lists Bug 37266: [24.11.x] patron_lists/delete.pl should have CSRF protection 2025-02-24 19:30:42 +01:00
patroncards Bug 39800: Error 500 when trying to delete patron card template 2025-10-03 15:36:48 +02:00
plugins Bug 30897: Add option to disable automated restart 2024-04-11 16:53:42 +02:00
pos Bug 40625: Fix duplicate cashup records via POST/REDIRECT/GET pattern 2025-12-02 09:52:51 +01:00
preservation Bug 38089: (follow-up) More fixes for errors in original submission 2024-10-11 11:13:47 +02:00
recalls Bug 38089: (follow-up) More fixes for errors in original submission 2024-10-11 11:13:47 +02:00
reports Bug 39298: (QA follow-up) Add missing html filter 2025-08-08 12:19:37 +02:00
reserve Bug 38412: Display warning on biblio level 2025-09-19 14:40:19 +02:00
reviews Bug 2486: Show user comments in staff interface 2024-08-26 17:39:42 +02:00
rotating_collections Bug 31930: Ignore whitespace before and after barcodes 2025-09-17 17:20:55 +02:00
serials Bug 40861: Remove warning from serials/acqui-search-result.pl 2025-10-16 12:16:45 +02:00
services
…
skel
…
suggestion Bug 36155: Improve perfs of suggestion.pl when there are many budgets 2025-09-23 14:24:16 +02:00
svc Bug 31224: Update instances of metadata->record 2024-11-07 16:29:23 +01:00
t Bug 40969: Mock the RenewalPeriodBase preference correctly 2025-11-10 16:21:25 +01:00
tags Bug 38969: (QA follow-up) fix tidy 2025-04-24 18:42:32 +02:00
tools Bug 38633: Prevent holidays from being ignored 2025-10-16 12:07:06 +02:00
virtualshelves Bug 40585: (follow-up) Display error if no records were found 2025-10-16 11:22:02 +02:00
xt Bug 37622: Adjust 'location' header test 2025-10-31 14:37:51 +00:00
.editorconfig
…
.gitignore Bug 35402: Update the OPAC and staff interface to Bootstrap 5 2024-08-23 15:58:41 +02:00
.htaccess
…
.mailmap Bug 40041: Remove duplicated or unecessary entries 2025-11-10 15:47:59 +01:00
.perlcriticrc
…
.perltidyrc
…
.prettierrc.js Bug 38546: Set tabWidth and useTabs in prettierrc 2025-08-06 09:56:52 +00:00
.proverc.dist
…
.stylelintrc.json
…
INSTALL
…
Koha.pm Bug 40936: DBRev 24.11.10.001 2025-11-10 15:36:51 +01:00
LICENSE
…
MANIFEST.SKIP
…
Makefile.PL Bug 40027: (follow-up) Add .github/ to Makefile.PL 2025-11-10 14:44:11 +01:00
README
…
README.md
…
README.robots
…
about.pl Bug 40608: (follow-up) Add warning in about page 2025-09-26 16:24:09 +02:00
app.psgi Bug 36149: Add userenv middleware to app.psgi 2024-05-14 15:04:37 -03:00
build-resources.PL
…
changelanguage.pl
…
cpanfile Bug 39857: Add new dependency Test::NoWarnings for 24.11.x 2025-05-26 11:03:03 +02:00
cypress.config.ts Revert "Bug 38770: Remove @vue/cli-service and babel" 2025-08-06 15:07:36 +00:00
eslint.config.mjs Bug 38167: Migrate ESLint config to new flat format 2025-08-06 09:57:04 +00:00
fix-perl-path.PL
…
gulpfile.js Bug 36640: (follow-up) CSS fixes for DataTables controls 2024-11-14 14:19:34 +01:00
help.pl
…
kohaversion.pl
…
mainpage.pl Bug 36064: (QA follow-up) Simplify and tidy 2024-10-25 11:09:51 +02:00
package.json Revert "Bug 38770: Remove @vue/cli-service and babel" 2025-08-06 15:07:36 +00:00
rewrite-config.PL
…
rspack.config.js Bug 37824: (QA follow-up) Fix improper handling of jQuery and DataTables libraries by marking them as externals 2024-09-16 18:41:17 +02:00
tsconfig.json
…
webpack.config.js Bug 35919: Add record sources admin page 2024-04-26 17:06:04 +02:00
yarn.lock Bug 38149: [24.11.x] Update yarn.lock 2025-08-08 07:56:06 +02:00

README.md

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo