@@ -103,6 +103,7 @@ type HandleActionButtonPressParams = {
103103 goToItem : ( ) => void ;
104104 snapshotReport : Report ;
105105 snapshotPolicy : Policy ;
106+ policy : OnyxEntry < Policy > ;
106107 lastPaymentMethod : OnyxEntry < LastPaymentMethod > ;
107108 userBillingGracePeriodEnds : OnyxCollection < BillingGraceEndPeriod > ;
108109 currentSearchKey ?: SearchKey ;
@@ -134,6 +135,7 @@ function handleActionButtonPress({
134135 goToItem,
135136 snapshotReport,
136137 snapshotPolicy,
138+ policy,
137139 lastPaymentMethod,
138140 userBillingGracePeriodEnds,
139141 currentSearchKey,
@@ -166,7 +168,7 @@ function handleActionButtonPress({
166168 onDelegateAccessRestricted ?.( ) ;
167169 return ;
168170 }
169- if ( snapshotReport . policyID && shouldRestrictUserBillableActions ( snapshotReport . policyID , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
171+ if ( snapshotReport . policyID && shouldRestrictUserBillableActions ( policy , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
170172 Navigation . navigate ( ROUTES . RESTRICTED_ACTION . getRoute ( snapshotReport . policyID ) ) ;
171173 return ;
172174 }
@@ -177,7 +179,7 @@ function handleActionButtonPress({
177179 onDelegateAccessRestricted ?.( ) ;
178180 return ;
179181 }
180- if ( snapshotReport . policyID && shouldRestrictUserBillableActions ( snapshotReport . policyID , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
182+ if ( snapshotReport . policyID && shouldRestrictUserBillableActions ( policy , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
181183 Navigation . navigate ( ROUTES . RESTRICTED_ACTION . getRoute ( snapshotReport . policyID ) ) ;
182184 return ;
183185 }
@@ -188,7 +190,7 @@ function handleActionButtonPress({
188190 approveMoneyRequestOnSearch ( hash , item . reportID ? [ item . reportID ] : [ ] , currentSearchKey ) ;
189191 return ;
190192 case CONST . SEARCH . ACTION_TYPES . SUBMIT : {
191- if ( snapshotReport . policyID && shouldRestrictUserBillableActions ( snapshotReport . policyID , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
193+ if ( snapshotReport . policyID && shouldRestrictUserBillableActions ( policy , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
192194 Navigation . navigate ( ROUTES . RESTRICTED_ACTION . getRoute ( snapshotReport . policyID ) ) ;
193195 return ;
194196 }
@@ -200,8 +202,8 @@ function handleActionButtonPress({
200202 return ;
201203 }
202204
203- const policy = snapshotPolicy ?? { } ;
204- const connectedIntegration = getValidConnectedIntegration ( policy ) ;
205+ const exportPolicy = snapshotPolicy ?? { } ;
206+ const connectedIntegration = getValidConnectedIntegration ( exportPolicy ) ;
205207
206208 if ( ! connectedIntegration ) {
207209 return ;
@@ -1410,7 +1412,7 @@ function handleBulkPayItemSelected(params: {
14101412 return ;
14111413 }
14121414
1413- if ( policy && shouldRestrictUserBillableActions ( policy ?. id , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
1415+ if ( policy && shouldRestrictUserBillableActions ( policy , ownerBillingGracePeriodEnd , userBillingGracePeriodEnds , amountOwed ) ) {
14141416 Navigation . navigate ( ROUTES . RESTRICTED_ACTION . getRoute ( policy ?. id ) ) ;
14151417 return ;
14161418 }
0 commit comments