aboutsummaryrefslogtreecommitdiff
path: root/src/client/View/LoggedIn
diff options
context:
space:
mode:
authorJoris2015-09-09 21:35:29 +0200
committerJoris2015-09-09 21:35:29 +0200
commit984356c796963bcba44dcbe261e460bd37385c35 (patch)
tree093c6ede90a77ca6f497aa23c7c13e95f6f2040b /src/client/View/LoggedIn
parent0e85e2815f5bb0ab8b5fb8156bd772b4a7743f13 (diff)
Authorizing refunds (negative payments) but stop authorizing null payments
Diffstat (limited to 'src/client/View/LoggedIn')
-rw-r--r--src/client/View/LoggedIn/Monthly.elm6
-rw-r--r--src/client/View/LoggedIn/Table.elm4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/client/View/LoggedIn/Monthly.elm b/src/client/View/LoggedIn/Monthly.elm
index 5d7260e..17c354a 100644
--- a/src/client/View/LoggedIn/Monthly.elm
+++ b/src/client/View/LoggedIn/Monthly.elm
@@ -68,8 +68,10 @@ paymentLine model loggedInView payment =
[ class ("row" ++ (if loggedInView.paymentEdition == Just payment.id then " edition" else ""))
, onClick actions.address (UpdateLoggedIn (ToggleEdit payment.id))
]
- [ div [ class "cell" ] [ text (payment.name) ]
- , div [ class "cell" ] [ text (toString payment.cost ++ " " ++ getMessage "MoneySymbol" model.translations) ]
+ [ div [ class "cell category" ] [ text (payment.name) ]
+ , div
+ [ class ("cell cost" ++ if payment.cost < 0 then " refund" else "") ]
+ [ text (toString payment.cost ++ " " ++ getMessage "MoneySymbol" model.translations) ]
, div
[ class "cell delete"
, onClick serverCommunications.address (SC.DeleteMonthlyPayment payment.id)
diff --git a/src/client/View/LoggedIn/Table.elm b/src/client/View/LoggedIn/Table.elm
index a8fef3e..0c65e50 100644
--- a/src/client/View/LoggedIn/Table.elm
+++ b/src/client/View/LoggedIn/Table.elm
@@ -57,7 +57,9 @@ paymentLine model loggedInView payment =
, onClick actions.address (UpdateLoggedIn (ToggleEdit payment.id))
]
[ div [ class "cell category" ] [ text payment.name ]
- , div [ class "cell cost" ] [ text ((toString payment.cost) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ]
+ , div
+ [ class ("cell cost" ++ if payment.cost < 0 then " refund" else "") ]
+ [ text ((toString payment.cost) ++ " " ++ (getMessage "MoneySymbol" model.translations)) ]
, div
[ class "cell user" ]
[ payment.userId