• DevPilot's avatar
    fix(cash-sessions): give every branch its own till instead of one per person · ce92f8e9
    DevPilot authored
    A cashier could hold only one open drawer across the whole academy, and the
    three screens that ask about it did not agree on which one. Opening a shift
    checked every branch (withoutBranchScope), while the POS terminal and the
    manage screen looked only at the branch being worked in. So a drawer left open
    at one branch locked every other branch out of selling: the terminal said "open
    a shift first", the open form answered "there is already one open", and the
    manage screen offered nothing to close, because the shift it was refusing over
    was in a branch that screen will not show. On OC-Sport three accounts had
    drawers open at ZSC since July, which is every account the other seven branches
    sell through.
    
    A drawer is a physical box standing in one branch — its float, its cash in and
    its variance at close all belong to that branch's reconciliation, and
    POSService already refuses to ring a sale against another branch's session. So
    the invariant it can actually carry is one open drawer per cashier per branch,
    which is also what the desks need: each branch opens its own shift and collects
    normally, and closing one is never a precondition for another.
    
    Also fixed, because more than one session per user can now be open at once:
    
    - getOpenSession() resolves a named branch through forBranch() rather than
      filtering on top of the request scope. RefundService asks it for the drawer of
      the branch whose money is going back out; from any other branch that returned
      null and the refund silently skipped the cash count.
    - UpdateCashSessionTotals prefers the drawer the payment names, and narrows its
      fallback to the payment's own branch. It runs on a queue where the branch
      scope is off, so an unqualified first() would have counted one branch's cash
      into another branch's box.
    - Both screens now name the branches where the cashier still has a drawer open,
      so "there is already an open shift" is something the desk can act on.
    Co-Authored-By: 's avatarClaude Opus 5 <noreply@anthropic.com>
    ce92f8e9
Name
Last commit
Last update
..
activities Loading commit data...
admin Loading commit data...
assignments Loading commit data...
attendance Loading commit data...
audit Loading commit data...
auth Loading commit data...
branches Loading commit data...
cash-sessions Loading commit data...
components Loading commit data...
dashboard Loading commit data...
documents Loading commit data...
enrollments Loading commit data...
evaluations Loading commit data...
events Loading commit data...
facilities Loading commit data...
financial Loading commit data...
groups Loading commit data...
guardian Loading commit data...
hr Loading commit data...
inventory Loading commit data...
invoices Loading commit data...
messaging Loading commit data...
notifications Loading commit data...
parent Loading commit data...
participants Loading commit data...
people Loading commit data...
portal Loading commit data...
pos Loading commit data...
pricing Loading commit data...
profile Loading commit data...
programs Loading commit data...
public Loading commit data...
receptionist Loading commit data...
reports Loading commit data...
requests Loading commit data...
roles Loading commit data...
schedule Loading commit data...
settings Loading commit data...
trainer Loading commit data...
training Loading commit data...
users Loading commit data...
wallets Loading commit data...
website Loading commit data...
whatsapp Loading commit data...
wizards Loading commit data...
branch-switcher.blade.php Loading commit data...
dashboard.blade.php Loading commit data...
global-search.blade.php Loading commit data...