convert: fix amount-field/in-field/out-field validation

This commit is contained in:
Simon Michael 2011-06-02 21:23:53 +00:00
parent 3617bc1a79
commit c562412964

View File

@ -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"