added full expenditures functionality

This commit is contained in:
2025-02-19 14:30:44 +01:00
parent 0e501e8ba4
commit dd587f7603
8 changed files with 1007 additions and 9 deletions

View File

@@ -44,15 +44,17 @@ function search(string, fields) {
var keywords = string.split(' ');
for (kid in keywords) {
var keyword = keywords[kid].toLowerCase();
var found = false;
for (fid in fields) {
var field = fields[fid].toLowerCase();
if (field.indexOf(keyword) >= 0) {
found = true;
break;
if (keyword != '') {
var found = false;
for (fid in fields) {
var field = fields[fid].toLowerCase();
if (field.indexOf(keyword) >= 0) {
found = true;
break;
}
}
if (!found) return false;
}
if (!found) return false;
}
return true;
}
@@ -1304,8 +1306,7 @@ function initDatabase() {
if ((oldVersion < 10) && (newVersion >= 10)) {
log('[db] to version 10');
var osExpenditures = db.createObjectStore('expenditures', { keyPath: 'id' });
osExpenditures.createIndex('user_from', 'user_from', { unique: false });
osExpenditures.createIndex('user_to', 'user_to', { unique: false });
osExpenditures.createIndex('user', 'user', { unique: false });
var osUpdateTimes = upgradeTransaction.objectStore('update_times');
osUpdateTimes.add({ table: 'expenditures', time: 0 });
}

View File

@@ -144,6 +144,69 @@
text-align: right;
}
/*** EXPENDITURES LIST ***/
.expenditures-list.display-border > div {
border-bottom: 1px solid #dee2e6;
}
.expenditures-list > div {
padding-top: 1rem;
padding-bottom: 1rem;
cursor: pointer;
}
.expenditures-list > div:last-child {
border: 0;
padding-bottom: 0;
}
.expenditures-list div {
white-space: nowrap;
}
.expenditures-list > div > div > div {
display: inline-block;
}
.expenditures-list > div > div:nth-child(1) > div:nth-child(1) {
width: calc(75% - 1.5em);
}
.expenditures-list > div > div:nth-child(1) > div:nth-child(2) {
width: 25%;
text-align: right;
}
.expenditures-list > div > div:nth-child(1) > div:nth-child(3) {
width: 1.5em;
text-align: right;
}
.expenditures-list > div > div:nth-child(2) > div:nth-child(1) {
width: 6em;
}
.expenditures-list > div > div:nth-child(2) > div:nth-child(2) {
width: calc(70% - 6em);
overflow-x: visible;
}
.expenditures-list > div > div:nth-child(2) > div:nth-child(3) {
width: 30%;
text-align: right;
}
.expenditures-list > div.sum {
padding: 0;
}
.expenditures-list > div.sum > div:nth-child(1) {
background: #dee2e6;
height: 1px;
display: flex;
justify-content: center;
}
.expenditures-list > div.sum > div:nth-child(1) > div:nth-child(1) {
background: white;
width: initial;
margin-top: -1em;
padding: 0 .5em;
}
/*** NORMAL LIST ***/
.normal-list > div {
padding-top: 1rem;