diff --git a/inventory/__pycache__/views.cpython-311.pyc b/inventory/__pycache__/views.cpython-311.pyc
index e919829b..9a332a1c 100644
Binary files a/inventory/__pycache__/views.cpython-311.pyc and b/inventory/__pycache__/views.cpython-311.pyc differ
diff --git a/inventory/signals.py b/inventory/signals.py
index 79f46ba3..af7d9da2 100644
--- a/inventory/signals.py
+++ b/inventory/signals.py
@@ -12,7 +12,7 @@ from django_ledger.models import (
ItemModelAbstract,
UnitOfMeasureModel,
VendorModel,
- EstimateModel
+ EstimateModel, CustomerModel
)
from . import models
from django.utils.timezone import now
@@ -669,32 +669,35 @@ def create_customer_user(sender, instance, created, **kwargs):
if created:
user = User.objects.create(
username=instance.email,
- email=instance.email,
+ email=instance.email,
+ is_active=False,
first_name=instance.additional_info.get('first_name',''),
last_name=instance.additional_info.get('last_name','')
)
- user.is_active = False
- user.is_staff = False
user.save()
instance.user = user
instance.save()
-# @receiver(post_save, sender=models.Customer)
-# def create_customer_user(sender, instance, created, **kwargs):
+
+
+# @receiver(post_save, sender=models.Lead)
+# def create_customer_from_lead(sender, instance, created, **kwargs):
+# dealer = instance.dealer
+# entity = dealer.entity
# if created:
-# user = User.objects.create(
-# username=instance.email,
-# email=instance.email,
-# password=None,
-# first_name=instance.first_name,
-# last_name=instance.last_name
+# customer = entity.create_customer(
+# customer_model_kwargs={
+# "customer_name": instance.full_name,
+# "address_1": instance.address,
+# "phone": instance.phone_number,
+# "email": instance.email,
+# "sales_tax_rate": 0.15,
+# }
# )
-# user.is_active = True
-# user.is_staff = True
-# user.save()
-# instance.user = user
+# instance.customer = customer
# instance.save()
+
# Create Item
@receiver(post_save, sender=models.Car)
def create_item_model(sender, instance, created, **kwargs):
diff --git a/inventory/views.py b/inventory/views.py
index 30561ffa..9a28da04 100644
--- a/inventory/views.py
+++ b/inventory/views.py
@@ -3221,6 +3221,8 @@ def lead_convert(request, pk):
@login_required
def schedule_lead(request, pk):
+ dealer = get_user_type(request)
+ print(dealer)
lead = get_object_or_404(models.Lead, pk=pk)
if request.method == "POST":
form = forms.ScheduleForm(request.POST)
@@ -3246,13 +3248,13 @@ def schedule_lead(request, pk):
service=service,
staff_member=StaffMember.objects.first()
)
-
+ print(lead.customer)
# Create Appointment
Appointment.objects.create(
- client=request.user, # Replace with the appropriate client
+ client=lead.customer.user, # Replace with the appropriate client
appointment_request=appointment_request,
- phone="123-456-7890", # Replace with actual phone number
- address="123 Main St", # Replace with actual address
+ phone=lead.customer.phone, # Replace with actual phone number
+ address=lead.customer.address_1, # Replace with actual address
)
messages.success(request, "Lead scheduled and appointment created successfully!")
diff --git a/templates/sales/estimates/estimate_preview.html b/templates/sales/estimates/estimate_preview.html
index e6089f64..b73b5224 100644
--- a/templates/sales/estimates/estimate_preview.html
+++ b/templates/sales/estimates/estimate_preview.html
@@ -81,9 +81,11 @@
margin-top: 1rem;
}
.footer-note {
+ position: absolute;
text-align: center;
color: #777;
- margin-top: 3rem;
+ margin-left: 0;
+ margin-top: 0;
font-size: 1rem;
font-weight: 400;
}
diff --git a/templates/sales/invoices/invoice_preview.html b/templates/sales/invoices/invoice_preview.html
index 5f8993f4..0a6adaba 100644
--- a/templates/sales/invoices/invoice_preview.html
+++ b/templates/sales/invoices/invoice_preview.html
@@ -1,4 +1,4 @@
-{% load i18n static custom_filters num2words_tags%}
+{% load i18n static custom_filters num2words_tags %}
@@ -7,7 +7,7 @@
Invoice
-
+
@@ -26,6 +26,7 @@
background: white;
border-radius: 5px;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
+ position: relative;
}
.invoice-header {
text-align: center;
@@ -51,85 +52,88 @@
}
.invoice-total {
text-align: right;
- font-size: 14px;
+ font-size: 13px;
font-weight: 600;
margin-top: 10px;
}
.footer-note {
position: absolute;
- bottom: 35mm;
+ bottom: 10mm;
+ left: 10mm;
+ right: 10mm;
font-size: 10px;
- margin-top: auto;
- margin-right: auto;
- width: 28%;
-}
-
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ }
+ .logo-img img {
+ width: 10mm;
+ height: 10mm;
+ }
+ .table-responsive {
+ overflow-x: auto;
+ }
-
+
-
-
-
-
+
+
-
-