Repository navigation
Map payroll code and category rule columns in category spreadsheet import - #102399
Conversation
…from a spreadsheet Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I created this PR from an upstream branch since I don't have push access to your fork. To take ownership of this branch and be able to push updates, run: Then you can close this PR and open a new one from your fork. |
🦜 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/it.ts b/src/languages/it.ts
index 99a2efa0..3f1f2b48 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -8230,7 +8230,7 @@ Richiedi dettagli sulle spese come ricevute e descrizioni, imposta limiti e valo
flagAmountsOver: 'Contrassegna importi superiori a',
flagAmountsOverDescription: (categoryName: string) => `Si applica alla categoria “${categoryName}”.`,
flagAmountsOverSubtitle: 'Questo sostituisce l’importo massimo per tutte le spese.',
- expenseLimitType: 'Tipo di limite di spesa',
+ expenseLimitType: 'Tipo di limite spesa',
expenseLimitTypes: {
expense: 'Spesa individuale',
expenseSubtitle:
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 6e67cb92..a520f25d 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -8206,7 +8206,7 @@ Vereis onkostendetails zoals bonnen en beschrijvingen, stel limieten en standaar
flagAmountsOver: 'Markeer bedragen boven',
flagAmountsOverDescription: (categoryName: string) => `Is van toepassing op de categorie “${categoryName}”.`,
flagAmountsOverSubtitle: 'Dit overschrijft het maximale bedrag voor alle onkosten.',
- expenseLimitType: 'Type onkostenlimiet',
+ expenseLimitType: 'Type onkostentegoed',
expenseLimitTypes: {
expense: 'Individuele uitgave',
expenseSubtitle:
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 4b4145b0..ebd6a456 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7924,7 +7924,7 @@ ${reportName}`,
flagAmountsOver: '标记超过此金额的费用',
flagAmountsOverDescription: (categoryName: string) => `适用于类别“${categoryName}”。`,
flagAmountsOverSubtitle: '这将覆盖所有报销的最高金额限制。',
- expenseLimitType: '报销限额类型',
+ expenseLimitType: '费用限额类型',
expenseLimitTypes: {
expense: '单笔报销',
expenseSubtitle: '按类别标记报销金额。此规则会覆盖工作区的一般最高报销金额规则。多天预订将按每晚平均金额进行评估。',
Note You can apply these changes to your branch by copying the patch to your clipboard, then running |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
🤖 Android test steps verification results: All five new mapping roles show up in the import, and the import finishes without errors. The imported "Flag amounts over" values are 100 times smaller than the CSV values: 500 became $5.00 and 75 became $0.75.
|
|
@MelvinBot please open this PR |
|
I couldn't mark this PR as ready for review. My environment blocked the Before you do, check these two points:
|
|
@MelvinBot please open this PR |
|
I still can't mark this PR as ready for review. My environment requires approval for the As the assignee, you can click Ready for review at the bottom of the PR page. Before you do, note that the Android test found imported "Flag amounts over" values are 100 times too small. For example, 500 became $5.00. |
|
@MelvinBot please fill the tests + Offline tests + QA steps sections in your checklist with the same steps in #101939 |
|
I filled in the Tests, Offline tests, and QA Steps sections with the steps from New Expensify category import can't map Payroll code, Require description or Description hint from a Classic export. The backend already accepts all three.. Each section lists the Action Performed steps, then the Expected Result as a final "Verify" step. I also removed the TODO placeholders. The Offline tests section uses the same steps you asked for. Adjust it if you want offline-specific checks. |
|
@MelvinBot please open this PR |
|
I tried again, but I still can't take this PR out of draft. My environment blocks the As the assignee, you can click Ready for review at the bottom of the PR page. Before you do, note that the Android test found imported "Flag amounts over" values are 100 times too small. For example, 500 became $5.00. |
This comment was marked as outdated.
This comment was marked as outdated.
@MelvinBot For this bug, please use |
Co-authored-by: daledah <daledah@users.noreply.github.com>
|
The failing Analysis: Two tests in Evidence:
After the IOU test failure is fixed on |
|
Both failing checks come from problems already on
Why I didn't trim `PolicyUtils.ts` hereMoving 39+ lines out of After both issues are fixed on |
|
I pushed the fix in 00011b1. ESLint and typecheck pass. I couldn't run Jest or the formatter check here. I also ran an Android check, but it didn't reach the import. The app froze on the column-mapping screen when I picked "Flag amounts over" for a column. After that, it ignored taps and the Back key. The parsers run only when you tap Import, so this commit didn't cause the freeze. Please confirm 500 → $500.00 when you test. |
|
Both failing checks are unrelated to this PR, so I didn't push a fix. The failures come from
After both issues are fixed on |
|
@MelvinBot please resolve conflict and fix the bug below New category columns don't auto-detect from their headerUploading a category export leaves Payroll Code, Max Expense amount, Itemized Receipts Required, Comments, Comment Hint and Expense Limit Type all on Ignore, so every one has to be mapped by hand.
Payroll Code has a second layer: even a bare |
…RuleColumns Co-authored-by: daledah <daledah@users.noreply.github.com> # Conflicts: # tests/actions/PolicyCategoryTest.ts
…rt columns Co-authored-by: daledah <daledah@users.noreply.github.com>
|
I resolved the conflict and fixed the header auto-detection. The PR is mergeable again.
Checks: ESLint and typecheck pass on the changed files. Web test: It didn't run. The browser session went blank before the test started, so nothing was verified in the app. view run · no recording available |
Classic exports amounts like "299,393.00". Number() returned NaN for these, so the import silently dropped Flag amounts over and Require receipts over. Move the parsing into ImportCategoriesUtils and add tests that import a Classic export row. Co-authored-by: daledah <daledah@users.noreply.github.com>
|
@cristipaval Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosiOS: HybridAppios.movMacOS: Chrome / SafariScreen.Recording.2026-09-30.at.14.48.56.mov |
|
@daledah, the checklist has been updated https://github.com/Expensify/App/blob/main/contributingGuides/REVIEWER_CHECKLIST.md Can you use the new list? |
|
@MelvinBot please merge main |
…RuleColumns Co-authored-by: daledah <daledah@users.noreply.github.com>
daledah
left a comment
There was a problem hiding this comment.
Screen.Recording.2026-10-04.at.11.40.39.mov
LGTM
|
🚧 cristipaval has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/cristipaval in version: 9.5.3-0 🚀
|
|
A help site update is needed. I opened Docs updates for E/A#102399 Add category rule import columns, fix receipt amounts. This PR made two parts of Create Expense Categories wrong:
@daledah, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
QA team failed on Web this PR with an original issue 1791255730757.bandicam_2026-10-06_09-54-36-721.mp4 |
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.5.3-4 🚀
Bundle Size Analysis (Sentry): |












Explanation of Change
Admins importing a Classic category export could not map Payroll code, Require description, Description hint, Flag amounts over (max expense amount) or Expense limit type. They had to set these by hand on every category. The backend already accepts all of these fields. Two frontend gates blocked them:
getColumnRoles()inImportedCategoriesPage.tsxoffered no roles for these columns.importPolicyCategories()inPolicy/Category.tsrebuilt each category from a fixed list of keys, so any extra field was stripped beforeImportCategoriesSpreadsheetwas called.This PR:
CONST.CSV_IMPORT_COLUMNSkeys for the five fields.isControlPolicy. The four rule fields sit behindarePolicyRulesEnabled.importCategories(). Unmapped columns are left out of the payload, so they don't overwrite existing values. Require description is parsed like Enabled (true/yes). Max expense amount is passed through as a number, the same way Require receipts over is today. Expense limit type accepts onlyexpenseordaily.importPolicyCategories()and counts a change to any of them as an update in the confirmation modal.workspace.rules.categoryRules.expenseLimitType("Expense limit type"), in every locale. The other labels reuse existing strings.Unit tests in
tests/actions/PolicyCategoryTest.tscover the API payload and the update count.AI tests run:
npm run typecheckpassed.npm test -- tests/actions/PolicyCategoryTest.tspassed (20/20).npm run linton the changed files passed.npm run spell-changedpassed.react-compiler-compliance-check checkonImportedCategoriesPage.tsxpassed (check-changedcould not resolve the base ref in CI). I could not run oxfmt in this environment. An automated browser test could not run: the test session loaded a blank page, and the web test tool cannot upload files.Fixed Issues
$ #101939
PROPOSAL: #101939 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, 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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari