houtmarkt-jeremy/markt/views.py
2020-05-25 02:15:12 -03:00

17 lines
563 B
Python

from django.shortcuts import render
from django.views import generic
from django.shortcuts import get_object_or_404
# Create your views here.
from markt.models import Factuur, Order, Klant
class FactuurDetailView(generic.DetailView):
model = Factuur
def get_context_data(self, **kwargs):
# Call the base implementation first to get the context
context = super(FactuurDetailView, self).get_context_data(**kwargs)
context['korting'] = context["factuur"].Korting_percent * context["factuur"].Subtotal / 100
return context