diff --git a/inventory/models.py b/inventory/models.py index 733a1262..6757961b 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -881,11 +881,11 @@ class Car(Base): @property def get_additional_services_vat(self): vat = VatRate.objects.filter(dealer=self.dealer,is_active=True).first() - return sum([Decimal((x.price)*(vat.rate)) for x in self.additional_services.all()]) + return sum([Decimal((x.price)*(vat.rate)) for x in self.additional_services.filter(taxable=True)]) def get_additional_services(self): vat = VatRate.objects.filter(dealer=self.dealer,is_active=True).first() - return {"services": [[x,(x.price)*(vat.rate)] for x in self.additional_services.all()], + return {"services": [[x,((x.price)*(vat.rate) if x.taxable else 0)] for x in self.additional_services.all()], "total_":self.get_additional_services_amount_, "total":self.get_additional_services_amount, "services_vat":self.get_additional_services_vat} diff --git a/inventory/utils.py b/inventory/utils.py index 1886d8fc..796d1a2a 100644 --- a/inventory/utils.py +++ b/inventory/utils.py @@ -1301,7 +1301,7 @@ def get_finance_data(estimate,dealer): additional_services = car.get_additional_services() discounted_price=(Decimal(car.marked_price) - discount) vat_amount = discounted_price * vat.rate - total_services_vat=sum([ x[1] for x in additional_services.get("services")]) + total_services_vat=sum([x[1] for x in additional_services.get("services")]) total_vat=vat_amount+total_services_vat return { "car": car, @@ -1311,7 +1311,7 @@ def get_finance_data(estimate,dealer): "vat_rate": vat.rate, "discount_amount": discount, "additional_services": additional_services, - "final_price": discounted_price+ vat_amount, + "final_price": discounted_price + vat_amount, "total_services_vat":total_services_vat, "total_vat":total_vat, "grand_total": discounted_price + total_vat + additional_services.get("total") diff --git a/templates/header.html b/templates/header.html index ba9a621d..62618724 100644 --- a/templates/header.html +++ b/templates/header.html @@ -518,11 +518,12 @@
Raise a ticket and we will get back to you as soon as possible.
- Raise a Ticket ++ Our support team is ready to assist you with any questions or issues. + Raise a new ticket, and we'll get back to you as soon as possible. +
+ + Raise a New Ticket +Explore common resources to find answers quickly.
+ +| ID | -Subject | -Status | -Priority | -Created | - -Actions | -
|---|---|---|---|---|---|
| #{{ ticket.id }} | -{{ ticket.subject }} | -- - {{ ticket.get_status_display }} - - | -- - {{ ticket.get_priority_display }} - - | -{{ ticket.created_at|date:"M d, Y H:i" }} | - -- - View - - | -
| No tickets found. | -|||||
| ID | +Subject | +Status | +Priority | +Created | +Actions | +
|---|---|---|---|---|---|
| #{{ ticket.id }} | +{{ ticket.subject }} | ++ + {{ ticket.get_status_display }} + + | ++ + {{ ticket.get_priority_display }} + + | +{{ ticket.created_at|date:"M d, Y" }} {{ ticket.created_at|time:"H:i" }} | ++ + View + + | +
|
+
+ No tickets found. +All your past and present tickets will appear here. + |
+ |||||