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" %}
{% trans "Net Profit from Cars" %}
{% trans "Total Cost of Cars Sold" %}
{% trans "Total VAT from Cars" %}
{% trans "New Cars Revenue" %}
{% trans "New Cars Net Profit" %}
{% trans "New Cars VAT" %}
{% trans "New Cars Cost" %}
{% trans "Used Cars Revenue" %}
{% trans "Used Cars Net Profit" %}
{% trans "Used Cars VAT" %}
{% trans "Used Cars Cost" %}
{% trans "Total Inventory Value" %}
{% trans "New Cars Inventory Value" %}
{% trans "Used Cars Inventory Value" %}
{% trans "Total Revenue from Services" %}
{% trans "Total VAT from Services" %}
{% trans "Total Revenue Generated" %}
{% trans "Total VAT Collected" %}
{% trans "Total Expenses" %}
- {{ 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 @@{{ total_po_amount }}
+{{ total_po_amount|floatformat:'2g' }}