File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
4343 const { showLockedAccountModal} = useLockedAccountActions ( ) ;
4444 const { isDelegateAccessRestricted} = useDelegateNoAccessState ( ) ;
4545 const { showDelegateNoAccessModal} = useDelegateNoAccessActions ( ) ;
46+ const [ userBillingGraceEndPeriods ] = useOnyx ( ONYXKEYS . COLLECTION . SHARED_NVP_PRIVATE_USER_BILLING_GRACE_PERIOD_END ) ;
4647 const [ isUserValidated ] = useOnyx ( ONYXKEYS . ACCOUNT , { selector : isUserValidatedSelector } ) ;
4748 const activeAdminPolicies = useSortedActiveAdminPolicies ( ) ;
4849
@@ -128,6 +129,7 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
128129 isDelegateAccessRestricted,
129130 showDelegateNoAccessModal,
130131 confirmPayment,
132+ userBillingGraceEndPeriods,
131133 } )
132134 }
133135 success
@@ -162,6 +164,7 @@ function SearchBulkActionsButton({queryJSON}: SearchBulkActionsButtonProps) {
162164 isDelegateAccessRestricted,
163165 showDelegateNoAccessModal,
164166 confirmPayment,
167+ userBillingGraceEndPeriods,
165168 } )
166169 }
167170 isSplitButton = { false }
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ import type {SearchAdvancedFiltersForm} from '@src/types/form/SearchAdvancedFilt
5151import type {
5252 BankAccountList ,
5353 Beta ,
54+ BillingGraceEndPeriod ,
5455 ExportTemplate ,
5556 LastPaymentMethod ,
5657 LastPaymentMethodType ,
@@ -1310,6 +1311,7 @@ function handleBulkPayItemSelected(params: {
13101311 activeAdminPolicies : Policy [ ] ;
13111312 isUserValidated : boolean | undefined ;
13121313 isDelegateAccessRestricted : boolean ;
1314+ userBillingGraceEndPeriods : OnyxCollection < BillingGraceEndPeriod > ;
13131315 showDelegateNoAccessModal : ( ) => void ;
13141316 confirmPayment ?: ( paymentType : PaymentMethodType | undefined , additionalData ?: Record < string , unknown > ) => void ;
13151317} ) {
@@ -1323,6 +1325,7 @@ function handleBulkPayItemSelected(params: {
13231325 activeAdminPolicies,
13241326 isUserValidated,
13251327 isDelegateAccessRestricted,
1328+ userBillingGraceEndPeriods,
13261329 showDelegateNoAccessModal,
13271330 confirmPayment,
13281331 } = params ;
@@ -1342,7 +1345,7 @@ function handleBulkPayItemSelected(params: {
13421345 return ;
13431346 }
13441347
1345- if ( policy && shouldRestrictUserBillableActions ( policy ?. id ) ) {
1348+ if ( policy && shouldRestrictUserBillableActions ( policy ?. id , userBillingGraceEndPeriods ) ) {
13461349 Navigation . navigate ( ROUTES . RESTRICTED_ACTION . getRoute ( policy ?. id ) ) ;
13471350 return ;
13481351 }
You can’t perform that action at this time.
0 commit comments