https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40445

--- Comment #122 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 193135
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193135&action=edit
Bug 40445: (follow-up) Fix backend validation for non-cash transactions

The previous commits fixed the frontend to allow cashup buttons when
there are non-cash transactions, but the backend validation was still
restricting cashups to cash-only scenarios.

This patch fixes the backend validation in Koha::Cash::Register:

1. start_cashup() - Changed validation to check for ANY transactions
   instead of only CASH/SIP00 transactions. This allows starting a
   cashup when there are Card or other non-cash payment types.

2. add_cashup() - Removed the requirement that amount must be non-zero.
   When there are only non-cash transactions, the cashup amount can
   legitimately be 0.00 (no cash to count/remove).

3. Updated error messages in register.tt to reflect the new validation
   logic (removed references to "cash transactions" and "non-zero").

Without these backend fixes, the frontend changes would still result in
validation errors when users attempted cashups with only non-cash
transactions.

Test plan:
1. Create transactions on a register using only Card payment type
2. Attempt to start a cashup - should succeed (not throw BadValue exception)
3. Enter 0.00 as the cashup amount - should complete successfully
4. Verify no surplus/deficit lines are created (balanced cashup)
5. Attempt to start cashup with zero transactions - should still fail
   with appropriate error message

Signed-off-by: Jackie Usher <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to