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 %}

{% blocktrans with start_date=start_date|date:"F j, Y" end_date=end_date|date:"F j, Y" %} @@ -302,9 +303,16 @@

{% trans "Gross Profit" %}

-

+ + {% if gross_profit|is_negative %} +

{{ gross_profit|floatformat:2 }} -

+

+ {% else %} +

+ {{ gross_profit|floatformat:2 }} +

+ {% endif %} diff --git a/templates/items/service/service_create.html b/templates/items/service/service_create.html index c8ff00d9..8f4dd33e 100644 --- a/templates/items/service/service_create.html +++ b/templates/items/service/service_create.html @@ -11,7 +11,7 @@ {% endif %} {% endblock %} {% block content %} -
+
diff --git a/templates/users/user_list.html b/templates/users/user_list.html index 98b9fef6..fa1eb263 100644 --- a/templates/users/user_list.html +++ b/templates/users/user_list.html @@ -20,7 +20,7 @@ - {% trans "Manage Groups" %} + {% trans "Manage Groups & Permissions" %}
{% endif %}