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("", include("inventory.urls")),
path("haikalbot/", include("haikalbot.urls")),
path("appointment/", include("appointment.urls")),
# path("appointment/", include("appointment.urls")),
path("plans/", include("plans.urls")),
path("schema/", Schema.as_view()),
path("tours/", include("tours.urls")),

View File

@ -621,7 +621,7 @@ class AdditionalServices(models.Model, LocalizedNameMixin):
if self.taxable
else self.price
)
@property
def service_tax(self):
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 plans.models import UserPlan
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
# logging

View File

@ -12,7 +12,7 @@ from django.db import transaction
from django_ledger.io import roles
from django_q.tasks import async_task
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.core.files.base import ContentFile
from django.contrib.auth import get_user_model

View File

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

View File

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