diff --git a/static/scripts/main.js b/static/scripts/main.js index b6007b9..0b671b0 100644 --- a/static/scripts/main.js +++ b/static/scripts/main.js @@ -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("/"); +} \ No newline at end of file