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

Enabling Invoices as a feature #46567

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
extend canSendInvoice
  • Loading branch information
rezkiy37 committed Jul 31, 2024
commit a911d3eecbb121d1734055176529f8a856506fa2
2 changes: 1 addition & 1 deletion src/libs/PolicyUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ function getActiveAdminWorkspaces(policies: OnyxCollection<Policy> | null): Poli

/** Whether the user can send invoice */
function canSendInvoice(policies: OnyxCollection<Policy> | null): boolean {
return getActiveAdminWorkspaces(policies).length > 0;
return getActiveAdminWorkspaces(policies).some((policy) => policy?.areInvoicesEnabled);
Copy link
Contributor

Choose a reason for hiding this comment

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

The check is correct, but maybe we should update it later and leave a TODO for now?
Cause invoicing settings screen isn't ready yet, and this update will block users from invoice creation.
It relates to other places where we check for areInvoicesEnabled as well.
Maybe we should confirm it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got you. Let me clarify.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah that makes sense, let's put it as a todo and update it when the invoices screen is ready

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've commented out some changes to prevent the invoice creation from being blocked.

Commit - 4acdd47.

Video
Flow.mp4

cc @madmax330 @VickyStash

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I open the PR for review?

Copy link
Contributor

Choose a reason for hiding this comment

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

@rezkiy37 let's add a link to the blocking issue in TODOs #45175, then it's fine

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done - c79964d.

}

function hasDependentTags(policy: OnyxEntry<Policy>, policyTagList: OnyxEntry<PolicyTagList>) {
Expand Down