Merge pull request 'User management changes' (#54) from frontend into main

Reviewed-on: #54
This commit is contained in:
ismail 2025-05-26 18:28:15 +03:00
commit 73338c303f
39 changed files with 205 additions and 63 deletions

View File

@ -550,7 +550,7 @@ class CarColorsForm(forms.ModelForm):
model = CarColors model = CarColors
fields = ["exterior", "interior"] fields = ["exterior", "interior"]
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
self.fields["exterior"].queryset = ExteriorColors.objects.all() self.fields["exterior"].queryset = ExteriorColors.objects.all()

View File

@ -945,6 +945,37 @@ class CarColorCreate(LoginRequiredMixin, PermissionRequiredMixin, CreateView):
context["car"] = get_object_or_404(models.Car, slug=self.kwargs["slug"]) context["car"] = get_object_or_404(models.Car, slug=self.kwargs["slug"])
return context return context
class CarColorsUpdateView( LoginRequiredMixin, PermissionRequiredMixin, SuccessMessageMixin, UpdateView):
model = models.CarColors
form_class = forms.CarColorsForm
template_name = "inventory/add_colors.html"
success_message = _("Car finance details updated successfully")
permission_required = ["inventory.change_carfinance"]
def get_success_url(self):
return reverse("car_detail", kwargs={"slug": self.object.car.slug})
def get_form_kwargs(self):
kwargs = super().get_form_kwargs()
kwargs["instance"] = self.get_object()
return kwargs
def get_initial(self):
initial = super().get_initial()
instance = self.get_object()
dealer = get_user_type(self.request)
selected_items = instance.additional_services.filter(dealer=dealer)
initial["additional_finances"] = selected_items
return initial
def get_form(self, form_class=None):
form = super().get_form(form_class)
dealer = get_user_type(self.request)
form.fields[
"additional_finances"
].queryset = models.AdditionalServices.objects.filter(dealer=dealer)
return form
class CarListView(LoginRequiredMixin, PermissionRequiredMixin, ListView): class CarListView(LoginRequiredMixin, PermissionRequiredMixin, ListView):
""" """

View File

@ -2,7 +2,7 @@
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% load i18n static %} {% load i18n static %}
{% load allauth account %} {% load allauth account %}
{% block head_title %} {% block title %}
{% trans 'User Settings' %} {% trans 'User Settings' %}
{% endblock %} {% endblock %}
{% block content %} {% block content %}

View File

@ -1,4 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %}
{%block title%} {%trans 'Admin Management' %} {%endblock%}
{% block content %} {% block content %}
<h1 class="mt-4"><i class="fas fa-tools me-2"></i>Admin Management</h1> <h1 class="mt-4"><i class="fas fa-tools me-2"></i>Admin Management</h1>
<div class="row row-cols-1 row-cols-md-4 g-4 mt-10"> <div class="row row-cols-1 row-cols-md-4 g-4 mt-10">

View File

@ -1,5 +1,13 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static crispy_forms_filters %} {% load i18n static crispy_forms_filters %}
{% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Lead'%}
{% else %}
{% trans 'Add New Lead'%}
{% endif %}
{% endblock %}
{% block customcss %} {% block customcss %}
<style> <style>
.htmx-indicator{ .htmx-indicator{

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static %} {% load i18n static %}
{% block title %}{{ _('Leads')|capfirst }}{% endblock title %} {% block title %}{{ _('Leads Tracking')|capfirst }}{% endblock title %}
{% block customCSS %} {% block customCSS %}
<style> <style>

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static humanize %} {% load i18n static humanize %}
{% block title %}{{ _("Opportunity Detail") }}{% endblock title %}
{% block content %} {% block content %}
<div class="row align-items-center justify-content-between g-3 mb-4"> <div class="row align-items-center justify-content-between g-3 mb-4">
<div class="col-12 col-md-auto"> <div class="col-12 col-md-auto">

View File

@ -1,6 +1,13 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static widget_tweaks custom_filters %} {% load i18n static widget_tweaks custom_filters %}
{% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Opportunity'%}
{% else %}
{% trans 'Add New Opportunity'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<div class="container-fluid"> <div class="container-fluid">
<div class="row g-3 mb-4 align-items-center"> <div class="row g-3 mb-4 align-items-center">

View File

@ -1,7 +1,7 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static humanize %} {% load i18n static humanize %}
{% load custom_filters %} {% load custom_filters %}
{% block title %}{{ _("Opportunities") }}{% endblock title %}
{% block content %} {% block content %}
<div class="row g-3"> <div class="row g-3">
<div class="col-12"> <div class="col-12">

View File

@ -1,8 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n static%} {% load i18n static%}
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% block title %}{% trans "Customers" %}{% endblock title %} {% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Customer'%}
{% else %}
{% trans 'Add New Customer'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<link rel="stylesheet" href="{% static 'flags/sprite.css' %}"> <link rel="stylesheet" href="{% static 'flags/sprite.css' %}">

View File

@ -1,5 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static %} {% load i18n static %}
{%block title%}{% trans 'Activity'%}{%endblock%}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="ol-auto pt-5 pb-9"> <div class="ol-auto pt-5 pb-9">

View File

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load static %} {% load i18n static %}
{%block title%} {% trans 'Car Makes'%}{%endblock%}
{% block content %} {% block content %}
<style> <style>
/* Your existing CSS styles here */ /* Your existing CSS styles here */

View File

@ -1,4 +1,7 @@
{% extends 'base.html' %} {% load i18n static custom_filters%} {% block content %} {% extends 'base.html' %}
{% load i18n static custom_filters%}
{%block title%}{%trans 'Profile'%} {%endblock%}
{% block content %}
<div class="container-fluid"> <div class="container-fluid">
<div class="row align-items-center justify-content-between g-3 mb-4"> <div class="row align-items-center justify-content-between g-3 mb-4">
<div class="col-auto"> <div class="col-auto">

View File

@ -1,7 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% block title %}{% trans "Group" %}{% endblock title %} {% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Group'%}
{% else %}
{% trans 'Add New Group'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% block title %}{% trans "Group" %}{% endblock title %} {% block title %}{% trans "Groups" %}{% endblock title %}
{% block content %} {% block content %}
<section class=""> <section class="">

View File

@ -1,4 +1,4 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static custom_filters %} {% load i18n static custom_filters %}
{% block title %}{{ _("Car Details") }}{% endblock %} {% block title %}{{ _("Car Details") }}{% endblock %}
{% block customCSS %} {% block customCSS %}
@ -14,7 +14,8 @@
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }
</style> </style>
{% endblock customCSS %} {% endblock customCSS %}
{% block content %} {% block content %}
{% if not car.ready %} {% if not car.ready %}
<div class="alert alert-outline-warning d-flex align-items-center" <div class="alert alert-outline-warning d-flex align-items-center"
@ -305,8 +306,24 @@
style="background-color: rgb({{ car.colors.interior.rgb }})"></div> style="background-color: rgb({{ car.colors.interior.rgb }})"></div>
</td> </td>
</tr> </tr>
{% else %}
<tr> <tr>
<td colspan="2">
{% comment %} {% if not car.get_transfer %}
<a href="{% url 'car_finance_update' car.finances.pk %}"
class="btn btn-phoenix-warning btn-sm mb-3">{% trans "Edit" %}</a>
{% else %}
<span class="badge bg-danger">{% trans "Cannot Edit, Car in Transfer." %}</span>
{% endif %}
{% else %}
<p>{% trans "No finance details available." %}</p>
{% if perms.inventory.add_carfinance %}
<a href="{% url 'car_finance_create' car.slug %}"
class="btn btn-phoenix-success btn-sm mb-3">{% trans "Add" %}</a>
{% endif %} {% endcomment %}
</td>
</tr>
{% comment %} <tr>
<td colspan="2">{% trans "No colors available for this car." %}</td> <td colspan="2">{% trans "No colors available for this car." %}</td>
</tr> </tr>
<tr> <tr>
@ -316,7 +333,7 @@
class="btn btn-phoenix-success btn-sm">{% trans "Add" %}</a> class="btn btn-phoenix-success btn-sm">{% trans "Add" %}</a>
{% endif %} {% endif %}
</td> </td>
</tr> </tr> {% endcomment %}
{% endif %} {% endif %}
</table> </table>
</div> </div>

View File

@ -1,5 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n static custom_filters %} {% load i18n static custom_filters %}
{%block title%} {%trans 'Add New Car'%} {%endblock%}
{% block content %} {% block content %}
<style> <style>
#video { #video {

View File

@ -1,6 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load custom_filters %} {% load custom_filters %}
{% block content %} {% block content %}
<div class="row-fluid p-2"> <div class="row-fluid p-2">
<!-- Display Validation Errors --> <!-- Display Validation Errors -->

View File

@ -1,5 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n custom_filters humanize %} {% load i18n custom_filters humanize %}
{%block title%} {%trans 'Stocks'%} {%endblock%}
{% block customCSS %} {% block customCSS %}
<style> <style>
.htmx-indicator{ .htmx-indicator{
@ -167,6 +168,7 @@
<th class="sort white-space-nowrap align-middle" scope="col">{{ _("Color") }}</th> <th class="sort white-space-nowrap align-middle" scope="col">{{ _("Color") }}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{{ _("Date Received") }}</th> <th class="sort white-space-nowrap align-middle" scope="col">{{ _("Date Received") }}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{{ _("Status") }}</th> <th class="sort white-space-nowrap align-middle" scope="col">{{ _("Status") }}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{{ _("Inventory Ready") }}</th>
<th class="sort white-space-nowrap align-middle" scope="col"></th> <th class="sort white-space-nowrap align-middle" scope="col"></th>
</tr> </tr>
</thead> </thead>
@ -216,6 +218,13 @@
<span class="badge badge-phoenix fs-11 badge-phoenix-warning">{{ _("Transfer") }}</span> <span class="badge badge-phoenix fs-11 badge-phoenix-warning">{{ _("Transfer") }}</span>
{% endif %} {% endif %}
</td> </td>
<td class="align-middle product white-space-nowrap">
{% if not car.ready %}
<span class="text-danger"> {{ _("NO") }} </span>
{%else%}
<span class="text-success"> {{ _("YES") }} </span>
{%endif%}
</td>
<td class="align-middle text-end white-space-nowrap pe-0 action"> <td class="align-middle text-end white-space-nowrap pe-0 action">
<div class="btn-reveal-trigger position-static"> <div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10" <button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10"

View File

@ -2,7 +2,7 @@
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% block title %}{{ _("Expenses") }}{% endblock title %} {% block title %}{{ _("Add New Expense") }}{% endblock title %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="row justify-content-center"> <div class="row justify-content-center">

View File

@ -2,7 +2,7 @@
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% block title %}{{ _("Expenses") }}{% endblock title %} {% block title %}{{ _("Update Expense") }}{% endblock title %}
{% block content %} {% block content %}
<div class="row"> <div class="row">
<div class="row justify-content-center"> <div class="row justify-content-center">

View File

@ -2,7 +2,16 @@
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% load static %} {% load static %}
{% load i18n %} {% load i18n %}
{% block title %}{{ _("Service") }}{% endblock title %}
{% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Service'%}
{% else %}
{% trans 'Add New Service'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">

View File

@ -1,7 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% block title %}{% trans "bank account" %}{% endblock title %} {% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Bank Account'%}
{% else %}
{% trans 'Add New Bank Account'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<div class="container"> <div class="container">

View File

@ -1,7 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% block title %}{% trans "account" %}{% endblock title %}
{% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Account'%}
{% else %}
{% trans 'Add New Account'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<div class="row my-5"> <div class="row my-5">

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% load custom_filters %} {% load custom_filters %}
{%block title%}{%trans 'Balance Sheet'%} {%endblock%}
{% block period_navigation %} {% block period_navigation %}
{% if entity %} {% if entity %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% load custom_filters %} {% load custom_filters %}
{%block title%}{%trans 'Cash Flow Statement'%} {%endblock%}
{% block period_navigation %} {% block period_navigation %}
{% if unit_model and entity %} {% if unit_model and entity %}
<div class="col-12">{% period_navigation 'unit-cf' %}</div> <div class="col-12">{% period_navigation 'unit-cf' %}</div>

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load static %} {% load static %}
{% load custom_filters %} {% load custom_filters %}
{%block title%}{%trans 'Income Statement'%} {%endblock%}
{% block period_navigation %} {% block period_navigation %}
{% if unit_model %} {% if unit_model %}
<div class="col-12">{% period_navigation 'unit-ic' %}</div> <div class="col-12">{% period_navigation 'unit-ic' %}</div>

View File

@ -1,7 +1,14 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% block title %}{% trans "Add Organization" %}{% endblock title %} {% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Organization'%}
{% else %}
{% trans 'Add New Organization'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}
<div class="container-fluid"> <div class="container-fluid">

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n crispy_forms_filters %} {% load i18n crispy_forms_filters %}
{%block title%} {% trans 'Billing Information'%}{%endblock%}
{% block content %} {% block content %}
<div class="row mb-3"> <div class="row mb-3">

View File

@ -95,9 +95,9 @@
<div class="card-body p-0"> <div class="card-body p-0">
<div class="table-responsive" style="overflow-x: auto;"> <div class="table-responsive" style="overflow-x: auto;">
<div style="min-width: 800px;"> <!-- Minimum width to ensure scrolling on smaller screens --> <div style="min-width: 800px;"> <!-- Minimum width to ensure scrolling on smaller screens -->
<table class="table table-hover mb-0"> <table class="table align-items-center table-flush table-hover">
<thead class=""> <thead class="">
<tr> <tr class="bg-body-highlight">
<th class="text-center sticky-col" style="width: 5%; z-index: 1;">#</th> <th class="text-center sticky-col" style="width: 5%; z-index: 1;">#</th>
<th style="width: 25%; min-width: 200px;">{{ _("Description") }}</th> <th style="width: 25%; min-width: 200px;">{{ _("Description") }}</th>
<th class="text-end" style="width: 10%; min-width: 100px;">{{ _("Unit Price")}}</th> <th class="text-end" style="width: 10%; min-width: 100px;">{{ _("Unit Price")}}</th>
@ -109,7 +109,7 @@
<th class="text-end" style="width: 10%; min-width: 100px;">{{ _("Subtotal") }}</th> <th class="text-end" style="width: 10%; min-width: 100px;">{{ _("Subtotal") }}</th>
<th class="text-center" style="width: 8%; min-width: 80px;">{{ _("VAT") }}</th> <th class="text-center" style="width: 8%; min-width: 80px;">{{ _("VAT") }}</th>
<th class="text-end" style="width: 10%; min-width: 100px;">{{ _("VAT Amount")}}</th> <th class="text-end" style="width: 10%; min-width: 100px;">{{ _("VAT Amount")}}</th>
<th class="text-end" style="width: 10%; min-width: 100px;">{{ _("Total") }}</th> <th class="text-center" style="width: 10%; min-width: 100px;">{{ _("Total") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -125,7 +125,7 @@
<td class="text-end">{{ invoice.total_net|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td> <td class="text-end">{{ invoice.total_net|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td>
<td class="text-center">{% if invoice.tax != None %}{{ invoice.tax|floatformat }}%{% else %}n/a{% endif %}</td> <td class="text-center">{% if invoice.tax != None %}{{ invoice.tax|floatformat }}%{% else %}n/a{% endif %}</td>
<td class="text-end">{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span>{% else %}{{ _("n/a")}}{% endif %}</td> <td class="text-end">{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span>{% else %}{{ _("n/a")}}{% endif %}</td>
<td class="text-end fw-bold">{{ invoice.total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td> <td class="text-center fw-bold">{{ invoice.total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td>
</tr> </tr>
</tbody> </tbody>
<tfoot class=""> <tfoot class="">
@ -134,7 +134,7 @@
<td class="text-end fw-bold">{{ invoice.total_net|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td> <td class="text-end fw-bold">{{ invoice.total_net|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td>
<td class="text-center fw-bold">{% if invoice.tax != None %}{{ invoice.tax|floatformat }}%{% else %}{{ _("n/a")}}{% endif %}</td> <td class="text-center fw-bold">{% if invoice.tax != None %}{{ invoice.tax|floatformat }}%{% else %}{{ _("n/a")}}{% endif %}</td>
<td class="text-end fw-bold">{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span>{% else %}{{ _("n/a")}}{% endif %}</td> <td class="text-end fw-bold">{% if invoice.tax_total != None %}{{ invoice.tax_total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span>{% else %}{{ _("n/a")}}{% endif %}</td>
<td class="text-end fw-bold text-primary">{{ invoice.total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td> <td class="text-center fw-bold text-primary">{{ invoice.total|floatformat:2 }} <span class="currency">{{ CURRENCY }}</span></td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View File

@ -1,6 +1,6 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{%block title%}{%trans 'Order Details'%} {%endblock%}
{% block head %} {% block head %}
<script> <script>
@ -15,7 +15,7 @@
{% block body %} {% block body %}
<h1>{% blocktrans with object.id as order_id and object.get_status_display as order_status %}Order #{{ order_id }} <h1 class="mt-4">{% blocktrans with object.id as order_id and object.get_status_display as order_status %}Order #{{ order_id }}
(status: {{ order_status }}){% endblocktrans %}</h1> (status: {{ order_status }}){% endblocktrans %}</h1>
{# You should provide displaying django messages in this template #} {# You should provide displaying django messages in this template #}
@ -25,7 +25,7 @@
{% endwith %} {% endwith %}
{% if object.get_all_invoices.count %} {% if object.get_all_invoices.count %}
<h2>{% trans "Printable documents" %}</h2> <h2 class="mt-3">{% trans "Printable documents" %}</h2>
<ul id="order_printable_documents"> <ul id="order_printable_documents">
{% for invoice in object.get_all_invoices %} {% for invoice in object.get_all_invoices %}
<li><a href="{{ invoice.get_absolute_url }}" <li><a href="{{ invoice.get_absolute_url }}"
@ -37,10 +37,10 @@
<h2>{% trans "Payment" %}</h2> <h2 class="mt-3">{% trans "Payment" %}</h2>
{% if object.completed %} {% if object.completed %}
<p class="alert alert-phoenix-success"> <p class="alert alert-phoenix-success mt-2">
{% blocktrans with object.completed as completed %} {% blocktrans with object.completed as completed %}
Payment completed on: {{ completed }} Payment completed on: {{ completed }}
{% endblocktrans %} {% endblocktrans %}
@ -50,7 +50,7 @@
{% if object.is_ready_for_payment %} {% if object.is_ready_for_payment %}
{% block payment_method %} {% block payment_method %}
<p> <p class="mt-2">
Here should go bindings to your payment. We recommend using <a Here should go bindings to your payment. We recommend using <a
href="https://github.com/cypreess/django-getpaid">django-getpaid</a> for payment processing. href="https://github.com/cypreess/django-getpaid">django-getpaid</a> for payment processing.
Use a fake payment below to simulate paying for an order: Use a fake payment below to simulate paying for an order:
@ -72,7 +72,7 @@
{% endblock %} {% endblock %}
{% else %} {% else %}
<p class="alert alert-phoenix-warning"> <p class="alert alert-phoenix-warning mt-2">
{% blocktrans %} {% blocktrans %}
This order is expired. It will accept an incoming payment made earlier, but new payment cannot be This order is expired. It will accept an incoming payment made earlier, but new payment cannot be
initialized. Please make a new order if necessary. initialized. Please make a new order if necessary.

View File

@ -1,32 +1,32 @@
{% load i18n %} {% load i18n %}
{% block table %} {% block table %}
<div class="table-responsive px-1 scrollbar"> <div class="table-responsive px-1 scrollbar mt-3">
<table class="table fs-9 mb-0 border-top border-translucent"> <table class="table align-items-center table-flush table-hover">
<thead> <thead>
<tr> <tr class="bg-body-highlight">
<th>{% trans "Name" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Name" %}</th>
<th>{% trans "Net price" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Net price" %}</th>
<th>{% trans "VAT" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "VAT" %}</th>
<th>{% trans "VAT total" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "VAT total" %}</th>
<th>{% trans "Total" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Total" %}</th>
<th>{% trans "Order completed" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Order completed" %}</th>
{% if order.user %} {% if order.user %}
<th>{% trans "Plan valid from" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Plan valid from" %}</th>
<th>{% trans "Plan valid until" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Plan valid until" %}</th>
{% endif %} {% endif %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>{{ order.name }}</td> <td class="align-middle product white-space-nowrap">{{ order.name }}</td>
<td>{{ order.amount }} {{ order.currency }}</td> <td class="align-middle product white-space-nowrap">{{ order.amount }} {{ order.currency }}</td>
<td>{% if order.tax == None %}n/a{% else %}{{ order.tax }} %{% endif %}</td> <td class="align-middle product white-space-nowrap">{% if order.tax == None %}n/a{% else %}{{ order.tax }} %{% endif %}</td>
<td>{% if order.tax_total == None %}n/a{% else %}{{ order.tax_total }} {{ order.currency }}{% endif %}</td> <td class="align-middle product white-space-nowrap">{% if order.tax_total == None %}n/a{% else %}{{ order.tax_total }} {{ order.currency }}{% endif %}</td>
<td class="number total">{{ order.total }} {{ order.currency }}</td> <td class="number total align-middle product white-space-nowrap">{{ order.total }} {{ order.currency }}</td>
<td class="date">{{ order.completed|date|default:"-" }}</td> <td class="date align-middle product white-space-nowrap">{{ order.completed|date|default:"-" }}</td>
<td class="date">{{ order.get_plan_extended_from|date|default:"-" }}</td> <td class="date align-middle product white-space-nowrap">{{ order.get_plan_extended_from|date|default:"-" }}</td>
<td class="date">{{ order.get_plan_extended_until|date|default:"-" }}</td> <td class="date align-middle product white-space-nowrap">{{ order.get_plan_extended_until|date|default:"-" }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -1,6 +1,6 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{%block title%}{%trans 'Plans Orders'%} {%endblock%}
{% block body %} {% block body %}
{% block order_header %} {% block order_header %}

View File

@ -1,6 +1,7 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n static %} {% load i18n static %}
{% load custom_filters %} {% load custom_filters %}
{%block title%} {% trans 'Upgrade Plan' %} {%endblock%}
{% block customCSS %} {% block customCSS %}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" integrity="sha512-X..." crossorigin="anonymous" referrerpolicy="no-referrer" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" integrity="sha512-X..." crossorigin="anonymous" referrerpolicy="no-referrer" />

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load tenhal_tag %} {% load tenhal_tag %}
{% block title %}{{ _("View Estimate") }}{% endblock title %} {% block title %}{{ _("View Invoice") }}{% endblock title %}
{% block customCSS %} {% block customCSS %}
<style> <style>
.disabled{ .disabled{

View File

@ -1,6 +1,7 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load custom_filters %} {% load custom_filters %}
{%block title%} {%trans 'Sales'%} {%endblock%}
{% block customCSS %} {% block customCSS %}
<style> <style>

View File

@ -1,7 +1,14 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% block title %}{% trans "Staff" %}{% endblock title %} {% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Staff'%}
{% else %}
{% trans 'Add New Staff'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}

View File

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% load render_table from django_tables2 %} {% load render_table from django_tables2 %}
{% block title %}{% trans "Staff" %}{% endblock title %} {% block title %}{% trans "Staffs" %}{% endblock title %}
{% block content %} {% block content %}
<section class=""> <section class="">

View File

@ -1,7 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% load i18n %} {% load i18n %}
{% load crispy_forms_filters %} {% load crispy_forms_filters %}
{% block title %}{% trans "Vendors" %}{% endblock title %} {% block title %}
{# Check if an 'object' exists in the context #}
{% if object %}
{% trans 'Update Vendor'%}
{% else %}
{% trans 'Add New Vendor'%}
{% endif %}
{% endblock %}
{% block content %} {% block content %}