templates/basecaisse.html.twig line 1

Open in your IDE?
  1. {# templates/basecaisse.html.twig #}
  2. <!DOCTYPE html>
  3. <html lang="fr">
  4. <head>
  5.   <meta charset="UTF-8">
  6.   <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7.   <title>Système de Caisse</title>
  8.  
  9. <!-- Dans votre basecaisse.html.twig -->
  10. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
  11. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
  12.     <!-- Font Awesome pour les icônes -->
  13.     <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  14.     
  15.     <title>{% block title %}Système de Caisse{% endblock %}</title>
  16.     
  17.  
  18.     {# CSS #}
  19.  
  20.     {# Styles spécifiques à la caisse #}
  21.  
  22.     
  23.     {% block stylesheets %}{% endblock %}
  24.    <style>
  25.     :root {
  26.       --primary: #6366f1;
  27.       --secondary: #f59e0b;
  28.       --success: #22c55e;
  29.       --danger: #ef4444;
  30.       --purple: #8b5cf6;
  31.       --blue: #3b82f6;
  32.     }
  33.     body {
  34.       background-color: #f3f4f6;
  35.       font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  36.     }
  37.     header {
  38.       background-color: white;
  39.       box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  40.       padding: 10px 15px;
  41.       position: sticky;
  42.       top: 0;
  43.       z-index: 100;
  44.     }
  45.     .customer-badge {
  46.       display: flex;
  47.       align-items: center;
  48.       border: 1px solid #e5e7eb;
  49.       border-radius: 6px;
  50.       overflow: hidden;
  51.     }
  52.     .customer-number {
  53.       background-color: #f3f4f6;
  54.       padding: 5px 10px;
  55.       font-size: 14px;
  56.     }
  57.     .customer-name {
  58.       padding: 5px 10px;
  59.       font-weight: 600;
  60.       cursor: pointer;
  61.       border: none;
  62.       background: none;
  63.     }
  64.     .customer-name:hover {
  65.       background-color: #f9fafb;
  66.     }
  67.     .price-display {
  68.       font-size: 24px;
  69.       font-weight: 700;
  70.       color: var(--primary);
  71.     }
  72.     .seller-badge {
  73.       background-color: var(--purple);
  74.       color: white;
  75.       padding: 5px 10px;
  76.       border-radius: 6px;
  77.       font-size: 14px;
  78.     }
  79.     .category-nav {
  80.         background-color: white;
  81.         overflow-x: auto;
  82.         margin-bottom: 1rem;
  83.         box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  84.     }
  85.     .category-container {
  86.       display: flex;
  87.       min-width: max-content;
  88.       padding: 10px;
  89.       gap: 5px;
  90.     }
  91.     .category-button {
  92.       display: flex;
  93.       flex-direction: column;
  94.       align-items: center;
  95.       padding: 10px;
  96.       border-radius: 8px;
  97.       border: none;
  98.       background: none;
  99.       transition: all 0.2s;
  100.     }
  101.     .category-button:hover {
  102.       background-color: rgba(99, 102, 241, 0.1);
  103.       transform: scale(1.05);
  104.     }
  105.     .category-button.active {
  106.       background-color: rgba(99, 102, 241, 0.2);
  107.       border-bottom: 2px solid var(--primary);
  108.     }
  109.     .category-icon {
  110.       width: 48px;
  111.       height: 48px;
  112.       margin-bottom: 8px;
  113.       object-fit: contain;
  114.     }
  115.     .category-label {
  116.       font-size: 14px;
  117.       font-weight: 500;
  118.       color: #4b5563;
  119.     }
  120.     .product-grid {
  121.       display: grid;
  122.       grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  123.       gap: 16px;
  124.       padding: 16px;
  125.     }
  126.     .product-card {
  127.       background-color: white;
  128.       border: 1px solid #e5e7eb;
  129.       border-radius: 8px;
  130.       overflow: hidden;
  131.       display: flex;
  132.       flex-direction: column;
  133.       transition: box-shadow 0.2s;
  134.       cursor: pointer;
  135.       height: 100%;
  136.     }
  137.     .product-card:hover {
  138.       box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  139.     }
  140.     .product-image {
  141.       width: 100%;
  142.       height: 100px;
  143.       object-fit: contain;
  144.       padding:  8px;
  145.     }
  146.     .product-info {
  147.       padding: 10px;
  148.       text-align: center;
  149.       flex-grow: 1;
  150.       display: flex;
  151.       flex-direction: column;
  152.       justify-content: space-between;
  153.     }
  154.     .product-title {
  155.       font-weight: 500;
  156.       font-size: 14px;
  157.       margin-bottom: 4px;
  158.     }
  159.     .product-price {
  160.       color: var(--primary);
  161.       font-weight: 700;
  162.     }
  163.     .cart-container {
  164.       background-color: #f9fafb;
  165.       border-left: 1px solid #e5e7eb;
  166.       display: flex;
  167.       flex-direction: column;
  168.       height: 100%;
  169.     }
  170.     .cart-header {
  171.       background-color: white;
  172.       padding: 10px 15px;
  173.       margin-bottom: 8px;
  174.       border-bottom: 1px solid #e5e7eb;
  175.       font-weight: 600;
  176.     }
  177.     .cart-items {
  178.       flex-grow: 1;
  179.       overflow-y: auto;
  180.       padding: 8px;
  181.     }
  182.     .cart-item {
  183.       background-color: white;
  184.       border-radius: 8px;
  185.       padding: 10px;
  186.       margin-bottom: 8px;
  187.       display: flex;
  188.       justify-content: space-between;
  189.       align-items: center;
  190.     }
  191.     .cart-item-details {
  192.       flex: 1;
  193.     }
  194.     .cart-item-name {
  195.       font-weight: 500;
  196.     }
  197.     .cart-item-price {
  198.       font-size: 14px;
  199.       color: #6b7280;
  200.     }
  201.     .cart-item-actions {
  202.       display: flex;
  203.       align-items: center;
  204.       gap: 8px;
  205.     }
  206.     .cart-item-total {
  207.       font-weight: 600;
  208.       text-align: right;
  209.     }
  210.     .quantity-control {
  211.       display: flex;
  212.       align-items: center;
  213.     }
  214.     .quantity-btn {
  215.       width: 28px;
  216.       height: 28px;
  217.       border-radius: 4px;
  218.       border: 1px solid #e5e7eb;
  219.       background: none;
  220.       font-size: 14px;
  221.     }
  222.     .quantity-value {
  223.       width: 24px;
  224.       text-align: center;
  225.     }
  226.     .delete-btn {
  227.       color: var(--danger);
  228.       background: none;
  229.       border: none;
  230.       padding: 4px;
  231.       border-radius: 4px;
  232.     }
  233.     .delete-btn:hover {
  234.       background-color: rgba(239, 68, 68, 0.1);
  235.     }
  236.     .cart-summary {
  237.       border-top: 1px solid #e5e7eb;
  238.       background-color: white;
  239.       padding: 10px 15px;
  240.     }
  241.     .actions-grid {
  242.       display: grid;
  243.       grid-template-columns: repeat(4, 1fr);
  244.       gap: 8px;
  245.       padding: 8px;
  246.     }
  247.     .action-button {
  248.       display: flex;
  249.       flex-direction: column;
  250.       align-items: center;
  251.       justify-content: center;
  252.       padding: 10px 5px;
  253.       border-radius: 8px;
  254.       color: white;
  255.       border: none;
  256.       transition: opacity 0.2s;
  257.     }
  258.     .action-button:hover {
  259.       opacity: 0.9;
  260.     }
  261.     .action-button i {
  262.       margin-bottom: 5px;
  263.       font-size: 20px;
  264.     }
  265.     .action-button span {
  266.       font-size: 12px;
  267.     }
  268.     .btn-espece { background-color: var(--secondary); }
  269.     .btn-non-paye { background-color: var(--danger); }
  270.     .btn-multiple { background-color: var(--purple); }
  271.     .btn-cheque { background-color: var(--blue); }
  272.     .btn-carte { background-color: var(--success); }
  273.     .btn-attente { background-color: var(--primary); }
  274.     .btn-valider { 
  275.       background-color: var(--success);
  276.       grid-column: span 2;
  277.     }
  278.     .search-container {
  279.       position: relative;
  280.       padding: 8px 16px;
  281.     }
  282.     .search-input {
  283.       width: 100%;
  284.       padding: 8px 35px 8px 35px;
  285.       border-radius: 6px;
  286.       border: 1px solid #e5e7eb;
  287.     }
  288.     .search-icon {
  289.       position: absolute;
  290.       left: 25px;
  291.       top: 50%;
  292.       transform: translateY(-50%);
  293.       color: #6b7280;
  294.     }
  295.     .clear-search {
  296.       position: absolute;
  297.       right: 25px;
  298.       top: 50%;
  299.       transform: translateY(-50%);
  300.       color: #6b7280;
  301.       background: none;
  302.       border: none;
  303.       cursor: pointer;
  304.     }
  305.     .close-modal {
  306.       float: right;
  307.       font-size: 24px;
  308.       font-weight: bold;
  309.       cursor: pointer;
  310.     }
  311.     .pending-orders {
  312.       max-height: 300px;
  313.       overflow-y: auto;
  314.     }
  315.     .pending-order {
  316.       background-color: white;
  317.       border: 1px solid #e5e7eb;
  318.       border-radius: 8px;
  319.       padding: 10px;
  320.       margin-bottom: 8px;
  321.       display: flex;
  322.       justify-content: space-between;
  323.       align-items: center;
  324.       cursor: pointer;
  325.     }
  326.     .pending-order:hover {
  327.       background-color: #f9fafb;
  328.     }
  329.     .order-details {
  330.       font-size: 14px;
  331.     }
  332.     .order-customer {
  333.       font-weight: 500;
  334.     }
  335.     .order-time, .order-items {
  336.       color: #6b7280;
  337.     }
  338.     .order-total {
  339.       font-weight: 600;
  340.     }
  341.     .selected-method {
  342.       box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary);
  343.     }
  344.     @media (min-width: 768px) {
  345.       .main-container {
  346.         display: flex;
  347.         height: calc(100vh - 60px);
  348.       }
  349.       .products-container {
  350.         flex: 1;
  351.         overflow-hidden;
  352.         display: flex;
  353.         flex-direction: column;
  354.       }
  355.       .product-grid-container {
  356.         flex: 1;
  357.         overflow-y: auto;
  358.       }
  359.       .cart-container {
  360.         width: 33.333%;
  361.       }
  362.     }
  363.    </style>
  364.        
  365.     <style>
  366.         .modal-header {
  367.             background-color: #0d6efd;
  368.             color: white;
  369.         }
  370.         .btn-close-white {
  371.             filter: invert(1);
  372.         }
  373.     </style>
  374. </head>
  375. <body>
  376.    
  377.   
  378.     {% block body %}
  379.   
  380.     {% endblock %}
  381.  
  382.    
  383.    
  384.       <script>
  385.         // Fonctions utilitaires communes
  386.         function formatPrice(price) {
  387.             return parseFloat(price).toFixed(3);
  388.         }
  389.         // Gestion des modals
  390.         function setupModal(modalId, openButtonId, closeButtonClass) {
  391.             const modal = document.getElementById(modalId);
  392.             const openBtn = document.getElementById(openButtonId);
  393.             
  394.             if (modal && openBtn) {
  395.                 openBtn.addEventListener('click', () => modal.style.display = 'block');
  396.                 
  397.                 const closeBtn = modal.querySelector(closeButtonClass);
  398.                 if (closeBtn) {
  399.                     closeBtn.addEventListener('click', () => modal.style.display = 'none');
  400.                 }
  401.                 
  402.                 window.addEventListener('click', (e) => {
  403.                     if (e.target === modal) modal.style.display = 'none';
  404.                 });
  405.             }
  406.         }
  407.         // Initialisation des modals (customerModal géré dans index.html.twig)
  408.         document.addEventListener('DOMContentLoaded', function() {
  409.             setupModal('pendingOrdersModal', 'pendingOrdersBtn', '.close-modal');
  410.             setupModal('cashPaymentModal', null, '.close-modal');
  411.         });
  412.     </script>
  413. </body>
  414. </html>