diff --git a/app/Http/Controllers/Kasir/Menu.php b/app/Http/Controllers/Kasir/Menu.php
index 182d3ab..eb105ab 100644
--- a/app/Http/Controllers/Kasir/Menu.php
+++ b/app/Http/Controllers/Kasir/Menu.php
@@ -11,7 +11,7 @@ class Menu extends Controller
{
public function index()
{
- return view('pages.menu.index');
+ return view('pages.Menu.index');
}
public function getDataMenu()
diff --git a/resources/views/pages/Kasir/js.blade.php b/resources/views/pages/Kasir/js.blade.php
index 9cd000e..8e4e8da 100644
--- a/resources/views/pages/Kasir/js.blade.php
+++ b/resources/views/pages/Kasir/js.blade.php
@@ -115,8 +115,10 @@
document.getElementById('datetime-order').innerHTML = utc.toLocaleDateString("id-ID", options);
}
+ // show time every second
setInterval(showTime, 1000);
+ let globalId = 0;
// make function add menu to table and calculate qty and total price menu ordered and check menu ordered is exist or not in tbody table order-menus insert this in
function aadMenu(params, menuPaket = false) {
var paketFreenya = [];
@@ -124,11 +126,11 @@
if (menuPaket == true) {
for (let index = 0; index < itemFree.length; index++) {
// const element = itemFree[index];
- console.log(itemFree[index].nama_produk);
+ // console.log(itemFree[index].nama_produk);
paketFreenya.push(itemFree[index].nama_produk);
idPaketFreenya.push(itemFree[index].id);
}
- console.log(itemFree);
+ // console.log(itemFree);
}
var table = document.getElementById("order-menus");
@@ -185,7 +187,7 @@
${(diskonSatuan > 0) ? 'Rp. ' + (harga * qty) + ' | Rp. ' + total + '' : 'Rp. ' + totalLama + ''}
@@ -314,11 +318,12 @@
// delete menu from table and calculate qty and total price menu ordered
function deleteMenu(params) {
+ console.log(params);
var table = document.getElementById("order-menus");
var index = 0;
for (var i = 1, row; row = table.rows[i]; i++) {
- var id = row.getAttribute('data-id');
+ var id = row.getAttribute('data-row-id');
if (id == params) {
index = i;
@@ -358,11 +363,13 @@
// increment qty menu ordered
function incrementMenu(params, nama_produk) {
+ console.log(params);
var table = document.getElementById("order-menus");
var index = 0;
for (var i = 1, row; row = table.rows[i]; i++) {
- var id = row.getAttribute('data-id');
+ var id = row.getAttribute('data-row-id');
+
if (id == params) {
index = i;
}
@@ -372,6 +379,8 @@
var diskonSatuan = table.rows[index].getAttribute('data-diskon-satuan');
var total = table.rows[index].getAttribute('data-total');
var harga = table.rows[index].getAttribute('data-harga');
+ var valueKeterangan = table.rows[index].cells[0].getElementsByTagName('input')[0].getAttribute(
+ 'data-keterangan');
qty = parseInt(qty) + 1;
var totalLama = parseInt(total) + parseInt(harga);
@@ -388,7 +397,7 @@
${(diskonSatuan > 0) ? 'Rp. ' + (harga * qty) + ' | Rp. ' + total + '' : 'Rp. ' + totalLama + ''}
-
+
`;
@@ -416,7 +425,7 @@
var index = 0;
for (var i = 1, row; row = table.rows[i]; i++) {
- var id = row.getAttribute('data-id');
+ var id = row.getAttribute('data-row-id');
if (id == params) {
index = i;
@@ -427,6 +436,8 @@
var diskonSatuan = table.rows[index].getAttribute('data-diskon-satuan');
var total = table.rows[index].getAttribute('data-total');
var harga = table.rows[index].getAttribute('data-harga');
+ var valueKeterangan = table.rows[index].cells[0].getElementsByTagName('input')[0].getAttribute(
+ 'data-keterangan');
if (qty > 1) {
qty = parseInt(qty) - 1;
@@ -444,7 +455,7 @@
${(diskonSatuan > 0) ? 'Rp. ' + (harga * qty) + ' | Rp. ' + total + '' : 'Rp. ' + totalLama + ''}
-
+
`;
@@ -473,7 +484,7 @@
var index = 0;
for (var i = 1, row; row = table.rows[i]; i++) {
- var id = row.getAttribute('data-id');
+ var id = row.getAttribute('data-row-id');
if (id == params) {
index = i;
@@ -484,7 +495,8 @@
var diskonSatuan = parseInt(diskon);
var total = table.rows[index].getAttribute('data-total');
var harga = table.rows[index].getAttribute('data-harga');
-
+ var valueKeterangan = table.rows[index].cells[0].getElementsByTagName('input')[0].getAttribute(
+ 'data-keterangan');
// if (diskonSatuan >= 1) {
// console.log(diskonSatuan);
@@ -503,7 +515,7 @@
${(diskonSatuan >= 1) ? 'Rp. ' + (harga * qty) + ' | Rp. ' + total + '' : 'Rp. ' + totalLama + ''}
-
+
`;
@@ -1011,7 +1023,7 @@
// clear selected menus
function clearSelected() {
- // console.log(selectedMenus);
+ console.log('batal');
for (var i = 0; i < selectedMenus.length; i++) {
changeOrderedMenus(selectedMenus[i].id, 'batal');
menu_terpilih.innerHTML = ` `;
diff --git a/resources/views/pages/menu/index.blade.php b/resources/views/pages/Menu/index.blade.php
similarity index 100%
rename from resources/views/pages/menu/index.blade.php
rename to resources/views/pages/Menu/index.blade.php