vendor ui

This commit is contained in:
Faheedkhan 2025-05-21 16:32:58 +03:00
parent 41feca462d
commit fe66ce1ca1
6 changed files with 318 additions and 231 deletions

View File

@ -4,48 +4,68 @@
{% block title %}{{ _("Expenses") }}{% endblock title %} {% block title %}{{ _("Expenses") }}{% endblock title %}
{% block content %} {% block content %}
<div class="row mt-4 mx-4">
<div class="d-flex justify-content-between mb-2 p-6"> <div class="row mt-4">
<span></span>
<h3 class="text-center">{% trans "Expenses" %}</h3> <div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Expenses" %}</h3>
<a href="{% url 'item_expense_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans "Add Expense" %}</a> <a href="{% url 'item_expense_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans "Add Expense" %}</a>
</div> </div>
<div class="mx-n4 px-4 mx-lg-n6 px-lg-6 pt-7 border-y">
<div class="table-responsive mx-n1 px-1 scrollbar"> {% if page_obj.object_list %}
<table class="table fs-9 mb-0 border-top border-translucent"> <div class="table-responsive px-1 scrollbar mt-3">
<thead> <table class="table align-items-center table-flush">
<tr> <thead>
<tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Item Number" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Item Number" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Name" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Name" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Unit of Measure" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Unit of Measure" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th>
</tr> </tr>
</thead> </thead>
<tbody class="list">
{% for expense in expenses %} <tbody class="list">
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap py-0">{{ expense.item_number }}</td> {% for expense in expenses %}
<td class="align-middle product white-space-nowrap">{{ expense.name }}</td>
<td class="align-middle product white-space-nowrap">{{ expense.uom }}</td> <tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class=""> <td class="align-middle product white-space-nowrap">
<a href="{% url 'item_expense_update' expense.pk %}" {{ expense.item_number }}
</td>
<td class="align-middle product white-space-nowrap">
{{ expense.name }}
</td>
<td class="align-middle product white-space-nowrap">
{{ expense.uom }}
</td>
<td class="align-middle product white-space-nowrap">
<a href="{% url 'item_expense_update' expense.pk %}"
class="btn btn-sm btn-phoenix-success"> class="btn btn-sm btn-phoenix-success">
{% trans "Update" %} {% trans "Update" %}
</a> </a>
</td> </td>
</tr> <td class="align-middle product white-space-nowrap">
</td>
<td class="align-middle white-space-nowrap text-start">
</td>
</tr>
{% empty %} {% empty %}
<tr> <tr>
<td colspan="6" class="text-center">{% trans "No Invoice Found" %}</td> <td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div>
<div class="d-flex justify-content-center">
</div>
</div> </div>
<div class="d-flex justify-content-center">
</div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -4,19 +4,19 @@
{% block title %}{{ _("Expenses") }}{% endblock title %} {% block title %}{{ _("Expenses") }}{% endblock title %}
{% block content %} {% block content %}
<div class="row">
<div class="d-flex justify-content-between">
<h3 class="mb-2">{% trans "Services" %}</h3> <div class="row mt-4">
<a href="{% url 'item_service_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans "Add Service" %}</a>
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Services" %}</h3>
<a href="{% url 'item_service_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans "Add Service" %}</a>
</div> </div>
{% if page_obj.object_list %}
<div class="table-responsive scrollbar transition"> <div class="table-responsive px-1 scrollbar mt-3">
<table class="table table-sm fs-9 mb-0 border-translucent"> <table class="table align-items-center table-flush">
<thead> <thead>
<tr> <tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Item Number" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Item Number" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Name" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Name" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Unit of Measure" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Unit of Measure" %}</th>
@ -25,30 +25,43 @@
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th>
</tr> </tr>
</thead> </thead>
<tbody class="list"> <tbody class="list">
{% for service in services %} {% for service in services %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static"> <tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap py-0">{{ service.pk }}</td>
<td class="align-middle product white-space-nowrap">{{ service.get_local_name }}</td>
<td class="align-middle product white-space-nowrap">{{ service.uom }}</td>
<td class="align-middle product white-space-nowrap"> <td class="align-middle product white-space-nowrap">
{% if service.taxable %} {{ service.pk }}
Yes
{% else %}
No
{% endif %}
</td> </td>
<td class="align-middle product white-space-nowrap">{{ service.item.co }}</td> <td class="align-middle product white-space-nowrap">
<td class="text-center"> {{ service.get_local_name }}
<a href="{% url 'item_service_update' service.pk %}" </td>
<td class="align-middle product white-space-nowrap">
{{ service.uom }}
</td>
<td class="align-middle product white-space-nowrap">
{% if service.taxable %}
Yes
{% else %}
No
{% endif %}
</td>
<td class="align-middle product white-space-nowrap">
{{ service.item.co }}
</td>
<td class="align-middle white-space-nowrap text-start">
<a href="{% url 'item_service_update' service.pk %}"
class="btn btn-sm btn-phoenix-success"> class="btn btn-sm btn-phoenix-success">
{% trans "Update" %} {% trans "Update" %}
</a> </a>
</td> </td>
</tr> </tr>
{% empty %}
{% empty %}
<tr> <tr>
<td colspan="6" class="text-center">{% trans "No Invoice Found" %}</td> <td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -56,5 +69,9 @@
</div> </div>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
</div> </div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -5,52 +5,82 @@
{% block content %} {% block content %}
<div class="row mt-4"> <div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Bank Accounts" %}</h3> <div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Bank Accounts" %}</h3>
<a href="{% url 'bank_account_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans "Add Bank Account" %}</a> <a href="{% url 'bank_account_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans "Add Bank Account" %}</a>
</div> </div>
<div class="col-12">
<form method="get" class=" mb-4">
<div class="input-group input-group-sm">
<button class="btn btn-sm btn-secondary rounded-start" type="submit">
{% trans "search" %}
</button>
<input type="text"
name="q"
class="form-control form-control-sm rounded-end"
value="{{ request.GET.q }}"
placeholder="{% trans 'Search bank accounts...' %}" />
{% if request.GET.q %}
<a href="{% url request.resolver_match.view_name %}"
class="btn btn-sm btn-outline-danger ms-1 rounded">
<i class="bi bi-x-lg"></i>
</a>
{% endif %}
</div>
</form>
</div>
{% if page_obj.object_list %}
<div class="table-responsive px-1 scrollbar mt-3"> <div class="table-responsive px-1 scrollbar mt-3">
<table class="table align-items-center table-flush"> <table class="table align-items-center table-flush">
<thead> <thead>
<tr class="bg-body-highlight"> <tr class="bg-body-highlight">
<th class="border-top border-translucent ps-3">{% trans "Name" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Name" %}</th>
<th class="border-top border-translucent ps-3">{% trans "Account Number" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Account Number" %}</th>
<th class="border-top border-translucent text-end pe-3">{% trans "Type" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Type" %}</th>
<th class="border-top border-translucent text-end pe-3" scope="col">{% trans "Action" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th>
</tr> </tr>
</thead> </thead>
<tbody class="list"> <tbody class="list">
{% for bank in bank_accounts %} {% for bank in bank_accounts %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static"> <tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle ps-3">{{ bank.name }}</td> <td class="align-middle product white-space-nowrap">
<td class="align-middle ps-3">{{ bank.account_number }}</td> {{ bank.name }}
<td class="align-middle product text-end pe-3 ">{{ bank.account_type|capfirst }}</td> </td>
<td class="align-middle product text-end pe-3 "> <td class="align-middle product white-space-nowrap">
<a href="{% url 'bank_account_update' bank.pk %}" {{ bank.account_number }}
</td>
<td class="align-middle product white-space-nowrap">
{{ bank.account_type|capfirst }}
</td>
<td class="align-middle product white-space-nowrap">
<a href="{% url 'bank_account_update' bank.pk %}"
class="btn btn-sm btn-phoenix-success"> class="btn btn-sm btn-phoenix-success">
{% trans "Update" %} {% trans "Update" %}
</a> </a>
</td> </td>
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>
<td colspan="6" class="text-center">{% trans "No Bank Accounts Found" %}</td> <td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
</div> </div>
{% endif %}
</div> </div>
{% endblock %} {% endblock %}

View File

@ -8,16 +8,12 @@
</a> </a>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<!--test-->
<!-- Search Bar -->
<div class="row mt-4"> <div class="row mt-4">
<div class="d-grid gap-2 d-md-flex justify-content-md-end"> <div class="d-flex justify-content-between mb-2">
<a href="{% url 'account_create' %}" class="btn btn-md btn-phoenix-primary"> <h3 class=""><i class="fa-solid fa-book"></i> {% trans "Accounts" %}</h3>
<i class="fa fa-plus me-2"></i> <a href="{% url 'account_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'New Account' %}</a>
{% trans 'New Account' %}</a>
</div> </div>
<h3 class="mb-3">
<i class="fa-solid fa-book"></i> {% trans "Accounts" %}</h3>
<div class="col-12"> <div class="col-12">
<form method="get" class=" mb-4"> <form method="get" class=" mb-4">
<div class="input-group input-group-sm"> <div class="input-group input-group-sm">
@ -38,25 +34,24 @@
</div> </div>
</form> </form>
</div> </div>
</div>
{% if page_obj.object_list %}
{% if page_obj.object_list %}
<div class="table-responsive px-1 scrollbar mt-3"> <div class="table-responsive px-1 scrollbar mt-3">
<table class="table align-items-center table-flush"> <table class="table align-items-center table-flush">
<thead> <thead>
<tr class="bg-body-highlight"> <tr class="bg-body-highlight">
<th class="border-top border-translucent">{% trans "Type" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Type" %}</th>
<th class="border-top border-translucent ps-3">{% trans "Account Name" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Account Name" %}</th>
<th class="border-top border-translucent">{% trans "Code" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Code" %}</th>
<th class="border-top border-translucent text-end pe-3">{% trans "Balance Type" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Balance Type" %}</th>
<th class="border-top border-translucent text-end pe-3">{% trans "Active" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Active" %}</th>
<th class="border-top border-translucent text-end align-middle pe-0 ps-4" scope="col"></th> <th class="sort white-space-nowrap align-middle" scope="col"></th>
</tr> </tr>
</thead> </thead>
<tbody class="list"> <tbody class="list">
{% for account in accounts %} {% for account in accounts %}
<div class="modal fade" id="deleteModal" <div class="modal fade" id="deleteModal"
data-bs-backdrop="static" data-bs-backdrop="static"
@ -91,11 +86,18 @@
</div> </div>
</div> </div>
</div> </div>
<tr>
<td class="align-middle ps-3 fw-lighter">{{ account.role_bs|upper }}</td> <tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle ps-3">{{ account.name }}</td> <td class="align-middle product white-space-nowrap">
<td class="align-middle">{{ account.code }}</td> {{ account.role_bs|upper }}
<td class="align-middle text-end py-3 pe-3"> </td>
<td class="align-middle product white-space-nowrap">
{{ account.name }}
</td>
<td class="align-middle product white-space-nowrap">
{{ account.code }}
</td>
<td class="align-middle product white-space-nowrap">
{% if account.balance_type == 'debit' %} {% if account.balance_type == 'debit' %}
<div class="badge badge-phoenix fs-10 badge-phoenix-success"><span class="fw-bold"><i class="fa-solid fa-circle-up"></i> {{ _("Debit") }}</span></div> <div class="badge badge-phoenix fs-10 badge-phoenix-success"><span class="fw-bold"><i class="fa-solid fa-circle-up"></i> {{ _("Debit") }}</span></div>
@ -103,14 +105,14 @@
<div class="badge badge-phoenix fs-10 badge-phoenix-danger"><span class="fw-bold"><i class="fa-solid fa-circle-down"></i> {{ _("Credit") }}</span></div> <div class="badge badge-phoenix fs-10 badge-phoenix-danger"><span class="fw-bold"><i class="fa-solid fa-circle-down"></i> {{ _("Credit") }}</span></div>
{% endif %} {% endif %}
</td> </td>
<td class="align-middle text-end py-3 pe-3"> <td class="align-middle product white-space-nowrap">
{% if account.active %} {% if account.active %}
<span class="fw-bold text-success fas fa-check-circle"></span> <span class="fw-bold text-success fas fa-check-circle"></span>
{% else %} {% else %}
<span class="fw-bold text-danger far fa-times-circle"></span> <span class="fw-bold text-danger far fa-times-circle"></span>
{% endif %} {% endif %}
</td> </td>
<td> <td class="align-middle white-space-nowrap text-start">
<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" type="button" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h fs-10"></span></button> <button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10" type="button" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h fs-10"></span></button>
<div class="dropdown-menu dropdown-menu-end py-2"><a href="{% url 'account_detail' account.uuid %}" class="dropdown-item text-success-dark"> <div class="dropdown-menu dropdown-menu-end py-2"><a href="{% url 'account_detail' account.uuid %}" class="dropdown-item text-success-dark">
@ -121,18 +123,14 @@
</div> </div>
</td> </td>
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>
<td colspan="5" class="text-center text-muted"> <td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
{% trans "No account found." %}
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="d-flex justify-content-between mt-3"><span class="d-none d-sm-inline-block" data-list-info="data-list-info">{{ page_obj.start_index }} {{ _("to") }} {{ page_obj.end_index }}<span class="text-body-tertiary"> {{ _("Items of")}} </span>{{ page_obj.paginator.count }}</span> <div class="d-flex justify-content-between mt-3"><span class="d-none d-sm-inline-block" data-list-info="data-list-info">{{ page_obj.start_index }} {{ _("to") }} {{ page_obj.end_index }}<span class="text-body-tertiary"> {{ _("Items of")}} </span>{{ page_obj.paginator.count }}</span>
<div class="d-flex"> <div class="d-flex">
@ -142,7 +140,9 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
</div>
<!--test-->
{% endblock %} {% endblock %}

View File

@ -4,18 +4,19 @@
{% block title %}{{ _("Ledger") }}{% endblock title %} {% block title %}{{ _("Ledger") }}{% endblock title %}
{% block content %} {% block content %}
<div class="row mt-4"> <div class="row mt-4">
<div class="d-flex justify-content-between mb-2"> <div class="d-flex justify-content-between mb-2">
<h3 class="">{% trans "Ledger" %}</h3> <h3 class="">{% trans "Ledger" %}</h3>
</div> <a href="{% url 'ledger_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{% trans 'Create Ledger' %}</a>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<a href="{% url 'ledger_create' %}" class="btn btn-md btn-phoenix-primary">
<i class="fa fa-plus me-2"></i>
{% trans 'Create Ledger' %}</a>
</div> </div>
<div class="table-responsive px-1 scrollbar mt-3"> <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">
<thead> <thead>
<tr class="bg-body-highlight"> <tr class="bg-body-highlight">
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Ledger Name" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Ledger Name" %}</th>
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Journal Entries" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Journal Entries" %}</th>
@ -25,11 +26,13 @@
<th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th> <th class="sort white-space-nowrap align-middle" scope="col">{% trans "Action" %}</th>
</tr> </tr>
</thead> </thead>
<tbody class="list"> <tbody class="list">
{% for ledger in ledgers %} {% for ledger in ledgers %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static"> <tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap"> <td class="align-middle product white-space-nowrap">
{% if ledger.invoicemodel %} {% if ledger.invoicemodel %}
<a href="{% url 'invoice_detail' ledger.invoicemodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a> <a href="{% url 'invoice_detail' ledger.invoicemodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
{% elif ledger.billmodel %} {% elif ledger.billmodel %}
<a href="{% url 'bill_detail' ledger.billmodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a> <a href="{% url 'bill_detail' ledger.billmodel.pk %}">{{ ledger.get_wrapped_model_instance }}</a>
@ -38,7 +41,7 @@
{% endif %} {% endif %}
</td> </td>
<td class="align-middle product white-space-nowrap"> <td class="align-middle product white-space-nowrap">
<a class="btn btn-sm btn-primary" <a class="btn btn-sm btn-primary"
href="{% url 'journalentry_list' ledger.pk %}"> href="{% url 'journalentry_list' ledger.pk %}">
<i class="fa-solid fa-right-left"></i> <i class="fa-solid fa-right-left"></i>
<span> <span>
@ -48,17 +51,17 @@
</a> </a>
</td> </td>
<td class="align-middle product white-space-nowrap"> <td class="align-middle product white-space-nowrap">
{{ ledger.created |date }} {{ ledger.created |date }}
</td> </td>
<td class="align-middle product white-space-nowrap"> <td class="align-middle product white-space-nowrap">
{% if ledger.is_posted %} {% if ledger.is_posted %}
<i class="fa-solid fa-square-check text-success"></i> <i class="fa-solid fa-square-check text-success"></i>
{% else %} {% else %}
<i class="fa-solid fa-circle-xmark text-danger"></i> <i class="fa-solid fa-circle-xmark text-danger"></i>
{% endif %} {% endif %}
</td> </td>
<td class="align-middle product white-space-nowrap"> <td class="align-middle product white-space-nowrap">
{% if ledger.is_locked %} {% if ledger.is_locked %}
<i class="fa-solid fa-lock text-success"></i> <i class="fa-solid fa-lock text-success"></i>
{% else %} {% else %}
<i class="fa-solid fa-unlock text-danger"></i> <i class="fa-solid fa-unlock text-danger"></i>
@ -113,7 +116,7 @@
</tr> </tr>
{% empty %} {% empty %}
<tr> <tr>
<td colspan="6" class="text-center">{% trans "No Bank Accounts Found" %}</td> <td colspan="6" class="text-center">{% trans "No Entries found" %}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
@ -122,5 +125,8 @@
<div class="d-flex justify-content-center"> <div class="d-flex justify-content-center">
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View File

@ -5,125 +5,139 @@
{% block vendors %}<a class="nav-link active">{{ _("Vendors")|capfirst }}</a>{% endblock %} {% block vendors %}<a class="nav-link active">{{ _("Vendors")|capfirst }}</a>{% endblock %}
{% block content %} {% block content %}
<section class="pt-5 pb-9">
<div class="row">
<h2 class="mb-4">{{ _("Vendors")|capfirst }}</h2> <div class="row mt-4">
<div class="d-flex justify-content-between mb-2">
<div class="row g-3 justify-content-between mb-4"> <h3 class="">{{ _("Vendors")|capfirst }}</h2>
<div class="col-auto"> <a href="{% url 'vendor_create' %}" class="btn btn-md btn-phoenix-primary"><i class="fa fa-plus me-2"></i>{{ _("Add Vendor") }}</a>
<div class="d-md-flex justify-content-between">
<div>
<a href="{% url 'vendor_create' %}" class="btn btn-md btn-phoenix-primary"><span class="fas fa-plus me-2"></span>{{ _("Add Vendor") }}</a>
</div>
</div>
</div> </div>
<div class="col-auto">
<div class="d-flex">
<div class="search-box me-2">
<form method="get" class="d-inline-block position-relative">
<input name="q" class="form-control search-input search" type="search" placeholder="{{ _('Enter vendor name') }}" aria-label="Search" value="{{ request.GET.q }}"/>
<span class="fas fa-search search-box-icon"></span>
{% if request.GET.q %}
<a href="{% url request.resolver_match.view_name %}" class="btn btn-outline-danger ms-1">
<i class="bi bi-x-lg"></i>
</a>
{% endif %}
</form>
</div>
</div> <div class="col-12">
<form method="get" class=" mb-4">
<div class="input-group input-group-sm">
<button class="btn btn-sm btn-secondary rounded-start" type="submit">
{% trans "search" %}
</button>
<input type="text"
name="q"
class="form-control form-control-sm rounded-end"
value="{{ request.GET.q }}"
placeholder="{{ _('Enter vendor name') }}" />
{% if request.GET.q %}
<a href="{% url request.resolver_match.view_name %}"
class="btn btn-sm btn-outline-danger ms-1 rounded">
<i class="bi bi-x-lg"></i>
</a>
{% endif %}
</div>
</form>
</div> </div>
</div>
<div class="table-responsive scrollbar mx-n1 px-1">
<table class="table table-hover fs-9 mb-0">
<thead>
<tr>
<th class="sort white-space-nowrap align-middle text-uppercase ps-0" scope="col" data-sort="name" style="width:25%;">{{ _("Name")|capfirst }}</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase border-end border-translucent" scope="col" data-sort="email" style="width:15%;">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-success-subtle rounded me-2"><span class="text-success-dark" data-feather="mail"></span></div><span>{{ _("email")|capfirst }}</span>
</div>
</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase border-end border-translucent" scope="col" data-sort="phone" style="width:15%; min-width: 180px;">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-primary-subtle rounded me-2"><span class="text-primary-dark" data-feather="phone"></span></div><span>{{ _("Phone") }}</span>
</div>
</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase border-end border-translucent" scope="col" data-sort="contact" style="width:15%;">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-info-subtle rounded me-2"><span class="text-info-dark" data-feather="user"></span></div><span>{{ _("Contact name")|capfirst }}</span>
</div>
</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase border-end border-translucent" scope="col" data-sort="company" style="width:15%;">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-warning-subtle rounded me-2"><span class="text-warning-dark" data-feather="grid"></span></div><span>{{ _("Address")|capfirst }}</span>
</div>
</th>
<th class="sort align-middle ps-4 pe-5 text-uppercase" scope="col" data-sort="date" style="width:15%;">
{{ _("Create date") }}</th>
<th class="sort text-end align-middle pe-0 ps-4" scope="col"></th>
</tr>
</thead>
<tbody class="list" id="leal-tables-body">
{% for vendor in vendors %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="name align-middle white-space-nowrap ps-0"> {% if page_obj.object_list %}
<div class="d-flex align-items-center"> <div class="table-responsive px-1 scrollbar mt-3">
{% if vendor.logo %} <table class= "table align-items-center table-flush table-hover">
<div class="avatar avatar-xl me-3"><img class="rounded-circle" src="{{ vendor.logo.url }}" alt="" /> <thead>
{% else %}
<div class="avatar avatar-xl me-3"><img class="rounded-circle" src="{% static 'images/icons/picture.svg' %}" alt="" /> <tr class="bg-body-highlight">
{% endif %} <th class="sort white-space-nowrap align-middle" scope="col" data-sort="name" style="width:25%;">{{ _("Name")|capfirst }}</th>
<th class="sort white-space-nowrap align-middle" scope="col" data-sort="email" style="width:15%;">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-success-subtle rounded me-2"><span class="text-success-dark" data-feather="mail"></span></div><span>{{ _("email")|capfirst }}</span>
</div>
</th>
<th class="sort white-space-nowrap align-middle" scope="col" data-sort="phone" style="width:15%; min-width: 180px;">
<div class="d-inline-flex flex-center">
<div class="d-flex align-items-center px-1 py-1 bg-primary-subtle rounded me-2"><span class="text-primary-dark" data-feather="phone"></span></div><span>{{ _("Phone") }}</span>
</div> </div>
<div><a class="fs-8 fw-bold" href="{% url 'vendor_detail' vendor.slug %}">{{ vendor.arabic_name }}</a> </th>
<div class="d-flex align-items-center"> <th class="sort white-space-nowrap align-middle" scope="col" data-sort="contact" style="width:15%;">
<p class="mb-0 text-body-highlight fw-semibold fs-9 me-2">{{ vendor.name}}</p><!--<span class="badge badge-phoenix badge-phoenix-primary">{{ vendor.vendor_model.uuid }}</span>--> <div class="d-inline-flex flex-center">
</div> <div class="d-flex align-items-center px-1 py-1 bg-info-subtle rounded me-2"><span class="text-info-dark" data-feather="user"></span></div><span>{{ _("Contact name")|capfirst }}</span>
</div> </div>
</div> </th>
</td> <th class="sort white-space-nowrap align-middle" scope="col" data-sort="company" style="width:15%;">
<td class="email align-middle white-space-nowrap fw-semibold ps-4 border-end border-translucent"><a class="text-body-highlight" href="">{{ vendor.email }}</a></td> <div class="d-inline-flex flex-center">
<td class="phone align-middle white-space-nowrap fw-semibold ps-4 border-end border-translucent"><a class="text-body-highlight" href="tel:{{ vendor.phone }}">{{ vendor.phone_number }}</a></td> <div class="d-flex align-items-center px-1 py-1 bg-warning-subtle rounded me-2"><span class="text-warning-dark" data-feather="grid"></span></div><span>{{ _("Address")|capfirst }}</span>
<td class="contact align-middle white-space-nowrap ps-4 border-end border-translucent fw-semibold text-body-highlight">{{ vendor.contact_person }}</td> </div>
<td class="company align-middle white-space-nowrap text-body-tertiary text-opacity-85 ps-4 border-end border-translucent fw-semibold text-body-highlight"> </th>
{{ vendor.address }}</td> <th class="sort white-space-nowrap align-middle" scope="col" data-sort="date" style="width:15%;">{{ _("Create date") }}</th>
<td class="date align-middle white-space-nowrap text-body-tertiary text-opacity-85 ps-4 text-body-tertiary">{{ vendor.created_at|date }}</td> <th class="sort white-space-nowrap align-middle" scope="col"></th>
<td class="align-middle white-space-nowrap text-end pe-0 ps-4">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10" type="button" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h fs-10"></span></button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'vendor_update' vendor.slug %}" class="dropdown-item text-success-dark">
{% trans "Edit" %}
</a>
<div class="dropdown-divider"></div>
<button class="delete-btn dropdown-item text-danger"
data-url="{% url 'vendor_delete' vendor.slug %}"
data-message="{{ _("Are you sure you want to delete this vendor")}}?"
data-bs-toggle="modal" data-bs-target="#deleteModal">
{{ _("Delete") }}
</button>
</div>
</div>
</td>
</tr> </tr>
{% endfor %} </thead>
</tbody> <tbody class="list">
{% for vendor in vendors %}
<tr class="hover-actions-trigger btn-reveal-trigger position-static">
<td class="align-middle product white-space-nowrap">
<div class="d-flex align-items-center">
{% if vendor.logo %}
<div class="avatar avatar-xl me-3"><img class="rounded-circle" src="{{ vendor.logo.url }}" alt="" />
{% else %}
<div class="avatar avatar-xl me-3"><img class="rounded-circle" src="{% static 'images/icons/picture.svg' %}" alt="" />
{% endif %}
</div>
<div><a class="fs-8 fw-bold" href="{% url 'vendor_detail' vendor.slug %}">{{ vendor.arabic_name }}</a>
<div class="d-flex align-items-center">
<p class="mb-0 text-body-highlight fw-semibold fs-9 me-2">{{ vendor.name}}</p><!--<span class="badge badge-phoenix badge-phoenix-primary">{{ vendor.vendor_model.uuid }}</span>-->
</div>
</div>
</div>
</td>
<td class="align-middle product white-space-nowrap">
<a class="text-body-highlight" href="">{{ vendor.email }}</a>
</td>
<td class="align-middle product white-space-nowrap">
<a class="text-body-highlight" href="tel:{{ vendor.phone }}">{{ vendor.phone_number }}</a>
</td>
<td class="align-middle product white-space-nowrap">
{{ vendor.contact_person }}
</td>
<td class="align-middle product white-space-nowrap">
{{ vendor.address }}
</td>
<td class="align-middle product white-space-nowrap">
{{ vendor.created_at|date }}
</td>
<td class="align-middle product white-space-nowrap">
<div class="btn-reveal-trigger position-static">
<button class="btn btn-sm dropdown-toggle dropdown-caret-none transition-none btn-reveal fs-10" type="button" data-bs-toggle="dropdown" data-boundary="window" aria-haspopup="true" aria-expanded="false" data-bs-reference="parent"><span class="fas fa-ellipsis-h fs-10"></span></button>
<div class="dropdown-menu dropdown-menu-end py-2">
<a href="{% url 'vendor_update' vendor.slug %}" class="dropdown-item text-success-dark">
{% trans "Edit" %}
</a>
<div class="dropdown-divider"></div>
<button class="delete-btn dropdown-item text-danger"
data-url="{% url 'vendor_delete' vendor.slug %}"
data-message="{{ _("Are you sure you want to delete this vendor")}}?"
data-bs-toggle="modal" data-bs-target="#deleteModal">
{{ _("Delete") }}
</button>
</div>
</div>
</td>
</tr>
{% empty %}
<tr>
<td colspan="6" class="text-center text-muted">{% trans "No Accounts Found" %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<div class="row align-items-center justify-content-end py-4 pe-0 fs-9">
<!-- Optional: Pagination -->
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %}
</div>
</table>
</div>
<div class="row align-items-center justify-content-end py-4 pe-0 fs-9">
<!-- Optional: Pagination -->
{% if is_paginated %}
{% include 'partials/pagination.html' %}
{% endif %} {% endif %}
</div>
</div> </div>
</section>
{% include 'modal/delete_modal.html' %} {% include 'modal/delete_modal.html' %}
{% endblock %} {% endblock %}