Skip to content

feat(shift-closing): default payment counts to 0 instead of null#299

Open
NotAbdelrahmanelsayed wants to merge 1 commit into
BrainWise-DEV:developfrom
NotAbdelrahmanelsayed:feat/closing-shift-default-zero
Open

feat(shift-closing): default payment counts to 0 instead of null#299
NotAbdelrahmanelsayed wants to merge 1 commit into
BrainWise-DEV:developfrom
NotAbdelrahmanelsayed:feat/closing-shift-default-zero

Conversation

@NotAbdelrahmanelsayed

Copy link
Copy Markdown
Contributor

What

In the Close Shift reconciliation dialog, every payment method now defaults to a counted amount of 0 (and is pre-marked as touched) instead of starting as null.

Why

Previously each row started as null with _touched = false, so the submit button stayed disabled until the cashier clicked into every payment method — including ones where no cash was collected. This was an unnecessary step: a method with nothing counted should simply be 0.

Change

POS/src/components/ShiftClosingDialog.vue — in loadClosingData():

- closing_amount: payment.closing_amount ?? null,
+ closing_amount: payment.closing_amount ?? 0,
  difference: 0,
- _touched: false,
+ _touched: true,

Differences are computed immediately on load, and the shift can be closed without manually zeroing untouched methods. An existing closing_amount (e.g. resumed/edited shift) is still preserved via the ?? fallback.

Scope

Single file, two lines. No backend or schema changes.

Previously every payment method in the closing-shift reconciliation
started as null with _touched=false, forcing the cashier to click into
each row before the form could be submitted. Methods with no cash
collected still had to be touched manually.

Default closing_amount to 0 and mark rows as touched so the expected
amounts compute immediately and the shift can be closed without
manually zeroing untouched methods.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant