Skip to content

Commit

Permalink
Refactor report field disable logic for invoice reports
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Feb 12, 2025
1 parent 4d2a1ed commit a3a106d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3290,8 +3290,7 @@ function isReportFieldDisabled(report: OnyxEntry<Report>, reportField: OnyxEntry
const isReportClosed = isClosedReport(report);
const isTitleField = isReportFieldOfTypeTitle(reportField);
const isAdmin = isPolicyAdmin(report?.policyID, {[`${ONYXKEYS.COLLECTION.POLICY}${policy?.id}`]: policy});
const disabledForInvoice = isInvoiceReport(report) && isNewDotInvoice(report?.chatReportID);
if (disabledForInvoice) {
if (isInvoiceReport(report)) {
return true;
}
return isTitleField ? !reportField?.deletable : !isAdmin && (isReportSettled || isReportClosed);
Expand Down

0 comments on commit a3a106d

Please sign in to comment.