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

Martin Renvoize (ashimema) <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #186640|0                           |1
        is obsolete|                            |

--- Comment #19 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 189337
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189337&action=edit
Bug 40445: Implement two-phase cashup workflow for point of sale

This commit introduces a two-phase cashup system that allows staff to start
a cashup session, remove cash for counting, and complete the cashup later
with reconciliation against the actual counted amount.

Key changes:

1. **New cashup workflow methods**:
   - start_cashup(): Creates CASHUP_START action to begin counting session
   - cashup_in_progress(): Checks if a cashup session is active
   - Enhanced add_cashup(): Supports both legacy 'Quick cashup' and new
     two-phase modes

2. **Improved session boundary calculation**:
   - _get_session_start_timestamp(): Handles mixed quick/two-phase workflows
   - outstanding_accountlines(): Uses session boundaries instead of last CASHUP
   - Session boundaries correctly account for CASHUP_START timestamps

3. **Enhanced reconciliation logic**:
   - Reconciliation lines are backdated appropriately for each mode
   - Two-phase mode: Backdate to before CASHUP_START timestamp
   - Legacy mode: Backdate to before current time

4. **Updated cashup summary calculations**:
   - _get_session_boundaries(): Properly calculates session start/end
   - accountlines(): Returns session-specific accountlines
   - summary(): Uses correct session boundaries for transaction grouping

5. **Register interface updates**:
   - Dynamic toolbar shows "Start cashup" vs "Complete cashup"
   - Status indicator when cashup is in progress
   - Dual-workflow modal with quick and two-phase options

6. **Comprehensive test coverage**:
   - Two-phase workflow scenarios
   - Session boundary calculations
   - Mixed workflow compatibility
   - Error handling for duplicate operations

This implementation maintains full backward compatibility while enabling
libraries to separate cash counting from register operation, supporting
real-world workflows where counting takes time.

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