OBPIH-6690 Add option to edit unit price on invoice items made from order adjustments#4842
OBPIH-6690 Add option to edit unit price on invoice items made from order adjustments#4842awalkowiak merged 3 commits intorelease/0.9.2-hotfix1from
Conversation
| return translate('react.invoice.errors.unitPrice.label', 'Wrong amount to invoice value'); | ||
| } | ||
|
|
||
| setInvalidRows((rows) => rows.filter((rowId) => row.id !== rowId)); |
There was a problem hiding this comment.
this feels a bit weird - why can't we just update the invalid rows when there is one?
In other words:
- if there are validation errors, append the invalid item to the list
currently it looks like all of the rows are marked as invalid, and if there is not validation error for a row, we filter it out from the invalid rows list 🤔 ?
There was a problem hiding this comment.
If the row is invalid we are adding it to the invalidRows:
setInvalidRows((rows) => ([...rows, row?.id]));
The line that you are pointed removes the line from invalidRows if there is no error (the user already changed the value)
There was a problem hiding this comment.
yeah, I know, but I've been just wondering why all of the items are treated as invalid in advance and then you filter out an item if it's valid.
It's my loud thinking so I don't expect you to change anything now, it just feels a bit weird for me.
✨ Description of Change
Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-6690
Description:
I adjusted the hook to be able to edit the unit price of order adjustments.
📷 Screenshots & Recordings (optional)