From 533dacc4cfdb3a6dbead2ef7135fed94c3c1e331 Mon Sep 17 00:00:00 2001 From: Kilian Saffran Date: Wed, 20 Nov 2019 17:24:26 +0100 Subject: [PATCH] v20191120 --- .../module/invoicejournal/index.js | 190 +++++++++--------- data/dksaccess.sqlite | Bin 0 -> 32768 bytes dksnas.pl | 38 ++-- 3 files changed, 110 insertions(+), 118 deletions(-) create mode 100644 data/dksaccess.sqlite diff --git a/CGI/tmpl/app/invoicejournal/module/invoicejournal/index.js b/CGI/tmpl/app/invoicejournal/module/invoicejournal/index.js index a457f39..4505686 100644 --- a/CGI/tmpl/app/invoicejournal/module/invoicejournal/index.js +++ b/CGI/tmpl/app/invoicejournal/module/invoicejournal/index.js @@ -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 "" + statuslang[value] + ""; - } else if (value.indexOf("overdue") >= 0) { - return "" + statuslang[value] + ""; - } else if (value.indexOf("planned") >= 0) { - return "" + statuslang[value] + ""; - } else { - return "" + statuslang[value] + ""; - } - } - }, - { - 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 "" + statuslang[value] + ""; + } else if (value.indexOf("overdue") >= 0) { + return "" + statuslang[value] + ""; + } else if (value.indexOf("planned") >= 0) { + return "" + statuslang[value] + ""; + } else { + return "" + statuslang[value] + ""; + } + } + }, + { + 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 index 0000000000000000000000000000000000000000..60c838c7fc3c3e34eb60cbdb5476bb8ae8b140fc GIT binary patch literal 32768 zcmeI(Jx|*}7zc1WAvnB*v_s?x)f6FtK!}tiB6sht5eq zQ9nk%1yjd%>sG0E4t8vz4%tfhTR1tNeev`B?ru2QoPVg=E>YTjr>nclq3}!)Md6L2 z2!gP}_9WZ=jh7ev1NJS3%Ks{^2>aWgQtYg>LWOi=?a$iB)c4h&t1sChHV8lf0uX=z z1Rwwb2s{OW(Vis9o15bJg{vDKGH^(nIHYG18Y(7Fnrc~76|H<+Rh7^QWjnRJWLrw5 zuBq?TrgGM-)XL2(<-K~PlrOYKrOsN`)Vj9kUDp~?;`kTeSLuU6xMrYV6Gc-my%y6u zc~z<9ol#{`k~0}`JoLh4jVa%yNPxU%rpR~<{yi;1O~)R%cE1p>szK4~%ao*P`{kZ#{4E#0!5pw4uNm-Hzc2wJ74DyQn(@un_jSX>}2x6K> zG$}1Sh-XqiQ#3q{$-Vs{WmAi^^ij~MTgU|_NM&SH!5?yh(>84Ncawi0epax?TM zWArc{iIYZ8Zu1}AV=Z?^`=TVvvN(PnWbEE4ByZ$%*@Ij*Z&;*sP&BNZMMySpwT*1yNH3YiqrAOdqAVP-#1Rwwb2tWV=5P$##AOHafJZXVcEFol;GJLIn z!S=M6V6P6y-lPAr|NNi*(?2!{KmY;|fB*y_009U<00Izz00ib(fIt7o`hSi)7^y)3 z0uX=z1Rwwb2tWV=5P$##m;l!Q7zPl400bZa0SG_<0uX=z1Rwx``4_ 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; + # } }; -- 2.39.5