This commit is contained in:
Marwan Alwali 2025-02-06 11:49:47 +03:00
commit 1f2cf5a7ec
6 changed files with 108 additions and 6 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.17 on 2025-02-05 09:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('inventory', '0007_schedule_scheduled_type'),
]
operations = [
migrations.AddField(
model_name='schedule',
name='status',
field=models.CharField(choices=[('Scheduled', 'Scheduled'), ('Completed', 'Completed'), ('Canceled', 'Canceled')], default='Scheduled', max_length=200),
),
]

View File

@ -0,0 +1,21 @@
# Generated by Django 4.2.17 on 2025-02-05 10:00
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.DJANGO_LEDGER_CUSTOMER_MODEL),
('inventory', '0008_schedule_status'),
]
operations = [
migrations.AlterField(
model_name='opportunity',
name='customer',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='opportunities', to=settings.DJANGO_LEDGER_CUSTOMER_MODEL),
),
]

View File

@ -0,0 +1,27 @@
# Generated by Django 4.2.17 on 2025-02-05 10:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('inventory', '0009_alter_opportunity_customer'),
]
operations = [
migrations.RemoveField(
model_name='lead',
name='id_car_make',
),
migrations.RemoveField(
model_name='lead',
name='id_car_model',
),
migrations.AddField(
model_name='lead',
name='car',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='inventory.car', verbose_name='Car'),
),
]

View File

@ -0,0 +1,25 @@
# Generated by Django 4.2.17 on 2025-02-05 10:17
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.DJANGO_LEDGER_CUSTOMER_MODEL),
('inventory', '0010_remove_lead_id_car_make_remove_lead_id_car_model_and_more'),
]
operations = [
migrations.RemoveField(
model_name='lead',
name='year',
),
migrations.AlterField(
model_name='schedule',
name='customer',
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='schedules', to=settings.DJANGO_LEDGER_CUSTOMER_MODEL),
),
]

View File

@ -135,19 +135,26 @@
</div>
</td>
<td class="align-middle white-space-nowrap fw-semibold"><a class="text-body-highlight" href="">{{ lead.id_car_make.get_local_name }} - {{ lead.id_car_model.get_local_name }} {{ lead.year }}</a></td>
<td class="align-middle white-space-nowrap fw-semibold"><a class="text-body-highlight" href="">{{ lead.car.id_car_make.get_local_name }} - {{ lead.car.id_car_model.get_local_name }} {{ lead.year }}</a></td>
<td class="align-middle white-space-nowrap fw-semibold"><a class="text-body-highlight" href="">{{ lead.email }}</a></td>
<td class="align-middle white-space-nowrap fw-semibold"><a class="text-body-highlight" href="tel:{{ lead.phone_number }}">{{ lead.phone_number }}</a></td>
<td class="align-middle white-space-nowrap fw-semibold">
{% if lead.get_latest_schedule %}
<span class="text-success" data-feather="calendar"></span> <span class="badge badge-phoenix badge-phoenix-primary text-success fw-semibold">{{ lead.get_latest_schedule.scheduled_type }}</span> <br>
<span class="text-success" data-feather="clock"></span> <span class="badge badge-phoenix badge-phoenix-primary text-success fw-semibold">{{ lead.get_latest_schedule.scheduled_at }}</span>
{% if lead.get_latest_schedule.scheduled_type == "Call" %}
<span class="badge badge-phoenix badge-phoenix-primary text-primary fw-semibold"><span class="text-primary" data-feather="phone"></span>
{{ lead.get_latest_schedule.scheduled_at }}</span>
{% elif lead.get_latest_schedule.scheduled_type == "Meeting" %}
<span class="badge badge-phoenix badge-phoenix-success text-success fw-semibold"><span class="text-success" data-feather="calendar"></span>
{{ lead.get_latest_schedule.scheduled_at }}</span>
{% elif lead.get_latest_schedule.scheduled_type == "Email" %}
<span class="badge badge-phoenix badge-phoenix-warning text-warning fw-semibold"><span class="text-warning" data-feather="email"></span>
{{ lead.get_latest_schedule.scheduled_at }}</span>
{% endif %}
{% endif %}
</td>
<td class="align-middle white-space-nowrap text-body-tertiary text-opacity-85 fw-semibold text-body-highlight">{{ lead.staff|upper }}</td>
<td class="align-middle white-space-nowrap fw-semibold text-body-highlight">{{ lead.source|upper }}</td>
<td class="align-middle white-space-nowrap text-body-tertiary text-opacity-85 fw-semibold text-body-highlight">{{ lead.channel|upper }}</td>
<td class="align-middle white-space-nowrap text-body-tertiary text-opacity-85 text-body-tertiary">{{ lead.created|date }}</td>
<td class="align-middle white-space-nowrap text-body-tertiary text-opacity-85 fw-semibold text-body-highlight">{{ lead.channel|upper }}</td>
<td class="align-middle white-space-nowrap text-end">
<div class="btn-reveal-trigger position-static">
<button

View File

@ -36,7 +36,11 @@
</div>
<div class="d-md-flex d-xl-block align-items-center justify-content-between mb-5">
<div class="d-flex align-items-center mb-3 mb-md-0 mb-xl-3">
<div class="avatar avatar-xl me-3"><img class="rounded" src="{{ opportunity.car.id_car_make.logo.url }}" alt="" /></div>
<div class="avatar avatar-xl me-3">
{% if opportunity.car.id_car_make.logo %}
<img class="rounded" src="{{ opportunity.car.id_car_make.logo.url }}" alt="" />
{% endif %}
</div>
<div>
<h5>{{ opportunity.staff.get_local_name}}</h5>
<div class="dropdown"><a class="text-body-secondary dropdown-toggle text-decoration-none dropdown-caret-none" href="#!" data-bs-toggle="dropdown" aria-expanded="false">