mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-09 00:15:48 +03:00
convert: fix amount-field/in-field/out-field validation
This commit is contained in:
parent
3617bc1a79
commit
c562412964
@ -165,10 +165,10 @@ initialRulesFileContent =
|
||||
|
||||
validateRules :: CsvRules -> Maybe String
|
||||
validateRules rules = let
|
||||
hasAccount = isJust $ accountField rules
|
||||
hasAmount = isJust $ amountField rules
|
||||
hasIn = isJust $ inField rules
|
||||
hasOut = isJust $ outField rules
|
||||
in case (hasAccount, hasIn, hasOut) of
|
||||
in case (hasAmount, hasIn, hasOut) of
|
||||
(True, True, _) -> Just "Don't specify in-field when specifying amount-field"
|
||||
(True, _, True) -> Just "Don't specify out-field when specifying amount-field"
|
||||
(_, False, True) -> Just "Please specify in-field when specifying out-field"
|
||||
|
Loading…
Reference in New Issue
Block a user