muni-corn / silverfox

The double-entry plain-text accounting tool designed with budgeting in mind
GNU General Public License v3.0
6 stars 0 forks source link

Blank if-rule matches all entries #5

Open muni-corn opened 4 years ago

muni-corn commented 4 years ago

Given the rules file:

// skip 1 line
skip 1

// fields
fields date,recordedat,scheduledfor,amount,activity,pending,rawdescription,description,categoryfolder,category,streetaddress,city,state,zip,latitude,longitude,memo

// comment to add to each transaction
comment raw description: %rawdescription%, memo: %memo%, simple category: %category%, address: %streetaddress%, %city%, %state%, %zip%

// date format
date_format %Y/%m/%d

// set default account
account1 assets:simple:safe_to_spend
amount1 %amount%

status ~

if 
groceries
wal mart
    account2 expenses:food:groceries

if
cocoa bean
dairy queen
fast food
fd srvcs
great scotts
jamba juice
k-lani
mcdonald's
panda express
restaurants
taco bell
taqueria el rancho
wendy's
    account2 expenses:food:dining

if protected goal account transfer
    account2 assets:simple:protectedgoals

if crypto.com
    account2 assets:cryptocom:fiat

if byu
    account2 expenses:education

if arcadia
    account2 expenses:home:electricity

if sofi
    account2 assets:sofi

if 
call oil co
gas
    account2 expenses:auto:gas

All imported entries had expenses:food:groceries as their second account

muni-corn commented 4 years ago

Looks like this happens because the first if block line has no qualifier. Will likely fix this so that a blank if line won't count anything