@@ -9,7 +9,7 @@ import * as CurrencyUtils from '@libs/CurrencyUtils';
99import DateUtils from '@libs/DateUtils' ;
1010import { isReceiptError } from '@libs/ErrorUtils' ;
1111import Parser from '@libs/Parser' ;
12- import { getDistanceRateCustomUnitRate , getPerDiemRateCustomUnitRate , getSortedTagKeys , isTaxTrackingEnabled } from '@libs/PolicyUtils' ;
12+ import { getDistanceRateCustomUnitRate , getPerDiemRateCustomUnitRate , getSortedTagKeys , isDefaultTagName , isTaxTrackingEnabled } from '@libs/PolicyUtils' ;
1313import * as TransactionUtils from '@libs/TransactionUtils' ;
1414import { shouldShowViolation } from '@libs/TransactionUtils' ;
1515import CONST from '@src/CONST' ;
@@ -38,7 +38,8 @@ function getTagViolationsForSingleLevelTags(
3838 // Add 'tagOutOfPolicy' violation if tag is not in policy
3939 if ( ! hasTagOutOfPolicyViolation && updatedTransaction . tag && ! isTagInPolicy ) {
4040 const tagName = policyTagList [ policyTagListName ] ?. name ;
41- newTransactionViolations . push ( { name : CONST . VIOLATIONS . TAG_OUT_OF_POLICY , type : CONST . VIOLATION_TYPES . VIOLATION , data : { tagName} } ) ;
41+ const tagNameToShow = isDefaultTagName ( tagName ) ? undefined : tagName ;
42+ newTransactionViolations . push ( { name : CONST . VIOLATIONS . TAG_OUT_OF_POLICY , type : CONST . VIOLATION_TYPES . VIOLATION , data : { tagName : tagNameToShow } } ) ;
4243 }
4344
4445 // Remove 'tagOutOfPolicy' violation if tag is in policy
@@ -54,7 +55,8 @@ function getTagViolationsForSingleLevelTags(
5455 // Add 'missingTag violation' if tag is required and not set
5556 if ( ! hasMissingTagViolation && ! updatedTransaction . tag && policyRequiresTags ) {
5657 const tagName = policyTagList [ policyTagListName ] ?. name ;
57- newTransactionViolations . push ( { name : CONST . VIOLATIONS . MISSING_TAG , type : CONST . VIOLATION_TYPES . VIOLATION , data : { tagName} } ) ;
58+ const tagNameToShow = isDefaultTagName ( tagName ) ? undefined : tagName ;
59+ newTransactionViolations . push ( { name : CONST . VIOLATIONS . MISSING_TAG , type : CONST . VIOLATION_TYPES . VIOLATION , data : { tagName : tagNameToShow } } ) ;
5860 }
5961 return newTransactionViolations ;
6062}
0 commit comments