made rough stock, without grouping. need esqueleto for that.
This commit is contained in:
parent
9ad4be6ba4
commit
ac00ceebef
@ -3,4 +3,19 @@ module Handler.Stock where
|
||||
import Import
|
||||
|
||||
getStockR :: Handler Html
|
||||
getStockR = error "Not yet implemented: getStockR"
|
||||
getStockR = loginOrDo (\(uid,user) -> do
|
||||
items <- runDB $ selectList [TransactionUser ==. uid, TransactionInStock >. 0] [Asc TransactionTypeName]
|
||||
defaultLayout $ [whamlet|
|
||||
<h1>Current Stock
|
||||
<table>
|
||||
<tr>
|
||||
<th>Item name
|
||||
<th>Quantity
|
||||
<th>Buy Price
|
||||
$forall Entity _ t <- items
|
||||
<tr>
|
||||
<td>#{transactionTypeName t}
|
||||
<td>#{transactionInStock t}
|
||||
<td>#{transactionPriceCents t}
|
||||
|]
|
||||
)
|
||||
|
@ -41,6 +41,7 @@ $newline never
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="@{HomeR}">Home</a>
|
||||
<li><a href="@{WalletR}">Transactions</a>
|
||||
<li><a href="@{StockR}">Stock</a>
|
||||
<li><a href="@{SettingsR}">Settings</a>
|
||||
<!--li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span>
|
||||
|
Loading…
Reference in New Issue
Block a user