Skip to content

fix(pos): block unpriced open-price lines from breaking cart actions - #16

Open
orwilDz wants to merge 1 commit into
DZBuild-com:mainfrom
orwilDz:fix/open-price-product
Open

orwilDz wants to merge 1 commit into
DZBuild-com:mainfrom
orwilDz:fix/open-price-product

Conversation

@orwilDz

@orwilDz orwilDz commented Nov 27, 2026

Copy link
Copy Markdown

Prompt for a price and quantity before adding an open-price product to the cart, so catalogue open-price lines always carry a unit price. When an unpriced open-price line is already present, let cart event recording value the line on a best-effort basis so void, quantity reduction, and cart cancellation still work.

Return a dedicated open_price_required validation error, show it explicitly in the cart, and offer a direct action to set the missing price. Add openPrice to product/catalog bindings and update translations and fixtures

What and why

Bug from issue: #15

Fixes the sale cart getting stuck when an open-price product is present without a unit price.

  • Ask for price and quantity before adding an open-price catalogue product from the POS grid/search/scan flow.
  • Make cart event recording tolerant for unpriceable open-price lines so line void, quantity reduction, and cart cancellation can still be journaled.
  • Replace the generic unitPrice required validation with a dedicated open_price_required code.
  • Surface the error clearly in the cart, identify the affected line, and provide a "Set price" action.
  • Expose openPrice on Product / ProductHit, regenerate bindings, and add locale/fixture updates.

How it was tested

pnpm check (fail on rust) see bellow.

  • [] pnpm check passes locally. pnpm run test succeeds, but the Rust tests fail. This failure does not appear to be related to this fix; it may be specific to my local environment, as the tests were already failing on a fresh fork before applying these changes.

  • Tests added or updated for the change

Checklist

  • One topic in this pull request
  • Commits follow Conventional Commits and are signed off (git commit -s, DCO)
  • No hard-coded user-facing text; every new key exists in ar, fr and en (pnpm i18n)
  • Layout uses logical CSS only (ms-, pe-, start, end) and was checked in Arabic (right to left)
  • Amounts are integer centimes; no unwrap() or expect() in command paths
  • No Database changes at all
  • Core flows still work with no network
  • No secrets, personal data or real shop data in the code, tests or screenshots

Screenshots

"before" screen are attached to the issue.

Fix screens:

FR

image image image

AR

image image image

EN

image image image

Prompt for a price and quantity before adding an open-price product to the cart, so catalogue open-price lines always carry a unit price. When an unpriced open-price line is already present, let cart event recording value the line on a best-effort basis so void, quantity reduction, and cart cancellation still work.

Return a dedicated open_price_required validation error, show it explicitly in the cart, and offer a direct action to set the missing price. Add openPrice to product/catalog bindings and update translations and fixtures

Signed-off-by: orwilDz <djedri.aimen.lotfi@gmail.com>
@github-actions github-actions Bot added area/till Sales screen, tenders, returns, cash sessions and Z report area/stock Products, catalogue, stock movements and inventory counts area/i18n Arabic, French and English texts, right-to-left layout labels Nov 27, 2026
@ogyamada
ogyamada self-requested a review November 29, 2026 12:33
@ogyamada ogyamada linked an issue Nov 29, 2026 that may be closed by this pull request
2 tasks done
@ogyamada

Copy link
Copy Markdown
Contributor

@orwilDz i will test this out,it will take a few days to build and run everything, and once its verified, Ill merge it in. Thanks for the effort!
Thank U GIF by Rockwell Trading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/i18n Arabic, French and English texts, right-to-left layout area/stock Products, catalogue, stock movements and inventory counts area/till Sales screen, tenders, returns, cash sessions and Z report

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Open-price product added from the till cannot be voided or cancelled

2 participants