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

--- Comment #35 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 189364
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189364&action=edit
Bug 40445: Add cashup summary preview for in-progress cashups

In the two-phase cashup workflow, staff start a cashup and then count
cash while continuing to process transactions. There was no way to
preview what would be included in the cashup until it was completed.

This patch adds a "Preview expected summary" link in the
"Cashup in progress" alert that allows staff to:
- See what transactions will be included in the cashup
- Review expected cash amounts before completing
- Verify the session period is correct
- Check for any unexpected transactions

Changes:

Backend (Koha/REST/V1/CashRegisters/Cashups.pm):
- Modified get() endpoint to handle CASHUP_START actions for preview
- Fallback lookup finds CASHUP_START by ID when not found as completed
- Wraps CASHUP_START as Cashup object to generate summary

Frontend (pos/register.tt):
- Added "Preview expected summary" link in cashup-in-progress alert
- Link includes data-in-progress="true" attribute for JS handling
- Uses existing cashupSummaryModal for consistent UX

JavaScript (cashup_modal.js):
- Detects in-progress flag from link data attribute
- Changes modal title to "Cashup summary preview (in progress)"
- Adds informational alert explaining this is a preview
- Note clarifies that transactions will update values until completion
- Removes preview notice for completed cashup summaries

The preview uses the same summary generation logic as completed cashups,
showing accurate period boundaries and transaction totals. Staff can
open the preview multiple times to see updated values as they process
transactions.

Test plan:
1. Start a cashup on a register (two-phase workflow)
2. Verify "Cashup in progress" alert appears
3. Click "Preview expected summary" link
4. Verify modal shows:
   - Title includes "(in progress)"
   - Blue info alert explaining this is a preview
   - Correct period dates
   - Current transaction totals
5. Add a new cash transaction
6. Re-open preview, verify totals updated
7. Complete the cashup normally
8. View completed cashup summary
9. Verify no preview notice shown, title is normal

-- 
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