Merge branch 'main' of http://10.10.1.136:3000/ismail/haikal into frontend
This commit is contained in:
commit
d5b7e7fa7e
@ -122,9 +122,12 @@ class DealerSlugMiddleware:
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
def process_view(self, request, view_func, view_args, view_kwargs):
|
def process_view(self, request, view_func, view_args, view_kwargs):
|
||||||
if request.user.is_authenticated:
|
if not request.user.is_authenticated:
|
||||||
dealer = get_user_type(request)
|
return None
|
||||||
if view_kwargs.get("dealer_slug"):
|
if request.path.startswith('/en/ledger/') or request.path.startswith('/ar/ledger/'):
|
||||||
if view_kwargs["dealer_slug"] != dealer.slug:
|
return None
|
||||||
raise Http404("Dealer slug mismatch")
|
if not view_kwargs.get("dealer_slug"):
|
||||||
return None
|
return None
|
||||||
|
dealer = get_user_type(request)
|
||||||
|
if view_kwargs["dealer_slug"] != dealer.slug:
|
||||||
|
raise Http404("Dealer slug mismatch")
|
||||||
|
|||||||
@ -2911,7 +2911,7 @@ class UserCreateView(
|
|||||||
success_message = _("User created successfully")
|
success_message = _("User created successfully")
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
dealer = get_user_type(self.request)
|
dealer = get_object_or_404(models.Dealer, slug=self.kwargs["dealer_slug"])
|
||||||
# quota_dict = get_user_quota(dealer.user)
|
# quota_dict = get_user_quota(dealer.user)
|
||||||
# allowed_users = quota_dict.get("Users")
|
# allowed_users = quota_dict.get("Users")
|
||||||
|
|
||||||
@ -5578,7 +5578,7 @@ def schedule_lead(request, dealer_slug,slug):
|
|||||||
messages.success(request, _("Appointment Created Successfully"))
|
messages.success(request, _("Appointment Created Successfully"))
|
||||||
try:
|
try:
|
||||||
if lead.opportunity:
|
if lead.opportunity:
|
||||||
return redirect("opportunity_detail", slug=lead.opportunity.slug)
|
return redirect("opportunity_detail", dealer_slug=lead.dealer.slug, slug=lead.opportunity.slug)
|
||||||
except models.Lead.opportunity.RelatedObjectDoesNotExist:
|
except models.Lead.opportunity.RelatedObjectDoesNotExist:
|
||||||
return redirect("lead_list", dealer_slug=lead.dealer.slug)
|
return redirect("lead_list", dealer_slug=lead.dealer.slug)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -5,7 +5,6 @@
|
|||||||
<table class="table table-hover table-bordered align-middle">
|
<table class="table table-hover table-bordered align-middle">
|
||||||
<thead class="table-light">
|
<thead class="table-light">
|
||||||
<tr class="text-center">
|
<tr class="text-center">
|
||||||
<th class="py-3 text-start">{% trans "Created at" %}</th>
|
|
||||||
<th class="py-3 text-start">{% trans "Item" %}</th>
|
<th class="py-3 text-start">{% trans "Item" %}</th>
|
||||||
<th class="py-3">{% trans "UOM" %}</th>
|
<th class="py-3">{% trans "UOM" %}</th>
|
||||||
<th class="py-3">{% trans "Quantity" %}</th>
|
<th class="py-3">{% trans "Quantity" %}</th>
|
||||||
@ -17,8 +16,6 @@
|
|||||||
{% for i in inventory_list %}
|
{% for i in inventory_list %}
|
||||||
|
|
||||||
<tr class="hover-actions-trigger">
|
<tr class="hover-actions-trigger">
|
||||||
|
|
||||||
<td class="ps-2 fw-medium">{{ i.item_model__name }}</td>
|
|
||||||
<td class="ps-2 fw-medium">{{ i.item_model__name }}</td>
|
<td class="ps-2 fw-medium">{{ i.item_model__name }}</td>
|
||||||
<td class="text-center">{{ i.item_model__uom__name }}</td>
|
<td class="text-center">{{ i.item_model__uom__name }}</td>
|
||||||
<td class="text-end pe-3">{{ i.total_quantity | floatformat:3 }}</td>
|
<td class="text-end pe-3">{{ i.total_quantity | floatformat:3 }}</td>
|
||||||
|
|||||||
@ -102,7 +102,7 @@
|
|||||||
<div class="row g-4 g-xl-1 g-xxl-3 justify-content-between">
|
<div class="row g-4 g-xl-1 g-xxl-3 justify-content-between">
|
||||||
<div class="col-sm-auto">
|
<div class="col-sm-auto">
|
||||||
<div class="d-sm-block d-inline-flex d-md-flex flex-xl-column flex-xxl-row align-items-center align-items-xl-start align-items-xxl-center">
|
<div class="d-sm-block d-inline-flex d-md-flex flex-xl-column flex-xxl-row align-items-center align-items-xl-start align-items-xxl-center">
|
||||||
<div class="d-flex bg-success-subtle rounded flex-center me-3 mb-sm-3 mb-md-0 mb-xl-3 mb-xxl-0" style="width:32px; height:32px"><span class="text-success-dark" data-feather="dollar-sign" style="width:24px; height:24px"></span></div>
|
<div class="d-flex bg-success-subtle rounded flex-center me-3 mb-sm-3 mb-md-0 mb-xl-3 mb-xxl-0" style="width:32px; height:32px"><span class="text-success-dark icon-saudi_riyal" style="width:24px; height:24px;font-weight: bold"></span></div>
|
||||||
<div>
|
<div>
|
||||||
<p class="fw-bold mb-1">{% trans 'Paid Amount' %}</p>
|
<p class="fw-bold mb-1">{% trans 'Paid Amount' %}</p>
|
||||||
<h4 class="fw-bolder text-nowrap {% if invoice.is_paid %}text-success{% endif %}">{{invoice.amount_paid}} <span class="icon-saudi_riyal"></span></h4>
|
<h4 class="fw-bolder text-nowrap {% if invoice.is_paid %}text-success{% endif %}">{{invoice.amount_paid}} <span class="icon-saudi_riyal"></span></h4>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user