Skip to content

Commit 12f7da3

Browse files
committed
in preview can not pay empty invoice report
1 parent 5c22160 commit 12f7da3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/libs/ReportPreviewActionUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ function canPay(
164164
}
165165

166166
const parentReport = getParentReport(report);
167-
if (parentReport?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.INDIVIDUAL) {
167+
if (parentReport?.invoiceReceiver?.type === CONST.REPORT.INVOICE_RECEIVER_TYPE.INDIVIDUAL && reimbursableSpend > 0) {
168168
return parentReport?.invoiceReceiver?.accountID === getCurrentUserAccountID();
169169
}
170170

171-
return invoiceReceiverPolicy?.role === CONST.POLICY.ROLE.ADMIN;
171+
return invoiceReceiverPolicy?.role === CONST.POLICY.ROLE.ADMIN && reimbursableSpend > 0;
172172
}
173173

174174
function canExport(report: Report, violations: OnyxCollection<TransactionViolation[]>, policy?: Policy, reportActions?: OnyxEntry<ReportActions> | ReportAction[]) {

0 commit comments

Comments
 (0)