account set
authorKilian Saffran <ksaffran@dks.lu>
Sun, 24 Mar 2019 17:37:46 +0000 (18:37 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Sun, 24 Mar 2019 17:37:46 +0000 (18:37 +0100)
db/cashbox.sqlite.schema.sql
index.html
modules/accounts/form_account.html [moved from modules/tables/index.html with 51% similarity]
modules/accounts/form_account.js [new file with mode: 0644]
modules/accounts/index.html [moved from modules/clients/index.html with 85% similarity]
modules/accounts/index.js [moved from modules/clients/index.js with 60% similarity]
modules/accounts/lib/accounts.js [new file with mode: 0644]
modules/tables/index.js [deleted file]

index 09fcdf6..14c9d30 100644 (file)
Binary files a/db/cashbox.sqlite.schema.sql and b/db/cashbox.sqlite.schema.sql differ
index 189d072..fc37cdc 100644 (file)
@@ -23,8 +23,8 @@
                     <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('paywindow');">Kasse</a>
                     <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('overview');">Übersicht</a>
                     <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('products');">Produkte</a>
-                    <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('clients');">Kunden</a>
-                    <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('tables');">Tische</a>
+                    <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('accounts');">Konten</a>
+                    
                     <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('stations');">Geräte</a>
                     <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('transactions');">Transaktionen</a>
                     <a class="list-group-item list-group-item-action bg-light" href="javascript:browserapp.loadmodule('sales');">Verkäufe</a>
similarity index 51%
rename from modules/tables/index.html
rename to modules/accounts/form_account.html
index 34f2f6f..ba35738 100644 (file)
@@ -8,34 +8,38 @@
 <link rel="stylesheet" href="../../node_modules/@fortawesome/fontawesome-free/css/fontawesome.min.css">
 <link rel="stylesheet" href="../../css/cashbox.epic.css">
 <link rel="stylesheet" href="../../css/app.css">
-<title>Rechnungen</title>
+<title>Konto</title>
 </head>
 <body>
         <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
-                <a class="navbar-brand" href="#">Tische</a>
+                <a class="navbar-brand" href="#">Konto</a>
                 <div class="ml-auto">
-           <div class="btn-group" role="group" aria-label="Basic example">
-    <button class="btn btn-primary" onclick="table_new();"><i class="fas fa-plus"></i><br/>New</button>
-    <button class="btn btn-primary" onclick="table_edit();"><i class="fas fa-edit"></i><br/>Edit</button>
-    <button class="btn btn-primary" onclick="table_delete();"><i class="fas fa-trash"></i><br/>Delete</button>
-    <button class="btn btn-primary" onclick="table_clone();"><i class="fas fa-clone"></i><br/>Dupl.</button>
-    
-   </div>
-                </div>
+          <div class="btn-group" role="group" aria-label="Basic example">
+
+          </div>
               </nav>
     <div class="cotainer-fluid" style="margin-top: 52px;">            
-    <table id="tbl_tables" class="table table-bordered table-hover table-striped">
-        <thead class="thead-dark"> 
-                <th data-checkbox="true"></th>
-                <th data-sortable="true">Name</th>
-                <th data-sortable="true">Sitzplätze</th>
-                <th data-sortable="true">Standort</th>
-                <th data-sortable="true">Status</th>
-                <th data-sortable="true">Freie Plätze</th>
-                <th data-sortable="true" data-align="right" data-width="100">Betrag</th>
-        <tfoot></tfoot>
-        <tbody></tbody>
-    </table>
+      <input type="hidden" value="" id="id" name="id" />         
+      <div class="row">
+        
+        <div class="col-md-4">
+          <div class="form-group">
+            <label for="name">Name</label>
+            <input type="text" class="form-control" id="name" name="name" />
+          </div>
+        </div>
+        <div class="col-md-2">
+            <div class="form-group">
+              <label for="name">Typ</label>
+              <select class="form-control" id="type" name="type" >
+                <option value="table">Tisch</option>
+                <option value="client">Kunde</option>
+                <option value="seat">Sitzplatz</option>
+                <option value="account">Konto</option>
+              </select>
+            </div>
+        </div>
+      </div>
     </div>
 <script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
 <script src="../../node_modules/jquery/dist/jquery.min.js"></script>
@@ -44,7 +48,7 @@
 <script src="../../node_modules/@fortawesome/fontawesome-free/js/all.min.js"></script>
 <script src="../../js/moduleglobal.js"></script>
 <script src="../../js/database.js"></script>
-<script src="index.js"></script>
+<script src="account.js"></script>
 <script>if (window.module) module = window.module;</script>
 </body>
 </html>
\ No newline at end of file
diff --git a/modules/accounts/form_account.js b/modules/accounts/form_account.js
new file mode 100644 (file)
index 0000000..16a8163
--- /dev/null
@@ -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
similarity index 85%
rename from modules/clients/index.html
rename to modules/accounts/index.html
index 8ec6aab..44cd7c1 100644 (file)
                 </div>
               </nav>
     <div class="cotainer-fluid" style="margin-top: 52px;">            
-    <table id="tbl_clients" class="table table-bordered table-hover table-striped">
+    <table id="tbl_accounts" class="table table-bordered table-hover table-striped">
         <thead class="thead-dark"> 
                 <th data-checkbox="true"></th>
                 <th data-sortable="true">Name</th>
-                <th data-sortable="true">Addresse</th>
-                <th data-sortable="true">Tel</th>
-                <th data-sortable="true">E-Mail</th>
-                <th data-sortable="true">Status</th>
-                <th data-sortable="true">Offener Betrag</th>
+                <th data-sortable="true">Typ</th>
+                <th data-sortable="true">Info</th>
+                 
         <tfoot></tfoot>
         <tbody></tbody>
     </table>
similarity index 60%
rename from modules/clients/index.js
rename to modules/accounts/index.js
index 488cc5b..91d8ade 100644 (file)
@@ -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 = '<tr id="' +data.sqldata[i].id + '">'+
    '<td></td>' +
+      '<td>'+ data.sqldata[i].name +'</td>' +
+      '<td>'+ data.sqldata[i].type +'</td>' +
      '<td>'+ data.sqldata[i].prename + ' ' + data.sqldata[i].surname + '</td>' +
     '<td>'+ data.sqldata[i].address + '<br/>' + data.sqldata[i].zip + ' ' + data.sqldata[i].city + '<br/>' + data.sqldata[i].country +'</td>' +
-     '<td>' + data.sqldata[i].phone+ '</td>' +
-     '<td>' + data.sqldata[i].email+ '</td>' +
-     '<td>' +  '</td>' +
-     '<td>' +  '</td>' +
+     '<td>' + data.sqldata[i].phone+ '<br/>' + data.sqldata[i].email+ '</td>' +
      '</tr>';
-     $("#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 (file)
index 0000000..beab1ab
--- /dev/null
@@ -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 (file)
index 94ca376..0000000
+++ /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 = '<tr id="' +data.sqldata[i].id + '">'+
-    '<td></td>' +
-    '<td>' + data.sqldata[i].name+ '</td>' +
-    '<td>' + data.sqldata[i].seats+ '</td>' +
-    '<td>' + data.sqldata[i].location+ '</td>' +
-    '<td>' +  'unbekannt' +'</td>' +
-    '<td >' + 0+ '</td>' +
-    '<td class="'+ acolor +'">' + 0.00+ ' €</td>' +
-    
-    '</tr>';
-    $("#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