added function to get last entry
This commit is contained in:
parent
297fe2ce3c
commit
8297a05678
4 changed files with 7 additions and 118 deletions
114
Eingabe.html
114
Eingabe.html
|
|
@ -1,114 +0,0 @@
|
|||
<!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>
|
||||
|
|
@ -132,7 +132,6 @@
|
|||
<button id="print-button" type="button">Einträge drucken</button>
|
||||
<div id="anzeige">
|
||||
<table id="table" class="Ausgaben">
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
const { contextBridge, ipcRenderer } = require("electron");
|
||||
|
||||
const rows = ipcRenderer.invoke('db-query', 'SELECT * FROM abrechnungen');
|
||||
console.log(rows);
|
||||
|
||||
contextBridge.exposeInMainWorld('api', {
|
||||
invoke: (channel, data) => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
let abrechnungen = window.api.invoke('db-query', "SELECT * FROM abrechnungen").then(function(res) {
|
||||
console.log(res);
|
||||
return res;
|
||||
})
|
||||
.catch(function(err) {
|
||||
|
|
@ -75,7 +74,7 @@ const Tagesbilanz = () => {
|
|||
const sonderIn = parseFloat(document.getElementById("Sondereingabe").value);
|
||||
const stornoWenig = parseFloat(document.getElementById("Storno-wenig").value);
|
||||
const stornoViel = parseFloat(document.getElementById("Storno-viel").value);
|
||||
|
||||
const last = lastEntry();
|
||||
const result = gesamtMitEc - zBonBericht + sonderOut - sonderIn - stornoWenig + stornoViel;
|
||||
document.getElementById("tagesbilanz").value = result.toFixed(2);
|
||||
}
|
||||
|
|
@ -128,4 +127,10 @@ const anzeige = () => {
|
|||
});
|
||||
}
|
||||
|
||||
const lastEntry = () => {
|
||||
const lastAbrechnung = window.api.invoke('db-query', "SELECT * FROM abrechnungen ORDER BY datum DESC Limit 1").then(function(res) {
|
||||
return res;
|
||||
});
|
||||
return lastAbrechnung;
|
||||
}
|
||||
createListeners();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue