web: add form: in description field also offer declared/used payees
This commit is contained in:
		
							parent
							
								
									422329fbfa
								
							
						
					
					
						commit
						3f095fb472
					
				| @ -14,7 +14,6 @@ module Hledger.Web.Widget.AddForm | ||||
| import Control.Monad.State.Strict (evalStateT) | ||||
| import Data.Bifunctor (first) | ||||
| import Data.List (dropWhileEnd, intercalate, unfoldr) | ||||
| import Data.List.Extra (nubSort) | ||||
| import Data.Maybe (isJust) | ||||
| #if !(MIN_VERSION_base(4,13,0)) | ||||
| import Data.Semigroup ((<>)) | ||||
| @ -28,6 +27,7 @@ import Yesod | ||||
| 
 | ||||
| import Hledger | ||||
| import Hledger.Web.Settings (widgetFile) | ||||
| import Data.List.Extra (nubSort) | ||||
| 
 | ||||
| addModal :: | ||||
|      ( MonadWidget m | ||||
| @ -72,7 +72,7 @@ addForm j today = identifyForm "add" $ \extra -> do | ||||
|   let (postRes, displayRows) = validatePostings acctRes amtRes | ||||
| 
 | ||||
|   -- bindings used in add-form.hamlet | ||||
|   let descriptions = nubSort $ tdescription <$> jtxns j | ||||
|   let descriptions = nubSort $ journalPayeesDeclaredOrUsed j ++ journalDescriptions j | ||||
|       journals = fst <$> jfiles j | ||||
| 
 | ||||
|   pure (validateTransaction dateRes descRes postRes, $(widgetFile "add-form")) | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user