Skip to content

Commit

Permalink
fix:add: account names provided on command line were being ignored [#…
Browse files Browse the repository at this point in the history
…2305]

Fix suggested by Raphael (lowercasename)
  • Loading branch information
simonmichael committed Dec 21, 2024
1 parent efa1010 commit eb9bb16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hledger/Hledger/Cli/Commands/Add.hs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ confirmedTransactionWizard prevInput es [] = confirmedTransactionWizard prevInpu
confirmedTransactionWizard prevInput es@EntryState{..} stack@(currentStage : _) = case currentStage of
EnterDateAndCode -> dateAndCodeWizard prevInput es >>= \case
Just (efd, code) -> do
let
let
date = fromEFDay efd
es' = es{ esArgs = drop 1 esArgs
, esDefDate = date
Expand Down Expand Up @@ -239,7 +239,7 @@ confirmedTransactionWizard prevInput es@EntryState{..} stack@(currentStage : _)
}
amountAndCommentString = showAmount amt ++ T.unpack (if T.null comment then "" else " ;" <> comment)
prevAmountAndCmnt' = replaceNthOrAppend (length esPostings) amountAndCommentString (prevAmountAndCmnt prevInput)
es' = es{esPostings=esPostings++[p], esArgs=drop 2 esArgs}
es' = es{esPostings=esPostings++[p], esArgs=drop 1 esArgs}
confirmedTransactionWizard prevInput{prevAmountAndCmnt=prevAmountAndCmnt'} es' (EnterNewPosting txnParams (Just posting) : stack)
Nothing -> confirmedTransactionWizard prevInput es (drop 1 stack)

Expand Down

0 comments on commit eb9bb16

Please sign in to comment.