diff --git a/Eingabe.html b/Eingabe.html deleted file mode 100644 index ae0d7d0..0000000 --- a/Eingabe.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - Test - - - - -
-
-

Eingabe Tagesdaten

-

Hier kannst du deine Daten für den heutigen Tag eingeben.

-
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
- - -
-
-
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - - - diff --git a/index.html b/index.html index 52485c7..308f386 100644 --- a/index.html +++ b/index.html @@ -132,7 +132,6 @@
-
diff --git a/preload.js b/preload.js index 740d0d5..46d1ee4 100644 --- a/preload.js +++ b/preload.js @@ -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) => { diff --git a/renderer.js b/renderer.js index 7e5b249..1eff6d3 100644 --- a/renderer.js +++ b/renderer.js @@ -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();