-
Notifications
You must be signed in to change notification settings - Fork 68
feat: allow editing item name in cart for single invoice #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
feat: allow editing item name in cart for single invoice #51
Conversation
|
Added a new commit: item code is now displayed below the item name in the edit dialog |
|
Potential improvement: validate server-side that item name in the form data matches the item name in the database when "Allow Custom Item Name in Cart" is disabled. I'm not seeing any currently implemented logic that already validates item names in form so I'm not sure if this is necessary. |
|
Thanks I will start reviewing this code. |
IMO this make no sense, because in case od disable this new option item_name on form will always match the item_name in Item doctype since it is fetched from there. Maybe I am missing something |
|
@git-avc even when the option is disabled, item_name is sent by client so in theory it would be possible to construct and send manual API calls (bypassing the front-end) with modified item names. The question is whether it's necessary to prevent that or not. I'm assuming this was deemed unnecessary since there's no validation to begin with but thought it was worth mentioning. |
|
My Concern about this PR what will prevent the Casher to sell a higher rate item with Lower rate by just changing the names. e.g. IPhone 13 can be Sold as IPhone 17 by just renaming. |
|
Hy @engahmed1190 @aperebaskine Purpose of this is let people use POS system without all the items created ... Imagine a printing services shop. We have some items/services created (A4 color print, A4 BW print, ...) but need to specify on the item name something related to the job (ADS PROTOTYPE, CAMPAIGN SAMPLE ...). Maybe we can configure 1 item group for that ... We can consider too add a custom field to Item Doctype (something like "Let change item name on POS") |
|
Your concern is valid, here are possible steps we could take to solve this problem:
This would have to be implemented in Desk, removing the toggle inside the settings menu of the front-end. |
This seems good plan |
Description
This PR allows users to modify an item's name in the cart, for the corresponding invoice only. This is useful as some small businesses do not register an entry for every single of their SKUs on sale, opting instead use a more general item entry and specify a name on a per-invoice basis.
This does not update the item's original name nor does it allow the user to tamper with the item code (the actual identifier for the SKU in the database).
This is an updated version of PR #27, which may be closed following the merging of this one.
Implementation details
As requested in PR #27, a check field in POS Settings has been added to toggle this feature.
If the feature is enabled, within the item edit dialog, the item name is replaced with an input field. A function is added to restore the original name from cache, which can be triggered manually via a button in the UI, or automatically on blur if the field is empty.
To improve UX with this feature enabled, item code is now also displayed below the editable item name.