before deploy 2

This commit is contained in:
Flatlogic Bot 2026-02-10 05:20:18 +00:00
parent b2602b999f
commit 7c0bb7cb38
6 changed files with 1161 additions and 1131 deletions

View File

@ -371,6 +371,7 @@
<i class="bi bi-list fs-5"></i>
</button>
<div class="d-flex align-items-center gap-3">
<div class="language-switcher">
<form action="{% url 'set_language' %}" method="post" class="d-flex align-items-center">
{% csrf_token %}
@ -388,6 +389,53 @@
</select>
</form>
</div>
<div class="dropdown">
<a href="#" class="d-flex align-items-center text-decoration-none dropdown-toggle text-dark" id="userDropdown" data-bs-toggle="dropdown" aria-expanded="false">
{% if user.profile.image %}
<img src="{{ user.profile.image.url }}" alt="{{ user.username }}" width="32" height="32" class="rounded-circle me-2 border shadow-sm" style="object-fit: cover;">
{% else %}
<div class="bg-primary-subtle text-primary rounded-circle d-flex align-items-center justify-content-center me-2 border shadow-sm" style="width: 32px; height: 32px;">
<i class="bi bi-person-fill"></i>
</div>
{% endif %}
<span class="d-none d-md-inline fw-semibold small">{{ user.get_full_name|default:user.username }}</span>
</a>
<ul class="dropdown-menu dropdown-menu-end shadow-lg border-0 rounded-4 mt-2 py-3" aria-labelledby="userDropdown" style="min-width: 200px;">
<li class="px-3 mb-3 text-center">
{% if user.profile.image %}
<img src="{{ user.profile.image.url }}" alt="{{ user.username }}" width="60" height="60" class="rounded-circle mb-2 border shadow-sm" style="object-fit: cover;">
{% else %}
<div class="bg-primary-subtle text-primary rounded-circle d-flex align-items-center justify-content-center mx-auto mb-2 border shadow-sm" style="width: 60px; height: 60px;">
<i class="bi bi-person-fill fs-3"></i>
</div>
{% endif %}
<div class="fw-bold text-truncate" style="max-width: 180px;">{{ user.get_full_name|default:user.username }}</div>
<div class="text-muted small text-truncate" style="max-width: 180px;">{{ user.email|default:user.username }}</div>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<a class="dropdown-item py-2 px-3" href="{% url 'profile' %}">
<i class="bi bi-person-circle me-2 text-primary"></i> {% trans "My Profile" %}
</a>
</li>
<li>
<a class="dropdown-item py-2 px-3" href="{% url 'profile' %}#edit">
<i class="bi bi-pencil-square me-2 text-success"></i> {% trans "Edit Profile" %}
</a>
</li>
<li><hr class="dropdown-divider"></li>
<li>
<form action="{% url 'logout' %}" method="post" id="nav-logout-form">
{% csrf_token %}
<button type="submit" class="dropdown-item py-2 px-3 text-danger">
<i class="bi bi-box-arrow-right me-2"></i> {% trans "Logout" %}
</button>
</form>
</li>
</ul>
</div>
</div>
</div>
{% endif %}

View File

@ -0,0 +1,58 @@
{% extends 'base.html' %}
{% load i18n static %}
{% block content %}
<div class="container mt-4">
<div class="card shadow-sm" style="max-width: 600px; margin: 0 auto;">
<div class="card-header bg-danger text-white">
<h4 class="mb-0"><i class="fas fa-door-closed me-2"></i> {% trans "Close Session" %}</h4>
</div>
<div class="card-body">
<div class="row mb-4">
<div class="col-md-6">
<strong>{% trans "Started At:" %}</strong><br>
{{ session.start_time|date:"Y-m-d H:i" }}
</div>
<div class="col-md-6">
<strong>{% trans "Opening Balance:" %}</strong><br>
{{ session.opening_balance }}
</div>
</div>
<div class="card bg-light mb-3">
<div class="card-body">
<h5>{% trans "Session Summary (System)" %}</h5>
<table class="table table-sm">
<tr>
<td>{% trans "Total Sales:" %}</td>
<td class="text-end fw-bold">{{ total_sales|floatformat:3 }}</td>
</tr>
{% for pm in payments %}
<tr>
<td>{{ pm.payment_method_name }}</td>
<td class="text-end">{{ pm.total|floatformat:3 }}</td>
</tr>
{% endfor %}
</table>
</div>
</div>
<form method="post">
{% csrf_token %}
<div class="mb-3">
<label class="form-label">{% trans "Closing Cash Balance (Counted)" %}</label>
{{ form.closing_balance }}
<div class="form-text">{% trans "Enter the actual cash amount found in the drawer." %}</div>
</div>
<div class="mb-3">
<label class="form-label">{% trans "Notes" %}</label>
{{ form.notes }}
</div>
<div class="d-grid">
<button type="submit" class="btn btn-danger">{% trans "Close Session" %}</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,55 @@
{% extends 'base.html' %}
{% load i18n static %}
{% block content %}
<div class="container-fluid mt-4">
<div class="d-flex justify-content-between align-items-center mb-4">
<h2><i class="fas fa-list-alt me-2"></i> {% trans "Cashier Sessions" %}</h2>
</div>
<div class="card shadow-sm">
<div class="card-body">
<div class="table-responsive">
<table class="table table-hover align-middle">
<thead class="table-light">
<tr>
<th>{% trans "ID" %}</th>
<th>{% trans "Cashier" %}</th>
<th>{% trans "Counter" %}</th>
<th>{% trans "Start Time" %}</th>
<th>{% trans "End Time" %}</th>
<th>{% trans "Status" %}</th>
<th>{% trans "Actions" %}</th>
</tr>
</thead>
<tbody>
{% for session in sessions %}
<tr>
<td>#{{ session.id }}</td>
<td>{{ session.user.username }}</td>
<td>{{ session.counter.name|default:"-" }}</td>
<td>{{ session.start_time|date:"Y-m-d H:i" }}</td>
<td>{{ session.end_time|date:"Y-m-d H:i"|default:"-" }}</td>
<td>
<span class="badge bg-{% if session.status == 'active' %}success{% else %}secondary{% endif %}">
{{ session.get_status_display }}
</span>
</td>
<td>
<a href="{% url 'session_detail' pk=session.pk %}" class="btn btn-sm btn-info text-white">
<i class="fas fa-eye"></i>
</a>
</td>
</tr>
{% empty %}
<tr>
<td colspan="7" class="text-center text-muted">{% trans "No sessions found." %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,35 @@
{% extends 'base.html' %}
{% load i18n static %}
{% block content %}
<div class="container mt-4">
<div class="card shadow-sm" style="max-width: 500px; margin: 0 auto;">
<div class="card-header bg-primary text-white">
<h4 class="mb-0"><i class="fas fa-cash-register me-2"></i> {% trans "Start Cashier Session" %}</h4>
</div>
<div class="card-body">
{% if counter %}
<div class="alert alert-info">
<strong>{% trans "Counter:" %}</strong> {{ counter.name }} <br>
<strong>{% trans "Cashier:" %}</strong> {{ request.user.username }}
</div>
{% endif %}
<form method="post">
{% csrf_token %}
<div class="mb-3">
<label class="form-label">{% trans "Opening Cash Balance" %}</label>
{{ form.opening_balance }}
</div>
<div class="mb-3">
<label class="form-label">{% trans "Notes" %}</label>
{{ form.notes }}
</div>
<div class="d-grid">
<button type="submit" class="btn btn-success">{% trans "Open Session" %}</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}

File diff suppressed because it is too large Load Diff