Disregard what I said in my earlier post. I think your config may be 
missing: target_account

You could override the method below to use different targets for different 
types, like expense or interest you have specified above.
def get_target_account(self, ot):
     """Can be overridden by importer"""
     return self.config.get('target_account')
On Saturday, January 13, 2024 at 8:49:27 PM UTC-5 christia...@gmail.com 
wrote:

> 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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/0a975f2d-0151-4c7e-9e8c-80cf63acd05bn%40googlegroups.com.

Reply via email to