mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-07-09 19:36:02 +00:00
feat: mapeamento automatico de categoria na importacao de planilhas
This commit is contained in:
committed by
Felipe Coutinho
parent
2fd6e3c323
commit
558197e870
@@ -108,9 +108,18 @@ export function ImportPage({
|
||||
|
||||
setRows(
|
||||
stmt.transactions.map((t) => {
|
||||
const mappedCategoryId =
|
||||
let mappedCategoryId =
|
||||
categoryMappings[normalizeDescriptionKey(t.description)] ?? null;
|
||||
|
||||
if (t.categoryRaw) {
|
||||
const matchedOption = categoryOptions.find(
|
||||
(opt) => opt.label.toLowerCase() === t.categoryRaw?.toLowerCase()
|
||||
);
|
||||
if (matchedOption) {
|
||||
mappedCategoryId = matchedOption.value;
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...t,
|
||||
isDuplicate: t.externalId ? duplicates.has(t.externalId) : false,
|
||||
@@ -129,7 +138,7 @@ export function ImportPage({
|
||||
setIsChecking(false);
|
||||
}
|
||||
},
|
||||
[isCategoryCompatible, payerId],
|
||||
[isCategoryCompatible, payerId, categoryOptions],
|
||||
);
|
||||
|
||||
// Pré-seleciona cartão ou conta com base no tipo detectado no OFX
|
||||
|
||||
Reference in New Issue
Block a user