[Bug 42963] New: Add POST endpoint for cash register cashups
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42963 Bug ID: 42963 Summary: Add POST endpoint for cash register cashups Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: REST API Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: tomascohen@gmail.com Target Milestone: --- This is part of the Point of Sale to Vue migration tracked under bug 42959. GET /api/v1/cash_registers/{cash_register_id}/cashups already exists but there is no way to record a cashup via the API. The staff interface pages pos/register.pl and pos/registers.pl currently call Koha::Cash::Register->add_cashup() directly from Perl, including a bulk cashup action across multiple registers. This patch should add POST /api/v1/cash_registers/{cash_register_id}/cashups to record a single cashup. It should also settle, as part of the design discussion, whether bulk cashup (cashing up several registers at once) is best modelled as repeated client-side calls to this endpoint or as a genuine batch endpoint. Test plan: 1. Perform a cashup via the new endpoint and confirm it matches the result of the existing Koha::Cash::Register->add_cashup() call. 2. Confirm permissions match the existing cash_management cashup requirement. 3. Add unit tests under t/db_dependent/api/v1/. -- 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=42963 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42967 Blocks| |42969 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Something to carry over when the cashup logic moves from the controllers to this endpoint. The Quick cashup button on pos/register.pl and pos/registers.pl posts no per-payment-type amounts at all. The controllers fill in the expected total for each configured payment type, so that the cashup is balanced. Bug 33501 (Passed QA) changes add_cashup to take a list of per-payment-type reconciliations, and its follow-up (attachment 208984) adds Koha::Cash::Register->balanced_reconciliations for exactly this case, because pos/register.pl was missing it. Suggestion: let the endpoint accept a request with no reconciliations meaning "balanced, using the expected totals", built with balanced_reconciliations, so the Vue pages do not have to work the expected amounts out themselves and the Quick cashup path is not lost in the migration. Also worth deciding while the endpoint is designed: nothing on the server currently refuses a cashup on a register with nothing to bank. The Record cashup button is disabled in the staff interface when the bankable total is zero, but a stale page or a direct request creates a cashup of 0.00. The endpoint would be a good place to reject that. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42967 [Bug 42967] Migrate POS register detail view to Vue.js (pos/register.pl) https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42969 [Bug 42969] Migrate POS registers list and cashup view to Vue.js (pos/registers.pl) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org