Can now redirect to pay with cash

This commit is contained in:
Yarne Coppens 2024-09-04 10:08:06 +02:00
parent 50a262e549
commit 30e7d5a164

View file

@ -2,7 +2,7 @@ var all_products
let barcodeForm
const api_url = "http://127.0.0.1:8000"
const api_url = "http://192.168.1.3:8000"
var to_fill_product_index = 0
@ -30,7 +30,10 @@ async function loadCash(price) {
for (var x = 0; x < bill_amount; x++){
const new_column = document.createElement('div')
new_column.classList.add('col')
new_column.innerHTML = bill_type
const bill_image = document.createElement('img')
bill_image.src = api_url + '/icons/' + bill_type
new_column.appendChild(bill_image)
cash_bills_row.appendChild(new_column)
}
}
@ -78,3 +81,12 @@ async function loadProducts() {
});
}
async function payCash() {
const total_cost = document.getElementById('totalprice').innerHTML.replace('€ ','')
window.location.replace("/pay_cash/" + total_cost);
}
async function toMain() {
window.location.replace("/");
}