"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",
if (data && data.sqldata) {
//console.log(data);
fillformbydataclass("invoices", data.sqldata[0], false);
+ gettblbookingdata();
}
return false;
}
#!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;
$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$/){
}
closedir(API);
mount "/htdocs" => Plack::App::File->new(root => $RealBin."/htdocs")->to_app;
+ # if (-e $cfgpath.'/'.$name.'.passwd'){
+ # enable "Auth::Basic", authenticator => \&authen_cb;
+ # }
};