-
Notifications
You must be signed in to change notification settings - Fork 0
/
Forms.hs
41 lines (38 loc) · 1.65 KB
/
Forms.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Forms
where
import Import
import Data.Time
import Prelude
companyForm :: Form Company
companyForm = renderDivs $ Company
<$> areq textField "Name" Nothing
<*> areq intField "Parent Id" Nothing
<*> areq intField "Partner Id" Nothing
<*> aopt (selectField currencies) "Currency Id" Nothing
<*> areq intField "Create User" Nothing
<*> lift (liftIO getCurrentTime)
<*> lift (liftIO getCurrentTime)
<*> areq intField "Write User" Nothing
<*> aopt textareaField "Footer" Nothing
<*> areq textareaField "Header" Nothing
<*> areq textField "Paper_format" Nothing
<*> aopt textField "Logo_web" Nothing
<*> areq textareaField "Rml_header2" Nothing
<*> areq textareaField "Rml_header3" Nothing
<*> areq textareaField "Rml Header1" Nothing
<*> aopt textField "Account" Nothing
<*> aopt textField "Company Registry" Nothing
<*> aopt boolField "Custom Footer" Nothing
<*> areq boolField "Expects COA" Nothing
<*> aopt textField "Paypal Account" Nothing
<*> areq textField "Overdue Msg" Nothing
<*> areq textField "Tax Rounding Method" Nothing
<*> areq doubleField "Schedule Range" Nothing
<*> areq intField "EC_Exchange Account" Nothing
<*> areq intField "IC Exchange Account" Nothing
<*> areq doubleField "Security Lead" Nothing
where
currencies :: HandlerT App IO (OptionList (Key Currency))
currencies = do
entities <- runDB $ selectList [] [Asc CurrencyName]
optionsPairs $ Prelude.map (\cat -> (currencyName $ entityVal cat, entityKey cat)) entities