v20191120
authorKilian Saffran <ksaffran@dks.lu>
Wed, 20 Nov 2019 16:24:26 +0000 (17:24 +0100)
committerKilian Saffran <ksaffran@dks.lu>
Wed, 20 Nov 2019 16:24:26 +0000 (17:24 +0100)
CGI/tmpl/app/invoicejournal/module/invoicejournal/index.js
data/dksaccess.sqlite [new file with mode: 0644]
dksnas.pl

index a457f39..4505686 100644 (file)
@@ -49,104 +49,109 @@ function initpage() {
         "locale": "de",
     });
 
-    tbl = new Tabulator("#tbl_invoices", {
-        headerFilterPlaceholder: "filter...",
-        height: "92vh",
-        layout: "fitData",
-        selectable: 1,
-        // responsiveLayout:"collapse",
-        columns: [
-            { title: "Quartal", field: "bquarter", headerFilter: "input" },
-            {
-                title: "Datum",
-                field: "invoicedate",
-                formatter: "datetime",
-                formatterParams: {
-                    inputFormat: "YYYY-MM-DD",
-                    outputFormat: "DD.MM.YYYY",
-                    invalidPlaceholder: ""
-                }
-            },
-            { title: "Empfänger", field: "receipient", headerFilter: "input", width: 200 },
-            { title: "Sender", field: "sender", headerFilter: "input" },
-            { title: "Referenz", field: "reference", headerFilter: "input" },
-            {
-                title: "Status",
-                field: "status",
-                headerFilter: "input",
-                formatter: function(cell, formatterParams) {
-                    var value = cell.getValue();
-                    //console.log(value.indexOf("bez"));
-                    if (value.indexOf("payed") >= 0) {
-                        return "<span style='color:green;'>" + statuslang[value] + "</span>";
-                    } else if (value.indexOf("overdue") >= 0) {
-                        return "<span style='color:red; font-weight: bold;'>" + statuslang[value] + "</span>";
-                    } else if (value.indexOf("planned") >= 0) {
-                        return "<span style='color:grey;'>" + statuslang[value] + "</span>";
-                    } else {
-                        return "<span style='color:orange;'>" + statuslang[value] + "</span>";
-                    }
-                }
-            },
-            {
-                title: "Netto",
-                field: "netamount",
-                align: "right",
-                formatter: "money",
-                formatterParams: {
-                    decimal: ",",
-                    thousand: ".",
-                    symbol: "€",
-                    symbolAfter: "p",
-                    precision: 2,
-                }
-            },
-            {
-                title: "MwSt",
-                field: "vatamount",
-                align: "right",
-                formatter: "money",
-                formatterParams: {
-                    decimal: ",",
-                    thousand: ".",
-                    symbol: "€",
-                    symbolAfter: "p",
-                    precision: 2,
-                }
-            }, {
-                title: "Brutto",
-                field: "grossamount",
-                align: "right",
-                formatter: "money",
-                formatterParams: {
-                    decimal: ",",
-                    thousand: ".",
-                    symbol: "€",
-                    symbolAfter: "p",
-                    precision: 2,
-                }
-            }, {
-                title: "Bezahlt",
-                field: "payedamount",
-                align: "right",
-                formatter: "money",
-                formatterParams: {
-                    decimal: ",",
-                    thousand: ".",
-                    symbol: "€",
-                    symbolAfter: "p",
-                    precision: 2,
-                }
-            }
-        ]
-    });
-    gettbldata();
+    
     fillchoices();
+    inittblinvoices();
     inittblbookings();
     inittblfiles();
     return false;
 }
 
+function inittblinvoices(){
+  tbl = new Tabulator("#tbl_invoices", {
+    headerFilterPlaceholder: "filter...",
+    height: "92vh",
+    layout: "fitData",
+    selectable: 1,
+    // responsiveLayout:"collapse",
+    columns: [
+        { title: "Quartal", field: "bquarter", headerFilter: "input" },
+        {
+            title: "Datum",
+            field: "invoicedate",
+            formatter: "datetime",
+            formatterParams: {
+                inputFormat: "YYYY-MM-DD",
+                outputFormat: "DD.MM.YYYY",
+                invalidPlaceholder: ""
+            }
+        },
+        { title: "Empfänger", field: "receipient", headerFilter: "input", width: 200 },
+        { title: "Sender", field: "sender", headerFilter: "input" },
+        { title: "Referenz", field: "reference", headerFilter: "input" },
+        {
+            title: "Status",
+            field: "status",
+            headerFilter: "input",
+            formatter: function(cell, formatterParams) {
+                var value = cell.getValue();
+                //console.log(value.indexOf("bez"));
+                if (value.indexOf("payed") >= 0) {
+                    return "<span style='color:green;'>" + statuslang[value] + "</span>";
+                } else if (value.indexOf("overdue") >= 0) {
+                    return "<span style='color:red; font-weight: bold;'>" + statuslang[value] + "</span>";
+                } else if (value.indexOf("planned") >= 0) {
+                    return "<span style='color:grey;'>" + statuslang[value] + "</span>";
+                } else {
+                    return "<span style='color:orange;'>" + statuslang[value] + "</span>";
+                }
+            }
+        },
+        {
+            title: "Netto",
+            field: "netamount",
+            align: "right",
+            formatter: "money",
+            formatterParams: {
+                decimal: ",",
+                thousand: ".",
+                symbol: "€",
+                symbolAfter: "p",
+                precision: 2,
+            }
+        },
+        {
+            title: "MwSt",
+            field: "vatamount",
+            align: "right",
+            formatter: "money",
+            formatterParams: {
+                decimal: ",",
+                thousand: ".",
+                symbol: "€",
+                symbolAfter: "p",
+                precision: 2,
+            }
+        }, {
+            title: "Brutto",
+            field: "grossamount",
+            align: "right",
+            formatter: "money",
+            formatterParams: {
+                decimal: ",",
+                thousand: ".",
+                symbol: "€",
+                symbolAfter: "p",
+                precision: 2,
+            }
+        }, {
+            title: "Bezahlt",
+            field: "payedamount",
+            align: "right",
+            formatter: "money",
+            formatterParams: {
+                decimal: ",",
+                thousand: ".",
+                symbol: "€",
+                symbolAfter: "p",
+                precision: 2,
+            }
+        }
+    ]
+});
+gettbldata();
+}
+
 function inittblfiles() {
     tblfiles = new Tabulator("#tbl_files", {
         height: "80vh",
@@ -240,6 +245,7 @@ function fillinvoice(data) {
     if (data && data.sqldata) {
         //console.log(data);
         fillformbydataclass("invoices", data.sqldata[0], false);
+        gettblbookingdata();
     }
     return false;
 }
diff --git a/data/dksaccess.sqlite b/data/dksaccess.sqlite
new file mode 100644 (file)
index 0000000..60c838c
Binary files /dev/null and b/data/dksaccess.sqlite differ
index 1dac0d9..9b097cf 100644 (file)
--- a/dksnas.pl
+++ b/dksnas.pl
@@ -1,42 +1,24 @@
 #!C:\Strawberry\perl\bin\perl.exe
 use strict;
 use File::Basename;
-use Getopt::Long;
+
 use Time::HiRes;
 use Data::Dumper;
 use FindBin qw($Bin $RealBin);
-use lib ($RealBin);
-#use lib ('/home/dks/perl5/lib/perl5');
-# if ($^O ne "MSWin32" ){
-#      use lib (dirname($0));
-#      #use lib ($ENV{HOME}.'/perl5/lib/perl5');
-# }
-#if ($^O eq "darwin"){
-# use lib ($ENV{HOME}.'/perl5/lib/perl5');
-#}
 use Plack::Builder;
 use Plack::App::File;
 use Plack::App::WrapCGI;
 use Plack::Middleware::Auth::Basic;
 use Plack::Request; 
 use Plack::Runner;
-#use Module::Service;
-#use Module::Test;
-#use Module::SQLite;
-#use Module::Audio; 
-#use Module::System; 
-#use Module::OpenVPN; 
-#use Module::SSH; 
-#use JSON::PP;
+use lib ($RealBin);
+our $cfgpath = "";
 
 print $^O."\n";
 print $^X."\n";
 print "Process:".$$."\n";
 print join(@INC)."\n";
-# if (-e dirname($0).'/dksnas.json'){
-#   open(CFG,dirname($0).'/dksnas.json')
-#   close(CFG);
-# }
+
 my @match =  grep { /par-.*inc$/} @INC;
 
 my $basedir = $RealBin;
@@ -44,26 +26,27 @@ if (scalar(@match) > 0){
        $basedir = $match[0];
 }
 
-my $cfgpath = "";
+
 print "BASEDIR:".$basedir."\n";
 my $name = basename($0);
 $name =~ s/\.pl$//;
 $name =~ s/\.exe$//;
-$cfgpath = $ENV{HOME}.'/.dks';
+
 if ($^O eq "MSWin32"){
        $cfgpath = $ENV{APPDATA}.'/dks';
 } elsif ($^O eq "darwin"){
        $cfgpath = $ENV{HOME}.'/Library/Application Support/dks';
 } else {
        $cfgpath = $ENV{HOME}.'/.dks';
-}      
+}
+       
 $cfgpath =~ s/\\/\//g;
 print $cfgpath."\n";
 
 my $allapp = builder {
   enable "DirIndex", dir_index => 'index.html';
   mount "/" => Plack::App::WrapCGI->new(script => $RealBin."/CGI/index.cgi")->to_app;
-  #mount "/git" => Plack::App::WrapCGI->new(script => $RealBin."/CGI/git.cgi")->to_app;
+  
   opendir(API,dirname($0)."/CGI/api");
    while (my $s = readdir(API)){
      if ($s =~ /\.cgi$/){
@@ -72,6 +55,9 @@ my $allapp = builder {
    }
    closedir(API);
    mount "/htdocs" => Plack::App::File->new(root => $RealBin."/htdocs")->to_app;
+  #  if (-e $cfgpath.'/'.$name.'.passwd'){
+  #            enable "Auth::Basic", authenticator => \&authen_cb;     
+  #  }
 };