Add 'Require company cards for all purchases' configuration#76728
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🦜 Polyglot Parrot! 🦜Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues: View the translation diffdiff --git a/src/languages/de.ts b/src/languages/de.ts
index b8c27ad0..270e78b2 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -6215,8 +6215,8 @@ Fordere Spesendetails wie Belege und Beschreibungen an, lege Limits und Standard
gambling: 'Glücksspiel',
tobacco: 'Tabak',
adultEntertainment: 'Unterhaltung für Erwachsene',
- requireCompanyCard: 'Firmenkarten für alle Einkäufe erforderlich machen',
- requireCompanyCardDescription: 'Kennzeichnen Sie alle Barausgaben, einschließlich Kilometer- und Tagegeldspesen.',
+ requireCompanyCard: 'Firmenkarten für alle Käufe erforderlich',
+ requireCompanyCardDescription: 'Markiere alle Barausgaben, einschließlich Kilometer- und Pauschalspesen.',
},
expenseReportRules: {
title: 'Fortgeschritten',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 4fe8a891..8e3aa643 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -6223,7 +6223,7 @@ Exigez des informations de dépense comme les reçus et les descriptions, défin
tobacco: 'Tabac',
adultEntertainment: 'Divertissement pour adultes',
requireCompanyCard: 'Exiger des cartes d’entreprise pour tous les achats',
- requireCompanyCardDescription: 'Marquez toutes les dépenses payées en espèces, y compris les frais kilométriques et les indemnités journalières.',
+ requireCompanyCardDescription: 'Signalez toutes les dépenses en espèces, y compris les frais de kilométrage et les indemnités journalières.',
},
expenseReportRules: {
title: 'Avancé',
@@ -7343,7 +7343,7 @@ Exigez des informations de dépense comme les reçus et les descriptions, défin
confirmDuplicatesInfo: `Les doublons que vous ne conservez pas seront mis de côté pour que l’expéditeur les supprime.`,
hold: 'Cette dépense a été mise en attente',
resolvedDuplicates: 'a résolu le doublon',
- companyCardRequired: 'Achats avec carte d’entreprise requis',
+ companyCardRequired: 'Achats par carte d’entreprise requis',
},
reportViolations: {
[CONST.REPORT_VIOLATIONS.FIELD_REQUIRED]: ({fieldName}: RequiredFieldParams) => `${fieldName} est requis`,
diff --git a/src/languages/it.ts b/src/languages/it.ts
index e893f814..78014bd2 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -6194,7 +6194,7 @@ Richiedi dettagli di spesa come ricevute e descrizioni, imposta limiti e valori
tobacco: 'Tabacco',
adultEntertainment: 'Intrattenimento per adulti',
requireCompanyCard: 'Richiedi carte aziendali per tutti gli acquisti',
- requireCompanyCardDescription: 'Contrassegna tutte le spese in contanti, incluse le spese per chilometraggio e le diarie.',
+ requireCompanyCardDescription: 'Contrassegna tutte le spese in contanti, incluse le spese chilometriche e di diaria.',
},
expenseReportRules: {
title: 'Avanzato',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index ed55c72d..6a5dd2dd 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -6157,7 +6157,7 @@ ${reportName}
tobacco: 'たばこ',
adultEntertainment: 'アダルトエンターテインメント',
requireCompanyCard: 'すべての購入に会社カードを必須にする',
- requireCompanyCardDescription: 'マイレージや日当の経費を含む、すべての現金支出にフラグを付けます。',
+ requireCompanyCardDescription: '現金での支出(走行距離精算や日当経費を含む)をすべてフラグ付けします。',
},
expenseReportRules: {
title: '上級',
@@ -7265,7 +7265,7 @@ ${reportName}
confirmDuplicatesInfo: `あなたが保持しない重複分は、申請者が削除できるように保留されます。`,
hold: 'この経費は保留になっています',
resolvedDuplicates: '重複を解決しました',
- companyCardRequired: '法人カードでの購入が必須',
+ companyCardRequired: '会社カードでの購入が必須',
},
reportViolations: {
[CONST.REPORT_VIOLATIONS.FIELD_REQUIRED]: ({fieldName}: RequiredFieldParams) => `${fieldName} は必須です`,
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 9e08df96..7aaefada 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -6182,7 +6182,7 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
tobacco: 'Tabak',
adultEntertainment: 'Volwassenenentertainment',
requireCompanyCard: 'Bedrijfskaarten vereisen voor alle aankopen',
- requireCompanyCardDescription: 'Markeer alle contante uitgaven, inclusief kilometer- en dagvergoedingen.',
+ requireCompanyCardDescription: 'Markeer alle uitgaven in contanten, inclusief kilometer- en dagvergoedingen.',
},
expenseReportRules: {
title: 'Geavanceerd',
@@ -7301,7 +7301,7 @@ Vraag verplichte uitgavedetails zoals bonnetjes en beschrijvingen, stel limieten
confirmDuplicatesInfo: `De duplicaten die je niet behoudt, worden bewaard zodat de indiener ze kan verwijderen.`,
hold: 'Deze uitgave is in de wacht gezet',
resolvedDuplicates: 'het duplicaat opgelost',
- companyCardRequired: 'Aankopen met bedrijfskaart verplicht',
+ companyCardRequired: 'Aankopen met bedrijfskaart vereist',
},
reportViolations: {
[CONST.REPORT_VIOLATIONS.FIELD_REQUIRED]: ({fieldName}: RequiredFieldParams) => `${fieldName} is verplicht`,
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index cabd5b56..04028e15 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -6176,7 +6176,7 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
tobacco: 'Tytoń',
adultEntertainment: 'Rozrywka dla dorosłych',
requireCompanyCard: 'Wymagaj kart firmowych dla wszystkich zakupów',
- requireCompanyCardDescription: 'Oznacz wszystkie wydatki gotówkowe, w tym koszty za przejechane kilometry i diety.',
+ requireCompanyCardDescription: 'Oznacz wszystkie wydatki gotówkowe, w tym koszty za przejechane kilometry oraz należności ryczałtowe (per diem).',
},
expenseReportRules: {
title: 'Zaawansowany',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 9c2625eb..f984c101 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -6177,7 +6177,7 @@ Exija detalhes de despesas como recibos e descrições, defina limites e padrõe
tobacco: 'Tabaco',
adultEntertainment: 'Entretenimento adulto',
requireCompanyCard: 'Exigir cartões corporativos para todas as compras',
- requireCompanyCardDescription: 'Sinalize todas as despesas em dinheiro, incluindo quilometragem e diárias.',
+ requireCompanyCardDescription: 'Classifique todas as despesas em dinheiro, incluindo quilometragem e despesas de diária.',
},
expenseReportRules: {
title: 'Avançado',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index ca1eccf0..37503545 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -6063,8 +6063,8 @@ ${reportName}
gambling: '赌博',
tobacco: '烟草',
adultEntertainment: '成人娱乐',
- requireCompanyCard: '所有购买均需使用公司卡',
- requireCompanyCardDescription: '标记所有现金支出,包括里程和日津贴费用。',
+ requireCompanyCard: '所有消费都必须使用公司卡',
+ requireCompanyCardDescription: '标记所有现金支出,包括里程和每日补贴费用。',
},
expenseReportRules: {
title: '高级',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
…mpany-cards-violation
|
BE PR is merged, waiting for deploy |
|
This should be good @ikevin127 |
|
🔄 Checking... |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid-hybrid.mp4Android: mWeb Chromeandroid-mweb.mp4iOS: HybridAppios-hybrid.moviOS: mWeb Safariios-mweb.movMacOS: Chrome / Safariweb.mov |
ikevin127
left a comment
There was a problem hiding this comment.
🟢 LGTM - tests well while offline as well 👍
@JS00001 policy?.requireCompanyCardsEnabled is enabled or disabled, here's an example of this issue:
ios-hybrid.mov
…github.com:Expensify/App into jsenyitko-add-company-cards-violation
|
@ikevin127 I think that last issue is a case that isnt common enough to add extra logic for The user would have to be: So I think we should leave the logic in its simplest version of just checking for the violation |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Valforte in version: 9.2.79-0 🚀
|
|
This PR failing because of a regression issue 527467828-41ef34d5-f5bc-428a-ab2b-2abbb5d165d8.mp4 |
|
🚀 Deployed to staging by https://github.com/Valforte in version: 9.2.81-0 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.81-5 🚀
|
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 9.2.81-5 🚀
|
Explanation of Change
Adds the 'Require Company Cards for All Purchases' violation, which requires members of a policy to use company cards for purchases (via a violation)
Fixed Issues
$ #76673
Tests
Create a policy
Enable workspace rules
Ensure that you cannot toggle the 'Require company cards for all purchases' option until you have a card feed
Connect a card feed
Ensure that you can now enable the 'Require company cards for all purchases' rule
Enable the rule
Create a cash expense - The expense should have a violation that cannot be dismissed: "Company card purchases required"
Create a card expense (or import some from the feed) - The expense should not have a violation
Create an expense by importing a personal card
Move the expense to a report on the policy
A violation should show up: "Company card purchases required"
Disable the rule in the workspace settings
All of the violations should disappear
Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Screen.Recording.2025-12-04.at.1.27.57.PM.mov