Skip to content

Commit

Permalink
new payable value
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed Apr 4, 2016
1 parent ab4c3a6 commit 3aecdb6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/budy/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ def complex_csv_url(cls, start = None, end = None, absolute = False):
def _build(cls, model, map):
prefix = appier.conf("BUDY_ORDER_REF", "BD-%06d")
id = model.get("id", None)
total = model.get("total", 0.0)
discount = model.get("discount", 0.0)
if id: model["reference"] = prefix % id
model["payable"] = total - discount

def pre_delete(self):
bundle.Bundle.pre_delete(self)
Expand Down

0 comments on commit 3aecdb6

Please sign in to comment.