use the expense and revenue account names as category names if the transaction has not category when importing Firefly III transactions

This commit is contained in:
MaysWind
2025-07-13 01:51:27 +08:00
parent ca5c451d36
commit 0413f8c0aa
8 changed files with 107 additions and 64 deletions
@@ -818,7 +818,7 @@ func TestGnuCashTransactionDatabaseFileParseImportedData_MissingAccountRequiredN
DefaultCurrency: "CNY",
}
// Missing Transaction Time Node
// Missing Account Currency Node
_, _, _, _, _, _, err := converter.ParseImportedData(context, user, []byte(
"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n"+
"<gnc-v2\n"+
@@ -177,6 +177,8 @@ func (t *gnucashTransactionDataRowIterator) parseTransaction(ctx core.Context, u
if toAccount.Commodity != nil && toAccount.Commodity.Space == gnucashCommodityCurrencySpace {
data[datatable.TRANSACTION_DATA_TABLE_ACCOUNT_CURRENCY] = toAccount.Commodity.Id
} else {
return nil, false, errs.ErrAccountCurrencyInvalid
}
data[datatable.TRANSACTION_DATA_TABLE_AMOUNT] = toAmount
@@ -207,6 +209,8 @@ func (t *gnucashTransactionDataRowIterator) parseTransaction(ctx core.Context, u
if fromAccount.Commodity != nil && fromAccount.Commodity.Space == gnucashCommodityCurrencySpace {
data[datatable.TRANSACTION_DATA_TABLE_ACCOUNT_CURRENCY] = fromAccount.Commodity.Id
} else {
return nil, false, errs.ErrAccountCurrencyInvalid
}
data[datatable.TRANSACTION_DATA_TABLE_AMOUNT] = fromAmount