I'm trying to import a CSV file from USAA Bank. The CSV file looks like 
this:
Date,Description,Original Description,Category,Amount,Status
2023-01-03,"Credit Card Payment","CARDMEMBER SERV  WEB PYMT   
***********1234",Credit Card Payment,-663.94,Posted
2023-01-03,"Overdraft Advance Transfer In","OD ADVANCE TRANSFER 
IN",Transfer,622.42,Posted

When I run my importer, I only get one entry (as opposed to both legs of a 
double entry accounting transaction). Is this a problem with my 
transaction_type_map? The output I get looks like this:
2023-01-03 * "CARDMEMBER SERV  WEB PYMT   ***********1234" "Credit Card 
Payment"
  Assets:US:USAA:Savings  -663.94 USD

2023-01-03 * "OD ADVANCE TRANSFER IN" "Overdraft Advance Transfer In"
  Assets:US:USAA:Savings  622.42 USD

I've created a __init__.py file under 
beancount_reds_importers/importers/usaa with the following content:
""" USAA csv importer."""

from beancount_reds_importers.libreader import csvreader
from beancount_reds_importers.libtransactionbuilder import banking


class Importer(csvreader.Importer,banking.Importer):
    IMPORTER_NAME = 'USAA CSV'
    def custom_init(self):
        self.max_rounding_error = 0.14
        self.filename_pattern_def = 'bk_download*'
        self.date_format = '%Y-%m-%d'
        self.skip_head_rows = 0
        self.skip_transaction_types = []
        self.header_identifier = 'Date,Description,Original 
Description,Category,Amount,Status'
     

        # CSV column spec
        self.header_map = {
            "Date": "date",
            "Description": "payee",
            "Category": "type",
            "Original Description":"memo",
            "Amount": "amount",
         }

        self.transaction_type_map = {
            "Interest Income": "income",
            "Credit Card Payment": "expense",
            "Shopping": "expense",
            "Transfer": "transfer",
            "ATM": "cash",
            "FEE": "fees",
        }
Here is what my.import looks like:
"""Import configuration."""

import sys
from os import path

sys.path.insert(0, path.join(path.dirname(__file__)))

from beancount_reds_importers.importers import vanguard,chase,usaa
from beancount_reds_importers.importers.schwab import schwab_csv_brokerage
from fund_info import *
CONFIG = [
        usaa.Importer({
        'main_account'  : 'Assets:US:USAA:SavingsChristian',
        'interest'      : 'Income:US:Interest:USAA:SavingsChristian',
        'income'        : 'Income:US:USAA:SavingsChristian',
        'expense'       : 'Expenses:Shopping',
        'currency'      : 'USD',
    }),
]

Can you tell me what I'm missing here?
Thanks

Christian

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/78024df6-3727-4203-a831-1daea0d12415n%40googlegroups.com.

Reply via email to