Skip to content

Commit

Permalink
Add the prestation total
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsieurV committed Feb 16, 2021
1 parent 16e21e5 commit 2e9fa5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/test_definitions_parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,12 @@ def test_parse_quote_with_quantities():
assert len(quote["optional_prestations"]) == 0
assert quote["prestations"][0]["title"] == "Création des configurations sur le CPQ"
assert quote["prestations"][0]["price"] == 5000
assert quote["prestations"][0]["total"] == 5000
assert quote["prestations"][0]["optional"] is False
assert quote["prestations"][0]["quantity"] == 1
assert quote["prestations"][1]["title"] == "Intégration de l'UI"
assert quote["prestations"][1]["price"] == 10000
assert quote["prestations"][1]["total"] == 30000
assert quote["prestations"][1]["optional"] is False
assert quote["prestations"][1]["quantity"] == 3

Expand Down
1 change: 1 addition & 0 deletions tqwgp_parser/parser.hy
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
["title"]
["price" "quantity" "description" "batch" "optional"])
{
"total" (compute-price [prestation] :count-optional True)
"quantity" (get-default prestation "quantity" 1)
"section" (get-default (if (none? section) {} section) "title" None)
"batch" (parse-batch (get-default prestation "batch" (get-default (if (none? section) {} section) "batch" None)))
Expand Down

0 comments on commit 2e9fa5c

Please sign in to comment.