progress form for the plan resloved

This commit is contained in:
Faheed 2025-09-10 15:43:39 +03:00
parent acf335e2ec
commit 863aeab25c
7 changed files with 52 additions and 52 deletions

View File

@ -26,7 +26,7 @@ urlpatterns += i18n_patterns(
path("ledger/", include("django_ledger.urls", namespace="django_ledger")), path("ledger/", include("django_ledger.urls", namespace="django_ledger")),
path("", include("inventory.urls")), path("", include("inventory.urls")),
path("haikalbot/", include("haikalbot.urls")), path("haikalbot/", include("haikalbot.urls")),
path("appointment/", include("appointment.urls")), # path("appointment/", include("appointment.urls")),
path("plans/", include("plans.urls")), path("plans/", include("plans.urls")),
path("schema/", Schema.as_view()), path("schema/", Schema.as_view()),
path("tours/", include("tours.urls")), path("tours/", include("tours.urls")),

View File

@ -621,7 +621,7 @@ class AdditionalServices(models.Model, LocalizedNameMixin):
if self.taxable if self.taxable
else self.price else self.price
) )
@property @property
def service_tax(self): def service_tax(self):
vat = VatRate.objects.filter(dealer=self.dealer, is_active=True).first() vat = VatRate.objects.filter(dealer=self.dealer, is_active=True).first()

View File

@ -28,7 +28,7 @@ from django.db import transaction
from django_q.tasks import async_task from django_q.tasks import async_task
from plans.models import UserPlan from plans.models import UserPlan
from plans.signals import order_completed, activate_user_plan from plans.signals import order_completed, activate_user_plan
from inventory.tasks import send_email # from inventory.tasks import send_email
from django.conf import settings from django.conf import settings
# logging # logging

View File

@ -12,7 +12,7 @@ from django.db import transaction
from django_ledger.io import roles from django_ledger.io import roles
from django_q.tasks import async_task from django_q.tasks import async_task
from django.core.mail import send_mail from django.core.mail import send_mail
from appointment.models import StaffMember # from appointment.models import StaffMember
from django.utils.translation import activate from django.utils.translation import activate
from django.core.files.base import ContentFile from django.core.files.base import ContentFile
from django.contrib.auth import get_user_model from django.contrib.auth import get_user_model

View File

@ -26,7 +26,6 @@ distro==1.9.0
Django==5.2.4 Django==5.2.4
django-allauth==65.10.0 django-allauth==65.10.0
django-appconf==1.1.0 django-appconf==1.1.0
django-appointment==3.8.0
django-background-tasks==1.2.8 django-background-tasks==1.2.8
django-bootstrap5==25.1 django-bootstrap5==25.1
django-ckeditor==6.7.3 django-ckeditor==6.7.3

View File

@ -259,7 +259,7 @@
<div class="card-body"> <div class="card-body">
<div class="table-responsive scrollbar mb-3"> <div class="table-responsive scrollbar mb-3">
<table class="table table-sm fs-9 mb-0 overflow-hidden"> <table class="table table-sm fs-9 mb-0 overflow-hidden">
{% if car.marked_price and request.is_accountant or request.is_dealer or request.is_manager %} {% if car.marked_price %}
<tr> <tr>
<th>{% trans "Cost Price"|capfirst %}</th> <th>{% trans "Cost Price"|capfirst %}</th>
{% if request.is_dealer or request.is_accountant or request.manager%} {% if request.is_dealer or request.is_accountant or request.manager%}

View File

@ -21,10 +21,7 @@
--card-selected-shadow: rgba(13, 110, 253, 0.4); --card-selected-shadow: rgba(13, 110, 253, 0.4);
} }
body {
background-color: #f8f9fa;
}
.pricing-card-label { .pricing-card-label {
transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out;
cursor: pointer; cursor: pointer;
@ -233,9 +230,9 @@
for="plan_{{ forloop.counter }}"> for="plan_{{ forloop.counter }}">
<div class="card h-100 rounded-4"> <div class="card h-100 rounded-4">
<div class="card-body p-4 position-relative"> <div class="card-body p-4 position-relative">
{% if forloop.first %} {% comment %} {% if forloop.counter == 2 %}
<div class="pricing-card-badge">{{ _("Most Popular") }}</div> <div class="pricing-card-badge">{{ _("Most Popular") }}</div>
{% endif %} {% endif %} {% endcomment %}
<h4 class="mb-2 fw-bold text-primary">{{ pp.plan.name|capfirst }}</h4> <h4 class="mb-2 fw-bold text-primary">{{ pp.plan.name|capfirst }}</h4>
<h2 class="mb-4"> <h2 class="mb-4">
{{ pp.price_with_tax }}<span class="fs-5 fw-normal"> <span class="icon-saudi_riyal"></span> / {{ pp.pricing.period }} {{ _("days") }}</span> {{ pp.price_with_tax }}<span class="fs-5 fw-normal"> <span class="icon-saudi_riyal"></span> / {{ pp.pricing.period }} {{ _("days") }}</span>
@ -570,55 +567,59 @@
} }
} }
function initWizardSteps() { function initWizardSteps() {
let currentStep = 0; let currentStep = 0;
const steps = document.querySelectorAll(".step"); const steps = document.querySelectorAll(".step");
const nextBtn = document.getElementById("nextBtn"); const progressSteps = document.querySelectorAll(".progress-indicator .step-item");
const prevBtn = document.getElementById("prevBtn"); const nextBtn = document.getElementById("nextBtn");
const submitBtn = document.getElementById("submitBtn"); const prevBtn = document.getElementById("prevBtn");
const submitBtn = document.getElementById("submitBtn");
if (!steps.length || !nextBtn || !prevBtn || !submitBtn) return; if (!steps.length || !nextBtn || !prevBtn || !submitBtn || !progressSteps.length) return;
// Remove old listeners nextBtn.removeEventListener("click", handleNext);
nextBtn.removeEventListener("click", handleNext); prevBtn.removeEventListener("click", handlePrev);
prevBtn.removeEventListener("click", handlePrev);
// Add new listeners nextBtn.addEventListener("click", handleNext);
nextBtn.addEventListener("click", handleNext); prevBtn.addEventListener("click", handlePrev);
prevBtn.addEventListener("click", handlePrev);
function showStep(index) { function showStep(index) {
steps.forEach((step, i) => { steps.forEach((step, i) => {
step.classList.toggle("d-none", i !== index); step.classList.toggle("d-none", i !== index);
}); });
prevBtn.disabled = index === 0; // Add this section to update the progress indicator
nextBtn.classList.toggle("d-none", index === steps.length - 1); progressSteps.forEach((step, i) => {
submitBtn.classList.toggle("d-none", index !== steps.length - 1); step.classList.toggle("active", i === index);
step.classList.toggle("completed", i < index);
});
if (index === steps.length - 1) { prevBtn.disabled = index === 0;
populateSummary(); nextBtn.classList.toggle("d-none", index === steps.length - 1);
} submitBtn.classList.toggle("d-none", index !== steps.length - 1);
}
function handleNext() { if (index === steps.length - 1) {
// Validate current step before proceeding populateSummary();
if (!validateCurrentStep(currentStep)) { }
return; }
}
if (currentStep < steps.length - 1) { function handleNext() {
currentStep++; if (!validateCurrentStep(currentStep)) {
showStep(currentStep); return;
} }
}
function handlePrev() { if (currentStep < steps.length - 1) {
if (currentStep > 0) { currentStep++;
currentStep--; showStep(currentStep);
showStep(currentStep); }
} }
}
function handlePrev() {
if (currentStep > 0) {
currentStep--;
showStep(currentStep);
}
}
function populateSummary() { function populateSummary() {
const selectedPlan = document.querySelector('input[name="selected_plan"]:checked'); const selectedPlan = document.querySelector('input[name="selected_plan"]:checked');