diff --git a/inventory/models.py b/inventory/models.py index a3986995..4f9e8aa2 100644 --- a/inventory/models.py +++ b/inventory/models.py @@ -3190,6 +3190,7 @@ class CustomGroup(models.Model): "notes", "tasks", "activity", + "additionalservices" ], ) self.set_permissions( @@ -3305,6 +3306,7 @@ class CustomGroup(models.Model): "activity", "payment", "vendor", + "additionalservices", ], other_perms=[ "view_car", diff --git a/inventory/templatetags/custom_filters.py b/inventory/templatetags/custom_filters.py index 72f5c9f8..f096dcf0 100644 --- a/inventory/templatetags/custom_filters.py +++ b/inventory/templatetags/custom_filters.py @@ -13,7 +13,16 @@ from django.db.models import Case, Value, When, IntegerField register = template.Library() - +@register.filter +def is_negative(value): + """ + Checks if the given value is a negative number. + """ + try: + return float(value) < 0 + except (ValueError, TypeError): + return False + @register.filter def get_percentage(value, total): try: diff --git a/templates/dashboards/partials/financial_data_cards.html b/templates/dashboards/partials/financial_data_cards.html index 373b5072..2099124c 100644 --- a/templates/dashboards/partials/financial_data_cards.html +++ b/templates/dashboards/partials/financial_data_cards.html @@ -1,4 +1,5 @@ {% load i18n %} +{% load custom_filters %} {% if request.is_dealer or request.is_manager or request.is_accountant %}
{% trans "Gross Profit" %}
-