diff --git a/db.sqlite b/db.sqlite index 15d38a38..9e3f045e 100644 Binary files a/db.sqlite and b/db.sqlite differ diff --git a/inventory/__pycache__/admin.cpython-311.pyc b/inventory/__pycache__/admin.cpython-311.pyc index 4b7818bc..1fa44382 100644 Binary files a/inventory/__pycache__/admin.cpython-311.pyc and b/inventory/__pycache__/admin.cpython-311.pyc differ diff --git a/inventory/__pycache__/urls.cpython-311.pyc b/inventory/__pycache__/urls.cpython-311.pyc index 8080971d..f063eeeb 100644 Binary files a/inventory/__pycache__/urls.cpython-311.pyc and b/inventory/__pycache__/urls.cpython-311.pyc differ diff --git a/inventory/__pycache__/views.cpython-311.pyc b/inventory/__pycache__/views.cpython-311.pyc index 78691ac4..9f3abbc3 100644 Binary files a/inventory/__pycache__/views.cpython-311.pyc and b/inventory/__pycache__/views.cpython-311.pyc differ diff --git a/inventory/admin.py b/inventory/admin.py index 285dc267..01027fb0 100644 --- a/inventory/admin.py +++ b/inventory/admin.py @@ -27,6 +27,7 @@ admin.site.register(models.Representative) admin.site.register(models.CarTrim) admin.site.register(models.AdditionalServices) admin.site.register(models.Payment) +admin.site.register(models.VatRate) @admin.register(models.CarMake) class CarMakeAdmin(admin.ModelAdmin): diff --git a/inventory/migrations/0016_alter_staff_staff_type.py b/inventory/migrations/0016_alter_staff_staff_type.py new file mode 100644 index 00000000..229113a1 --- /dev/null +++ b/inventory/migrations/0016_alter_staff_staff_type.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.4 on 2024-12-30 15:13 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('inventory', '0015_merge_0008_vatrate_0014_useractivitylog'), + ] + + operations = [ + migrations.AlterField( + model_name='staff', + name='staff_type', + field=models.CharField(choices=[('manager', 'Manager'), ('inventory', 'Inventory'), ('accountant', 'Accountant'), ('sales', 'Sales')], max_length=255, verbose_name='Staff Type'), + ), + ] diff --git a/inventory/views.py b/inventory/views.py index 4a2e8aeb..f90fa7e1 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -1687,7 +1687,8 @@ class EstimateDetailView(LoginRequiredMixin, DetailView): if estimate.get_itemtxs_data(): total = sum(x.ce_cost_estimate for x in estimate.get_itemtxs_data()[0].all()) vat = models.VatRate.objects.filter(is_active=True).first() - kwargs["vate_amount"] = (total * vat.vat_rate) + # vat = settings.VAT_RATE + kwargs["vat_amount"] = (total * vat.vat_rate) kwargs["total"] = (total * vat.vat_rate) + total kwargs["vat"] = vat.rate return super().get_context_data(**kwargs) @@ -1715,7 +1716,7 @@ class InvoiceDetailView(LoginRequiredMixin, DetailView): total = sum(x.unit_cost for x in invoice.get_itemtxs_data()[0].all()) total = int(total) vat = models.VatRate.objects.filter(is_active=True).first() - kwargs["vate_amount"] = (total * int(vat.vat_rate)) + kwargs["vat_amount"] = (total * int(vat.vat_rate)) kwargs["total"] = (total * int(vat.vat_rate)) + total kwargs["vat"] = vat.rate return super().get_context_data(**kwargs) @@ -1840,7 +1841,7 @@ class EstimatePreviewView(LoginRequiredMixin, DetailView): if estimate.get_itemtxs_data(): total = sum(x.ce_cost_estimate for x in estimate.get_itemtxs_data()[0].all()) vat = models.VatRate.objects.filter(is_active=True).first() - kwargs["vate_amount"] = (total * vat.vat_rate) + kwargs["vat_amount"] = (total * vat.vat_rate) kwargs["total"] = (total * vat.vat_rate) + total kwargs["vat"] = vat.rate return super().get_context_data(**kwargs) @@ -1856,7 +1857,7 @@ class InvoicePreviewView(LoginRequiredMixin, DetailView): total = sum(x.unit_cost for x in invoice.get_itemtxs_data()[0].all()) total = int(total) vat = models.VatRate.objects.filter(is_active=True).first() - kwargs["vate_amount"] = (total * vat.vat_rate) + kwargs["vat_amount"] = (total * vat.vat_rate) kwargs["total"] = (total * vat.vat_rate) + total kwargs["vat"] = vat.rate return super().get_context_data(**kwargs) diff --git a/static/js/travel-agency-dashboard.js b/static/js/travel-agency-dashboard.js index ae622bfe..b7c234ef 100644 --- a/static/js/travel-agency-dashboard.js +++ b/static/js/travel-agency-dashboard.js @@ -654,7 +654,7 @@ ); const profitData = [ - [350000, 390000, 410700, 450000, 390000, 410700], + [9, 8678, 2122, 99898998, 767, 1], [245000, 310000, 420000, 480000, 530000, 580000], [278450, 513220, 359890, 444567, 201345, 589000] ]; diff --git a/templates/base.html b/templates/base.html index 67ee5def..0a305b3d 100644 --- a/templates/base.html +++ b/templates/base.html @@ -193,7 +193,7 @@ const url = "{% url 'estimate_create' %}" - + diff --git a/templates/dashboards/accounting.html b/templates/dashboards/accounting.html index 9dd42880..51a6f5a3 100644 --- a/templates/dashboards/accounting.html +++ b/templates/dashboards/accounting.html @@ -290,5 +290,272 @@ + {% endblock %} diff --git a/templates/header.html b/templates/header.html index cf56937b..1bd65144 100644 --- a/templates/header.html +++ b/templates/header.html @@ -127,7 +127,7 @@ -