{# templates/basecaisse.html.twig #}
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Système de Caisse</title>
<!-- Dans votre basecaisse.html.twig -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<!-- Font Awesome pour les icônes -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<title>{% block title %}Système de Caisse{% endblock %}</title>
{# CSS #}
{# Styles spécifiques à la caisse #}
{% block stylesheets %}{% endblock %}
<style>
:root {
--primary: #6366f1;
--secondary: #f59e0b;
--success: #22c55e;
--danger: #ef4444;
--purple: #8b5cf6;
--blue: #3b82f6;
}
body {
background-color: #f3f4f6;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
header {
background-color: white;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
padding: 10px 15px;
position: sticky;
top: 0;
z-index: 100;
}
.customer-badge {
display: flex;
align-items: center;
border: 1px solid #e5e7eb;
border-radius: 6px;
overflow: hidden;
}
.customer-number {
background-color: #f3f4f6;
padding: 5px 10px;
font-size: 14px;
}
.customer-name {
padding: 5px 10px;
font-weight: 600;
cursor: pointer;
border: none;
background: none;
}
.customer-name:hover {
background-color: #f9fafb;
}
.price-display {
font-size: 24px;
font-weight: 700;
color: var(--primary);
}
.seller-badge {
background-color: var(--purple);
color: white;
padding: 5px 10px;
border-radius: 6px;
font-size: 14px;
}
.category-nav {
background-color: white;
overflow-x: auto;
margin-bottom: 1rem;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.category-container {
display: flex;
min-width: max-content;
padding: 10px;
gap: 5px;
}
.category-button {
display: flex;
flex-direction: column;
align-items: center;
padding: 10px;
border-radius: 8px;
border: none;
background: none;
transition: all 0.2s;
}
.category-button:hover {
background-color: rgba(99, 102, 241, 0.1);
transform: scale(1.05);
}
.category-button.active {
background-color: rgba(99, 102, 241, 0.2);
border-bottom: 2px solid var(--primary);
}
.category-icon {
width: 48px;
height: 48px;
margin-bottom: 8px;
object-fit: contain;
}
.category-label {
font-size: 14px;
font-weight: 500;
color: #4b5563;
}
.product-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
gap: 16px;
padding: 16px;
}
.product-card {
background-color: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
overflow: hidden;
display: flex;
flex-direction: column;
transition: box-shadow 0.2s;
cursor: pointer;
height: 100%;
}
.product-card:hover {
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.product-image {
width: 100%;
height: 100px;
object-fit: contain;
padding: 8px;
}
.product-info {
padding: 10px;
text-align: center;
flex-grow: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.product-title {
font-weight: 500;
font-size: 14px;
margin-bottom: 4px;
}
.product-price {
color: var(--primary);
font-weight: 700;
}
.cart-container {
background-color: #f9fafb;
border-left: 1px solid #e5e7eb;
display: flex;
flex-direction: column;
height: 100%;
}
.cart-header {
background-color: white;
padding: 10px 15px;
margin-bottom: 8px;
border-bottom: 1px solid #e5e7eb;
font-weight: 600;
}
.cart-items {
flex-grow: 1;
overflow-y: auto;
padding: 8px;
}
.cart-item {
background-color: white;
border-radius: 8px;
padding: 10px;
margin-bottom: 8px;
display: flex;
justify-content: space-between;
align-items: center;
}
.cart-item-details {
flex: 1;
}
.cart-item-name {
font-weight: 500;
}
.cart-item-price {
font-size: 14px;
color: #6b7280;
}
.cart-item-actions {
display: flex;
align-items: center;
gap: 8px;
}
.cart-item-total {
font-weight: 600;
text-align: right;
}
.quantity-control {
display: flex;
align-items: center;
}
.quantity-btn {
width: 28px;
height: 28px;
border-radius: 4px;
border: 1px solid #e5e7eb;
background: none;
font-size: 14px;
}
.quantity-value {
width: 24px;
text-align: center;
}
.delete-btn {
color: var(--danger);
background: none;
border: none;
padding: 4px;
border-radius: 4px;
}
.delete-btn:hover {
background-color: rgba(239, 68, 68, 0.1);
}
.cart-summary {
border-top: 1px solid #e5e7eb;
background-color: white;
padding: 10px 15px;
}
.actions-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 8px;
padding: 8px;
}
.action-button {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 10px 5px;
border-radius: 8px;
color: white;
border: none;
transition: opacity 0.2s;
}
.action-button:hover {
opacity: 0.9;
}
.action-button i {
margin-bottom: 5px;
font-size: 20px;
}
.action-button span {
font-size: 12px;
}
.btn-espece { background-color: var(--secondary); }
.btn-non-paye { background-color: var(--danger); }
.btn-multiple { background-color: var(--purple); }
.btn-cheque { background-color: var(--blue); }
.btn-carte { background-color: var(--success); }
.btn-attente { background-color: var(--primary); }
.btn-valider {
background-color: var(--success);
grid-column: span 2;
}
.search-container {
position: relative;
padding: 8px 16px;
}
.search-input {
width: 100%;
padding: 8px 35px 8px 35px;
border-radius: 6px;
border: 1px solid #e5e7eb;
}
.search-icon {
position: absolute;
left: 25px;
top: 50%;
transform: translateY(-50%);
color: #6b7280;
}
.clear-search {
position: absolute;
right: 25px;
top: 50%;
transform: translateY(-50%);
color: #6b7280;
background: none;
border: none;
cursor: pointer;
}
.close-modal {
float: right;
font-size: 24px;
font-weight: bold;
cursor: pointer;
}
.pending-orders {
max-height: 300px;
overflow-y: auto;
}
.pending-order {
background-color: white;
border: 1px solid #e5e7eb;
border-radius: 8px;
padding: 10px;
margin-bottom: 8px;
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
}
.pending-order:hover {
background-color: #f9fafb;
}
.order-details {
font-size: 14px;
}
.order-customer {
font-weight: 500;
}
.order-time, .order-items {
color: #6b7280;
}
.order-total {
font-weight: 600;
}
.selected-method {
box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
}
@media (min-width: 768px) {
.main-container {
display: flex;
height: calc(100vh - 60px);
}
.products-container {
flex: 1;
overflow-hidden;
display: flex;
flex-direction: column;
}
.product-grid-container {
flex: 1;
overflow-y: auto;
}
.cart-container {
width: 33.333%;
}
}
</style>
<style>
.modal-header {
background-color: #0d6efd;
color: white;
}
.btn-close-white {
filter: invert(1);
}
</style>
</head>
<body>
{% block body %}
{% endblock %}
<script>
// Fonctions utilitaires communes
function formatPrice(price) {
return parseFloat(price).toFixed(3);
}
// Gestion des modals
function setupModal(modalId, openButtonId, closeButtonClass) {
const modal = document.getElementById(modalId);
const openBtn = document.getElementById(openButtonId);
if (modal && openBtn) {
openBtn.addEventListener('click', () => modal.style.display = 'block');
const closeBtn = modal.querySelector(closeButtonClass);
if (closeBtn) {
closeBtn.addEventListener('click', () => modal.style.display = 'none');
}
window.addEventListener('click', (e) => {
if (e.target === modal) modal.style.display = 'none';
});
}
}
// Initialisation des modals (customerModal géré dans index.html.twig)
document.addEventListener('DOMContentLoaded', function() {
setupModal('pendingOrdersModal', 'pendingOrdersBtn', '.close-modal');
setupModal('cashPaymentModal', null, '.close-modal');
});
</script>
</body>
</html>