Skip to content

OBPIH-6690 Add option to edit unit price on invoice items made from order adjustments#4842

Merged
awalkowiak merged 3 commits intorelease/0.9.2-hotfix1from
OBPIH-6690-2
Sep 17, 2024
Merged

OBPIH-6690 Add option to edit unit price on invoice items made from order adjustments#4842
awalkowiak merged 3 commits intorelease/0.9.2-hotfix1from
OBPIH-6690-2

Conversation

@alannadolny
Copy link
Collaborator

✨ 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)

image

@alannadolny alannadolny self-assigned this Sep 16, 2024
@github-actions github-actions bot added domain: frontend Changes or discussions relating to the frontend UI domain: l10n Changes or discussions relating to localization & Internationalization labels Sep 16, 2024
return translate('react.invoice.errors.unitPrice.label', 'Wrong amount to invoice value');
}

setInvalidRows((rows) => rows.filter((rowId) => row.id !== rowId));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 🤔 ?

Copy link
Collaborator Author

@alannadolny alannadolny Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Collaborator

@kchelstowski kchelstowski Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@awalkowiak awalkowiak merged commit 7ad2c66 into release/0.9.2-hotfix1 Sep 17, 2024
@awalkowiak awalkowiak deleted the OBPIH-6690-2 branch September 17, 2024 09:34
jwalbers pushed a commit to jwalbers/openboxes that referenced this pull request Oct 29, 2024
jwalbers pushed a commit to jwalbers/openboxes that referenced this pull request Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: frontend Changes or discussions relating to the frontend UI domain: l10n Changes or discussions relating to localization & Internationalization

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants