From e400faa38b6b45abf05d967917cf001b177db6ed Mon Sep 17 00:00:00 2001 From: Kilian Saffran Date: Sun, 24 Mar 2019 18:37:46 +0100 Subject: [PATCH] account set --- db/cashbox.sqlite.schema.sql | Bin 5060 -> 5966 bytes index.html | 4 +- .../index.html => accounts/form_account.html} | 50 ++++++------ modules/accounts/form_account.js | 15 ++++ modules/{clients => accounts}/index.html | 10 +-- modules/{clients => accounts}/index.js | 28 +++---- modules/accounts/lib/accounts.js | 14 ++++ modules/tables/index.js | 77 ------------------ 8 files changed, 74 insertions(+), 124 deletions(-) rename modules/{tables/index.html => accounts/form_account.html} (51%) create mode 100644 modules/accounts/form_account.js rename modules/{clients => accounts}/index.html (85%) rename modules/{clients => accounts}/index.js (60%) create mode 100644 modules/accounts/lib/accounts.js delete mode 100644 modules/tables/index.js diff --git a/db/cashbox.sqlite.schema.sql b/db/cashbox.sqlite.schema.sql index 09fcdf66b9eecd0ed6b82803933db0b188c4d6a4..14c9d30f59aabed7aa1923a792efe262b195b807 100644 GIT binary patch delta 258 zcmX@2eok-05#h;Ei~^Huc(`~I8Ipl8pP`f?kD+ApL=NT21p+dYKM4q#D=_dfa4~QK zWpfxZ8B#&=KwQd@%a8=*6)`9P`Kb&QKvD;)vH&QWIyqlJnzb0Ht_Z{enx6uMKyij* zhT_SAtisGy44IP!*+totfu@!)RD#5K;VuBG1dDJMFk}E-l?OBrC@-7}v^5c^J_ljz bW=3X7Ml|Qwb1QNqd1&%Rc5O5j{7j_){e?ON delta 7 OcmX@7cSL=|5n%uh*aL3> diff --git a/index.html b/index.html index 189d072..fc37cdc 100644 --- a/index.html +++ b/index.html @@ -23,8 +23,8 @@ Kasse Übersicht Produkte - Kunden - Tische + Konten + Geräte Transaktionen Verkäufe diff --git a/modules/tables/index.html b/modules/accounts/form_account.html similarity index 51% rename from modules/tables/index.html rename to modules/accounts/form_account.html index 34f2f6f..ba35738 100644 --- a/modules/tables/index.html +++ b/modules/accounts/form_account.html @@ -8,34 +8,38 @@ -Rechnungen +Konto
- - - - - - - - - - - -
NameSitzplätzeStandortStatusFreie PlätzeBetrag
+ +
+ +
+
+ + +
+
+
+
+ + +
+
+
@@ -44,7 +48,7 @@ - + \ No newline at end of file diff --git a/modules/accounts/form_account.js b/modules/accounts/form_account.js new file mode 100644 index 0000000..16a8163 --- /dev/null +++ b/modules/accounts/form_account.js @@ -0,0 +1,15 @@ +var winh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); +var tblh = winh-54; + +function initpage(){ + if (mpref.cfg.id){ + getaccountdata(mpref.cfg.id); + } else { + //load default new invoice data + } + console.log("invoice ID:",mpref.cfg.id); +} + +function getaccountdata(){ + +} \ No newline at end of file diff --git a/modules/clients/index.html b/modules/accounts/index.html similarity index 85% rename from modules/clients/index.html rename to modules/accounts/index.html index 8ec6aab..44cd7c1 100644 --- a/modules/clients/index.html +++ b/modules/accounts/index.html @@ -23,15 +23,13 @@
- +
- - - - - + + +
NameAddresseTelE-MailStatusOffener BetragTypInfo
diff --git a/modules/clients/index.js b/modules/accounts/index.js similarity index 60% rename from modules/clients/index.js rename to modules/accounts/index.js index 488cc5b..91d8ade 100644 --- a/modules/clients/index.js +++ b/modules/accounts/index.js @@ -2,29 +2,25 @@ var winh = Math.max(document.documentElement.clientHeight, window.innerHeight || var tblh = winh-54; function initpage(){ - loadtable(); } - - function loadtable(){ - var sql = 'SELECT id, prename,surname, address, zip, city, country, clientnumber, email, phone FROM clients;' + var sql = 'SELECT id, name,type,prename,surname, address, zip, city, country, clientnumber, email, phone FROM accounts;' var data = appdb.dbquery(sql); // //console.log(data.sqldata); for (var i in data.sqldata){ var row = ''+ '' + + ''+ data.sqldata[i].name +'' + + ''+ data.sqldata[i].type +'' + ''+ data.sqldata[i].prename + ' ' + data.sqldata[i].surname + '' + ''+ data.sqldata[i].address + '
' + data.sqldata[i].zip + ' ' + data.sqldata[i].city + '
' + data.sqldata[i].country +'' + - '' + data.sqldata[i].phone+ '' + - '' + data.sqldata[i].email+ '' + - '' + '' + - '' + '' + + '' + data.sqldata[i].phone+ '
' + data.sqldata[i].email+ '' + ''; - $("#tbl_clients").append(row); + $("#tbl_accounts").append(row); } - $('#tbl_clients').bootstrapTable({ + $('#tbl_accounts').bootstrapTable({ pagination: false, search: false, height: tblh, @@ -36,25 +32,25 @@ function loadtable(){ -function client_edit(){ +function account_edit(){ var cl_id= getTableSelectionID(); if (cl_id){ - parent.browserapp.loadmodulepage('clients','client',{"id":cl_id}); + parent.browserapp.loadmodulepage('accounts','account',{"id":cl_id}); } } -function client_delete(){ +function delete_delete(){ } -function client_duplicate(){ +function account_duplicate(){ } function getTableSelectionID(){ - var sel = $('#tbl_clients').bootstrapTable('getSelections'); + var sel = $('#tbl_accounts').bootstrapTable('getSelections'); var id = null; if (sel){ id=sel[0]._id; } @@ -63,7 +59,7 @@ function getTableSelectionID(){ } function getTableSelectionIDs(){ - var sel = $('#tbl_clients').bootstrapTable('getSelections'); + var sel = $('#tbl_accounts').bootstrapTable('getSelections'); var ids = []; if (sel){ for (var s in sel){ diff --git a/modules/accounts/lib/accounts.js b/modules/accounts/lib/accounts.js new file mode 100644 index 0000000..beab1ab --- /dev/null +++ b/modules/accounts/lib/accounts.js @@ -0,0 +1,14 @@ +var account = { + new: function(){ + parent.browserapp.loadmodulepage('accounts','form_account',{"id":""}); + }, + edit: function(id){ + parent.browserapp.loadmodulepage('accounts','form_account',{"id":id}); + }, + duplicate: function(id){ + + }, + delete: function(id){ + + } +} \ No newline at end of file diff --git a/modules/tables/index.js b/modules/tables/index.js deleted file mode 100644 index 94ca376..0000000 --- a/modules/tables/index.js +++ /dev/null @@ -1,77 +0,0 @@ -var winh = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); -var tblh = winh-54; - -function initpage(){ - console.log(appdb.url); - loadtable(); -} - - - -function loadtable(){ - var sql = 'SELECT id, name, seats,location FROM tables;'; - var data = appdb.dbquery(sql); - //console.log(data.sqldata); - for (var i in data.sqldata){ - - var row = ''+ - '' + - '' + data.sqldata[i].name+ '' + - '' + data.sqldata[i].seats+ '' + - '' + data.sqldata[i].location+ '' + - '' + 'unbekannt' +'' + - '' + 0+ '' + - '' + 0.00+ ' €' + - - ''; - $("#tbl_tables").append(row); - } - $('#tbl_tables').bootstrapTable({ - pagination: false, - search: false, - height: tblh, - clickToSelect: true - }); - - -} - - - -function table_edit(){ - var tbl_id= getTableSelectionID(); - if (tbl_id){ - parent.browserapp.loadmodulepage('tables','table',{"id":tbl_id}); - } - -} - -function table_delete(){ - -} - -function table_clone(){ - -} - - - -function getTableSelectionID(){ - var sel = $('#tbl_tables').bootstrapTable('getSelections'); - var id = null; - - if (sel){ id=sel[0]._id; } - console.log("Selected ID:" + id); - return id; -} - -function getTableSelectionIDs(){ - var sel = $('#tbl_tables').bootstrapTable('getSelections'); - var ids = []; - if (sel){ - for (var s in sel){ - ids.push(s._id); - } - } - return ids; -} \ No newline at end of file -- 2.39.5