fix transaction type was not checked when replacing transaction categories using batch rules (#248)

This commit is contained in:
MaysWind
2025-09-18 22:42:30 +08:00
parent bc363438f1
commit ce74c4817b
@@ -1720,8 +1720,16 @@ function showReplaceAllTypesDialog(): void {
if (rule.dataType === 'expenseCategory' || rule.dataType === 'incomeCategory' || rule.dataType === 'transferCategory') {
if (importTransaction.type !== TransactionType.ModifyBalance && importTransaction.originalCategoryName === rule.sourceValue) {
importTransaction.categoryId = rule.targetId;
updated = true;
if (rule.dataType === 'expenseCategory' && importTransaction.type === TransactionType.Expense) {
importTransaction.categoryId = rule.targetId;
updated = true;
} else if (rule.dataType === 'incomeCategory' && importTransaction.type === TransactionType.Income) {
importTransaction.categoryId = rule.targetId;
updated = true;
} else if (rule.dataType === 'transferCategory' && importTransaction.type === TransactionType.Transfer) {
importTransaction.categoryId = rule.targetId;
updated = true;
}
}
} else if (rule.dataType === 'account') {
if (importTransaction.originalSourceAccountName === rule.sourceValue) {