#41149·dolibarr

NEW: TakePOS cash control per cashier shift instead of per calendar day

Author: catrielrCreated Sep 30, 2026Updated Sep 30, 2026
LabelsFeature request

Feature Request

Feature request

TakePOS cash control (llx_pos_cash_fence) is a calendar-day report, not a cashier shift. A terminal that is closed and opened again the same day (cashier change) produces totals that do not match the sales of the new shift.

Current behavior

  • With TAKEPOS_CONTROL_CASH_OPENING, the opening popup runs only when no cash fence was created today on that terminal, whatever its status (takepos/index.php, related to #38597). A second cashier does not get an opening dialog.
  • The period stored on the fence is end-of-day minus 24 hours (cashcontrol_card.php), not date_creation → date_valid.
  • Theoretical amounts on close count only payment codes LIQ, CHQ and CB for that whole window. Any other code (for example a local code) is omitted.
  • The suggested opening amount is the bank balance before the start of that window, not the cash declared at the previous close.
  • Reopening the same fence (action=reopen) recalculates the same calendar day, so the first shift's sales are included again.
  • compta/cashcontrol/report.php uses the same day window and the same three payment codes. There is no hook to replace that query.

Expected behavior

  • One open fence = one cashier shift.
  • Period start = date_creation of this fence (or date_valid of the previous closed fence of the same terminal). Period end = date_valid, or now while it is still draft.
  • A new opening popup when there is no draft fence, including after a close earlier the same day.
  • Opening amount suggested from the previous fence cash_declared.
  • Every active payment code on its own line. Only LIQ increases expected cash in the drawer. The sales total does not include the opening amount.
  • report.php and the close form must use this same shift query.
  • A hook (for example around the period bounds and the per-payment aggregation) so external modules can print a Z ticket consistent with the screen.

Why

Shops with more than one cashier per day cannot trust the cash control. The second close repeats the first shift's cash sales, drops non-standard payment modes, and the printed report does not match the close screen.

Use case

No response

Suggested implementation

No response