diff --git a/inventory/views.py b/inventory/views.py index 7399e422..df35f062 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -503,9 +503,7 @@ def general_dashboard(request,dealer_slug): total_vat_collected_from_services = sum([car.get_additional_services()['services_vat'] for car in cars_sold_filtered]) total_vat_collected = total_vat_collected_from_cars + total_vat_collected_from_services total_revenue_generated = total_revenue_from_cars + total_revenue_from_services - - expenses = models.ItemModel.objects.filter(entity__admin__dealer=dealer, item_role='expense') - total_expenses = expenses.aggregate(total=Sum('default_amount'))['total'] or 0 + total_expenses=sum([x.amount_paid for x in dealer.entity.get_bills().filter(bill_items__item_role="expense")]) gross_profit = net_profit_from_cars - total_expenses # ---------------------------------------------------- diff --git a/static/images/car_images/d004326438f695f30050fa1e7f252d9d2d60da4b7b26f49e42badcc0687ebb3c.png b/static/images/car_images/d004326438f695f30050fa1e7f252d9d2d60da4b7b26f49e42badcc0687ebb3c.png new file mode 100644 index 00000000..10fe5ecb Binary files /dev/null and b/static/images/car_images/d004326438f695f30050fa1e7f252d9d2d60da4b7b26f49e42badcc0687ebb3c.png differ diff --git a/templates/dashboards/partials/financial_data_cards.html b/templates/dashboards/partials/financial_data_cards.html index 2099124c..8b63c278 100644 --- a/templates/dashboards/partials/financial_data_cards.html +++ b/templates/dashboards/partials/financial_data_cards.html @@ -20,7 +20,7 @@

{% trans "Total Revenue from Cars" %}

- {{ total_revenue_from_cars|floatformat:2 }} + {{ total_revenue_from_cars|floatformat:'2g' }}

@@ -30,7 +30,7 @@

{% trans "Net Profit from Cars" %}

- {{ net_profit_from_cars|floatformat:2 }} + {{ net_profit_from_cars|floatformat:'2g' }}

@@ -50,7 +50,7 @@

{% trans "Total Cost of Cars Sold" %}

- {{ total_cost_of_cars_sold|floatformat:2 }} + {{ total_cost_of_cars_sold|floatformat:'2g' }}

@@ -60,7 +60,7 @@

{% trans "Total VAT from Cars" %}

- {{ total_vat_collected_from_cars|floatformat:2 }} + {{ total_vat_collected_from_cars|floatformat:'2g' }}

@@ -81,7 +81,7 @@

{% trans "New Cars Revenue" %}

- {{ total_revenue_from_new_cars|floatformat:2 }} + {{ total_revenue_from_new_cars|floatformat:'2g' }}

@@ -91,7 +91,7 @@

{% trans "New Cars Net Profit" %}

- {{ net_profit_from_new_cars|floatformat:2 }} + {{ net_profit_from_new_cars|floatformat:'2g' }}

@@ -101,7 +101,7 @@

{% trans "New Cars VAT" %}

- {{ total_vat_collected_from_new_cars|floatformat:2 }} + {{ total_vat_collected_from_new_cars|floatformat:'2g' }}

@@ -111,7 +111,7 @@

{% trans "New Cars Cost" %}

- {{ total_cost_of_new_cars_sold|floatformat:2 }} + {{ total_cost_of_new_cars_sold|floatformat:'2g' }}

@@ -132,7 +132,7 @@

{% trans "Used Cars Revenue" %}

- {{ total_revenue_from_used_cars|floatformat:2 }} + {{ total_revenue_from_used_cars|floatformat:'2g' }}

@@ -142,7 +142,7 @@

{% trans "Used Cars Net Profit" %}

- {{ net_profit_from_used_cars|floatformat:2 }} + {{ net_profit_from_used_cars|floatformat:'2g' }}

@@ -152,7 +152,7 @@

{% trans "Used Cars VAT" %}

- {{ total_vat_collected_from_used_cars|floatformat:2 }} + {{ total_vat_collected_from_used_cars|floatformat:'2g' }}

@@ -162,7 +162,7 @@

{% trans "Used Cars Cost" %}

- {{ total_cost_of_used_cars_sold|floatformat:2 }} + {{ total_cost_of_used_cars_sold|floatformat:'2g' }}

@@ -185,7 +185,7 @@

{% trans "Total Inventory Value" %}

- {{ total_inventory_value|floatformat:2 }} + {{ total_inventory_value|floatformat:'2g' }}

@@ -211,7 +211,7 @@

{% trans "New Cars Inventory Value" %}

- {{ new_car_value|floatformat:2 }} + {{ new_car_value|floatformat:'2g' }}

@@ -221,7 +221,7 @@

{% trans "Used Cars Inventory Value" %}

- {{ used_car_value|floatformat:2 }} + {{ used_car_value|floatformat:'2g' }}

@@ -254,7 +254,7 @@

{% trans "Total Revenue from Services" %}

- {{ total_revenue_from_services|floatformat:2 }} + {{ total_revenue_from_services|floatformat:'2g' }}

@@ -264,7 +264,7 @@

{% trans "Total VAT from Services" %}

- {{ total_vat_collected_from_services|floatformat:2 }} + {{ total_vat_collected_from_services|floatformat:'2g' }}

@@ -274,7 +274,7 @@

{% trans "Total Revenue Generated" %}

- {{ total_revenue_generated|floatformat:2 }} + {{ total_revenue_generated|floatformat:'2g' }}

@@ -284,7 +284,7 @@

{% trans "Total VAT Collected" %}

- {{ total_vat_collected|floatformat:2 }} + {{ total_vat_collected|floatformat:'2g' }}

@@ -294,7 +294,7 @@

{% trans "Total Expenses" %}

- {{ total_expenses|floatformat:2 }} + {{ total_expenses|floatformat:'2g' }}

@@ -306,11 +306,11 @@ {% if gross_profit|is_negative %}

- {{ gross_profit|floatformat:2 }} + {{ gross_profit|floatformat:'2g' }}

{% else %}

- {{ gross_profit|floatformat:2 }} + {{ gross_profit|floatformat:'2g' }}

{% endif %} diff --git a/templates/items/expenses/expenses_list.html b/templates/items/expenses/expenses_list.html index 90d75d69..f4e60d44 100644 --- a/templates/items/expenses/expenses_list.html +++ b/templates/items/expenses/expenses_list.html @@ -51,9 +51,9 @@ href="{% url 'item_expense_update' request.dealer.slug expense.pk %}"> {% trans "Update" %} - {% comment %} - {% trans "Delete" %} - {% endcomment %} + + {% trans "Create Expense Bill" %} + {% endif %} diff --git a/templates/ledger/reports/car_sale_report.html b/templates/ledger/reports/car_sale_report.html index f9e97da3..88db5f35 100644 --- a/templates/ledger/reports/car_sale_report.html +++ b/templates/ledger/reports/car_sale_report.html @@ -121,7 +121,7 @@ {% trans 'Total Revenue from Cars' %}

- {{ total_revenue_from_cars|floatformat:2 }} + {{ total_revenue_from_cars|floatformat:'2g' }}

@@ -133,7 +133,7 @@ {% trans 'Total Revenue from Services' %}

- {{ total_revenue_from_additonals|floatformat:2 }} + {{ total_revenue_from_additonals|floatformat:'2g' }}

@@ -145,7 +145,7 @@ {% trans 'Total Revenue' %}

- {{ total_revenue_collected|floatformat:2 }} + {{ total_revenue_collected|floatformat:'2g' }}

@@ -157,7 +157,7 @@ {% trans 'Total VAT from Cars' %}

- {{ total_vat_on_cars|floatformat:2 }} + {{ total_vat_on_cars|floatformat:'2g' }}

@@ -169,7 +169,7 @@ {% trans 'Total VAT from Services' %}

- {{ total_vat_from_additonals|floatformat:2 }} + {{ total_vat_from_additonals|floatformat:'2g' }}

@@ -181,7 +181,7 @@ {% trans 'Total VAT' %}

- {{ total_vat_collected|floatformat:2 }} + {{ total_vat_collected|floatformat:'2g' }}

@@ -193,7 +193,7 @@ {% trans 'Total Discount Amount' %}

- {{ total_discount|floatformat:2 }} + {{ total_discount|floatformat:'2g' }}

diff --git a/templates/ledger/reports/purchase_report.html b/templates/ledger/reports/purchase_report.html index e713d777..0690bf81 100644 --- a/templates/ledger/reports/purchase_report.html +++ b/templates/ledger/reports/purchase_report.html @@ -75,7 +75,7 @@
{% trans 'Total Purchase Amount' %}
-

{{ total_po_amount }}

+

{{ total_po_amount|floatformat:'2g' }}