Cash Closes
Cash register closes (cierres de caja).
ποΈ Get cash close by ID
Returns a single cash close including payment-method lines and optional cash withdrawals.
ποΈ Update cash close
Full replacement of an existing cash close. `warehouseId` is immutable. When balances change, the legacy facade propagates subsequent closes via `updateNextSaldosCaja`.
ποΈ Delete cash close
Deletes a cash close. Closed registers with withdrawals are re-opened in the legacy flow before deletion.
ποΈ Merge-patch cash close
RFC 7396 merge-patch over `application/merge-patch+json`. Send only the fields you want to change; include a field with value `null` to remove it. Use the `If-Match` header for optimistic concurrency control.
ποΈ List cash closes
Returns a paginated list of cash register closes. Mirror the legacy JSF list defaults with `filter=draft==false;closeType==N` (limited users only see normal closes, not opening balances). Use `open==true` or `open==false` to list open or closed periods.
ποΈ Create cash close
Creates and optionally closes a cash register period. Set `needsRecalculation=true` (or call calculate first) when `closeAt` changed so totals are refreshed from underlying payments. Writable line fields: `countedAmount` per payment method; `withdrawals` when the branch tracks register withdrawals.
ποΈ Calculate cash close totals
Recomputes payment-method totals and period boundaries from underlying `Cobro` rows ({@code CajaService.calcularCierre}). Does not persist ΓΓΓΆ call PUT/POST afterwards to save counts and withdrawals.
ποΈ Download withdrawal photo
Streams the deposit receipt image attached to a cash withdrawal.
ποΈ Upload withdrawal photo
Stores a deposit receipt image for a cash withdrawal linked to this close. Accepts .gif, .jpg, .jpeg and .png up to 5 MiB (parity with JSF movCajaForm).
ποΈ Delete withdrawal photo
Removes the deposit receipt image from a cash withdrawal.
ποΈ Prototype cash close for a creation form
Returns a non-persisted cash close with backend defaults (branch, default close datetime, open=true). Optional JSON hints: `warehouseId`. Call `POST /api/v2/cash-closes` to persist.
ποΈ Calculate cash close totals (stateless)
Recomputes payment-method totals for a not-yet-persisted cash close. Send a {@link CashCloseDocument} without {@code id} (at minimum {@code warehouseId} and {@code closeAt}). Parity with the legacy JSF 'Calcular' action before the first save. Does not persist.