diff --git a/inventory/models.py b/inventory/models.py
index 223d8f40..e2653559 100644
--- a/inventory/models.py
+++ b/inventory/models.py
@@ -48,7 +48,7 @@ from imagekit.models import ImageSpecField
from imagekit.processors import ResizeToFill
# from plans.models import AbstractPlan
# from simple_history.models import HistoricalRecords
-
+from plans.models import Invoice
class Base(models.Model):
id = models.UUIDField(
@@ -1262,6 +1262,9 @@ class Dealer(models.Model, LocalizedNameMixin):
def __str__(self):
return self.name
+ @property
+ def invoices(self):
+ return Invoice.objects.filter(order__user=self.user)
class StaffTypes(models.TextChoices):
# MANAGER = "manager", _("Manager")
diff --git a/inventory/signals.py b/inventory/signals.py
index dfc90c1f..30ee0c29 100644
--- a/inventory/signals.py
+++ b/inventory/signals.py
@@ -502,7 +502,7 @@ def create_item_service(sender, instance, created, **kwargs):
"""
if created:
entity = instance.dealer.entity
- uom = entity.get_uom_all().get(name=str(instance.uom).lower())
+ uom = entity.get_uom_all().filter(unit_abbr=instance.uom).first()
cogs = (
entity.get_all_accounts()
.filter(role=roles.COGS, active=True, role_default=True)
diff --git a/inventory/utils.py b/inventory/utils.py
index 7aca476f..8ffbfe09 100644
--- a/inventory/utils.py
+++ b/inventory/utils.py
@@ -1094,16 +1094,13 @@ class CarFinanceCalculator:
total_vat_amount = total_price_discounted * self.vat_rate
return {
- "total_price_before_discount": round(
- total_price, 2
- ),
- "total_price": round(total_price_discounted, 2),
- "total_vat_amount": round(total_vat_amount, 2),
- "total_discount": round(Decimal(total_discount)),
- "total_additionals": round(total_additionals, 2),
- "grand_total": round(
- total_price_discounted + total_vat_amount + total_additionals, 2
- ),
+ "total_price_discounted":total_price_discounted,
+ "total_price_before_discount":total_price,
+ "total_price": total_price_discounted,
+ "total_vat_amount": total_vat_amount,
+ "total_discount": Decimal(total_discount),
+ "total_additionals": total_additionals,
+ "grand_total":total_price_discounted + total_vat_amount + total_additionals,
}
def get_finance_data(self):
@@ -1114,6 +1111,7 @@ class CarFinanceCalculator:
self._get_quantity(item) for item in self.item_transactions
),
"total_price": totals["total_price"],
+ "total_price_discounted": totals["total_price_discounted"],
"total_price_before_discount": totals["total_price_before_discount"],
"total_vat": totals["total_vat_amount"] + totals["total_price"],
"total_vat_amount": totals["total_vat_amount"],
diff --git a/inventory/views.py b/inventory/views.py
index 39cb9a47..130ebb37 100644
--- a/inventory/views.py
+++ b/inventory/views.py
@@ -7204,6 +7204,7 @@ class ItemServiceCreateView(
def form_valid(self, form):
dealer = get_user_type(self.request)
vat = models.VatRate.objects.get(dealer=dealer, is_active=True)
+
form.instance.dealer = dealer
# if form.instance.taxable:
# form.instance.price = (form.instance.price * vat.rate) + form.instance.price
@@ -7253,7 +7254,11 @@ class ItemServiceUpdateView(
def form_valid(self, form):
dealer = get_user_type(self.request)
vat = models.VatRate.objects.get(dealer=dealer, is_active=True)
+ uom = dealer.entity.get_uom_all().filter(unit_abbr=form.instance.uom).first()
form.instance.dealer = dealer
+ form.instance.uom = uom.name
+ form.instance.item.uom = uom
+
# if form.instance.taxable:
# form.instance.price = (form.instance.price * vat.rate) + form.instance.price
return super().form_valid(form)
@@ -10607,7 +10612,7 @@ def purchase_report_view(request,dealer_slug):
po_quantity=0
for item in items:
po_amount+=item["total"]
- po_quantity+=item["q"]
+ po_quantity+=item["q"]
total_po_amount+=po_amount
total_po_cars+=po_quantity
diff --git a/static/images/no_content/no_search_results.png b/static/images/no_content/no_search_results.png
new file mode 100644
index 00000000..a360db49
Binary files /dev/null and b/static/images/no_content/no_search_results.png differ
diff --git a/templates/account/signup-wizard.html b/templates/account/signup-wizard.html
index 52dac1a7..e96b99c5 100644
--- a/templates/account/signup-wizard.html
+++ b/templates/account/signup-wizard.html
@@ -282,9 +282,9 @@
-