mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-26 03:42:25 +03:00
lib: fixed validation rules for minimul viable csv rules to include account1 etc
This commit is contained in:
parent
f1ab107400
commit
b2ba1086b6
@ -468,16 +468,18 @@ validateRules rules = do
|
||||
(not amount && (amountin && amountout)) ||
|
||||
balance)
|
||||
$ Left $ unlines [
|
||||
"Please specify (as a top level CSV rule) either the amount field,"
|
||||
,"both the amount-in and amount-out fields, or the balance field. Eg:"
|
||||
,"amount %2\n"
|
||||
"Please specify (as a top level CSV rule) either the amount1 field,"
|
||||
,"both the amount1-in and amount1-out fields, or the balance1 field. Eg:"
|
||||
,"amount1 %2\n"
|
||||
,"You can also use amount, or both amount-in and amount-out, or balance,"
|
||||
,"though this syntax is considered legacy."
|
||||
]
|
||||
Right rules
|
||||
where
|
||||
amount = isAssigned "amount"
|
||||
amountin = isAssigned "amount-in"
|
||||
amountout = isAssigned "amount-out"
|
||||
balance = isAssigned "balance" || isAssigned "balance1" || isAssigned "balance2"
|
||||
amount = isAssigned "amount" || isAssigned "amount1"
|
||||
amountin = isAssigned "amount-in" || isAssigned "amount1-in"
|
||||
amountout = isAssigned "amount-out" || isAssigned "amount1-out"
|
||||
balance = isAssigned "balance" || isAssigned "balance1"
|
||||
isAssigned f = isJust $ getEffectiveAssignment rules [] f
|
||||
|
||||
-- parsers
|
||||
|
Loading…
Reference in New Issue
Block a user