now tracking article loss
This commit is contained in:
parent
207bcbc35d
commit
58d7a3c443
7 changed files with 9 additions and 0 deletions
|
@ -28,6 +28,7 @@ postModifyR bId = do
|
|||
, BeveragePrice =. beveragePrice nBev
|
||||
, BeverageAmount =. beverageAmount nBev
|
||||
, BeverageAlertAmount =. beverageAlertAmount nBev
|
||||
, BeverageCorrectedAmount +=. ((beverageAmount nBev) - (beverageAmount bev))
|
||||
, BeverageMl =. beverageMl nBev
|
||||
, BeverageAvatar =. beverageAvatar nBev
|
||||
]
|
||||
|
@ -46,6 +47,7 @@ modifyForm bev = renderDivs $ Beverage
|
|||
<*> areq currencyField (fieldSettingsLabel MsgPrice) (Just $ beveragePrice bev)
|
||||
<*> areq amountField (fieldSettingsLabel MsgCurrentStock) (Just $ beverageAmount bev)
|
||||
<*> areq amountField (fieldSettingsLabel MsgAnnouncedStock) (Just $ beverageAlertAmount bev)
|
||||
<*> pure (beverageCorrectedAmount bev)
|
||||
<*> areq volumeField (fieldSettingsLabel MsgVolume) (Just $ beverageMl bev)
|
||||
<*> aopt (selectField avatars) (fieldSettingsLabel MsgSelectAvatar) (Just $ beverageAvatar bev)
|
||||
where
|
||||
|
|
|
@ -72,6 +72,7 @@ newArticleForm = renderDivs $ Beverage
|
|||
<*> areq currencyField (fieldSettingsLabel MsgPrice) (Just 100)
|
||||
<*> areq amountField (fieldSettingsLabel MsgAmount) (Just 0)
|
||||
<*> areq amountField (fieldSettingsLabel MsgAmountWarning) (Just 0)
|
||||
<*> pure 0
|
||||
<*> areq volumeField (fieldSettingsLabel MsgVolume) (Just 500)
|
||||
<*> aopt (selectField avatars) (fieldSettingsLabel MsgSelectAvatar) Nothing
|
||||
where
|
||||
|
|
|
@ -115,5 +115,6 @@ insOrUpd bev = do
|
|||
(bevStorePrice bev)
|
||||
(bevStoreAmount bev)
|
||||
(bevStoreAlertAmount bev)
|
||||
0
|
||||
(bevStoreMl bev)
|
||||
Nothing
|
||||
|
|
|
@ -11,6 +11,7 @@ Beverage
|
|||
price Int
|
||||
amount Int
|
||||
alertAmount Int
|
||||
correctedAmount Int default=0
|
||||
ml Int default=500
|
||||
avatar AvatarId Maybe
|
||||
UniqueBeverage ident
|
||||
|
|
|
@ -100,3 +100,4 @@ DeleteAvatar: Smazat avatar
|
|||
AvatarDeleted: Avatar úspěšně smazán
|
||||
AvatarInUseError: Avatar nelze smazat dokud je v užitku
|
||||
Volume: Objem v l
|
||||
CorrectedAmount: Stráta
|
||||
|
|
|
@ -100,3 +100,4 @@ DeleteAvatar: Diesen Avatar löschen
|
|||
AvatarDeleted: Avatar gelöscht
|
||||
AvatarInUseError: Avatare können nicht gelöscht werden, solange sie in Benutzung sind.
|
||||
Volume: Volumen in l
|
||||
CorrectedAmount: Schwund
|
||||
|
|
|
@ -9,6 +9,7 @@ $if not $ L.null bevs
|
|||
<th>_{MsgName}
|
||||
<th>_{MsgVolume}
|
||||
<th>_{MsgCurrentAmount}
|
||||
<th>_{MsgCorrectedAmount}
|
||||
<th>_{MsgAnnouncedStock}
|
||||
<th>_{MsgValueIn $ appCurrency $ appSettings master}
|
||||
<th>
|
||||
|
@ -17,6 +18,7 @@ $if not $ L.null bevs
|
|||
<td>#{beverageIdent bev}
|
||||
<td>#{formatIntVolume (beverageMl bev)}
|
||||
<td>#{beverageAmount bev}
|
||||
<td>#{beverageCorrectedAmount bev}
|
||||
<td>#{beverageAlertAmount bev}
|
||||
<td>#{formatIntCurrency (beveragePrice bev)} #{appCurrency $ appSettings master}
|
||||
<td><a href=@{ModifyR bId}>bearbeiten
|
||||
|
|
Loading…
Reference in a new issue