Aleksmorshen commited on
Commit
99f280c
·
verified ·
1 Parent(s): e54f3bc

Update script.js

Browse files
Files changed (1) hide show
  1. script.js +6 -3
script.js CHANGED
@@ -236,7 +236,7 @@ document.addEventListener('DOMContentLoaded', function () {
236
  openReceiptForConfirmation(receipt);
237
  };
238
 
239
- // Функция для отображения чека в модальном окне для подтверждения
240
  function openReceiptForConfirmation(receipt) {
241
  const modal = document.getElementById('receiptModal');
242
  const receiptTable = document.getElementById('receiptTable').getElementsByTagName('tbody')[0];
@@ -264,6 +264,9 @@ document.addEventListener('DOMContentLoaded', function () {
264
  document.getElementById('receiptDiscount').textContent = receipt.discount.toFixed(2);
265
  document.getElementById('receiptFinalTotal').textContent = (totalAmount - receipt.discount).toFixed(2);
266
 
 
 
 
267
  // Показываем модальное окно
268
  modal.style.display = 'flex';
269
 
@@ -346,7 +349,7 @@ document.addEventListener('DOMContentLoaded', function () {
346
  });
347
  }
348
 
349
- // Функция для открытия чека
350
  function openReceipt(index) {
351
  const receipt = receipts[index];
352
  const modal = document.getElementById('receiptModal');
@@ -375,7 +378,7 @@ document.addEventListener('DOMContentLoaded', function () {
375
  document.getElementById('receiptDiscount').textContent = receipt.discount.toFixed(2);
376
  document.getElementById('receiptFinalTotal').textContent = (totalAmount - receipt.discount).toFixed(2);
377
 
378
- // Убираем кнопку "Подтвердить" при просмотре чека
379
  document.getElementById('confirmSaleBtn').style.display = 'none';
380
 
381
  // Показываем модальное окно
 
236
  openReceiptForConfirmation(receipt);
237
  };
238
 
239
+ // Функция для отображения чека в модальном окне для подтверждения (из корзины)
240
  function openReceiptForConfirmation(receipt) {
241
  const modal = document.getElementById('receiptModal');
242
  const receiptTable = document.getElementById('receiptTable').getElementsByTagName('tbody')[0];
 
264
  document.getElementById('receiptDiscount').textContent = receipt.discount.toFixed(2);
265
  document.getElementById('receiptFinalTotal').textContent = (totalAmount - receipt.discount).toFixed(2);
266
 
267
+ // Показываем кнопку "Подтвердить" (для корзины)
268
+ document.getElementById('confirmSaleBtn').style.display = 'block';
269
+
270
  // Показываем модальное окно
271
  modal.style.display = 'flex';
272
 
 
349
  });
350
  }
351
 
352
+ // Функция для открытия чека (из отчетов)
353
  function openReceipt(index) {
354
  const receipt = receipts[index];
355
  const modal = document.getElementById('receiptModal');
 
378
  document.getElementById('receiptDiscount').textContent = receipt.discount.toFixed(2);
379
  document.getElementById('receiptFinalTotal').textContent = (totalAmount - receipt.discount).toFixed(2);
380
 
381
+ // Убираем кнопку "Подтвердить" при просмотре чека (для отчетов)
382
  document.getElementById('confirmSaleBtn').style.display = 'none';
383
 
384
  // Показываем модальное окно