Skip to content
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

(feat) : added a refund option to the bill manager. #296

Merged
merged 11 commits into from
Aug 7, 2024

Conversation

amosmachora
Copy link
Collaborator

Requirements

  • This PR has a title that briefly describes the work done, including the ticket number if there is a ticket.
  • My work conforms to the OpenMRS 3.0 Styleguide.
  • I checked for feature overlap with existing widgets.

Summary

In this PR I have added a refund option to the bill manager. Now administrators could be able to refund line items. This means that refunded items will be consequentially not count towards the total of the bill.

Also the UI marks the refunded lineitem rows with a pale red for accountability purposes. This approach was chosen over filtering out the refunded items. Thanks @ojwanganto for the help.

I also added checks to make sure we do not refund already refunded items.

Screenshots

Refund Option

image

Screen With Refunded Items

image

Refund Item Modal

image

Related Issue

None.

Other

None.

@ojwanganto
Copy link
Contributor

Thanks, @amosmachora. Can we only shade credited row(s)?

@amosmachora
Copy link
Collaborator Author

The only rows shaded are the credited rows. Maybe the screenshot doesn't do the best job in showing that but I only shade the credited rows.

@ojwanganto
Copy link
Contributor

image
From this, I see 2 rows for Malaria test. One has a positive figure and the other negative. Both rows are shaded.

@amosmachora
Copy link
Collaborator Author

Yeah it is by design. Remember we add a new lineitem with a negative value so that it gets subtracted from the total. Thats why both are shaded implying they are refunded items. I dont know maybe we should filter out one to avoid confusion?

@ojwanganto
Copy link
Contributor

just shade the one with negative value.

@amosmachora
Copy link
Collaborator Author

Fixed it @ojwanganto

image

@ojwanganto
Copy link
Contributor

Thanks, @amosmachora. CC @donaldkibet

@donaldkibet donaldkibet changed the title Feat: Added a refund option to the bill manager. (feat) : added a refund option to the bill manager. Aug 7, 2024
Copy link
Contributor

@donaldkibet donaldkibet left a comment

Choose a reason for hiding this comment

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

Thanks @amosmachora Am merging this please do a follow up PR to address the feedback.

@@ -12,3 +12,15 @@
.dataTableSkeleton {
margin-top: 0.625rem;
}

.refundedItem {
background-color: #fee2e2;
Copy link
Contributor

Choose a reason for hiding this comment

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

We should be using colors from carbon token system e.g

@use '@cabon/colors';

}

.refundedItem:hover {
background-color: #fecaca !important;
Copy link
Contributor

Choose a reason for hiding this comment

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

Using !important isn't recommend and used as the last resort. I would discourage its usage here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was actually a last resort. I couldnt get anything else to work. But I did not try the carbon/colors option so maybe that will work. Thanks for the feedback will work on the rest of the feedback before the end of today.

@donaldkibet donaldkibet merged commit b07fe0b into palladiumkenya:main Aug 7, 2024
6 of 7 checks passed
@amosmachora amosmachora deleted the feat/refund-option branch August 13, 2024 09:24
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.

3 participants