Add cash report
parent
5775599b4b
commit
37ce4a2cc4
Binary file not shown.
@ -0,0 +1,297 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
|
||||||
|
// Detect if loaded by the user or by PHP
|
||||||
|
if (count(get_included_files()) == 1) {
|
||||||
|
define("LOADED", true);
|
||||||
|
} else {
|
||||||
|
define("LOADED", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
require_once __DIR__ . "/../required.php";
|
||||||
|
|
||||||
|
use League\Csv\Writer;
|
||||||
|
use League\Csv\HTMLConverter;
|
||||||
|
use odsPhpGenerator\ods;
|
||||||
|
use odsPhpGenerator\odsTable;
|
||||||
|
use odsPhpGenerator\odsTableRow;
|
||||||
|
use odsPhpGenerator\odsTableColumn;
|
||||||
|
use odsPhpGenerator\odsTableCellString;
|
||||||
|
use odsPhpGenerator\odsStyleTableColumn;
|
||||||
|
use odsPhpGenerator\odsStyleTableCell;
|
||||||
|
|
||||||
|
require_once __DIR__ . "/userinfo.php";
|
||||||
|
require_once __DIR__ . "/login.php";
|
||||||
|
|
||||||
|
// Allow access with a download code, for mobile app and stuff
|
||||||
|
$date = date("Y-m-d H:i:s");
|
||||||
|
$allowed_users = [];
|
||||||
|
$requester = -1;
|
||||||
|
if (isset($VARS['code']) && LOADED) {
|
||||||
|
if (!$database->has('report_access_codes', ["AND" => ['code' => $VARS['code'], 'expires[>]' => $date]])) {
|
||||||
|
dieifnotloggedin();
|
||||||
|
$requester = $_SESSION['uid'];
|
||||||
|
} else {
|
||||||
|
$requester = $database->get('report_access_codes', 'uid', ['code' => $VARS['code']]);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
dieifnotloggedin();
|
||||||
|
$requester = $_SESSION['uid'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (account_has_permission($_SESSION['username'], "ADMIN")) {
|
||||||
|
$allowed_users = true;
|
||||||
|
} else {
|
||||||
|
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_MANAGE")) {
|
||||||
|
$allowed_users = getManagedUIDs($requester);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (account_has_permission($_SESSION['username'], "QWIKCLOCK_EDITSELF")) {
|
||||||
|
$allowed_users[] = $_SESSION['uid'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete old DB entries
|
||||||
|
$database->delete('report_access_codes', ['expires[<=]' => $date]);
|
||||||
|
|
||||||
|
if (LOADED) {
|
||||||
|
$user = null;
|
||||||
|
if (isset($VARS['type']) && isset($VARS['format'])) {
|
||||||
|
generateReport($VARS['type'], $VARS['format'], $VARS['register'], $VARS['startdate'], $VARS['enddate']);
|
||||||
|
die();
|
||||||
|
} else {
|
||||||
|
lang("invalid parameters");
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getCashFlowReport($register = null, $start = null, $end = null) {
|
||||||
|
global $database;
|
||||||
|
$where = [];
|
||||||
|
|
||||||
|
if (!is_null($register) && $database->has('registers', ['registerid' => $register])) {
|
||||||
|
$where["registers.registerid"] = $register;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((bool) strtotime($start) == TRUE) {
|
||||||
|
$where["OR #open"] = [
|
||||||
|
"open[>=]" => date("Y-m-d", strtotime($start)),
|
||||||
|
"close[>=]" => date("Y-m-d", strtotime($start))
|
||||||
|
];
|
||||||
|
}
|
||||||
|
if ((bool) strtotime($end) == TRUE) {
|
||||||
|
// Make the date be the end of the day, not the start
|
||||||
|
$where["close[<=]"] = date("Y-m-d", strtotime($end)) . " 23:59:59";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (count($where) > 1) {
|
||||||
|
$where = ["AND" => $where];
|
||||||
|
}
|
||||||
|
$cash = $database->select(
|
||||||
|
"cash_drawer", [
|
||||||
|
'[>]registers' => ['cash_drawer.registerid' => 'registerid'],
|
||||||
|
'[>]transactions' => ['cash_drawer.cashid' => 'cashid'],
|
||||||
|
'[>]payments' => ['transactions.txid' => 'txid'],
|
||||||
|
'[>]payment_types' => ['payments.type' => 'typeid']
|
||||||
|
], [
|
||||||
|
"cash_drawer.cashid",
|
||||||
|
"registers.registername",
|
||||||
|
"cash_drawer.registerid",
|
||||||
|
"open",
|
||||||
|
"close",
|
||||||
|
"payments.type",
|
||||||
|
"payments.amount",
|
||||||
|
"payment_types.typename"
|
||||||
|
], $where
|
||||||
|
);
|
||||||
|
$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)];
|
||||||
|
$out = [$header];
|
||||||
|
|
||||||
|
$registers = [];
|
||||||
|
|
||||||
|
foreach ($cash as $c) {
|
||||||
|
$registers[$c['registerid']]['name'] = $c['registername'];
|
||||||
|
$registers[$c['registerid']]['id'] = $c['registerid'];
|
||||||
|
$registers[$c['registerid']]['open'] = date(DATETIME_FORMAT, strtotime($c['open']));
|
||||||
|
if (is_null($c['close'])) {
|
||||||
|
$registers[$c['registerid']]['close'] = date(DATETIME_FORMAT);
|
||||||
|
} else {
|
||||||
|
$registers[$c['registerid']]['close'] = date(DATETIME_FORMAT, strtotime($c['close']));
|
||||||
|
}
|
||||||
|
if (!isset($registers[$c['registerid']][$c['typename']])) {
|
||||||
|
$registers[$c['registerid']][$c['typename']] = 0.0;
|
||||||
|
}
|
||||||
|
$registers[$c['registerid']][$c['typename']] += $c['amount'];
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($registers as $r) {
|
||||||
|
$types = $database->select('payment_types', 'typename');
|
||||||
|
foreach ($types as $t) {
|
||||||
|
if (!isset($r[$t])) {
|
||||||
|
$r[$t] = 0.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$out[] = [
|
||||||
|
$r['name'],
|
||||||
|
$r['open'],
|
||||||
|
$r['close'],
|
||||||
|
$r['cash'] . "",
|
||||||
|
$r['card'] . "",
|
||||||
|
$r['check'] . "",
|
||||||
|
$r['crypto'] . "",
|
||||||
|
$r['giftcard'] . "",
|
||||||
|
$r['free'] . ""
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getReportData($type, $register = null, $start = null, $end = null) {
|
||||||
|
switch ($type) {
|
||||||
|
case "cashflow":
|
||||||
|
return getCashFlowReport($register, $start, $end);
|
||||||
|
default:
|
||||||
|
return [["error"]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function dataToCSV($data, $name = "report", $register = null, $start = null, $end = null) {
|
||||||
|
$csv = Writer::createFromString('');
|
||||||
|
$usernotice = "";
|
||||||
|
$usertitle = "";
|
||||||
|
$datetitle = "";
|
||||||
|
if ($start != null && (bool) strtotime($start)) {
|
||||||
|
$datenotice = lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false);
|
||||||
|
$datetitle = "_" . date(DATE_FORMAT, strtotime($start));
|
||||||
|
$csv->insertOne([$datenotice]);
|
||||||
|
}
|
||||||
|
if ($end != null && (bool) strtotime($end)) {
|
||||||
|
$datenotice = lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false);
|
||||||
|
$datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end));
|
||||||
|
$csv->insertOne([$datenotice]);
|
||||||
|
}
|
||||||
|
$csv->insertAll($data);
|
||||||
|
header('Content-type: text/csv');
|
||||||
|
header('Content-Disposition: attachment; filename="' . $name . $usertitle . $datetitle . "_" . date("Y-m-d_Hi") . ".csv" . '"');
|
||||||
|
echo $csv;
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
function dataToODS($data, $name = "report", $register = null, $start = null, $end = null) {
|
||||||
|
$ods = new ods();
|
||||||
|
$styleColumn = new odsStyleTableColumn();
|
||||||
|
$styleColumn->setUseOptimalColumnWidth(true);
|
||||||
|
$headerstyle = new odsStyleTableCell();
|
||||||
|
$headerstyle->setFontWeight("bold");
|
||||||
|
$table = new odsTable($name);
|
||||||
|
|
||||||
|
for ($i = 0; $i < count($data[0]); $i++) {
|
||||||
|
$table->addTableColumn(new odsTableColumn($styleColumn));
|
||||||
|
}
|
||||||
|
|
||||||
|
$usernotice = "";
|
||||||
|
$usertitle = "";
|
||||||
|
$datetitle = "";
|
||||||
|
if ($user != null && array_key_exists('username', $user) && array_key_exists('name', $user)) {
|
||||||
|
$usernotice = lang2("report filtered to user", ["name" => $user['name'], "username" => $user['username']], false);
|
||||||
|
$usertitle = "_" . $user['username'];
|
||||||
|
$row = new odsTableRow();
|
||||||
|
$row->addCell(new odsTableCellString($usernotice));
|
||||||
|
$table->addRow($row);
|
||||||
|
}
|
||||||
|
if ($start != null && (bool) strtotime($start)) {
|
||||||
|
$datenotice = lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false);
|
||||||
|
$datetitle = "_" . date(DATE_FORMAT, strtotime($start));
|
||||||
|
$row = new odsTableRow();
|
||||||
|
$row->addCell(new odsTableCellString($datenotice));
|
||||||
|
$table->addRow($row);
|
||||||
|
}
|
||||||
|
if ($end != null && (bool) strtotime($end)) {
|
||||||
|
$datenotice = lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false);
|
||||||
|
$datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end));
|
||||||
|
$row = new odsTableRow();
|
||||||
|
$row->addCell(new odsTableCellString($datenotice));
|
||||||
|
$table->addRow($row);
|
||||||
|
}
|
||||||
|
|
||||||
|
$rowid = 0;
|
||||||
|
foreach ($data as $datarow) {
|
||||||
|
$row = new odsTableRow();
|
||||||
|
foreach ($datarow as $cell) {
|
||||||
|
if ($rowid == 0) {
|
||||||
|
$row->addCell(new odsTableCellString($cell, $headerstyle));
|
||||||
|
} else {
|
||||||
|
$row->addCell(new odsTableCellString($cell));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$table->addRow($row);
|
||||||
|
$rowid++;
|
||||||
|
}
|
||||||
|
$ods->addTable($table);
|
||||||
|
$ods->downloadOdsFile($name . $usertitle . $datetitle . "_" . date("Y-m-d_Hi") . ".ods");
|
||||||
|
}
|
||||||
|
|
||||||
|
function dataToHTML($data, $name = "report", $register = null, $start = null, $end = null) {
|
||||||
|
global $SECURE_NONCE;
|
||||||
|
// HTML exporter doesn't like null values
|
||||||
|
for ($i = 0; $i < count($data); $i++) {
|
||||||
|
for ($j = 0; $j < count($data[$i]); $j++) {
|
||||||
|
if (is_null($data[$i][$j])) {
|
||||||
|
$data[$i][$j] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$datenotice = "";
|
||||||
|
$datetitle = "";
|
||||||
|
if ($start != null && (bool) strtotime($start)) {
|
||||||
|
$datenotice = "<span>" . lang2("report filtered to start date", ["date" => date(DATE_FORMAT, strtotime($start))], false) . "</span><br />";
|
||||||
|
$datetitle = "_" . date(DATE_FORMAT, strtotime($start));
|
||||||
|
}
|
||||||
|
if ($end != null && (bool) strtotime($end)) {
|
||||||
|
$datenotice .= "<span>" . lang2("report filtered to end date", ["date" => date(DATE_FORMAT, strtotime($end))], false) . "</span><br />";
|
||||||
|
$datetitle .= ($datetitle == "" ? "_" : "-") . date(DATE_FORMAT, strtotime($end));
|
||||||
|
}
|
||||||
|
header('Content-type: text/html');
|
||||||
|
$converter = new HTMLConverter();
|
||||||
|
$out = "<!DOCTYPE html>\n"
|
||||||
|
. "<meta charset=\"utf-8\">\n"
|
||||||
|
. "<meta name=\"viewport\" content=\"width=device-width\">\n"
|
||||||
|
. "<title>" . $name . $datetitle . "_" . date("Y-m-d_Hi") . "</title>\n"
|
||||||
|
. <<<STYLE
|
||||||
|
<style nonce="$SECURE_NONCE">
|
||||||
|
.table-csv-data {
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
.table-csv-data tr:first-child {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.table-csv-data tr td {
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
STYLE
|
||||||
|
. $datenotice
|
||||||
|
. $converter->convert($data);
|
||||||
|
echo $out;
|
||||||
|
}
|
||||||
|
|
||||||
|
function generateReport($type, $format, $register = null, $start = null, $end = null, $deleted = true) {
|
||||||
|
$data = getReportData($type, $register, $start, $end, $deleted);
|
||||||
|
switch ($format) {
|
||||||
|
case "ods":
|
||||||
|
dataToODS($data, $type, $register, $start, $end);
|
||||||
|
break;
|
||||||
|
case "html":
|
||||||
|
dataToHTML($data, $type, $register, $start, $end);
|
||||||
|
break;
|
||||||
|
case "csv":
|
||||||
|
default:
|
||||||
|
echo dataToCSV($data, $type, $register, $start, $end);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,91 @@
|
|||||||
|
<?php
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
require_once __DIR__ . '/../required.php';
|
||||||
|
|
||||||
|
redirectifnotloggedin();
|
||||||
|
|
||||||
|
if (false) {
|
||||||
|
?>
|
||||||
|
<div class="alert alert-danger"><?php lang("missing permission") ?></div>
|
||||||
|
<?php
|
||||||
|
} else {
|
||||||
|
?>
|
||||||
|
<form action="lib/reports.php" method="GET" target="_BLANK">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-md-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 col-sm-6 col-md-12 col-lg-6">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title"><label for="type"><i class="fas fa-list"></i> <?php lang("report type"); ?></label></h4>
|
||||||
|
<select name="type" id="type" class="form-control" required>
|
||||||
|
<option value="cashflow"><?php lang("cashflow") ?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-sm-6 col-md-12 col-lg-6">
|
||||||
|
<div class="card mb-4">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title"><label for="format"><i class="fas fa-file"></i> <?php lang("format"); ?></label></h4>
|
||||||
|
<select name="format" class="form-control" required>
|
||||||
|
<option value="csv"><?php lang("csv file") ?></option>
|
||||||
|
<option value="ods"><?php lang("ods file") ?></option>
|
||||||
|
<option value="html"><?php lang("html file") ?></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 col-md-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<h4 class="card-title"><label><i class="fas fa-filter"></i> <?php lang("filter"); ?></label></h4>
|
||||||
|
<div id="date-filter">
|
||||||
|
<label><i class="fas fa-calendar"></i> <?php lang("date range") ?></label><br />
|
||||||
|
<div class="input-group">
|
||||||
|
<input type="text" id="startdate" name="startdate" data-toggle="datetimepicker" data-target="#startdate" class="form-control" />
|
||||||
|
<span class="input-group-text"><i class="fas fa-chevron-right"></i></span>
|
||||||
|
<input type="text" id="enddate" name="enddate" data-toggle="datetimepicker" data-target="#enddate" class="form-control" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="register-filter" class="mt-2">
|
||||||
|
<label for="register"><i class="fas fa-store-alt"></i> <?php lang("register"); ?></label>
|
||||||
|
<select name="register" class="form-control">
|
||||||
|
<option value=""><?php lang("all"); ?></option>
|
||||||
|
<?php
|
||||||
|
$registers = $database->select('registers', ['registerid (id)', 'registername (name)']);
|
||||||
|
foreach ($registers as $r) {
|
||||||
|
echo '<option value="' . $r['id'] . '">' . $r['name'] . '</option>';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-12 mt-4">
|
||||||
|
<?php
|
||||||
|
$code = uniqid(rand(10000000, 99999999), true);
|
||||||
|
$database->insert('report_access_codes', ['code' => $code, 'expires' => date("Y-m-d H:i:s", strtotime("+5 minutes"))]);
|
||||||
|
?>
|
||||||
|
<input type="hidden" name="code" value="<?php echo $code; ?>" />
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-success btn-block d-lg-none genrptbtn"><i class="fas fa-download"></i> <?php lang("generate report"); ?></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,204 @@
|
|||||||
|
/*@preserve
|
||||||
|
* Tempus Dominus Bootstrap4 v5.0.0-alpha16 (https://tempusdominus.github.io/bootstrap-4/)
|
||||||
|
* Copyright 2016-2018 Jonathan Peterson
|
||||||
|
* Licensed under MIT (https://github.com/tempusdominus/bootstrap-3/blob/master/LICENSE)
|
||||||
|
*/
|
||||||
|
|
||||||
|
.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 {
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 1px;
|
||||||
|
margin: -1px;
|
||||||
|
padding: 0;
|
||||||
|
overflow: hidden;
|
||||||
|
clip: rect(0, 0, 0, 0);
|
||||||
|
border: 0; }
|
||||||
|
|
||||||
|
.bootstrap-datetimepicker-widget {
|
||||||
|
list-style: none; }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu {
|
||||||
|
display: block;
|
||||||
|
margin: 2px 0;
|
||||||
|
padding: 4px;
|
||||||
|
width: 14rem; }
|
||||||
|
@media (min-width: 576px) {
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
|
||||||
|
width: 38em; } }
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
|
||||||
|
width: 38em; } }
|
||||||
|
@media (min-width: 992px) {
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.timepicker-sbs {
|
||||||
|
width: 38em; } }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu:before, .bootstrap-datetimepicker-widget.dropdown-menu:after {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
position: absolute; }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:before {
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
border-bottom: 7px solid #ccc;
|
||||||
|
border-bottom-color: rgba(0, 0, 0, 0.2);
|
||||||
|
top: -7px;
|
||||||
|
left: 7px; }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.bottom:after {
|
||||||
|
border-left: 6px solid transparent;
|
||||||
|
border-right: 6px solid transparent;
|
||||||
|
border-bottom: 6px solid white;
|
||||||
|
top: -6px;
|
||||||
|
left: 8px; }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.top:before {
|
||||||
|
border-left: 7px solid transparent;
|
||||||
|
border-right: 7px solid transparent;
|
||||||
|
border-top: 7px solid #ccc;
|
||||||
|
border-top-color: rgba(0, 0, 0, 0.2);
|
||||||
|
bottom: -7px;
|
||||||
|
left: 6px; }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.top:after {
|
||||||
|
border-left: 6px solid transparent;
|
||||||
|
border-right: 6px solid transparent;
|
||||||
|
border-top: 6px solid white;
|
||||||
|
bottom: -6px;
|
||||||
|
left: 7px; }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.float-right:before {
|
||||||
|
left: auto;
|
||||||
|
right: 6px; }
|
||||||
|
.bootstrap-datetimepicker-widget.dropdown-menu.float-right:after {
|
||||||
|
left: auto;
|
||||||
|
right: 7px; }
|
||||||
|
.bootstrap-datetimepicker-widget .list-unstyled {
|
||||||
|
margin: 0; }
|
||||||
|
.bootstrap-datetimepicker-widget a[data-action] {
|
||||||
|
padding: 6px 0; }
|
||||||
|
.bootstrap-datetimepicker-widget a[data-action]:active {
|
||||||
|
box-shadow: none; }
|
||||||
|
.bootstrap-datetimepicker-widget .timepicker-hour, .bootstrap-datetimepicker-widget .timepicker-minute, .bootstrap-datetimepicker-widget .timepicker-second {
|
||||||
|
width: 54px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2em;
|
||||||
|
margin: 0; }
|
||||||
|
.bootstrap-datetimepicker-widget button[data-action] {
|
||||||
|
padding: 6px; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="incrementHours"]::after {
|
||||||
|
content: "Increment Hours"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="incrementMinutes"]::after {
|
||||||
|
content: "Increment Minutes"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="decrementHours"]::after {
|
||||||
|
content: "Decrement Hours"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="decrementMinutes"]::after {
|
||||||
|
content: "Decrement Minutes"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="showHours"]::after {
|
||||||
|
content: "Show Hours"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="showMinutes"]::after {
|
||||||
|
content: "Show Minutes"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="togglePeriod"]::after {
|
||||||
|
content: "Toggle AM/PM"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="clear"]::after {
|
||||||
|
content: "Clear the picker"; }
|
||||||
|
.bootstrap-datetimepicker-widget .btn[data-action="today"]::after {
|
||||||
|
content: "Set the date to today"; }
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch {
|
||||||
|
text-align: center; }
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch::after {
|
||||||
|
content: "Toggle Date and Time Screens"; }
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch td {
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
height: auto;
|
||||||
|
width: auto;
|
||||||
|
line-height: inherit; }
|
||||||
|
.bootstrap-datetimepicker-widget .picker-switch td span {
|
||||||
|
line-height: 2.5;
|
||||||
|
height: 2.5em;
|
||||||
|
width: 100%; }
|
||||||
|
.bootstrap-datetimepicker-widget table {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0; }
|
||||||
|
.bootstrap-datetimepicker-widget table td,
|
||||||
|
.bootstrap-datetimepicker-widget table th {
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 0.25rem; }
|
||||||
|
.bootstrap-datetimepicker-widget table th {
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
width: 20px; }
|
||||||
|
.bootstrap-datetimepicker-widget table th.picker-switch {
|
||||||
|
width: 145px; }
|
||||||
|
.bootstrap-datetimepicker-widget table th.disabled, .bootstrap-datetimepicker-widget table th.disabled:hover {
|
||||||
|
background: none;
|
||||||
|
color: #868e96;
|
||||||
|
cursor: not-allowed; }
|
||||||
|
.bootstrap-datetimepicker-widget table th.prev::after {
|
||||||
|
content: "Previous Month"; }
|
||||||
|
.bootstrap-datetimepicker-widget table th.next::after {
|
||||||
|
content: "Next Month"; }
|
||||||
|
.bootstrap-datetimepicker-widget table thead tr:first-child th {
|
||||||
|
cursor: pointer; }
|
||||||
|
.bootstrap-datetimepicker-widget table thead tr:first-child th:hover {
|
||||||
|
background: #e9ecef; }
|
||||||
|
.bootstrap-datetimepicker-widget table td {
|
||||||
|
height: 54px;
|
||||||
|
line-height: 54px;
|
||||||
|
width: 54px; }
|
||||||
|
.bootstrap-datetimepicker-widget table td.cw {
|
||||||
|
font-size: .8em;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
color: #868e96; }
|
||||||
|
.bootstrap-datetimepicker-widget table td.day {
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
width: 20px; }
|
||||||
|
.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 {
|
||||||
|
background: #e9ecef;
|
||||||
|
cursor: pointer; }
|
||||||
|
.bootstrap-datetimepicker-widget table td.old, .bootstrap-datetimepicker-widget table td.new {
|
||||||
|
color: #868e96; }
|
||||||
|
.bootstrap-datetimepicker-widget table td.today {
|
||||||
|
position: relative; }
|
||||||
|
.bootstrap-datetimepicker-widget table td.today:before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
border: solid transparent;
|
||||||
|
border-width: 0 0 7px 7px;
|
||||||
|
border-bottom-color: #007bff;
|
||||||
|
border-top-color: rgba(0, 0, 0, 0.2);
|
||||||
|
position: absolute;
|
||||||
|
bottom: 4px;
|
||||||
|
right: 4px; }
|
||||||
|
.bootstrap-datetimepicker-widget table td.active, .bootstrap-datetimepicker-widget table td.active:hover {
|
||||||
|
background-color: #007bff;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }
|
||||||
|
.bootstrap-datetimepicker-widget table td.active.today:before {
|
||||||
|
border-bottom-color: #fff; }
|
||||||
|
.bootstrap-datetimepicker-widget table td.disabled, .bootstrap-datetimepicker-widget table td.disabled:hover {
|
||||||
|
background: none;
|
||||||
|
color: #868e96;
|
||||||
|
cursor: not-allowed; }
|
||||||
|
.bootstrap-datetimepicker-widget table td span {
|
||||||
|
display: inline-block;
|
||||||
|
width: 54px;
|
||||||
|
height: 54px;
|
||||||
|
line-height: 54px;
|
||||||
|
margin: 2px 1.5px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 0.25rem; }
|
||||||
|
.bootstrap-datetimepicker-widget table td span:hover {
|
||||||
|
background: #e9ecef; }
|
||||||
|
.bootstrap-datetimepicker-widget table td span.active {
|
||||||
|
background-color: #007bff;
|
||||||
|
color: #fff;
|
||||||
|
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); }
|
||||||
|
.bootstrap-datetimepicker-widget table td span.old {
|
||||||
|
color: #868e96; }
|
||||||
|
.bootstrap-datetimepicker-widget table td span.disabled, .bootstrap-datetimepicker-widget table td span.disabled:hover {
|
||||||
|
background: none;
|
||||||
|
color: #868e96;
|
||||||
|
cursor: not-allowed; }
|
||||||
|
.bootstrap-datetimepicker-widget.usetwentyfour td.hour {
|
||||||
|
height: 27px;
|
||||||
|
line-height: 27px; }
|
||||||
|
|
||||||
|
.input-group [data-toggle="datetimepicker"] {
|
||||||
|
cursor: pointer; }
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,55 @@
|
|||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
$(".genrptbtn").click(function () {
|
||||||
|
setTimeout(function () {
|
||||||
|
window.location.reload();
|
||||||
|
}, 1000)
|
||||||
|
});
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
$('#startdate').datetimepicker({
|
||||||
|
format: "MMM D YYYY",
|
||||||
|
useCurrent: false,
|
||||||
|
icons: {
|
||||||
|
time: "fas fa-clock",
|
||||||
|
date: "fas fa-calendar",
|
||||||
|
up: "fas fa-arrow-up",
|
||||||
|
down: "fas fa-arrow-down"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$('#enddate').datetimepicker({
|
||||||
|
format: "MMM D YYYY"/*"YYYY-M-DTH:m"*/,
|
||||||
|
useCurrent: true,
|
||||||
|
icons: {
|
||||||
|
time: "fas fa-clock",
|
||||||
|
date: "fas fa-calendar",
|
||||||
|
up: "fas fa-arrow-up",
|
||||||
|
down: "fas fa-arrow-down"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#type").change(function () {
|
||||||
|
switch ($("#type").val()) {
|
||||||
|
case "cashflow":
|
||||||
|
$('#date-filter').show('fast');
|
||||||
|
$('#register-filter').show('fast');
|
||||||
|
$('#cash-filter').hide('fast');
|
||||||
|
break;
|
||||||
|
case "z":
|
||||||
|
$('#date-filter').hide('fast');
|
||||||
|
$('#register-filter').show('fast');
|
||||||
|
$('#cash-filter').show('fast');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$('#date-filter').show('fast');
|
||||||
|
$('#register-filter').show('fast');
|
||||||
|
$('#cash-filter').hide('fast');
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#cash-filter').hide();
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue