File size: 5,749 Bytes
2ebd750
 
 
 
 
 
 
 
 
3674daf
4126c2b
 
 
 
 
 
 
3674daf
 
2ebd750
4126c2b
c982db7
1c64779
 
 
 
 
 
 
 
 
 
ada8f46
1c64779
 
 
 
d719a61
1c64779
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ada8f46
4126c2b
 
f7213ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6f8fd5a
 
 
 
f7213ca
 
 
4126c2b
 
1c64779
 
 
 
 
 
0e21349
 
 
 
 
 
ada8f46
2ebd750
feae588
 
 
 
 
 
 
 
 
 
 
7a1d2b2
 
feae588
 
 
 
 
 
 
 
 
6f8fd5a
 
feae588
 
 
 
 
2ebd750
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<!DOCTYPE html>
<html lang="ru">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Система учета товаров</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <!-- Бургер-меню для мобильных устройств -->
    <div class="burger-menu">
        <div class="burger-icon" onclick="toggleMenu()"></div>
        <div class="menu-items">
            <div onclick="showSection('inventory')">Инвентарь</div>
            <div onclick="showSection('cart')">Корзина</div>
            <div onclick="showSection('stats')">Отчеты</div>
        </div>
    </div>

    <div class="container">
        <!-- Колонка 1: Инвентарь -->
        <div class="column inventory active" id="inventory">
            <h2>Инвентарь</h2>
            <!-- Форма добавления товара -->
            <form id="productForm">
                <input type="text" id="productName" placeholder="Название товара" required>
                <input type="number" id="purchasePrice" placeholder="Приходная цена" required>
                <input type="number" id="salePrice" placeholder="Отпускная цена" required>
                <input type="number" id="quantity" placeholder="Остаток (пачек)" required>
                <input type="number" id="itemsPerPack" placeholder="Количество штук в пачке" required>
                <button type="submit">Добавить товар</button>
            </form>

            <!-- Поиск по товарам -->
            <div class="search-container">
                <input type="text" id="searchInput" placeholder="Поиск по названию товара">
            </div>

            <!-- Таблица товаров -->
            <table id="productTable">
                <thead>
                    <tr>
                        <th>Название</th>
                        <th>Приходная цена</th>
                        <th>Отпускная цена</th>
                        <th>Остаток (пачек)</th>
                        <th>Штук в пачке</th>
                        <th>Действия</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- Строки с товарами будут добавляться сюда -->
                </tbody>
            </table>
        </div>

        <!-- Колонка 2: Корзина -->
        <div class="column cart" id="cart">
            <h2>Корзина</h2>
            <table id="cartTable">
                <thead>
                    <tr>
                        <th>Название</th>
                        <th>Количество</th>
                        <th>Цена за единицу</th>
                        <th>Итого</th>
                        <th>Действия</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- Товары в корзине будут добавляться сюда -->
                </tbody>
            </table>
            <div class="discount-container">
                <label for="discountInput">Скидка:</label>
                <input type="number" id="discountInput" placeholder="Введите сумму скидки">
            </div>
            <button id="sellCartBtn" onclick="sellCart()">Продать товары из корзины</button>
        </div>

        <!-- Колонка 3: Отчеты -->
        <div class="column stats" id="stats">
            <h2>Отчеты</h2>
            <div class="stats-content">
                <p>Общее количество проданных товаров: <span id="totalSold">0</span></p>
                <p>Общая выручка: <span id="totalRevenue">0</span></p>
                <p>Общая прибыль: <span id="totalProfit">0</span></p>
            </div>
            <div class="receipts-container">
                <h3>Чеки за месяц</h3>
                <div id="receiptsList">
                    <!-- Список чеков будет добавляться сюда -->
                </div>
            </div>
        </div>
    </div>

    <!-- Модальное окно для чека -->
    <div id="receiptModal" class="modal">
        <div class="modal-content">
            <span class="close">&times;</span>
            <h2>Чек продажи</h2>
            <p>Дата и время: <span id="receiptDateTime"></span></p>
            <table id="receiptTable">
                <thead>
                    <tr>
                        <th>Название</th>
                        <th>Количество (пачек)</th>
                        <th>Штук в пачке</th>
                        <th>Цена за единицу</th>
                        <th>Итого</th>
                    </tr>
                </thead>
                <tbody>
                    <!-- Товары в чеке будут добавляться сюда -->
                </tbody>
            </table>
            <p>Общая сумма: <span id="receiptTotal"></span></p>
            <p>Скидка: <span id="receiptDiscount"></span></p>
            <p>Итого к оплате: <span id="receiptFinalTotal"></span></p>
            <button id="confirmSaleBtn">Подтвердить</button>
            <button id="cancelSaleBtn">Отмена</button>
        </div>
    </div>

    <script src="script.js"></script>
</body>
</html>