update
This commit is contained in:
commit
bcb180c053
@ -124,8 +124,7 @@ class DealerSlugMiddleware:
|
|||||||
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 request.user.is_authenticated:
|
||||||
dealer = get_user_type(request)
|
dealer = get_user_type(request)
|
||||||
if "dealer_slug" not in view_kwargs:
|
if view_kwargs.get("dealer_slug"):
|
||||||
return redirect("home", dealer_slug=dealer.slug, **view_kwargs)
|
if view_kwargs["dealer_slug"] != dealer.slug:
|
||||||
elif view_kwargs["dealer_slug"] != dealer.slug:
|
raise Http404("Dealer slug mismatch")
|
||||||
raise Http404("Dealer slug mismatch")
|
|
||||||
return None
|
return None
|
||||||
|
|||||||
@ -720,7 +720,9 @@ class Car(Base):
|
|||||||
car=self, exterior=exterior, interior=interior
|
car=self, exterior=exterior, interior=interior
|
||||||
)
|
)
|
||||||
self.save()
|
self.save()
|
||||||
|
@property
|
||||||
|
def logo(self):
|
||||||
|
return self.id_car_make.logo.url if self.id_car_make.logo else None
|
||||||
|
|
||||||
class CarTransfer(models.Model):
|
class CarTransfer(models.Model):
|
||||||
car = models.ForeignKey(
|
car = models.ForeignKey(
|
||||||
|
|||||||
@ -9,7 +9,7 @@ from django.conf.urls import handler403, handler400, handler404, handler500
|
|||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
# main URLs
|
# main URLs
|
||||||
path("", views.HomeView.as_view(), name="home"),
|
path("", views.HomeView.as_view(), name="home"),
|
||||||
path("<slug:dealer_slug>/", views.HomeView.as_view(), name="home"),
|
# path("<slug:dealer_slug>/", views.HomeView.as_view(), name="home"),
|
||||||
path("welcome/", views.WelcomeView.as_view(), name="welcome"),
|
path("welcome/", views.WelcomeView.as_view(), name="welcome"),
|
||||||
# Accounts URLs
|
# Accounts URLs
|
||||||
# path("login/", allauth_views.LoginView.as_view(template_name="account/login.html"), name="account_login"),
|
# path("login/", allauth_views.LoginView.as_view(template_name="account/login.html"), name="account_login"),
|
||||||
|
|||||||
@ -349,15 +349,6 @@ class HomeView(LoginRequiredMixin, TemplateView):
|
|||||||
|
|
||||||
template_name = "index.html"
|
template_name = "index.html"
|
||||||
|
|
||||||
def dispatch(self, request, *args, **kwargs):
|
|
||||||
# Redirect unauthenticated users to the welcome page
|
|
||||||
if not request.user.is_authenticated:
|
|
||||||
return redirect("welcome")
|
|
||||||
if not kwargs.get("dealer_slug"):
|
|
||||||
dealer = get_user_type(request)
|
|
||||||
return redirect("home", dealer_slug=dealer.slug)
|
|
||||||
return super().dispatch(request, *args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
class TestView(TemplateView):
|
class TestView(TemplateView):
|
||||||
"""
|
"""
|
||||||
@ -2662,7 +2653,6 @@ class GroupCreateView(
|
|||||||
model = models.CustomGroup
|
model = models.CustomGroup
|
||||||
form_class = forms.GroupForm
|
form_class = forms.GroupForm
|
||||||
template_name = "groups/group_form.html"
|
template_name = "groups/group_form.html"
|
||||||
success_url = reverse_lazy("group_list")
|
|
||||||
success_message = _("Group created successfully")
|
success_message = _("Group created successfully")
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
@ -2674,6 +2664,8 @@ class GroupCreateView(
|
|||||||
instance.save()
|
instance.save()
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
|
||||||
|
def get_success_url(self):
|
||||||
|
return reverse_lazy("group_list", args=[self.request.dealer.slug])
|
||||||
|
|
||||||
class GroupUpdateView(
|
class GroupUpdateView(
|
||||||
LoginRequiredMixin,
|
LoginRequiredMixin,
|
||||||
@ -2705,20 +2697,20 @@ class GroupUpdateView(
|
|||||||
model = models.CustomGroup
|
model = models.CustomGroup
|
||||||
form_class = forms.GroupForm
|
form_class = forms.GroupForm
|
||||||
template_name = "groups/group_form.html"
|
template_name = "groups/group_form.html"
|
||||||
success_url = reverse_lazy("group_list")
|
|
||||||
success_message = _("Group updated successfully")
|
success_message = _("Group updated successfully")
|
||||||
|
|
||||||
def form_valid(self, form):
|
def form_valid(self, form):
|
||||||
dealer = get_user_type(self.request)
|
dealer = get_user_type(self.request)
|
||||||
instance = form.save(commit=False)
|
instance = form.save(commit=False)
|
||||||
instance.set_defualt_permissions()
|
instance.set_default_permissions()
|
||||||
instance.group.name = f"{dealer.slug}_{instance.name}"
|
instance.group.name = f"{dealer.slug}_{instance.name}"
|
||||||
instance.save()
|
instance.save()
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
def get_success_url(self):
|
||||||
|
return reverse_lazy("group_list", args=[self.request.dealer.slug])
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def GroupDeleteview(request, pk):
|
def GroupDeleteview(request, dealer_slug,pk):
|
||||||
"""
|
"""
|
||||||
Handles the deletion of a specific group instance. This view ensures that only
|
Handles the deletion of a specific group instance. This view ensures that only
|
||||||
authenticated users can perform the deletion. Upon successful deletion, a
|
authenticated users can perform the deletion. Upon successful deletion, a
|
||||||
@ -2731,14 +2723,15 @@ def GroupDeleteview(request, pk):
|
|||||||
:return: The HTTP response that redirects the user to the group list page
|
:return: The HTTP response that redirects the user to the group list page
|
||||||
after the group is successfully deleted.
|
after the group is successfully deleted.
|
||||||
"""
|
"""
|
||||||
|
get_object_or_404(models.Dealer,slug=dealer_slug)
|
||||||
group = get_object_or_404(models.CustomGroup, pk=pk)
|
group = get_object_or_404(models.CustomGroup, pk=pk)
|
||||||
group.delete()
|
group.delete()
|
||||||
messages.success(request, _("Group deleted successfully"))
|
messages.success(request, _("Group deleted successfully"))
|
||||||
return redirect("group_list")
|
return redirect("group_list",dealer_slug=dealer_slug)
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def GroupPermissionView(request, pk):
|
def GroupPermissionView(request, dealer_slug,pk):
|
||||||
"""
|
"""
|
||||||
Handles the view for adding or modifying permissions of a specific group. This view
|
Handles the view for adding or modifying permissions of a specific group. This view
|
||||||
fetches the group based on the primary key passed as a parameter, and either displays
|
fetches the group based on the primary key passed as a parameter, and either displays
|
||||||
@ -2760,6 +2753,7 @@ def GroupPermissionView(request, pk):
|
|||||||
the group's permissions and redirects to the group's detail page.
|
the group's permissions and redirects to the group's detail page.
|
||||||
:rtype: HttpResponse
|
:rtype: HttpResponse
|
||||||
"""
|
"""
|
||||||
|
get_object_or_404(models.Dealer,slug=dealer_slug)
|
||||||
group = get_object_or_404(models.CustomGroup, pk=pk)
|
group = get_object_or_404(models.CustomGroup, pk=pk)
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
form = forms.PermissionForm(request.POST)
|
form = forms.PermissionForm(request.POST)
|
||||||
@ -2768,7 +2762,7 @@ def GroupPermissionView(request, pk):
|
|||||||
for i in permissions:
|
for i in permissions:
|
||||||
group.add_permission(Permission.objects.get(id=int(i)))
|
group.add_permission(Permission.objects.get(id=int(i)))
|
||||||
messages.success(request, _("Permission added successfully"))
|
messages.success(request, _("Permission added successfully"))
|
||||||
return redirect("group_detail", pk=group.pk)
|
return redirect("group_detail", dealer_slug=dealer_slug,pk=group.pk)
|
||||||
form = forms.PermissionForm(initial={"name": group.permissions})
|
form = forms.PermissionForm(initial={"name": group.permissions})
|
||||||
return render(
|
return render(
|
||||||
request, "groups/group_permission_form.html", {"group": group, "form": form}
|
request, "groups/group_permission_form.html", {"group": group, "form": form}
|
||||||
@ -2777,7 +2771,7 @@ def GroupPermissionView(request, pk):
|
|||||||
|
|
||||||
# Users
|
# Users
|
||||||
@login_required
|
@login_required
|
||||||
def UserGroupView(request, slug):
|
def UserGroupView(request, dealer_slug,slug):
|
||||||
"""
|
"""
|
||||||
Handles the assignment of user groups to a specific staff member. This view
|
Handles the assignment of user groups to a specific staff member. This view
|
||||||
allows updating the groups a staff member belongs to via a form submission.
|
allows updating the groups a staff member belongs to via a form submission.
|
||||||
@ -2793,6 +2787,7 @@ def UserGroupView(request, slug):
|
|||||||
user detail page after successful submission for POST requests.
|
user detail page after successful submission for POST requests.
|
||||||
:rtype: HttpResponse or HttpResponseRedirect
|
:rtype: HttpResponse or HttpResponseRedirect
|
||||||
"""
|
"""
|
||||||
|
get_object_or_404(models.Dealer,slug=dealer_slug)
|
||||||
staff = get_object_or_404(models.Staff, slug=slug)
|
staff = get_object_or_404(models.Staff, slug=slug)
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
form = forms.UserGroupForm(request.POST)
|
form = forms.UserGroupForm(request.POST)
|
||||||
@ -2804,7 +2799,7 @@ def UserGroupView(request, slug):
|
|||||||
staff.add_group(cg.group)
|
staff.add_group(cg.group)
|
||||||
|
|
||||||
messages.success(request, _("Group added successfully"))
|
messages.success(request, _("Group added successfully"))
|
||||||
return redirect("user_detail", slug=staff.slug)
|
return redirect("user_detail",dealer_slug=dealer_slug, slug=staff.slug)
|
||||||
|
|
||||||
form = forms.UserGroupForm(initial={"name": staff.groups})
|
form = forms.UserGroupForm(initial={"name": staff.groups})
|
||||||
form.fields["name"].queryset = models.CustomGroup.objects.filter(
|
form.fields["name"].queryset = models.CustomGroup.objects.filter(
|
||||||
@ -2948,7 +2943,8 @@ class UserCreateView(
|
|||||||
if group:
|
if group:
|
||||||
staff.add_group(group)
|
staff.add_group(group)
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
def get_success_url(self):
|
||||||
|
return reverse_lazy("user_list", args=[self.request.dealer.slug])
|
||||||
|
|
||||||
class UserUpdateView(
|
class UserUpdateView(
|
||||||
LoginRequiredMixin,
|
LoginRequiredMixin,
|
||||||
@ -3015,10 +3011,11 @@ class UserUpdateView(
|
|||||||
staff.add_as_manager()
|
staff.add_as_manager()
|
||||||
staff.save()
|
staff.save()
|
||||||
return super().form_valid(form)
|
return super().form_valid(form)
|
||||||
|
def get_success_url(self):
|
||||||
|
return reverse_lazy("user_list", args=[self.request.dealer.slug])
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def UserDeleteview(request, slug):
|
def UserDeleteview(request, dealer_slug,slug):
|
||||||
"""
|
"""
|
||||||
Deletes a user and its associated staff member from the database and redirects
|
Deletes a user and its associated staff member from the database and redirects
|
||||||
to the user list page. Displays a success message upon successful deletion
|
to the user list page. Displays a success message upon successful deletion
|
||||||
@ -3029,10 +3026,11 @@ def UserDeleteview(request, slug):
|
|||||||
:return: An HTTP redirect to the user list page.
|
:return: An HTTP redirect to the user list page.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
get_object_or_404(models.Dealer,slug=dealer_slug)
|
||||||
staff = get_object_or_404(models.Staff, slug=slug)
|
staff = get_object_or_404(models.Staff, slug=slug)
|
||||||
staff.deactivate_account()
|
staff.deactivate_account()
|
||||||
messages.success(request, _("User deleted successfully"))
|
messages.success(request, _("User deleted successfully"))
|
||||||
return redirect("user_list")
|
return redirect("user_list",dealer_slug=dealer_slug)
|
||||||
|
|
||||||
|
|
||||||
class OrganizationListView(LoginRequiredMixin, ListView):
|
class OrganizationListView(LoginRequiredMixin, ListView):
|
||||||
@ -9185,6 +9183,9 @@ def InventoryItemCreateView(request, dealer_slug):
|
|||||||
cogs_accounts = entity.get_coa_accounts().filter(role="cogs_regular")
|
cogs_accounts = entity.get_coa_accounts().filter(role="cogs_regular")
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
|
response = HttpResponse()
|
||||||
|
response["HX-Refresh"] = "true"
|
||||||
|
|
||||||
name = request.POST.get("name")
|
name = request.POST.get("name")
|
||||||
account = request.POST.get("account")
|
account = request.POST.get("account")
|
||||||
account = inventory_accounts.get(pk=account)
|
account = inventory_accounts.get(pk=account)
|
||||||
@ -9216,10 +9217,11 @@ def InventoryItemCreateView(request, dealer_slug):
|
|||||||
.first()
|
.first()
|
||||||
):
|
):
|
||||||
messages.error(request, _("Inventory item already exists"))
|
messages.error(request, _("Inventory item already exists"))
|
||||||
return redirect(
|
return response
|
||||||
f"{reverse('inventory_item_create')}?for_po={for_po}",
|
# return redirect(
|
||||||
dealer_slug=dealer.slug,
|
# f"{reverse('inventory_item_create')}?for_po={for_po}",
|
||||||
)
|
# dealer_slug=dealer.slug,
|
||||||
|
# )
|
||||||
uom = entity.get_uom_all().get(name="Unit")
|
uom = entity.get_uom_all().get(name="Unit")
|
||||||
entity.create_item_inventory(
|
entity.create_item_inventory(
|
||||||
name=inventory_name,
|
name=inventory_name,
|
||||||
@ -9229,7 +9231,8 @@ def InventoryItemCreateView(request, dealer_slug):
|
|||||||
coa_model=coa,
|
coa_model=coa,
|
||||||
)
|
)
|
||||||
messages.success(request, _("Inventory item created successfully"))
|
messages.success(request, _("Inventory item created successfully"))
|
||||||
return redirect("purchase_order_list", dealer_slug=dealer.slug)
|
return response
|
||||||
|
# return redirect("purchase_order_list", dealer_slug=dealer.slug)
|
||||||
if for_po:
|
if for_po:
|
||||||
form = forms.CSVUploadForm()
|
form = forms.CSVUploadForm()
|
||||||
form.fields["vendor"].queryset = dealer.vendors.filter(active=True)
|
form.fields["vendor"].queryset = dealer.vendors.filter(active=True)
|
||||||
|
|||||||
@ -108,3 +108,4 @@ html[dir="rtl"] .form-icon-container .form-control {
|
|||||||
padding-right: 35px;
|
padding-right: 35px;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
<div class="row justify-content-between mb-2">
|
<div class="row justify-content-between mb-2">
|
||||||
<div class="col-6 col-md-4 col-xxl-2 text-center border-translucent border-start-xxl border-end-xxl-0 border-bottom-xxl-0 border-end border-bottom pb-4 pb-xxl-0 ">
|
<div class="col-6 col-md-4 col-xxl-2 text-center border-translucent border-start-xxl border-end-xxl-0 border-bottom-xxl-0 border-end border-bottom pb-4 pb-xxl-0 ">
|
||||||
<span class="uil fs-5 lh-1 uil-users-alt text-success"></span>
|
<span class="uil fs-5 lh-1 uil-users-alt text-success"></span>
|
||||||
<a href="{% url 'user_list' %}"><h4 class="fs-6 pt-3">{{ staff }}</h4></a>
|
<a href="{% url 'user_list' request.dealer.slug %}"><h4 class="fs-6 pt-3">{{ staff }}</h4></a>
|
||||||
<p class="fs-9 mb-0">{{ _("Staff")}}</p>
|
<p class="fs-9 mb-0">{{ _("Staff")}}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 col-md-4 col-xxl-2 text-center border-translucent border-start-xxl border-end-xxl-0 border-bottom-xxl-0 border-end border-bottom pb-4 pb-xxl-0 ">
|
<div class="col-6 col-md-4 col-xxl-2 text-center border-translucent border-start-xxl border-end-xxl-0 border-bottom-xxl-0 border-end border-bottom pb-4 pb-xxl-0 ">
|
||||||
|
|||||||
@ -109,7 +109,11 @@
|
|||||||
{{ _("Delete") }}
|
{{ _("Delete") }}
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-sm btn-phoenix-secondary"
|
<a class="btn btn-sm btn-phoenix-secondary"
|
||||||
|
<<<<<<< HEAD
|
||||||
href="{% url 'group_list' request.dealer.slug%}">
|
href="{% url 'group_list' request.dealer.slug%}">
|
||||||
|
=======
|
||||||
|
href="{% url 'group_list' request.dealer.slug %}">
|
||||||
|
>>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7
|
||||||
<i class="fa-solid fa-arrow-left"></i>
|
<i class="fa-solid fa-arrow-left"></i>
|
||||||
{% trans "Back to List" %}
|
{% trans "Back to List" %}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<div class="text-danger">{{ error }}</div>
|
<div class="text-danger">{{ error }}</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<div class="d-flex mb-3">
|
<div class="d-flex mb-3">
|
||||||
<a href="{% url 'group_detail' group.pk %}" class="btn btn-phoenix-primary me-2 "><i class="fa-solid fa-ban"></i> {% trans "Cancel"|capfirst %}</a>
|
<a href="{% url 'group_detail' request.dealer.slug group.pk %}" class="btn btn-phoenix-primary me-2 "><i class="fa-solid fa-ban"></i> {% trans "Cancel"|capfirst %}</a>
|
||||||
<button class="btn btn-phoenix-primary" type="submit">
|
<button class="btn btn-phoenix-primary" type="submit">
|
||||||
<i class="fa-solid fa-floppy-disk"></i>
|
<i class="fa-solid fa-floppy-disk"></i>
|
||||||
{{ _("Save") }}
|
{{ _("Save") }}
|
||||||
|
|||||||
@ -28,6 +28,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<<<<<<< HEAD
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{% url 'inventory_item_create' request.dealer.slug %}">
|
<a class="nav-link" href="{% url 'inventory_item_create' request.dealer.slug %}">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
@ -42,6 +43,8 @@
|
|||||||
<span class="nav-link-icon"><span class="fas fa-file-import"></span></span><span class="nav-link-text">{% trans "Bulk Upload"|capfirst %}</span>
|
<span class="nav-link-icon"><span class="fas fa-file-import"></span></span><span class="nav-link-text">{% trans "Bulk Upload"|capfirst %}</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
=======
|
||||||
|
>>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
@ -59,6 +62,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'upload_cars' request.dealer.slug %}">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<span class="nav-link-icon"><span class="fas fa-file-import"></span></span><span class="nav-link-text">{% trans "Bulk Upload"|capfirst %}</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -267,6 +277,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
<<<<<<< HEAD
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" href="{% url 'purchase_order_list' request.dealer.slug %}">
|
<a class="nav-link" href="{% url 'purchase_order_list' request.dealer.slug %}">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
@ -274,6 +285,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
=======
|
||||||
|
{% if perms.django_ledger.view_purchaseordermodel %}
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" href="{% url 'purchase_order_list' request.dealer.slug %}">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<span class="nav-link-icon"><span class="fas fa-warehouse"></span></span><span class="nav-link-text">{% trans "purchase Orders"|capfirst %}</span>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
>>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -365,7 +387,7 @@
|
|||||||
aria-label="Toggle Navigation">
|
aria-label="Toggle Navigation">
|
||||||
<span class="navbar-toggle-icon"><span class="toggle-line"></span></span>
|
<span class="navbar-toggle-icon"><span class="toggle-line"></span></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand me-1 me-sm-3" href="{% url 'home' request.dealer.slug %}">
|
<a class="navbar-brand me-1 me-sm-3" href="{% url 'home' %}">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<img class="logo-img d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="haikal" width="27" />
|
<img class="logo-img d-dark-none" src="{% static 'images/logos/logo-d.png' %}" alt="haikal" width="27" />
|
||||||
<img class="logo-img d-light-none" src="{% static 'images/logos/logo.png' %}" alt="haikal" width="27" />
|
<img class="logo-img d-light-none" src="{% static 'images/logos/logo.png' %}" alt="haikal" width="27" />
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% load static i18n crispy_forms_tags %}
|
{% load static i18n crispy_forms_tags %}
|
||||||
{% block customCSS %}
|
|
||||||
<style>
|
{% block content %}
|
||||||
.color-card {
|
<form hx-boost="true" hx-swap="none" action="{% url 'inventory_item_create' request.dealer.slug %}?for_po=1" method="post">
|
||||||
|
<style>
|
||||||
|
.color-card {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: all 0.3s ease;
|
transition: all 0.3s ease;
|
||||||
border: 2px solid transparent;
|
border: 2px solid transparent;
|
||||||
@ -67,10 +69,7 @@
|
|||||||
gap: 10px;
|
gap: 10px;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
|
||||||
{% block content %}
|
|
||||||
<form action="" method="post">
|
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="row g-4">
|
<div class="row g-4">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@ -139,6 +138,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary mt-5">Add New Item To Inventory</button>
|
<button type="submit" class="btn btn-primary mt-5">{% trans 'Save' %}</button>
|
||||||
</form>
|
</form>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
@ -18,7 +18,19 @@
|
|||||||
<table class="table table-hover table-bordered">
|
<table class="table table-hover table-bordered">
|
||||||
<thead class="">
|
<thead class="">
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans 'Item' %}</th>
|
<th class="d-flex justify-content-between align-items-center">
|
||||||
|
{% trans 'Item' %}
|
||||||
|
<button type="button"
|
||||||
|
class="btn btn-sm btn-phoenix-success"
|
||||||
|
data-bs-toggle="modal"
|
||||||
|
data-bs-target="#mainModal"
|
||||||
|
hx-get="{% url 'inventory_item_create' dealer_slug %}?for_po=1"
|
||||||
|
hx-target=".main-modal-body"
|
||||||
|
hx-select="form"
|
||||||
|
hx-swap="innerHTML">
|
||||||
|
<i class="fas fa-plus me-1"></i>{% trans 'Add Item' %}
|
||||||
|
</button>
|
||||||
|
</th>
|
||||||
<th>{% trans 'Unit Cost' %}</th>
|
<th>{% trans 'Unit Cost' %}</th>
|
||||||
<th>{% trans 'Quantity' %}</th>
|
<th>{% trans 'Quantity' %}</th>
|
||||||
<th>{% trans 'Unit' %}</th>
|
<th>{% trans 'Unit' %}</th>
|
||||||
|
|||||||
@ -48,6 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<<<<<<< HEAD
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -55,6 +56,9 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h3 class="h4 fw-light mb-2">{{ po_model.po_title }}</h3>
|
<h3 class="h4 fw-light mb-2">{{ po_model.po_title }}</h3>
|
||||||
|
=======
|
||||||
|
|
||||||
|
>>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
{% po_item_table1 po_items %}
|
{% po_item_table1 po_items %}
|
||||||
@ -63,11 +67,23 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<<<<<<< HEAD
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
=======
|
||||||
|
<!--POS list-->
|
||||||
|
<a class="btn btn-phoenix-primary w-100 py-2 mt-2"
|
||||||
|
href="{% url 'purchase_order_list' request.dealer.slug %}">
|
||||||
|
<i class="fas fa-list me-2"></i>{% trans 'PO List' %}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
>>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7
|
||||||
{% include "purchase_orders/includes/mark_as.html" %}
|
{% include "purchase_orders/includes/mark_as.html" %}
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block customJS %}
|
{% block customJS %}
|
||||||
|
|||||||
@ -21,8 +21,6 @@
|
|||||||
<div>
|
<div>
|
||||||
<a href="{% url 'purchase_order_create' request.dealer.slug %}"
|
<a href="{% url 'purchase_order_create' request.dealer.slug %}"
|
||||||
class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{{ _("Create New PO") }}</a>
|
class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{{ _("Create New PO") }}</a>
|
||||||
<a href="{% url 'inventory_item_create' request.dealer.slug %}?for_po=1"
|
|
||||||
class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{{ _("Create Inventory Item for PO") }}</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "partials/search_box.html" %}
|
{% include "partials/search_box.html" %}
|
||||||
|
|||||||
@ -90,6 +90,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% include "purchase_orders/includes/mark_as.html" %}
|
{% include "purchase_orders/includes/mark_as.html" %}
|
||||||
|
<div class="modal fade"
|
||||||
|
id="mainModal"
|
||||||
|
tabindex="-1"
|
||||||
|
aria-labelledby="mainModalLabel"
|
||||||
|
aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-xl">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="mainModalLabel">{% trans 'Add' %}</h5>
|
||||||
|
<button type="button"
|
||||||
|
class="btn-close"
|
||||||
|
data-bs-dismiss="modal"
|
||||||
|
aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="main-modal-body" style="padding: 20px;">
|
||||||
|
<!-- Content will be loaded here via AJAX -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block customJS %}
|
{% block customJS %}
|
||||||
|
|||||||
@ -136,7 +136,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<p>
|
<p>
|
||||||
<strong>{% trans "Ledger Number" %}: </strong><a href="{% url 'ledger_detail' entity_slug=sale_order.invoice.ledger.entity.slug pk=sale_order.invoice.ledger.pk %}" target="_blank" rel="noopener noreferrer"> {{ sale_order.invoice.ledger }} <i class="fa fa-external-link" aria-hidden="true"></i></a><br>
|
<strong>{% trans "Ledger Number" %}: </strong><a href="{% url 'ledger_detail' dealer_slug=request.dealer.slug entity_slug=sale_order.invoice.ledger.entity.slug pk=sale_order.invoice.ledger.pk %}" target="_blank" rel="noopener noreferrer"> {{ sale_order.invoice.ledger }} <i class="fa fa-external-link" aria-hidden="true"></i></a><br>
|
||||||
<strong>{% trans "Date" %}:</strong> {{ sale_order.invoice.ledger.created|date }}<br>
|
<strong>{% trans "Date" %}:</strong> {{ sale_order.invoice.ledger.created|date }}<br>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -27,7 +27,11 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<h4 class="my-4">Groups</h4>
|
<h4 class="my-4">Groups</h4>
|
||||||
|
<<<<<<< HEAD
|
||||||
<a class="btn btn-sm btn-phoenix-primary mt-2 mb-4" href="{% url 'user_groups' user.slug %}"><i class="fa-solid fa-users"></i> Manage Groups</a>
|
<a class="btn btn-sm btn-phoenix-primary mt-2 mb-4" href="{% url 'user_groups' user.slug %}"><i class="fa-solid fa-users"></i> Manage Groups</a>
|
||||||
|
=======
|
||||||
|
<a class="btn btn-sm btn-phoenix-primary mt-2 mb-4" href="{% url 'user_groups' request.dealer.slug user_.slug %}"><i class="fa-solid fa-users"></i> Manage Groups</a>
|
||||||
|
>>>>>>> c9fad7b79c346875a636122fdc7514814180dbc7
|
||||||
<table class="table table-hover table-responsive-sm fs-9 mb-0">
|
<table class="table table-hover table-responsive-sm fs-9 mb-0">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -48,20 +52,20 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer d-flex ">
|
<div class="card-footer d-flex ">
|
||||||
<a class="btn btn-sm btn-phoenix-primary me-1" href="{% url 'user_update' user_.slug %}">
|
<a class="btn btn-sm btn-phoenix-primary me-1" href="{% url 'user_update' request.dealer.slug user_.slug %}">
|
||||||
{{ _("Edit") }}
|
{{ _("Edit") }}
|
||||||
<i class="fa-solid fa-pen-to-square"></i>
|
<i class="fa-solid fa-pen-to-square"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<button class="btn btn-phoenix-danger btn-sm delete-btn me-1"
|
<button class="btn btn-phoenix-danger btn-sm delete-btn me-1"
|
||||||
data-url="{% url 'user_delete' user_.slug %}"
|
data-url="{% url 'user_delete' request.dealer.slug user_.slug %}"
|
||||||
data-message="{{ _("Are you sure you want to delete this user?")}}"
|
data-message='{{ _("Are you sure you want to delete this user?")}}'
|
||||||
data-bs-toggle="modal" data-bs-target="#deleteModal">
|
data-bs-toggle="modal" data-bs-target="#deleteModal">
|
||||||
{{ _("Delete") }}
|
{{ _("Delete") }}
|
||||||
<i class="fas fa-trash"></i>
|
<i class="fas fa-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
<a class="btn btn-sm btn-phoenix-secondary"
|
<a class="btn btn-sm btn-phoenix-secondary"
|
||||||
href="{% url 'user_list' %}">
|
href="{% url 'user_list' request.dealer.slug %}">
|
||||||
{{ _("Back to List") }}
|
{{ _("Back to List") }}
|
||||||
<i class="fa-regular fa-circle-left"></i>
|
<i class="fa-regular fa-circle-left"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user