Skylar Ittner пре 10 месеци
родитељ
комит
37ce4a2cc4

+ 3
- 1
composer.json Прегледај датотеку

@@ -4,7 +4,9 @@
4 4
     "type": "project",
5 5
     "require": {
6 6
         "catfan/medoo": "^1.5",
7
-        "guzzlehttp/guzzle": "^6.2"
7
+        "guzzlehttp/guzzle": "^6.2",
8
+        "league/csv": "^9.1",
9
+        "lapinator/ods-php-generator": "^0.0.3"
8 10
     },
9 11
     "license": "MPL-2.0",
10 12
     "authors": [

+ 112
- 2
composer.lock Прегледај датотеку

@@ -4,8 +4,8 @@
4 4
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 5
         "This file is @generated automatically"
6 6
     ],
7
-    "hash": "577921e9d14ff39571692f88476151ee",
8
-    "content-hash": "1c8b61c5d506ae016285b99b20040cf0",
7
+    "hash": "0e5db12408080dd084cad072b8cfd599",
8
+    "content-hash": "348006dfc1d25121fcc3b4cb32bc3369",
9 9
     "packages": [
10 10
         {
11 11
             "name": "catfan/medoo",
@@ -247,6 +247,116 @@
247 247
             ],
248 248
             "time": "2017-03-20 17:10:46"
249 249
         },
250
+        {
251
+            "name": "lapinator/ods-php-generator",
252
+            "version": "v0.0.3",
253
+            "source": {
254
+                "type": "git",
255
+                "url": "https://github.com/Lapinator/odsPhpGenerator.git",
256
+                "reference": "575314c003c2ec3032813bedcc1d27032b7b7ab2"
257
+            },
258
+            "dist": {
259
+                "type": "zip",
260
+                "url": "https://api.github.com/repos/Lapinator/odsPhpGenerator/zipball/575314c003c2ec3032813bedcc1d27032b7b7ab2",
261
+                "reference": "575314c003c2ec3032813bedcc1d27032b7b7ab2",
262
+                "shasum": ""
263
+            },
264
+            "require": {
265
+                "php": ">=5.3"
266
+            },
267
+            "type": "library",
268
+            "autoload": {
269
+                "classmap": [
270
+                    "src/"
271
+                ]
272
+            },
273
+            "notification-url": "https://packagist.org/downloads/",
274
+            "license": [
275
+                "LGPL-3.0"
276
+            ],
277
+            "authors": [
278
+                {
279
+                    "name": "Laurent VUIBERT",
280
+                    "email": "lapinator@gmx.fr",
281
+                    "homepage": "http://lapinator.net",
282
+                    "role": "Developer"
283
+                }
284
+            ],
285
+            "description": "Open Document Spreadsheet (.ods) generator ",
286
+            "homepage": "https://odsphpgenerator.lapinator.net/",
287
+            "keywords": [
288
+                "LibreOffice",
289
+                "ods"
290
+            ],
291
+            "time": "2016-04-14 21:51:27"
292
+        },
293
+        {
294
+            "name": "league/csv",
295
+            "version": "9.1.4",
296
+            "source": {
297
+                "type": "git",
298
+                "url": "https://github.com/thephpleague/csv.git",
299
+                "reference": "9c8ad06fb5d747c149875beb6133566c00eaa481"
300
+            },
301
+            "dist": {
302
+                "type": "zip",
303
+                "url": "https://api.github.com/repos/thephpleague/csv/zipball/9c8ad06fb5d747c149875beb6133566c00eaa481",
304
+                "reference": "9c8ad06fb5d747c149875beb6133566c00eaa481",
305
+                "shasum": ""
306
+            },
307
+            "require": {
308
+                "ext-mbstring": "*",
309
+                "php": ">=7.0.10"
310
+            },
311
+            "require-dev": {
312
+                "ext-curl": "*",
313
+                "friendsofphp/php-cs-fixer": "^2.0",
314
+                "phpstan/phpstan": "^0.9.2",
315
+                "phpstan/phpstan-phpunit": "^0.9.4",
316
+                "phpstan/phpstan-strict-rules": "^0.9.0",
317
+                "phpunit/phpunit": "^6.0"
318
+            },
319
+            "suggest": {
320
+                "ext-iconv": "Needed to ease transcoding CSV using iconv stream filters"
321
+            },
322
+            "type": "library",
323
+            "extra": {
324
+                "branch-alias": {
325
+                    "dev-master": "9.x-dev"
326
+                }
327
+            },
328
+            "autoload": {
329
+                "psr-4": {
330
+                    "League\\Csv\\": "src"
331
+                },
332
+                "files": [
333
+                    "src/functions_include.php"
334
+                ]
335
+            },
336
+            "notification-url": "https://packagist.org/downloads/",
337
+            "license": [
338
+                "MIT"
339
+            ],
340
+            "authors": [
341
+                {
342
+                    "name": "Ignace Nyamagana Butera",
343
+                    "email": "nyamsprod@gmail.com",
344
+                    "homepage": "https://github.com/nyamsprod/",
345
+                    "role": "Developer"
346
+                }
347
+            ],
348
+            "description": "Csv data manipulation made easy in PHP",
349
+            "homepage": "http://csv.thephpleague.com",
350
+            "keywords": [
351
+                "csv",
352
+                "export",
353
+                "filter",
354
+                "import",
355
+                "read",
356
+                "write"
357
+            ],
358
+            "time": "2018-05-01 18:32:48"
359
+        },
250 360
         {
251 361
             "name": "psr/http-message",
252 362
             "version": "1.0.1",


+ 16
- 1
lang/en_us.php Прегледај датотеку

@@ -89,4 +89,19 @@ define("STRINGS", [
89 89
     "cash closed" => "Cash closed.",
90 90
     "register set" => "Register set.",
91 91
     "change register" => "Change register",
92
-]);
92
+    "reports" => "Reports",
93
+    "report type" => "Report Type",
94
+    "format" => "Format",
95
+    "filter" => "Filter",
96
+    "generate report" => "Generate Report",
97
+    "cashflow" => "Cash Flow",
98
+    "z report" => "Z Report",
99
+    "csv file" => "CSV text file",
100
+    "ods file" => "ODS spreadsheet",
101
+    "html file" => "HTML web page",
102
+    "register" => "Register",
103
+    "all" => "All",
104
+    "date range" => "Date Range",
105
+    "start" => "Start",
106
+    "end" => "End"
107
+]);

+ 297
- 0
lib/reports.php Прегледај датотеку

@@ -0,0 +1,297 @@
1
+<?php
2
+
3
+/* This Source Code Form is subject to the terms of the Mozilla Public
4
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
5
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
+
7
+
8
+// Detect if loaded by the user or by PHP
9
+if (count(get_included_files()) == 1) {
10
+    define("LOADED", true);
11
+} else {
12
+    define("LOADED", false);
13
+}
14
+
15
+require_once __DIR__ . "/../required.php";
16
+
17
+use League\Csv\Writer;
18
+use League\Csv\HTMLConverter;
19
+use odsPhpGenerator\ods;
20
+use odsPhpGenerator\odsTable;
21
+use odsPhpGenerator\odsTableRow;
22
+use odsPhpGenerator\odsTableColumn;
23
+use odsPhpGenerator\odsTableCellString;
24
+use odsPhpGenerator\odsStyleTableColumn;
25
+use odsPhpGenerator\odsStyleTableCell;
26
+
27
+require_once __DIR__ . "/userinfo.php";
28
+require_once __DIR__ . "/login.php";
29
+
30
+// Allow access with a download code, for mobile app and stuff
31
+$date = date("Y-m-d H:i:s");
32
+$allowed_users = [];
33
+$requester = -1;
34
+if (isset($VARS['code']) && LOADED) {
35
+    if (!$database->has('report_access_codes', ["AND" => ['code' => $VARS['code'], 'expires[>]' => $date]])) {
36
+        dieifnotloggedin();
37
+        $requester = $_SESSION['uid'];
38
+    } else {
39
+        $requester = $database->get('report_access_codes', 'uid', ['code' => $VARS['code']]);
40
+    }
41
+} else {
42
+    dieifnotloggedin();
43
+    $requester = $_SESSION['uid'];
44
+}
45
+
46
+if (account_has_permission($_SESSION['username'], "ADMIN")) {
47
+    $allowed_users = true;
48
+} else {
49
+    if (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE")) {
50
+        $allowed_users = getManagedUIDs($requester);
51
+    }
52
+
53
+    if (account_has_permission($_SESSION['username'], "QWIKCLOCK_EDITSELF")) {
54
+        $allowed_users[] = $_SESSION['uid'];
55
+    }
56
+}
57
+
58
+// Delete old DB entries
59
+$database->delete('report_access_codes', ['expires[<=]' => $date]);
60
+
61
+if (LOADED) {
62
+    $user = null;
63
+    if (isset($VARS['type']) && isset($VARS['format'])) {
64
+        generateReport($VARS['type'], $VARS['format'], $VARS['register'], $VARS['startdate'], $VARS['enddate']);
65
+        die();
66
+    } else {
67
+        lang("invalid parameters");
68
+        die();
69
+    }
70
+}
71
+
72
+function getCashFlowReport($register = null, $start = null, $end = null) {
73
+    global $database;
74
+    $where = [];
75
+
76
+    if (!is_null($register) && $database->has('registers', ['registerid' => $register])) {
77
+        $where["registers.registerid"] = $register;
78
+    }
79
+
80
+    if ((bool) strtotime($start) == TRUE) {
81
+        $where["OR #open"] = [
82
+            "open[>=]" => date("Y-m-d", strtotime($start)),
83
+            "close[>=]" => date("Y-m-d", strtotime($start))
84
+        ];
85
+    }
86
+    if ((bool) strtotime($end) == TRUE) {
87
+        // Make the date be the end of the day, not the start
88
+        $where["close[<=]"] = date("Y-m-d", strtotime($end)) . " 23:59:59";
89
+    }
90
+
91
+    if (count($where) > 1) {
92
+        $where = ["AND" => $where];
93
+    }
94
+    $cash = $database->select(
95
+            "cash_drawer", [
96
+        '[>]registers' => ['cash_drawer.registerid' => 'registerid'],
97
+        '[>]transactions' => ['cash_drawer.cashid' => 'cashid'],
98
+        '[>]payments' => ['transactions.txid' => 'txid'],
99
+        '[>]payment_types' => ['payments.type' => 'typeid']
100
+            ], [
101
+        "cash_drawer.cashid",
102
+        "registers.registername",
103
+        "cash_drawer.registerid",
104
+        "open",
105
+        "close",
106
+        "payments.type",
107
+        "payments.amount",
108
+        "payment_types.typename"
109
+            ], $where
110
+    );
111
+    $header = [lang("register", false), lang("open", false), lang("close", false), lang("cash", false), lang("card", false), lang("check", false), lang("crypto", false), lang("gift card", false), lang("free", false)];
112
+    $out = [$header];
113
+
114
+    $registers = [];
115
+
116
+    foreach ($cash as $c) {
117
+        $registers[$c['registerid']]['name'] = $c['registername'];
118
+        $registers[$c['registerid']]['id'] = $c['registerid'];
119
+        $registers[$c['registerid']]['open'] = date(DATETIME_FORMAT, strtotime($c['open']));
120
+        if (is_null($c['close'])) {
121
+            $registers[$c['registerid']]['close'] = date(DATETIME_FORMAT);
122
+        } else {
123
+            $registers[$c['registerid']]['close'] = date(DATETIME_FORMAT, strtotime($c['close']));
124
+        }
125
+        if (!isset($registers[$c['registerid']][$c['typename']])) {
126
+            $registers[$c['registerid']][$c['typename']] = 0.0;
127
+        }
128
+        $registers[$c['registerid']][$c['typename']] += $c['amount'];
129
+    }
130
+
131
+    foreach ($registers as $r) {
132
+        $types = $database->select('payment_types', 'typename');
133
+        foreach ($types as $t) {
134
+            if (!isset($r[$t])) {
135
+                $r[$t] = 0.0;
136
+            }
137
+        }
138
+        $out[] = [
139
+            $r['name'],
140
+            $r['open'],
141
+            $r['close'],
142
+            $r['cash'] . "",
143
+            $r['card'] . "",
144
+            $r['check'] . "",
145
+            $r['crypto'] . "",
146
+            $r['giftcard'] . "",
147
+            $r['free'] . ""
148
+        ];
149
+    }
150
+
151
+    return $out;
152
+}
153
+
154
+function getReportData($type, $register = null, $start = null, $end = null) {
155
+    switch ($type) {
156
+        case "cashflow":
157
+            return getCashFlowReport($register, $start, $end);
158
+        default:
159
+            return [["error"]];
160
+    }
161
+}
162
+
163
+function dataToCSV($data, $name = "report", $register = null, $start = null, $end = null) {
164
+    $csv = Writer::createFromString('');
165
+    $usernotice = "";
166
+    $usertitle = "";
167
+    $datetitle = "";
168
+    if ($start != null && (bool) strtotime($start)) {
169
+        $datenotice = lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false);
170
+        $datetitle = "_" . date(DATE_FORMAT, strtotime($start));
171
+        $csv->insertOne([$datenotice]);
172
+    }
173
+    if ($end != null && (bool) strtotime($end)) {
174
+        $datenotice = lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false);
175
+        $datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end));
176
+        $csv->insertOne([$datenotice]);
177
+    }
178
+    $csv->insertAll($data);
179
+    header('Content-type: text/csv');
180
+    header('Content-Disposition: attachment; filename="' . $name . $usertitle . $datetitle . "_" . date("Y-m-d_Hi") . ".csv" . '"');
181
+    echo $csv;
182
+    die();
183
+}
184
+
185
+function dataToODS($data, $name = "report", $register = null, $start = null, $end = null) {
186
+    $ods = new ods();
187
+    $styleColumn = new odsStyleTableColumn();
188
+    $styleColumn->setUseOptimalColumnWidth(true);
189
+    $headerstyle = new odsStyleTableCell();
190
+    $headerstyle->setFontWeight("bold");
191
+    $table = new odsTable($name);
192
+
193
+    for ($i = 0; $i < count($data[0]); $i++) {
194
+        $table->addTableColumn(new odsTableColumn($styleColumn));
195
+    }
196
+
197
+    $usernotice = "";
198
+    $usertitle = "";
199
+    $datetitle = "";
200
+    if ($user != null && array_key_exists('username', $user) && array_key_exists('name', $user)) {
201
+        $usernotice = lang2("report filtered to user", ["name" => $user['name'], "username" => $user['username']], false);
202
+        $usertitle = "_" . $user['username'];
203
+        $row = new odsTableRow();
204
+        $row->addCell(new odsTableCellString($usernotice));
205
+        $table->addRow($row);
206
+    }
207
+    if ($start != null && (bool) strtotime($start)) {
208
+        $datenotice = lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false);
209
+        $datetitle = "_" . date(DATE_FORMAT, strtotime($start));
210
+        $row = new odsTableRow();
211
+        $row->addCell(new odsTableCellString($datenotice));
212
+        $table->addRow($row);
213
+    }
214
+    if ($end != null && (bool) strtotime($end)) {
215
+        $datenotice = lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false);
216
+        $datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end));
217
+        $row = new odsTableRow();
218
+        $row->addCell(new odsTableCellString($datenotice));
219
+        $table->addRow($row);
220
+    }
221
+
222
+    $rowid = 0;
223
+    foreach ($data as $datarow) {
224
+        $row = new odsTableRow();
225
+        foreach ($datarow as $cell) {
226
+            if ($rowid == 0) {
227
+                $row->addCell(new odsTableCellString($cell, $headerstyle));
228
+            } else {
229
+                $row->addCell(new odsTableCellString($cell));
230
+            }
231
+        }
232
+        $table->addRow($row);
233
+        $rowid++;
234
+    }
235
+    $ods->addTable($table);
236
+    $ods->downloadOdsFile($name . $usertitle . $datetitle . "_" . date("Y-m-d_Hi") . ".ods");
237
+}
238
+
239
+function dataToHTML($data, $name = "report", $register = null, $start = null, $end = null) {
240
+    global $SECURE_NONCE;
241
+    // HTML exporter doesn't like null values
242
+    for ($i = 0; $i < count($data); $i++) {
243
+        for ($j = 0; $j < count($data[$i]); $j++) {
244
+            if (is_null($data[$i][$j])) {
245
+                $data[$i][$j] = '';
246
+            }
247
+        }
248
+    }
249
+    $datenotice = "";
250
+    $datetitle = "";
251
+    if ($start != null && (bool) strtotime($start)) {
252
+        $datenotice = "<span>" . lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false) . "</span><br />";
253
+        $datetitle = "_" . date(DATE_FORMAT, strtotime($start));
254
+    }
255
+    if ($end != null && (bool) strtotime($end)) {
256
+        $datenotice .= "<span>" . lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false) . "</span><br />";
257
+        $datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end));
258
+    }
259
+    header('Content-type: text/html');
260
+    $converter = new HTMLConverter();
261
+    $out = "<!DOCTYPE html>\n"
262
+            . "<meta charset=\"utf-8\">\n"
263
+            . "<meta name=\"viewport\" content=\"width=device-width\">\n"
264
+            . "<title>" . $name . $datetitle . "_" . date("Y-m-d_Hi") . "</title>\n"
265
+            . <<<STYLE
266
+<style nonce="$SECURE_NONCE">
267
+    .table-csv-data {
268
+        border-collapse: collapse;
269
+    }
270
+    .table-csv-data tr:first-child {
271
+        font-weight: bold;
272
+    }
273
+    .table-csv-data tr td {
274
+        border: 1px solid black;
275
+    }
276
+</style>
277
+STYLE
278
+            . $datenotice
279
+            . $converter->convert($data);
280
+    echo $out;
281
+}
282
+
283
+function generateReport($type, $format, $register = null, $start = null, $end = null, $deleted = true) {
284
+    $data = getReportData($type, $register, $start, $end, $deleted);
285
+    switch ($format) {
286
+        case "ods":
287
+            dataToODS($data, $type, $register, $start, $end);
288
+            break;
289
+        case "html":
290
+            dataToHTML($data, $type, $register, $start, $end);
291
+            break;
292
+        case "csv":
293
+        default:
294
+            echo dataToCSV($data, $type, $register, $start, $end);
295
+            break;
296
+    }
297
+}

+ 15
- 0
pages.php Прегледај датотеку

@@ -69,6 +69,21 @@ define("PAGES", [
69 69
             "static/js/registers.js"
70 70
         ],
71 71
     ],
72
+    "reports" => [
73
+        "title" => "reports",
74
+        "navbar" => true,
75
+        "icon" => "fas fa-download",
76
+        "styles" => [
77
+            "static/css/tempusdominus-bootstrap-4.min.css",
78
+            "static/css/easy-autocomplete.min.css"
79
+        ],
80
+        "scripts" => [
81
+            "static/js/moment.min.js",
82
+            "static/js/tempusdominus-bootstrap-4.min.js",
83
+            "static/js/jquery.easy-autocomplete.min.js",
84
+            "static/js/reports.js"
85
+        ]
86
+    ],
72 87
     "404" => [
73 88
         "title" => "404 error"
74 89
     ]

+ 91
- 0
pages/reports.php Прегледај датотеку

@@ -0,0 +1,91 @@
1
+<?php
2
+/* This Source Code Form is subject to the terms of the Mozilla Public
3
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
4
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
+
6
+require_once __DIR__ . '/../required.php';
7
+
8
+redirectifnotloggedin();
9
+
10
+if (false) {
11
+    ?>
12
+    <div class="alert alert-danger"><?php lang("missing permission") ?></div>
13
+    <?php
14
+} else {
15
+    ?>
16
+    <form action="lib/reports.php" method="GET" target="_BLANK">
17
+        <div class="row">
18
+            <div class="col-12 col-md-6">
19
+                <div class="row">
20
+                    <div class="col-12 col-sm-6 col-md-12 col-lg-6">
21
+                        <div class="card mb-4">
22
+                            <div class="card-body">
23
+                                <h4 class="card-title"><label for="type"><i class="fas fa-list"></i> <?php lang("report type"); ?></label></h4>
24
+                                <select name="type" id="type" class="form-control" required>
25
+                                    <option value="cashflow"><?php lang("cashflow") ?></option>
26
+                                </select>
27
+                            </div>
28
+                        </div>
29
+                    </div>
30
+                    <div class="col-12 col-sm-6 col-md-12 col-lg-6">
31
+                        <div class="card mb-4">
32
+                            <div class="card-body">
33
+                                <h4 class="card-title"><label for="format"><i class="fas fa-file"></i> <?php lang("format"); ?></label></h4>
34
+                                <select name="format" class="form-control" required>
35
+                                    <option value="csv"><?php lang("csv file") ?></option>
36
+                                    <option value="ods"><?php lang("ods file") ?></option>
37
+                                    <option value="html"><?php lang("html file") ?></option>
38
+                                </select>
39
+                            </div>
40
+                        </div>
41
+                    </div>
42
+                    <div class="col-12">
43
+                        <button type="submit" class="btn btn-success btn-block d-none d-lg-block genrptbtn"><i class="fas fa-download"></i> <?php lang("generate report"); ?></button>
44
+                    </div>
45
+                </div>
46
+            </div>
47
+            <div class="col-12 col-md-6">
48
+                <div class="row">
49
+                    <div class="col-12">
50
+                        <div class="card">
51
+                            <div class="card-body">
52
+                                <h4 class="card-title"><label><i class="fas fa-filter"></i> <?php lang("filter"); ?></label></h4>
53
+                                <div id="date-filter">
54
+                                    <label><i class="fas fa-calendar"></i> <?php lang("date range") ?></label><br />
55
+                                    <div class="input-group">
56
+                                        <input type="text" id="startdate" name="startdate" data-toggle="datetimepicker" data-target="#startdate" class="form-control" />
57
+                                        <span class="input-group-text"><i class="fas fa-chevron-right"></i></span>
58
+                                        <input type="text" id="enddate" name="enddate" data-toggle="datetimepicker" data-target="#enddate" class="form-control" />
59
+                                    </div>
60
+                                </div>
61
+                                <div id="register-filter" class="mt-2">
62
+                                    <label for="register"><i class="fas fa-store-alt"></i> <?php lang("register"); ?></label>
63
+                                    <select name="register" class="form-control">
64
+                                        <option value=""><?php lang("all"); ?></option>
65
+                                        <?php
66
+                                        $registers = $database->select('registers', ['registerid (id)', 'registername (name)']);
67
+                                        foreach ($registers as $r) {
68
+                                            echo '<option value="' . $r['id'] . '">' . $r['name'] . '</option>';
69
+                                        }
70
+                                        ?>
71
+                                    </select>
72
+                                </div>
73
+                            </div>
74
+                        </div>
75
+                    </div>
76
+                    <div class="col-12 mt-4">
77
+                        <?php
78
+                        $code = uniqid(rand(10000000, 99999999), true);
79
+                        $database->insert('report_access_codes', ['code' => $code, 'expires' => date("Y-m-d H:i:s", strtotime("+5 minutes"))]);
80
+                        ?>
81
+                        <input type="hidden" name="code" value="<?php echo $code; ?>" />
82
+
83
+                        <button type="submit" class="btn btn-success btn-block d-lg-none genrptbtn"><i class="fas fa-download"></i> <?php lang("generate report"); ?></button>
84
+                    </div>
85
+                </div>
86
+            </div>
87
+        </div>
88
+    </form>
89
+    <?php
90
+}
91
+?>

+ 11
- 0
static/css/easy-autocomplete.min.css
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 11
- 0
static/css/easy-autocomplete.themes.min.css
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 204
- 0
static/css/tempusdominus-bootstrap-4.min.css Прегледај датотеку

@@ -0,0 +1,204 @@
1
+/*@preserve
2
+ * Tempus Dominus Bootstrap4 v5.0.0-alpha16 (https://tempusdominus.github.io/bootstrap-4/)
3
+ * Copyright 2016-2018 Jonathan Peterson
4
+ * Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
5
+ */
6
+
7
+.sr-only, .bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after, .bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after, .bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after, .bootstrap-datetimepicker-widget .btn[data-action="clear"]::after, .bootstrap-datetimepicker-widget .btn[data-action="today"]::after, .bootstrap-datetimepicker-widget .picker-switch::after, .bootstrap-datetimepicker-widget table th.prev::after, .bootstrap-datetimepicker-widget table th.next::after {
8
+  position: absolute;
9
+  width: 1px;
10
+  height: 1px;
11
+  margin: -1px;
12
+  padding: 0;
13
+  overflow: hidden;
14
+  clip: rect(0, 0, 0, 0);
15
+  border: 0; }
16
+
17
+.bootstrap-datetimepicker-widget {
18
+  list-style: none; }
19
+  .bootstrap-datetimepicker-widget.dropdown-menu {
20
+    display: block;
21
+    margin: 2px 0;
22
+    padding: 4px;
23
+    width: 14rem; }
24
+    @media (min-width: 576px) {
25
+      .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
26
+        width: 38em; } }
27
+    @media (min-width: 768px) {
28
+      .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
29
+        width: 38em; } }
30
+    @media (min-width: 992px) {
31
+      .bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
32
+        width: 38em; } }
33
+    .bootstrap-datetimepicker-widget.dropdown-menu:before, .bootstrap-datetimepicker-widget.dropdown-menu:after {
34
+      content: '';
35
+      display: inline-block;
36
+      position: absolute; }
37
+    .bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
38
+      border-left: 7px solid transparent;
39
+      border-right: 7px solid transparent;
40
+      border-bottom: 7px solid #ccc;
41
+      border-bottom-color: rgba(0, 0, 0, 0.2);
42
+      top: -7px;
43
+      left: 7px; }
44
+    .bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
45
+      border-left: 6px solid transparent;
46
+      border-right: 6px solid transparent;
47
+      border-bottom: 6px solid white;
48
+      top: -6px;
49
+      left: 8px; }
50
+    .bootstrap-datetimepicker-widget.dropdown-menu.top:before {
51
+      border-left: 7px solid transparent;
52
+      border-right: 7px solid transparent;
53
+      border-top: 7px solid #ccc;
54
+      border-top-color: rgba(0, 0, 0, 0.2);
55
+      bottom: -7px;
56
+      left: 6px; }
57
+    .bootstrap-datetimepicker-widget.dropdown-menu.top:after {
58
+      border-left: 6px solid transparent;
59
+      border-right: 6px solid transparent;
60
+      border-top: 6px solid white;
61
+      bottom: -6px;
62
+      left: 7px; }
63
+    .bootstrap-datetimepicker-widget.dropdown-menu.float-right:before {
64
+      left: auto;
65
+      right: 6px; }
66
+    .bootstrap-datetimepicker-widget.dropdown-menu.float-right:after {
67
+      left: auto;
68
+      right: 7px; }
69
+  .bootstrap-datetimepicker-widget .list-unstyled {
70
+    margin: 0; }
71
+  .bootstrap-datetimepicker-widget a[data-action] {
72
+    padding: 6px 0; }
73
+  .bootstrap-datetimepicker-widget a[data-action]:active {
74
+    box-shadow: none; }
75
+  .bootstrap-datetimepicker-widget .timepicker-hour, .bootstrap-datetimepicker-widget .timepicker-minute, .bootstrap-datetimepicker-widget .timepicker-second {
76
+    width: 54px;
77
+    font-weight: bold;
78
+    font-size: 1.2em;
79
+    margin: 0; }
80
+  .bootstrap-datetimepicker-widget button[data-action] {
81
+    padding: 6px; }
82
+  .bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
83
+    content: "Increment Hours"; }
84
+  .bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
85
+    content: "Increment Minutes"; }
86
+  .bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
87
+    content: "Decrement Hours"; }
88
+  .bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
89
+    content: "Decrement Minutes"; }
90
+  .bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
91
+    content: "Show Hours"; }
92
+  .bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
93
+    content: "Show Minutes"; }
94
+  .bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
95
+    content: "Toggle AM/PM"; }
96
+  .bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
97
+    content: "Clear the picker"; }
98
+  .bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
99
+    content: "Set the date to today"; }
100
+  .bootstrap-datetimepicker-widget .picker-switch {
101
+    text-align: center; }
102
+    .bootstrap-datetimepicker-widget .picker-switch::after {
103
+      content: "Toggle Date and Time Screens"; }
104
+    .bootstrap-datetimepicker-widget .picker-switch td {
105
+      padding: 0;
106
+      margin: 0;
107
+      height: auto;
108
+      width: auto;
109
+      line-height: inherit; }
110
+      .bootstrap-datetimepicker-widget .picker-switch td span {
111
+        line-height: 2.5;
112
+        height: 2.5em;
113
+        width: 100%; }
114
+  .bootstrap-datetimepicker-widget table {
115
+    width: 100%;
116
+    margin: 0; }
117
+    .bootstrap-datetimepicker-widget table td,
118
+    .bootstrap-datetimepicker-widget table th {
119
+      text-align: center;
120
+      border-radius: 0.25rem; }
121
+    .bootstrap-datetimepicker-widget table th {
122
+      height: 20px;
123
+      line-height: 20px;
124
+      width: 20px; }
125
+      .bootstrap-datetimepicker-widget table th.picker-switch {
126
+        width: 145px; }
127
+      .bootstrap-datetimepicker-widget table th.disabled, .bootstrap-datetimepicker-widget table th.disabled:hover {
128
+        background: none;
129
+        color: #868e96;
130
+        cursor: not-allowed; }
131
+      .bootstrap-datetimepicker-widget table th.prev::after {
132
+        content: "Previous Month"; }
133
+      .bootstrap-datetimepicker-widget table th.next::after {
134
+        content: "Next Month"; }
135
+    .bootstrap-datetimepicker-widget table thead tr:first-child th {
136
+      cursor: pointer; }
137
+      .bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
138
+        background: #e9ecef; }
139
+    .bootstrap-datetimepicker-widget table td {
140
+      height: 54px;
141
+      line-height: 54px;
142
+      width: 54px; }
143
+      .bootstrap-datetimepicker-widget table td.cw {
144
+        font-size: .8em;
145
+        height: 20px;
146
+        line-height: 20px;
147
+        color: #868e96; }
148
+      .bootstrap-datetimepicker-widget table td.day {
149
+        height: 20px;
150
+        line-height: 20px;
151
+        width: 20px; }
152
+      .bootstrap-datetimepicker-widget table td.day:hover, .bootstrap-datetimepicker-widget table td.hour:hover, .bootstrap-datetimepicker-widget table td.minute:hover, .bootstrap-datetimepicker-widget table td.second:hover {
153
+        background: #e9ecef;
154
+        cursor: pointer; }
155
+      .bootstrap-datetimepicker-widget table td.old, .bootstrap-datetimepicker-widget table td.new {
156
+        color: #868e96; }
157
+      .bootstrap-datetimepicker-widget table td.today {
158
+        position: relative; }
159
+        .bootstrap-datetimepicker-widget table td.today:before {
160
+          content: '';
161
+          display: inline-block;
162
+          border: solid transparent;
163
+          border-width: 0 0 7px 7px;
164
+          border-bottom-color: #007bff;
165
+          border-top-color: rgba(0, 0, 0, 0.2);
166
+          position: absolute;
167
+          bottom: 4px;
168
+          right: 4px; }
169
+      .bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover {
170
+        background-color: #007bff;
171
+        color: #fff;
172
+        text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }
173
+      .bootstrap-datetimepicker-widget table td.active.today:before {
174
+        border-bottom-color: #fff; }
175
+      .bootstrap-datetimepicker-widget table td.disabled, .bootstrap-datetimepicker-widget table td.disabled:hover {
176
+        background: none;
177
+        color: #868e96;
178
+        cursor: not-allowed; }
179
+      .bootstrap-datetimepicker-widget table td span {
180
+        display: inline-block;
181
+        width: 54px;
182
+        height: 54px;
183
+        line-height: 54px;
184
+        margin: 2px 1.5px;
185
+        cursor: pointer;
186
+        border-radius: 0.25rem; }
187
+        .bootstrap-datetimepicker-widget table td span:hover {
188
+          background: #e9ecef; }
189
+        .bootstrap-datetimepicker-widget table td span.active {
190
+          background-color: #007bff;
191
+          color: #fff;
192
+          text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }
193
+        .bootstrap-datetimepicker-widget table td span.old {
194
+          color: #868e96; }
195
+        .bootstrap-datetimepicker-widget table td span.disabled, .bootstrap-datetimepicker-widget table td span.disabled:hover {
196
+          background: none;
197
+          color: #868e96;
198
+          cursor: not-allowed; }
199
+  .bootstrap-datetimepicker-widget.usetwentyfour td.hour {
200
+    height: 27px;
201
+    line-height: 27px; }
202
+
203
+.input-group [data-toggle="datetimepicker"] {
204
+  cursor: pointer; }

+ 10
- 0
static/js/jquery.easy-autocomplete.min.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 7
- 0
static/js/moment.min.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


+ 55
- 0
static/js/reports.js Прегледај датотеку

@@ -0,0 +1,55 @@
1
+/* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
+
5
+$(".genrptbtn").click(function () {
6
+    setTimeout(function () {
7
+        window.location.reload();
8
+    }, 1000)
9
+});
10
+
11
+$(function () {
12
+    $('#startdate').datetimepicker({
13
+        format: "MMM D YYYY",
14
+        useCurrent: false,
15
+        icons: {
16
+            time: "fas fa-clock",
17
+            date: "fas fa-calendar",
18
+            up: "fas fa-arrow-up",
19
+            down: "fas fa-arrow-down"
20
+        }
21
+    });
22
+    $('#enddate').datetimepicker({
23
+        format: "MMM D YYYY"/*"YYYY-M-DTH:m"*/,
24
+        useCurrent: true,
25
+        icons: {
26
+            time: "fas fa-clock",
27
+            date: "fas fa-calendar",
28
+            up: "fas fa-arrow-up",
29
+            down: "fas fa-arrow-down"
30
+        }
31
+    });
32
+});
33
+
34
+$("#type").change(function () {
35
+    switch ($("#type").val()) {
36
+        case "cashflow":
37
+            $('#date-filter').show('fast');
38
+            $('#register-filter').show('fast');
39
+            $('#cash-filter').hide('fast');
40
+            break;
41
+        case "z":
42
+            $('#date-filter').hide('fast');
43
+            $('#register-filter').show('fast');
44
+            $('#cash-filter').show('fast');
45
+            break;
46
+        default:
47
+            $('#date-filter').show('fast');
48
+            $('#register-filter').show('fast');
49
+            $('#cash-filter').hide('fast');
50
+            break;
51
+    }
52
+});
53
+
54
+
55
+$('#cash-filter').hide();

+ 7
- 0
static/js/tempusdominus-bootstrap-4.min.js
Разлика између датотеке није приказан због своје велике величине
Прегледај датотеку


Loading…
Откажи
Сачувај