initial commit
This commit is contained in:
commit
891f00cfca
11 changed files with 4258 additions and 0 deletions
25
.gitignore
vendored
Normal file
25
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
|
||||
# Logs
|
||||
logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
lerna-debug.log*
|
||||
|
||||
node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
|
||||
# Editor directories and files
|
||||
.vscode/*
|
||||
!.vscode/extensions.json
|
||||
.idea
|
||||
.DS_Store
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
114
Eingabe.html
Normal file
114
Eingabe.html
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Test</title>
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<div class="container template" id="Eingabe-template" data-tab="Eingabe">
|
||||
<h1>Eingabe Tagesdaten</h1>
|
||||
<p>Hier kannst du deine Daten für den heutigen Tag eingeben.</p>
|
||||
<div class="Eingaben">
|
||||
<div>
|
||||
<form class="BarGeld">
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Münzgeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtMuenzen" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>5€ Scheine:</label>
|
||||
<input type="number" id="5Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>10€ Scheine:</label>
|
||||
<input type="number" id="10Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>20€ Scheine:</label>
|
||||
<input type="number" id="20Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>50€ Scheine:</label>
|
||||
<input type="number" id="50Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>100€ Scheine:</label>
|
||||
<input type="number" id="100Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>200€ Scheine:</label>
|
||||
<input type="number" id="200Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Papiergeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtPapier" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Bargeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtBar" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Bargeld mit EC:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtBarEC" placeholder="" value="0.00">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<form class="EingabeSummen">
|
||||
<div class="formEntry">
|
||||
<label>Summe Rollengeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Rollengeld" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Summe Kartenzahlung:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Kartenzahlung" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>zBon Kassenbericht:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="zBon-Bericht" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Sonderausgabe aus Kasse:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Sonderausgabe" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Sondereingabe in Kasse:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Sondereingabe" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Storno - zu viel:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Storno-viel" placeholder="zu viel auf zBon"
|
||||
value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Storno - zu wenig:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Storno-wenig" placeholder="zu wenig auf zBon"
|
||||
value="0.00">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<form class="Ausgabe">
|
||||
<div class="formOut">
|
||||
<label>Papiergeld zurück in die Kasse</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="zurueckKasse" value="0.00">
|
||||
</div>
|
||||
<div class="formOut">
|
||||
<label>Einzahlung auf Konto:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="aufKonto" value="0.00">
|
||||
</div>
|
||||
<div class="formOut">
|
||||
<label>Tagesbilanz vgl- Einnahme zu zBon</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="tagesbilanz" value="0.00">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
<script src="renderer.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
abrechnung.db
Normal file
BIN
abrechnung.db
Normal file
Binary file not shown.
143
index.html
Normal file
143
index.html
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="de">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self';" />
|
||||
<title>Tagesabrechnung</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<main>
|
||||
<div id="main" class="screen">
|
||||
|
||||
<div class="container">
|
||||
<h1>Willkommen in der Tagesabrechnung</h1>
|
||||
<p>Was möchtest du tun?</p>
|
||||
<div class="menu">
|
||||
<button id="show-button" type="button">Zeige Einträge</button>
|
||||
<button id="in-button" type="button">Neuer Eintrag</button>
|
||||
<button id="print-button" type="button">Einträge drucken</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="Eingabe" class="screen modal">
|
||||
<h1>Eingabe Tagesdaten</h1>
|
||||
<p>Hier kannst du deine Daten für den heutigen Tag eingeben.</p>
|
||||
<div class="Eingaben">
|
||||
<div>
|
||||
<form class="BarGeld">
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Münzgeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtMuenzen" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>5€ Scheine:</label>
|
||||
<input type="number" id="5Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>10€ Scheine:</label>
|
||||
<input type="number" id="10Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>20€ Scheine:</label>
|
||||
<input type="number" id="20Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>50€ Scheine:</label>
|
||||
<input type="number" id="50Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>100€ Scheine:</label>
|
||||
<input type="number" id="100Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>200€ Scheine:</label>
|
||||
<input type="number" id="200Euro" value=0>
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Papiergeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtPapier" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Bargeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtBar" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Gesamtes Bargeld mit EC:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="gesamtBarEC" placeholder="" value="0.00">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<form class="EingabeSummen">
|
||||
<div class="formEntry">
|
||||
<label>Summe Rollengeld:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Rollengeld" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Summe Kartenzahlung:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Kartenzahlung" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>zBon Kassenbericht:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="zBon-Bericht" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Sonderausgabe aus Kasse:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Sonderausgabe" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Sondereingabe in Kasse:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Sondereingabe" placeholder="" value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Storno - zu viel:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Storno-viel" placeholder="zu viel auf zBon"
|
||||
value="0.00">
|
||||
</div>
|
||||
<div class="formEntry">
|
||||
<label>Storno - zu wenig:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="Storno-wenig" placeholder="zu wenig auf zBon"
|
||||
value="0.00">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<form class="Ausgabe">
|
||||
<div class="formOut">
|
||||
<label>Papiergeld zurück in die Kasse</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="zurueckKasse" value="0.00">
|
||||
</div>
|
||||
<div class="formOut">
|
||||
<label>Einzahlung auf Konto:</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="aufKonto" value="0.00">
|
||||
</div>
|
||||
<div class="formOut">
|
||||
<label>Tagesbilanz vgl- Einnahme zu zBon</label>
|
||||
<input type="text" pattern="\d+(\.\d{2})?" id="tagesbilanz" value="0.00">
|
||||
</div>
|
||||
</form>
|
||||
<div style="margin-top: 20px;">
|
||||
<button id="back-button" type="button">Zurück</button>
|
||||
<button id="save-button" type="button">Speichern</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="Ausgaben" class="screen modal Ausgaben">
|
||||
<h1>Ausgabe</h1>
|
||||
<button id="back2-button" type="button">Zurück</button>
|
||||
<div id="anzeige">
|
||||
<table id="table" class="Ausgaben">
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script src="./renderer.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
63
index1.html
Normal file
63
index1.html
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Tagesabrechnung</title>
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootswatch/4.1.3/cyborg/bootstrap.min.css">
|
||||
<link rel="import" href="pages/main.html">
|
||||
<link rel="import" href="pages/settings.html">
|
||||
<link rel="import" href="pages/help.html">
|
||||
<style>
|
||||
.nav-pills>a.active {
|
||||
background-color: #f30bf3 !important;
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
.nav-pills>a:hover {
|
||||
color: #ffffff !important;
|
||||
}
|
||||
|
||||
.nav-link-color {
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="container my-4">
|
||||
<div class="row">
|
||||
<div class="col-2">
|
||||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
||||
<a class="nav-link active" id="main-tab" data-toggle="pill" href="#main" role="tab" aria-controls="main" aria-selected="true">Main</a>
|
||||
<a class="nav-link" id="Anzeige-tab" data-toggle="pill" href="#Anzeige" role="tab" aria-controls="Anzeige" aria-selected="false">Anzeige</a>
|
||||
<a class="nav-link" id="Eingabe-tab" data-toggle="pill" href="#Eingabe" role="tab" aria-controls="Eingabe" aria-selected="false">Eingabe</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-10">
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="main" role="tabpanel" aria-labelledby="main-tab"></div>
|
||||
<div class="tab-pane fade" id="Eingabe" role="tabpanel" aria-labelledby="Eingabe-tab"></div>
|
||||
<div class="tab-pane fade" id="Anzeige" role="tabpanel" aria-labelledby="Anzeige-tab"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const links = document.querySelectorAll('link[rel="import"]');
|
||||
links.forEach((link) => {
|
||||
let template = link.import.querySelector('template');
|
||||
let clone = document.importNode(template.content, true);
|
||||
let target = clone.querySelector(".template").dataset.tab;
|
||||
document.getElementById(target).appendChild(clone);
|
||||
});
|
||||
|
||||
window.$ = window.jquery = require("jquery");
|
||||
window.popper = require("popper.js");
|
||||
require("bootstrap");
|
||||
require('./renderer.js')
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
53
main.js
Normal file
53
main.js
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
const { app, BrowserWindow, ipcMain } = require('electron');
|
||||
require('electron-reloader')(module);
|
||||
const sqlite = require('sqlite-electron');
|
||||
|
||||
const path = require('path');
|
||||
const sqlite3 = require('sqlite3');
|
||||
const db = new sqlite3.Database('./abrechnung.db');
|
||||
|
||||
const createWindow = () => {
|
||||
const win = new BrowserWindow({
|
||||
width: 1000,
|
||||
height: 900,
|
||||
webPreferences: {
|
||||
nodeIntegration: true,
|
||||
preload: path.join(__dirname, 'preload.js')
|
||||
}
|
||||
});
|
||||
ipcMain.handle('db-query', async (event, sqlQuery) => {
|
||||
return new Promise(res => {
|
||||
db.all(sqlQuery, (err, rows) => {
|
||||
if (err) throw err;
|
||||
res(rows);
|
||||
});
|
||||
});
|
||||
});
|
||||
win.webContents.openDevTools();
|
||||
win.loadFile('index.html');
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
createWindow();
|
||||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) createWindow()
|
||||
})
|
||||
});
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
if (process.platform !== 'darwin') app.quit();
|
||||
})
|
||||
|
||||
ipcMain.handle('databasePath', async (event, dbPath) => {
|
||||
return await sqlite.setdbPath(dbPath)
|
||||
});
|
||||
|
||||
ipcMain.handle('executeQuery', async (event, query, fetch, value) => {
|
||||
return await sqlite.executeQuery(query, fetch, value);
|
||||
});
|
||||
|
||||
db.serialize(() => {
|
||||
db.run("CREATE TABLE IF NOT EXISTS abrechnungen (id INTEGER PRIMARY KEY, datum TEXT, einzahlung REAL, tagesbilanz REAL, bargeld REAL)");
|
||||
});
|
||||
|
||||
3505
package-lock.json
generated
Normal file
3505
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
22
package.json
Normal file
22
package.json
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"name": "tagesabrechnung",
|
||||
"version": "1.0.0",
|
||||
"description": "Dies ist eine Software zum Berechnen des Tagesumsatzes",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "electron ."
|
||||
},
|
||||
"author": "Patryk Hegenberg",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"electron": "^22.2.0",
|
||||
"electron-reloader": "^1.2.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@electron/rebuild": "^3.2.10",
|
||||
"electron-rebuild": "^3.2.9",
|
||||
"sqlite-electron": "^2.2.5",
|
||||
"sqlite3": "^5.1.4"
|
||||
}
|
||||
}
|
||||
13
preload.js
Normal file
13
preload.js
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
|
||||
const rows = ipcRenderer.invoke('db-query', 'SELECT * FROM abrechnungen');
|
||||
console.log(rows);
|
||||
|
||||
contextBridge.exposeInMainWorld('api', {
|
||||
invoke: (channel, data) => {
|
||||
let validChannels = ['db-query'];
|
||||
if (validChannels.includes(channel)) {
|
||||
return ipcRenderer.invoke(channel, data);
|
||||
}
|
||||
}
|
||||
})
|
||||
131
renderer.js
Normal file
131
renderer.js
Normal file
|
|
@ -0,0 +1,131 @@
|
|||
let abrechnungen = window.api.invoke('db-query', "SELECT * FROM abrechnungen").then(function(res) {
|
||||
console.log(res);
|
||||
return res;
|
||||
})
|
||||
.catch(function(err) {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
const eintragen = () => {
|
||||
window.api.invoke('db-query', "INSERT INTO abrechnungen (datum, Einzahlung, Tagesbilanz, Bargeld) VALUES (date(), "
|
||||
+ parseFloat(document.getElementById("aufKonto").value) + ","
|
||||
+ parseFloat(document.getElementById("tagesbilanz").value) + ","
|
||||
+ parseFloat(document.getElementById("zurueckKasse").value) + ");").then(function(res) {
|
||||
console.log(res);
|
||||
})
|
||||
.catch(function(err) {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
document.getElementById("save-button").addEventListener('click', () => {
|
||||
eintragen()
|
||||
});
|
||||
document.getElementById("show-button").addEventListener('click', () => {
|
||||
document.getElementById("main").style.display = "none"
|
||||
document.getElementById("Ausgaben").style.display = "block"
|
||||
anzeige();
|
||||
});
|
||||
document.getElementById("in-button").addEventListener('click', () => {
|
||||
document.getElementById("Eingabe").style.display = "block"
|
||||
document.getElementById("main").style.display = "none"
|
||||
});
|
||||
document.getElementById("back-button").addEventListener('click', () => {
|
||||
document.getElementById("Eingabe").style.display = "none"
|
||||
document.getElementById("main").style.display = "block"
|
||||
});
|
||||
document.getElementById("back2-button").addEventListener('click', () => {
|
||||
document.getElementById("Ausgaben").style.display = "none"
|
||||
document.getElementById("main").style.display = "block"
|
||||
});
|
||||
|
||||
const updateGesamtBargeld = () => {
|
||||
const muenzen = parseFloat(document.getElementById("gesamtMuenzen").value);
|
||||
const papier = parseFloat(document.getElementById("gesamtPapier").value);
|
||||
const rollengeld = parseFloat(document.getElementById("Rollengeld").value);
|
||||
document.getElementById("gesamtBar").value = (muenzen + papier + rollengeld).toFixed(2);
|
||||
getGesamtMitEC();
|
||||
zurueckKasse();
|
||||
Einzahlung();
|
||||
Tagesbilanz();
|
||||
}
|
||||
|
||||
const getPapierGeld = () => {
|
||||
const euro5 = document.getElementById("5Euro").value * 5;
|
||||
const euro10 = document.getElementById("10Euro").value * 10;
|
||||
const euro20 = document.getElementById("20Euro").value * 20;
|
||||
const euro50 = document.getElementById("50Euro").value * 50;
|
||||
const euro100 = document.getElementById("100Euro").value * 100;
|
||||
const euro200 = document.getElementById("200Euro").value * 200;
|
||||
|
||||
document.getElementById("gesamtPapier").value = euro5 + euro10 + euro20 + euro50 + euro100 + euro200;
|
||||
updateGesamtBargeld();
|
||||
}
|
||||
const getGesamtMitEC = () => {
|
||||
const ec = parseFloat(document.getElementById("Kartenzahlung").value);
|
||||
const gesamtBar = parseFloat(document.getElementById("gesamtBar").value);
|
||||
document.getElementById("gesamtBarEC").value = (ec + gesamtBar).toFixed(2);
|
||||
}
|
||||
|
||||
const Tagesbilanz = () => {
|
||||
const gesamtMitEc = parseFloat(document.getElementById("gesamtBarEC").value);
|
||||
const zBonBericht = parseFloat(document.getElementById("zBon-Bericht").value);
|
||||
const sonderOut = parseFloat(document.getElementById("Sonderausgabe").value);
|
||||
const sonderIn = parseFloat(document.getElementById("Sondereingabe").value);
|
||||
const stornoWenig = parseFloat(document.getElementById("Storno-wenig").value);
|
||||
const stornoViel = parseFloat(document.getElementById("Storno-viel").value);
|
||||
|
||||
const result = gesamtMitEc - zBonBericht + sonderOut - sonderIn - stornoWenig + stornoViel;
|
||||
document.getElementById("tagesbilanz").value = result.toFixed(2);
|
||||
}
|
||||
const zurueckKasse = () => {
|
||||
const muenzgeld = parseFloat(document.getElementById("gesamtMuenzen").value);
|
||||
const rollengeld = parseFloat(document.getElementById("Rollengeld").value);
|
||||
const gesamt = 300 - muenzgeld - rollengeld;
|
||||
document.getElementById("zurueckKasse").value = (Math.floor(gesamt / 5) * 5).toFixed(2);
|
||||
}
|
||||
|
||||
const Einzahlung = () => {
|
||||
const gesamtBar = parseFloat(document.getElementById("gesamtBar").value);
|
||||
const zurueckKasse = parseFloat(document.getElementById("zurueckKasse").value);
|
||||
document.getElementById("aufKonto").value = (gesamtBar - zurueckKasse).toFixed(2);
|
||||
}
|
||||
|
||||
const createListeners = () => {
|
||||
document.getElementById("5Euro").addEventListener("change", getPapierGeld);
|
||||
document.getElementById("10Euro").addEventListener("change", getPapierGeld);
|
||||
document.getElementById("20Euro").addEventListener("change", getPapierGeld);
|
||||
document.getElementById("50Euro").addEventListener("change", getPapierGeld);
|
||||
document.getElementById("100Euro").addEventListener("change", getPapierGeld);
|
||||
document.getElementById("200Euro").addEventListener("change", getPapierGeld);
|
||||
|
||||
document.getElementById("gesamtMuenzen").addEventListener("change", updateGesamtBargeld);
|
||||
document.getElementById("gesamtPapier").addEventListener("change", updateGesamtBargeld);
|
||||
document.getElementById("Rollengeld").addEventListener("change", updateGesamtBargeld);
|
||||
|
||||
document.getElementById("Kartenzahlung").addEventListener("change", getGesamtMitEC);
|
||||
|
||||
document.getElementById("Kartenzahlung").addEventListener("change", Tagesbilanz);
|
||||
document.getElementById("zBon-Bericht").addEventListener("change", Tagesbilanz);
|
||||
document.getElementById("Sonderausgabe").addEventListener("change", Tagesbilanz);
|
||||
document.getElementById("Sondereingabe").addEventListener("change", Tagesbilanz);
|
||||
document.getElementById("Storno-wenig").addEventListener("change", Tagesbilanz);
|
||||
document.getElementById("Storno-viel").addEventListener("change", Tagesbilanz);
|
||||
|
||||
}
|
||||
|
||||
const anzeige = () => {
|
||||
console.log(abrechnungen);
|
||||
let table = "<tr><th>Datum</th><th>Einzahlung</th><th>Tagesbilanz</th><th>Bargeld</th></tr>";
|
||||
abrechnungen.then(function(data) {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
table += "<tr><td>" + data[i].datum + "</td><td>"
|
||||
+ data[i].einzahlung + "</td><td>" + data[i].tagesbilanz
|
||||
+ "</td><td>" + data[i].bargeld + "</td></tr>";
|
||||
}
|
||||
document.getElementById("table").innerHTML = table;
|
||||
});
|
||||
}
|
||||
|
||||
createListeners();
|
||||
189
style.css
Normal file
189
style.css
Normal file
|
|
@ -0,0 +1,189 @@
|
|||
:root {
|
||||
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
font-weight: 400;
|
||||
|
||||
color: #0f0f0f;
|
||||
background-color: #f6f6f6;
|
||||
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
.container {
|
||||
margin: 0;
|
||||
padding-top: 10vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.row {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
a {
|
||||
font-weight: 500;
|
||||
color: #646cff;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #535bf2;
|
||||
}
|
||||
|
||||
h1 {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
border-radius: 8px;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.6em 1.2em;
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
font-family: inherit;
|
||||
color: #0f0f0f;
|
||||
background-color: #ffffff;
|
||||
transition: border-color 0.25s;
|
||||
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
button {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
border-color: #396cd8;
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
#greet-input {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
color: #f6f6f6;
|
||||
background-color: #2f2f2f;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
color: #24c8db;
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
color: #ffffff;
|
||||
background-color: #0f0f0f98;
|
||||
}
|
||||
}
|
||||
.BarGeld {
|
||||
flex-direction: column;
|
||||
display: flex;
|
||||
padding: 5px;
|
||||
gap: 5px;
|
||||
}
|
||||
.EingabeSummen{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 5px;
|
||||
gap: 5px;
|
||||
}
|
||||
button {
|
||||
width: 250px;
|
||||
}
|
||||
.Eingaben{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-evenly;
|
||||
align-items: space-evenly;
|
||||
gap: 5px;
|
||||
}
|
||||
.menu{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
}
|
||||
.formEntry{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
.Ausgabe{
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
margin-top: 20px;
|
||||
gap:5px;
|
||||
}
|
||||
.formOut{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
#main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#Eingabe {
|
||||
display: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#Ausgaben {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#table{
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.Ausgaben {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
tr, th, td {
|
||||
margin: 10px;
|
||||
}
|
||||
table {
|
||||
width: 80%;
|
||||
border-collapse: collapse;
|
||||
margin: 2em auto;
|
||||
}
|
||||
|
||||
th, td {
|
||||
border: 1px solid #646cff;
|
||||
padding: 0.8em 1.2em;
|
||||
text-align: left;
|
||||
font-size: 1em;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
th {
|
||||
background-color: #646cff;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue