fix: Correctly map transactions without counterparty
Before this change, transactions that did not have a counterparty were not correctly mapped and could not be insterted into Firefly III. That is not correct: _all_ transactions must be added to Firefly III. Furthermore, Firefly III already has logic to deal with this, and rules that can solve it manually as well.
This commit is contained in:
@@ -146,9 +146,7 @@ impl TransactionDestination for FireflyAdapter {
|
||||
None
|
||||
},
|
||||
source_name: if is_credit {
|
||||
tx.counterparty_name
|
||||
.clone()
|
||||
.or(Some("Unknown Sender".to_string()))
|
||||
tx.counterparty_name.clone()
|
||||
} else {
|
||||
None
|
||||
},
|
||||
@@ -158,9 +156,7 @@ impl TransactionDestination for FireflyAdapter {
|
||||
None
|
||||
},
|
||||
destination_name: if !is_credit {
|
||||
tx.counterparty_name
|
||||
.clone()
|
||||
.or(Some("Unknown Recipient".to_string()))
|
||||
tx.counterparty_name.clone()
|
||||
} else {
|
||||
None
|
||||
},
|
||||
|
||||
@@ -8,6 +8,7 @@ use std::str::FromStr;
|
||||
pub fn map_transaction(tx: Transaction) -> Result<BankTransaction> {
|
||||
let internal_id = tx
|
||||
.transaction_id
|
||||
.or(tx.internal_transaction_id)
|
||||
.ok_or_else(|| anyhow::anyhow!("Transaction ID missing"))?;
|
||||
|
||||
let date_str = tx
|
||||
|
||||
Reference in New Issue
Block a user