mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 09:44:26 +08:00
fix transaction type was not checked when replacing transaction categories using batch rules (#248)
This commit is contained in:
@@ -1720,8 +1720,16 @@ function showReplaceAllTypesDialog(): void {
|
|||||||
|
|
||||||
if (rule.dataType === 'expenseCategory' || rule.dataType === 'incomeCategory' || rule.dataType === 'transferCategory') {
|
if (rule.dataType === 'expenseCategory' || rule.dataType === 'incomeCategory' || rule.dataType === 'transferCategory') {
|
||||||
if (importTransaction.type !== TransactionType.ModifyBalance && importTransaction.originalCategoryName === rule.sourceValue) {
|
if (importTransaction.type !== TransactionType.ModifyBalance && importTransaction.originalCategoryName === rule.sourceValue) {
|
||||||
importTransaction.categoryId = rule.targetId;
|
if (rule.dataType === 'expenseCategory' && importTransaction.type === TransactionType.Expense) {
|
||||||
updated = true;
|
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') {
|
} else if (rule.dataType === 'account') {
|
||||||
if (importTransaction.originalSourceAccountName === rule.sourceValue) {
|
if (importTransaction.originalSourceAccountName === rule.sourceValue) {
|
||||||
|
|||||||
Reference in New Issue
Block a user