From ee72c2eaa9820e3583838fc07044590e8d335756 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 11 Oct 2015 21:44:46 +0200 Subject: [PATCH] added feature of total crates --- Handler/SupplierActions.hs | 6 ++++-- messages/de.msg | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Handler/SupplierActions.hs b/Handler/SupplierActions.hs index bde03f6..b574dfe 100755 --- a/Handler/SupplierActions.hs +++ b/Handler/SupplierActions.hs @@ -27,7 +27,7 @@ getSupplierDigestR sId = do case mSup of Just sup -> do master <- getYesod - bevs <- runDB $ selectList [BeverageSupplier ==. (Just sId)] [Desc BeverageIdent] + bevs <- runDB $ selectList [BeverageSupplier ==. (Just sId)] [Asc BeverageIdent] digests <- return $ map genBevDigest bevs w <- return $ [whamlet|$newline always @@ -56,7 +56,9 @@ getSupplierDigestR sId = do #{T.pack $ show $ bdCrates dig} #{formatIntCurrency $ fromMaybe 0 $ beveragePricePerCrate $ bdBev dig} #{appCurrency $ appSettings master} #{formatIntCurrency $ bdTotal dig} #{appCurrency $ appSettings master} - _{MsgBuyValue} + _{MsgTotalCrates} + #{T.pack $ show $ sum $ map bdCrates digests} + _{MsgBuyValue} #{formatIntCurrency $ sum $ map bdTotal digests} #{appCurrency $ appSettings master} |] tableLayout w diff --git a/messages/de.msg b/messages/de.msg index 3ca59cd..1232db5 100755 --- a/messages/de.msg +++ b/messages/de.msg @@ -139,3 +139,4 @@ PricePerCrate: Preis Pro Kasten CrateCount: AnzahlKästen BuyValue: Zahlbetrag CustomerId: Kundennummer +TotalCrates: Gesamtanzahl Kästen