Browse Source

Add button to clear transaction and restart

Skylar Ittner 5 months ago
parent
commit
a4c9966c3f
3 changed files with 12 additions and 0 deletions
  1. 2
    0
      lang/en_us.php
  2. 4
    0
      pages/pos.php
  3. 6
    0
      static/js/pos.js

+ 2
- 0
lang/en_us.php View File

@@ -138,4 +138,6 @@ define("STRINGS", [
138 138
     "card x saved" => "Gift card #{arg} updated.",
139 139
     "open drawer" => "Open Drawer",
140 140
     "no items" => "No items in transaction.",
141
+    "delete transaction" => "Delete transaction",
142
+    "transaction discount" => "Transaction discount"
141 143
 ]);

+ 4
- 0
pages/pos.php View File

@@ -269,6 +269,10 @@ if (isset($_GET['switch']) || !isset($_SESSION['register']) || !$registeropen) {
269 269
                         <?php
270 270
                     }
271 271
                     ?>
272
+                    <div class="btn m-1" id="deletetxbtn">
273
+                        <i class="fas fa-trash"></i>
274
+                        <span class="sr-only"><?php lang("delete transaction"); ?></span>
275
+                    </div>
272 276
                 </div>
273 277
 
274 278
                 <div class="card-body d-md-none">

+ 6
- 0
static/js/pos.js View File

@@ -56,6 +56,12 @@ function recalculate() {
56 56
     $("#receiptchange").text(change.toFixed(2));
57 57
 }
58 58
 
59
+$("#deletetxbtn").click(function () {
60
+    bsalert("Confirm", "Really delete transaction?", "Yes", "No", function () {
61
+        window.location.href = "app.php?page=pos";
62
+    });
63
+});
64
+
59 65
 // Make sure the session doesn't expire
60 66
 setInterval(function () {
61 67
     $.get("action.php", {action: "session_keepalive"});