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

--- Comment #124 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 193137
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193137&action=edit
Bug 40445: (follow-up) Fix two-stage cashup completion not saving

When attempting to complete a two-stage cashup, the submission was
failing silently and not recording the cashup completion. This was
caused by two bugs:

1. Backend bug: pos/registers.pl was ignoring the user-entered amount
   and reconciliation note from the form submission. Instead of reading
   the 'amount' parameter from the form, it was recalculating the
   expected amount, which meant reconciliation (surplus/deficit) was
   never performed.

2. Frontend bug: The JavaScript modal handler was crashing when trying
   to parse the expected amount because jQuery's .data() method returns
   a number (not a string) when the value looks numeric. The code was
   calling .replace() on this number, which caused a TypeError. This
   crash prevented the registerid from being set in the hidden form
   field, causing the form submission to be ignored by the backend.

Test plan:
1. Create some cash transactions on a register
2. Click "Record cashup" → "Start cashup"
3. Click "Complete cashup" and enter an amount different from expected
4. Add a reconciliation note
5. Click "Complete cashup"
6. Verify the cashup completes successfully
7. Verify a CASHUP_SURPLUS or CASHUP_DEFICIT accountline was created
8. Verify the reconciliation note was saved

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