Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fe57749d9c | |||
| d3f9ca2c5d | |||
| fe18cb8dc2 | |||
| 20f47055f6 | |||
| c6caf7aacc | |||
| cc3a3a23a2 | |||
| cfd5362b1d | |||
| ca24ada1fd | |||
| 2adba956de | |||
| 3a2ab75b15 | |||
| 719558e8ee | |||
| 80311c8493 | |||
| 713edd3638 | |||
| e43ab1f20e | |||
| 9417c60346 | |||
| f8db846369 | |||
| dee494f7ca | |||
| a261d8eb9b | |||
| dbd84f193e | |||
| fa395b5a33 | |||
| 854cdded3d | |||
| 170a551169 | |||
| bf24b609c4 | |||
| 71309011a0 |
@@ -1,5 +1,6 @@
|
||||
description = "Umbrella : Accounting"
|
||||
|
||||
dependencies{
|
||||
implementation(project(":bus"))
|
||||
implementation(project(":core"))
|
||||
}
|
||||
@@ -3,13 +3,21 @@ package de.srsoftware.umbrella.accounting;
|
||||
|
||||
import de.srsoftware.umbrella.core.model.Account;
|
||||
import de.srsoftware.umbrella.core.model.Transaction;
|
||||
import de.srsoftware.umbrella.core.model.UmbrellaUser;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
||||
public interface AccountDb {
|
||||
Transaction dropTransaction(Transaction transaction);
|
||||
|
||||
void dropTransactionTag(long transactionId, String tag);
|
||||
|
||||
Collection<UmbrellaUser> getMembers(long accountId);
|
||||
|
||||
Optional<Transaction> lastTransaction(long accountId, String source, String dest, double amount);
|
||||
|
||||
Collection<Account> listAccounts(long userId);
|
||||
|
||||
Collection<String> listTags(long accountId, String source, String destination);
|
||||
|
||||
@@ -6,11 +6,10 @@ import static de.srsoftware.umbrella.accounting.Constants.CONFIG_DATABASE;
|
||||
import static de.srsoftware.umbrella.core.ConnectionProvider.connect;
|
||||
import static de.srsoftware.umbrella.core.ModuleRegistry.tagService;
|
||||
import static de.srsoftware.umbrella.core.ModuleRegistry.userService;
|
||||
import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
import static de.srsoftware.umbrella.core.constants.Path.*;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.invalidField;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.missingField;
|
||||
import static java.lang.System.Logger.Level.WARNING;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.*;
|
||||
import static de.srsoftware.umbrella.messagebus.MessageBus.messageBus;
|
||||
import static de.srsoftware.umbrella.messagebus.events.Event.EventType.CREATE;
|
||||
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import de.srsoftware.configuration.Configuration;
|
||||
@@ -23,6 +22,8 @@ import de.srsoftware.umbrella.core.constants.Field;
|
||||
import de.srsoftware.umbrella.core.constants.Text;
|
||||
import de.srsoftware.umbrella.core.exceptions.UmbrellaException;
|
||||
import de.srsoftware.umbrella.core.model.*;
|
||||
import de.srsoftware.umbrella.messagebus.events.Event;
|
||||
import de.srsoftware.umbrella.messagebus.events.TransactionEvent;
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -52,6 +53,7 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
case TRANSACTION -> {
|
||||
try {
|
||||
var transaction = accountDb.loadTransaction(Long.parseLong(path.pop()));
|
||||
if (!accountDb.getMembers(transaction.accountId()).contains(user.get())) throw forbidden("You are not allowed to access account {id}",Field.ID,transaction.accountId());
|
||||
yield dropTransaction(transaction, user.get(), path, ex);
|
||||
} catch (NumberFormatException ignored) {
|
||||
yield super.doDelete(path,ex);
|
||||
@@ -119,12 +121,13 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
var head = path.pop();
|
||||
return switch (head) {
|
||||
case null -> postEntry(user.get(),ex);
|
||||
case DESTINATIONS -> postSearchDestinations(user.get(),ex);
|
||||
case DESTINATIONS -> postSearchDestinations(user.get(),ex);
|
||||
case PURPOSES -> postSearchPurposes(user.get(),ex);
|
||||
case SOURCES -> postSearchSources(user.get(),ex);
|
||||
default -> {
|
||||
try {
|
||||
var accountId = Long.parseLong(head);
|
||||
if (!accountDb.getMembers(accountId).contains(user.get())) throw forbidden("You are not allowed to access account {id}",Field.ID,accountId);
|
||||
yield postToAccount(accountId,path,user.get(),ex);
|
||||
} catch (NumberFormatException ignored) {
|
||||
yield super.doPost(path,ex);
|
||||
@@ -137,16 +140,22 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean dropTransaction(Transaction transaction, UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
var dropped = accountDb.dropTransaction(transaction);
|
||||
messageBus().dispatch(new TransactionEvent(user,dropped,Event.EventType.DELETE));
|
||||
return sendContent(ex,dropped);
|
||||
}
|
||||
|
||||
public boolean dropTransaction(Transaction transaction, UmbrellaUser user, Path path, HttpExchange ex) throws IOException {
|
||||
var head = path.pop();
|
||||
return switch (head){
|
||||
case TAG -> dropTransactionTag(user,transaction,ex);
|
||||
case null, default -> super.doDelete(path,ex);
|
||||
case null -> dropTransaction(transaction,user,ex);
|
||||
default -> super.doDelete(path,ex);
|
||||
};
|
||||
}
|
||||
|
||||
private boolean dropTransactionTag(UmbrellaUser user, Transaction transaction, HttpExchange ex) throws IOException {
|
||||
LOG.log(WARNING,"Missing permission check in AccountModule.dropTransactionTag!");
|
||||
var json = json(ex);
|
||||
if (!json.has(Field.TAG)) throw missingField(Field.TAG);
|
||||
var tag = json.getString(Field.TAG);
|
||||
@@ -176,7 +185,15 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
}
|
||||
|
||||
private boolean getAccount(UmbrellaUser user, long accountId, HttpExchange ex) throws IOException {
|
||||
LOG.log(WARNING,"Missing authorization check in AccountingModule.getAccount(…)!");
|
||||
if (!accountDb.getMembers(accountId).contains(user)) throw forbidden("You are not allowed to access account {id}",Field.ID,accountId);
|
||||
return sendContent(ex, loadAccount(accountId));
|
||||
}
|
||||
|
||||
private boolean getAccounts(UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
return sendContent(ex,accountDb.listAccounts(user.id()).stream().map(Account::toMap));
|
||||
}
|
||||
|
||||
public AccountData loadAccount(long accountId){
|
||||
var account = accountDb.loadAccount(accountId);
|
||||
var transactions = accountDb.loadTransactions(account);
|
||||
var userMap = new HashMap<Long,UmbrellaUser>();
|
||||
@@ -193,20 +210,9 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
if (!userMap.containsKey(userId)) userMap.put(destination.id(),userService().loadUser(userId));
|
||||
}
|
||||
}
|
||||
|
||||
return sendContent(ex, Map.of(
|
||||
Field.ACCOUNT,account.toMap(),
|
||||
Field.TRANSACTIONS,transactions.stream().map(Transaction::toMap).toList(),
|
||||
Field.USER_LIST,mapValues(userMap)
|
||||
));
|
||||
return AccountData.of(account, transactions, userMap);
|
||||
}
|
||||
|
||||
private boolean getAccounts(UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
return sendContent(ex,accountDb.listAccounts(user.id()).stream().map(Account::toMap));
|
||||
}
|
||||
|
||||
|
||||
|
||||
private static boolean noNumbers(String s){
|
||||
try {
|
||||
Long.parseLong(s);
|
||||
@@ -218,7 +224,8 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
|
||||
private boolean patchTransaction(UmbrellaUser user, long transactionId, HttpExchange ex) throws IOException {
|
||||
var transaction = accountDb.loadTransaction(transactionId);
|
||||
LOG.log(WARNING,"Missing permission check in patchTransaction(…)!");
|
||||
if (!accountDb.getMembers(transaction.accountId()).contains(user)) throw forbidden("You are not allowed to access account {id}",Field.ID,transaction.accountId());
|
||||
var oldData = transaction.toMap();
|
||||
var json = json(ex);
|
||||
if (json.has(Field.AMOUNT)) transaction.amount(json.getDouble(Field.AMOUNT));
|
||||
if (json.has(Field.DATE)) transaction.date(LocalDate.parse(json.getString(Field.DATE)));
|
||||
@@ -226,7 +233,9 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
if (json.has(Field.PURPOSE)) transaction.purpose(json.getString(Field.PURPOSE));
|
||||
if (json.has(Field.SOURCE)) transaction.source(IdOrString.of(json.getString(Field.SOURCE)));
|
||||
if (json.has(Field.TAG)) transaction.tags().add(json.getString(Field.TAG));
|
||||
return sendContent(ex,accountDb.save(transaction));
|
||||
var patched = accountDb.save(transaction);
|
||||
messageBus().dispatch(new TransactionEvent(user,patched,oldData));
|
||||
return sendContent(ex,patched);
|
||||
}
|
||||
|
||||
private boolean postEntry(UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
@@ -291,10 +300,26 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
|
||||
|
||||
var transaction = accountDb.save(new Transaction(0,accountId,dateTime,source,destination,amount.doubleValue(),purpose,tags));
|
||||
|
||||
messageBus().dispatch(new TransactionEvent(user,transaction, CREATE));
|
||||
return sendContent(ex,newAccount != null ? newAccount : transaction);
|
||||
}
|
||||
|
||||
public boolean postGetLastTransaction(long accountId, UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
var json = json(ex);
|
||||
if (!json.has(Field.SOURCE)) throw missingField(Field.SOURCE);
|
||||
if (!(json.get(Field.SOURCE) instanceof JSONObject src)) throw invalidField(Field.SOURCE,JSON);
|
||||
var source = src.get(src.has(Field.ID) ? Field.ID : Field.DISPLAY).toString();
|
||||
if (!json.has(Field.DESTINATION)) throw missingField(Field.DESTINATION);
|
||||
if (!(json.get(Field.DESTINATION) instanceof JSONObject dst)) throw invalidField(Field.SOURCE,JSON);
|
||||
var dest = dst.get(dst.has(Field.ID) ? Field.ID : Field.DISPLAY).toString();
|
||||
if (!json.has(Field.AMOUNT)) throw missingField(Field.AMOUNT);
|
||||
if (!(json.get(Field.AMOUNT) instanceof Number amt)) throw invalidField(Field.AMOUNT,Text.NUMBER);
|
||||
var amount = amt.doubleValue();
|
||||
|
||||
var transaction = accountDb.lastTransaction(accountId, source, dest, amount);
|
||||
return transaction.isPresent() ? sendContent(ex,transaction.get()) : notFound(ex);
|
||||
}
|
||||
|
||||
public boolean postSearchDestinations(UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
return sendContent(ex,searchOptions(user, Field.DESTINATION, body(ex)));
|
||||
}
|
||||
@@ -311,7 +336,6 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
}
|
||||
|
||||
private boolean postSearchTags(long accountId, UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
LOG.log(WARNING,"Missing authorization check in AccountingModule.getAccount(…)!");
|
||||
var key = body(ex);
|
||||
if (!key.trim().startsWith("{")) { // search tags that contain value of body
|
||||
var tags = accountDb.searchTagsContaining(key, accountId);
|
||||
@@ -327,7 +351,9 @@ public class AccountingModule extends BaseHandler implements AccountingService {
|
||||
}
|
||||
|
||||
private boolean postToAccount(long accountId, Path path, UmbrellaUser user, HttpExchange ex) throws IOException {
|
||||
return switch (path.pop()) {
|
||||
var head = path.pop();
|
||||
return switch (head) {
|
||||
case PURPOSES -> postGetLastTransaction(accountId,user,ex);
|
||||
case TAGS -> postSearchTags(accountId,user,ex);
|
||||
case null, default -> super.doPost(path,ex);
|
||||
};
|
||||
|
||||
@@ -2,10 +2,12 @@
|
||||
package de.srsoftware.umbrella.accounting;
|
||||
|
||||
import static de.srsoftware.tools.NotImplemented.notImplemented;
|
||||
import static de.srsoftware.tools.Optionals.nullable;
|
||||
import static de.srsoftware.tools.jdbc.Condition.*;
|
||||
import static de.srsoftware.tools.jdbc.Query.*;
|
||||
import static de.srsoftware.tools.jdbc.Query.SelectQuery.ALL;
|
||||
import static de.srsoftware.umbrella.accounting.Constants.*;
|
||||
import static de.srsoftware.umbrella.core.ModuleRegistry.userService;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||
import static de.srsoftware.umbrella.core.exceptions.UmbrellaException.*;
|
||||
import static de.srsoftware.umbrella.core.model.Translatable.t;
|
||||
@@ -18,6 +20,7 @@ import de.srsoftware.umbrella.core.constants.Field;
|
||||
import de.srsoftware.umbrella.core.constants.Text;
|
||||
import de.srsoftware.umbrella.core.model.Account;
|
||||
import de.srsoftware.umbrella.core.model.Transaction;
|
||||
import de.srsoftware.umbrella.core.model.UmbrellaUser;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.time.ZoneOffset;
|
||||
@@ -116,6 +119,21 @@ public class SqliteDb extends BaseDb implements AccountDb {
|
||||
}
|
||||
}
|
||||
|
||||
public Transaction dropTransaction(Transaction transaction){
|
||||
try {
|
||||
db.setAutoCommit(false);
|
||||
Query.delete().from(TABLE_TAGS_TRANSACTIONS).where(TRANSACTION_ID,equal(transaction.id())).execute(db);
|
||||
Query.delete().from(TABLE_TRANSACTIONS).where(ID,equal(transaction.id())).execute(db);
|
||||
db.setAutoCommit(true);
|
||||
return transaction;
|
||||
} catch (SQLException e){
|
||||
try {
|
||||
db.rollback();
|
||||
} catch (SQLException ignored){};
|
||||
throw failedToDropObject(transaction);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropTransactionTag(long transactionId, String tag) {
|
||||
try {
|
||||
@@ -130,6 +148,50 @@ public class SqliteDb extends BaseDb implements AccountDb {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<UmbrellaUser> getMembers(long accountId) {
|
||||
try {
|
||||
var userIds = new HashSet<Long>();
|
||||
var rs = select("DISTINCT "+ SOURCE).from(TABLE_TRANSACTIONS).where(ACCOUNT,equal(accountId)).exec(db);
|
||||
while (rs.next()) try {
|
||||
userIds.add(Long.parseLong(rs.getString(1)));
|
||||
} catch (NumberFormatException ignored) {}
|
||||
rs.close();
|
||||
rs = select("DISTINCT "+ DESTINATION).from(TABLE_TRANSACTIONS).where(ACCOUNT,equal(accountId)).exec(db);
|
||||
while (rs.next()) try {
|
||||
userIds.add(Long.parseLong(rs.getString(1)));
|
||||
} catch (NumberFormatException ignored) {}
|
||||
rs.close();
|
||||
var us = userService();
|
||||
return userIds.stream().map(us::loadUser).toList();
|
||||
} catch (SQLException e) {
|
||||
throw failedToLoadMembers(Text.ACCOUNT);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<Transaction> lastTransaction(long accountId, String source, String dest, double amount) {
|
||||
try {
|
||||
var rs = select(ALL).from(TABLE_TRANSACTIONS)
|
||||
.where(ACCOUNT,equal(accountId)).where(SOURCE,equal(source)).where(DESTINATION,equal(dest)).where(AMOUNT,equal(amount))
|
||||
.sort(ID+" DESC")
|
||||
.limit(1)
|
||||
.exec(db);
|
||||
Transaction ta = null;
|
||||
if (rs.next()) ta = Transaction.of(rs);
|
||||
rs.close();
|
||||
if (ta != null){
|
||||
var tags = ta.tags();
|
||||
rs = select(TAG).from(TABLE_TAGS_TRANSACTIONS).leftJoin(TAG_ID,TABLE_TAGS,ID).where(TRANSACTION_ID,equal(ta.id())).exec(db);
|
||||
while (rs.next()) tags.add(rs.getString(1));
|
||||
rs.close();
|
||||
}
|
||||
return nullable(ta);
|
||||
} catch (SQLException e) {
|
||||
throw failedToSearchDb(t(Text.ACCOUNTING));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<Account> listAccounts(long userId) {
|
||||
try {
|
||||
@@ -271,13 +333,9 @@ public class SqliteDb extends BaseDb implements AccountDb {
|
||||
}
|
||||
} else if (transaction.isDirty()) {
|
||||
try {
|
||||
if (transaction.amount() == 0) {
|
||||
delete().from(TABLE_TRANSACTIONS).where(Field.ID, equal(transaction.id())).where(ACCOUNT, equal(transaction.accountId())).execute(db);
|
||||
} else {
|
||||
replaceInto(TABLE_TRANSACTIONS, Field.ID, Field.ACCOUNT, Field.TIMESTAMP, Field.SOURCE, Field.DESTINATION, Field.AMOUNT, Field.DESCRIPTION)
|
||||
.values(transaction.id(), transaction.accountId(), timestamp, transaction.source().value(), transaction.destination().value(), transaction.amount(), transaction.purpose())
|
||||
.execute(db).close();
|
||||
}
|
||||
replaceInto(TABLE_TRANSACTIONS, Field.ID, Field.ACCOUNT, Field.TIMESTAMP, Field.SOURCE, Field.DESTINATION, Field.AMOUNT, Field.DESCRIPTION)
|
||||
.values(transaction.id(), transaction.accountId(), timestamp, transaction.source().value(), transaction.destination().value(), transaction.amount(), transaction.purpose())
|
||||
.execute(db).close();
|
||||
return transaction.clearDirtyState();
|
||||
} catch (SQLException e) {
|
||||
throw failedToStoreObject(transaction);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MessageApi extends BaseHandler{
|
||||
}
|
||||
}
|
||||
|
||||
private void sendEvent(PrintWriter out, Event event) {
|
||||
private void sendEvent(PrintWriter out, Event<?> event) {
|
||||
if (event == null) return;
|
||||
out.print("event: ");
|
||||
out.println(event.eventType());
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/* © SRSoftware 2025 */
|
||||
package de.srsoftware.umbrella.messagebus.events;
|
||||
|
||||
import static de.srsoftware.umbrella.core.ModuleRegistry.accountingService;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||
import static de.srsoftware.umbrella.core.model.Translatable.t;
|
||||
|
||||
import de.srsoftware.umbrella.core.constants.Field;
|
||||
import de.srsoftware.umbrella.core.constants.Module;
|
||||
import de.srsoftware.umbrella.core.constants.Text;
|
||||
import de.srsoftware.umbrella.core.model.Transaction;
|
||||
import de.srsoftware.umbrella.core.model.Translatable;
|
||||
import de.srsoftware.umbrella.core.model.UmbrellaUser;
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
public class TransactionEvent extends Event<Transaction> {
|
||||
private Collection<UmbrellaUser> audience;
|
||||
|
||||
public TransactionEvent(UmbrellaUser initiator, Transaction transaction, EventType type) {
|
||||
super(initiator, Module.ACCOUNTING, transaction, type);
|
||||
audience = null;
|
||||
}
|
||||
|
||||
public TransactionEvent(UmbrellaUser initiator, Transaction transaction, Map<String, Object> oldData){
|
||||
super(initiator,Module.ACCOUNTING,transaction,oldData);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Collection<UmbrellaUser> audience() {
|
||||
if (audience == null) audience = accountingService().loadAccount(payload().accountId()).userMap().values();
|
||||
return audience;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Translatable describe() {
|
||||
var user = initiator().name();
|
||||
var type = t(Text.TRANSACTION);
|
||||
var entity = payload().purpose();
|
||||
return switch (eventType()){
|
||||
case CREATE -> describeDetail();
|
||||
case DELETE -> describeDetail();
|
||||
case UPDATE -> describeUpdate();
|
||||
case null, default -> t("TODO"); // TODO
|
||||
};
|
||||
}
|
||||
|
||||
private Translatable describeUpdate() {
|
||||
var head = t("Changes in {type} '{entity}':\n\n{body}",Field.TYPE,t(Text.TRANSACTION),Field.ENTITY,oldData().get(PURPOSE),BODY,diff().orElse(""));
|
||||
return t("{head}\n\n{link}","head",head,"link",link());
|
||||
}
|
||||
|
||||
private Translatable describeDetail(){
|
||||
var tr = payload();
|
||||
|
||||
var message = "{source}: {source_name}\n{destination}: {dest_name}\n{amount}: {value}\n{purpose}: {purpose_val}\n\n{link}";
|
||||
return t(message,SOURCE,t(Text.SOURCE), "source_name",tr.source(), DESTINATION,t(Text.DESTINATION),"dest_name",tr.destination(), AMOUNT,t(Text.AMOUNT), VALUE,tr.amount(), PURPOSE,t(Text.PURPOSE),"purpose_val",tr.purpose(),"link",link());
|
||||
}
|
||||
|
||||
private Translatable link() {
|
||||
return t("You can view/edit this transaction at {base_url}/account/{id}", ID, payload().accountId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Translatable subject() {
|
||||
var user = initiator().name();
|
||||
var entity = payload().purpose();
|
||||
return switch (eventType()){
|
||||
case CREATE -> t("{user} added a new transaction: {entity}", USER,user, ENTITY, entity);
|
||||
case DELETE -> t("The transaction '{entity}' has been deleted by {user}",Field.ENTITY, entity, USER, user);
|
||||
case UPDATE -> t("{user} updated the transaction '{entity}'", USER,user, ENTITY, oldData().get(PURPOSE));
|
||||
case null, default -> t("TODO"); // TODO
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -53,6 +53,10 @@ public class ModuleRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
public static AccountingService accountingService() {
|
||||
return singleton.accountingService;
|
||||
}
|
||||
|
||||
public static BookmarkService bookmarkService(){
|
||||
return singleton.bookmarkService;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,32 @@
|
||||
/* © SRSoftware 2025 */
|
||||
package de.srsoftware.umbrella.core.api;
|
||||
|
||||
import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
|
||||
import de.srsoftware.tools.Mappable;
|
||||
import de.srsoftware.umbrella.core.constants.Field;
|
||||
import de.srsoftware.umbrella.core.model.Account;
|
||||
import de.srsoftware.umbrella.core.model.Transaction;
|
||||
import de.srsoftware.umbrella.core.model.UmbrellaUser;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface AccountingService {
|
||||
public record AccountData(Account account, List<Transaction> transactions, HashMap<Long, UmbrellaUser> userMap) implements Mappable {
|
||||
public static AccountData of(Account account, List<Transaction> transactions, HashMap<Long, UmbrellaUser> userMap) {
|
||||
return new AccountData(account, transactions, userMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> toMap() {
|
||||
return Map.of(
|
||||
Field.ACCOUNT,account.toMap(),
|
||||
Field.TRANSACTIONS,transactions.stream().map(Transaction::toMap).toList(),
|
||||
Field.USER_LIST,mapValues(userMap)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
AccountData loadAccount(long accountId);
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ public class Field {
|
||||
public static final String EDITOR = "editor";
|
||||
public static final String EMAIL = "email";
|
||||
public static final String END_TIME = "end_time";
|
||||
public static final String ENTITY = "entity";
|
||||
public static final String ENTITY_ID = "entity_id";
|
||||
public static final String EST_TIME = "est_time";
|
||||
public static final String EVALUATION = "evaluation";
|
||||
|
||||
@@ -7,6 +7,7 @@ package de.srsoftware.umbrella.core.constants;
|
||||
public class Text {
|
||||
public static final String ACCOUNT = "account";
|
||||
public static final String ACCOUNTING = "accounting";
|
||||
public static final String AMOUNT = "amount";
|
||||
|
||||
public static final String BOOKMARK = "bookmark";
|
||||
public static final String BOOKMARKS = "bookmarks";
|
||||
@@ -21,6 +22,7 @@ public class Text {
|
||||
public static final String CUSTOMER = "customer";
|
||||
public static final String CUSTOMER_SETTINGS = "customer settings";
|
||||
|
||||
public static final String DESTINATION = "destination";
|
||||
public static final String DOCUMENT = "document";
|
||||
public static final String DOCUMENTS = "documents";
|
||||
public static final String DOCUMENT_TYPE_ID = "document type id";
|
||||
@@ -60,6 +62,7 @@ public class Text {
|
||||
public static final String PROJECT_WITH_ID = "project ({id})";
|
||||
public static final String PROPERTIES = "properties";
|
||||
public static final String PROPERTY = "property";
|
||||
public static final String PURPOSE = "purpose";
|
||||
|
||||
public static final String RECEIVER = "receiver";
|
||||
public static final String RECEIVERS = "receivers";
|
||||
@@ -69,6 +72,7 @@ public class Text {
|
||||
public static final String SERVICE_WITH_ID = "service ({id})";
|
||||
public static final String SESSION = "session";
|
||||
public static final String SETTINGS = "settings";
|
||||
public static final String SOURCE = "source";
|
||||
public static final String STOCK = "stock";
|
||||
public static final String STRING = "string";
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/* © SRSoftware 2025 */
|
||||
package de.srsoftware.umbrella.core.model;
|
||||
|
||||
import static de.srsoftware.tools.Optionals.isSet;
|
||||
|
||||
import de.srsoftware.tools.Mappable;
|
||||
import de.srsoftware.umbrella.core.constants.Field;
|
||||
import java.util.HashMap;
|
||||
@@ -52,6 +54,10 @@ public class IdOrString implements Mappable {
|
||||
return map;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
return id == null && !isSet(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return value;
|
||||
@@ -60,4 +66,4 @@ public class IdOrString implements Mappable {
|
||||
public String value(){
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import static de.srsoftware.umbrella.core.ModuleRegistry.*;
|
||||
import static de.srsoftware.umbrella.core.ResponseCode.HTTP_UNPROCESSABLE;
|
||||
import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.AMOUNT;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.COMPANY;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.CUSTOMER;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.DOCUMENT;
|
||||
|
||||
@@ -9,6 +9,7 @@ import static de.srsoftware.umbrella.core.Errors.*;
|
||||
import static de.srsoftware.umbrella.core.ModuleRegistry.translator;
|
||||
import static de.srsoftware.umbrella.core.constants.Constants.FALLBACK_LANG;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.AMOUNT;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.COMPANY;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.CUSTOMER;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.NUMBER;
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
let selected = $state(null);
|
||||
let candidates = $state([]);
|
||||
let timer = null;
|
||||
let list_elem;
|
||||
|
||||
async function dummyGetCandidates(text){
|
||||
console.warn(`getCandidates(${text}) not overridden!`);
|
||||
@@ -58,9 +59,8 @@
|
||||
}
|
||||
|
||||
async function fetchCandidates(){
|
||||
candidates = await getCandidates(candidate.display);
|
||||
candidates = candidate.display ? await getCandidates(candidate.display) : [];
|
||||
selected = null;
|
||||
if (selected>candidates.length) selected = candidates.length;
|
||||
}
|
||||
|
||||
async function onkeyup(ev){
|
||||
@@ -69,12 +69,14 @@
|
||||
ev.preventDefault();
|
||||
selected = selected == null ? 0: selected +1;
|
||||
if (selected >= candidates.length) selected = 0;
|
||||
scrollTo(selected);
|
||||
return false;
|
||||
}
|
||||
if (ev.key == 'ArrowUp'){
|
||||
ev.preventDefault();
|
||||
selected = selected == null ? candidates.length -1 : selected -1;
|
||||
if (selected < 0) selected = candidates.length -1;
|
||||
scrollTo(selected);
|
||||
return false;
|
||||
}
|
||||
if (ev.key == 'Enter'|| ev.key == 'Tab'){
|
||||
@@ -113,6 +115,11 @@
|
||||
onSelect(candidate);
|
||||
|
||||
}
|
||||
|
||||
function scrollTo(index){
|
||||
let list_elements = list_elem.children;
|
||||
if (list_elements) list_elements[index].scrollIntoView({block:'center'});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@@ -125,21 +132,24 @@
|
||||
color: orange;
|
||||
border: 1px solid orange;
|
||||
border-radius: 5px;
|
||||
z-index: 50;
|
||||
z-index: 65;
|
||||
list-style: none;
|
||||
padding: 4px;
|
||||
margin: 0;
|
||||
min-width: 400px;
|
||||
max-height: 200px;
|
||||
overflow: scroll;
|
||||
}
|
||||
.highlight { background: orange; color: black; }
|
||||
|
||||
</style>
|
||||
|
||||
<span>
|
||||
<span class="autocomplete">
|
||||
<input type="text" bind:value={candidate.display} {onkeyup} autofocus={autofocus} {id} />
|
||||
{#if candidates && candidates.length > 0}
|
||||
<ul>
|
||||
<ul bind:this={list_elem} class="suggestions">
|
||||
{#each candidates as candidate,i}
|
||||
<li class="option {selected==i?'highlight':''}" onclick={e => selected = i} ondblclick={e => select(i)}>{candidate.display}</li>
|
||||
<li class="option {selected==i?'highlight':''}" onclick={e => select(i)} ondblclick={e => select(i)}>{candidate.display}</li>
|
||||
{/each}
|
||||
</ul>
|
||||
{/if}
|
||||
|
||||
@@ -155,5 +155,8 @@
|
||||
{/if}
|
||||
{:else}
|
||||
<Display classes={{editable}} markdown={value} {onclick} {oncontextmenu} title={t('right_click_to_edit')} wrapper={type} />
|
||||
{#if !value.rendered}
|
||||
<button onclick={oncontextmenu}>{t('add_object',{object:t('content')})}</button>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script>
|
||||
import { onMount } from 'svelte';
|
||||
import { api, get } from '../../urls.svelte';
|
||||
import { api, eventStream, get } from '../../urls.svelte';
|
||||
import { error, yikes } from '../../warn.svelte';
|
||||
import { t } from '../../translations.svelte';
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
let { id } = $props();
|
||||
let account = $state(null);
|
||||
let eventSource = null;
|
||||
let filter = $state([]);
|
||||
let transactions = $state([]);
|
||||
let filtered = $derived(transactions.filter(t => checker(t.tags,filter)));
|
||||
@@ -27,7 +28,6 @@
|
||||
if (!transaction.destination.id) sums[0] += transaction.amount;
|
||||
if (!transaction.source.id) sums[0] -= transaction.amount;
|
||||
}
|
||||
window.setTimeout(scrollToBottom,100);
|
||||
return sums;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,30 @@
|
||||
filter = filter.filter(x => x != tag.toLowerCase());
|
||||
}
|
||||
|
||||
function handleCreateEvent(evt){
|
||||
const event_data = JSON.parse(evt.data);
|
||||
const new_transaction = event_data.transaction;
|
||||
transactions.push(new_transaction);
|
||||
window.setTimeout(scrollToBottom,100);
|
||||
}
|
||||
|
||||
function handleDeleteEvent(evt){
|
||||
const event_data = JSON.parse(evt.data);
|
||||
transactions = transactions.filter(t => t.id != event_data.transaction.id);
|
||||
}
|
||||
|
||||
function handleUpdateEvent(evt){
|
||||
const event_data = JSON.parse(evt.data);
|
||||
const updated_transaction = event_data.transaction;
|
||||
for (var idx in transactions){
|
||||
if (transactions[idx].id == updated_transaction.id) {
|
||||
updated_transaction.tags = transactions[idx].tags;
|
||||
transactions[idx] = updated_transaction;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function load(){
|
||||
let url = api(`accounting/${id}`);
|
||||
let res = await get(url);
|
||||
@@ -59,11 +83,15 @@
|
||||
transactions = json.transactions;
|
||||
users = json.user_list;
|
||||
account = json.account;
|
||||
try {
|
||||
eventSource = eventStream(handleCreateEvent,handleUpdateEvent,handleDeleteEvent);
|
||||
} catch (ignored) {}
|
||||
window.setTimeout(scrollToBottom,100);
|
||||
} else error(res);
|
||||
}
|
||||
|
||||
function onSave(){
|
||||
load();
|
||||
// load();
|
||||
}
|
||||
|
||||
function scrollToBottom(){
|
||||
@@ -77,6 +105,12 @@
|
||||
.amount{ text-align: right }
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
{#if account}
|
||||
<title>Umbrella – {account.name}</title>
|
||||
{/if}
|
||||
</svelte:head>
|
||||
|
||||
{#if filter.length > 0}
|
||||
<fieldset>
|
||||
<legend>{t('filter by tags')}</legend>
|
||||
@@ -101,6 +135,7 @@
|
||||
<th>{t('other party')}</th>
|
||||
<th>{t('purpose')}</th>
|
||||
<th>{t('tags')}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -122,7 +157,7 @@
|
||||
<br/>
|
||||
{sums[0].toFixed(2)} {account.currency}
|
||||
</td>
|
||||
<td colspan="2"></td>
|
||||
<td colspan="3"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -42,7 +42,10 @@
|
||||
}
|
||||
|
||||
function focusOnEnter(ev,id){
|
||||
if (ev.key == 'Enter') document.getElementById(id).focus();
|
||||
if (ev.key == 'Enter') {
|
||||
proposePurpose();
|
||||
document.getElementById(id).focus();
|
||||
}
|
||||
}
|
||||
|
||||
async function getAccountTags(text){
|
||||
@@ -93,6 +96,20 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function proposePurpose(){
|
||||
const source = entry.source;
|
||||
const destination = entry.destination;
|
||||
const amount = entry.amount;
|
||||
const url = api(`accounting/${account.id}/purposes`);
|
||||
const res = await post(url,{source,destination,amount});
|
||||
if (res.ok) {
|
||||
yikes();
|
||||
var lastTransaction = await res.json();
|
||||
entry.purpose = { display: lastTransaction.purpose};
|
||||
entry.tags = lastTransaction.tags;
|
||||
} else error(res);
|
||||
}
|
||||
|
||||
async function save(){
|
||||
let data = {
|
||||
...entry,
|
||||
@@ -169,4 +186,4 @@
|
||||
<span>
|
||||
<button onclick={save}>{t('save')}</button>
|
||||
</span>
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
onMount(load);
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Umbrella – {t('accounts')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<fieldset>
|
||||
|
||||
<span></span>
|
||||
|
||||
@@ -8,6 +8,16 @@
|
||||
let { account, addToFilter = tag => {}, transaction, users } = $props();
|
||||
let hidden = $state(false);
|
||||
|
||||
function deleteTransaction(ev){
|
||||
if (confirm(t('confirm_delete',{element:transaction.purpose}))){
|
||||
const url = api(`accounting/transaction/${transaction.id}`);
|
||||
const res = drop(url);
|
||||
if (res.ok){
|
||||
yikes();
|
||||
} else error(res);
|
||||
}
|
||||
}
|
||||
|
||||
async function dropTag(tag){
|
||||
var url = api(`accounting/transaction/${transaction.id}/tag`)
|
||||
var res = await drop(url,{tag});
|
||||
@@ -127,5 +137,8 @@
|
||||
<Autocomplete {getCandidates} {onCommit} />
|
||||
</span>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button class="symbol" onclick={deleteTransaction}></button>
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
authors = {...authors, ...data.authors};
|
||||
loader.offset += loader.limit;
|
||||
loader.active = false;
|
||||
console.log({authors});
|
||||
yikes();
|
||||
if (Object.keys(data.notes).length) onscroll(null); // when notes were received, check whether they fill up the page
|
||||
|
||||
@@ -78,4 +79,4 @@
|
||||
</svelte:head>
|
||||
|
||||
<svelte:window {onscroll} />
|
||||
<List {notes} />
|
||||
<List {notes} {authors} />
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
<legend class="entity" onclick={() => goToEntity(note)}>{title(note)}</legend>
|
||||
{/if}
|
||||
<legend class="time">
|
||||
{#if !module} {authors[note.user_id].name} – {/if}
|
||||
{note.timestamp.replace('T',' ')}
|
||||
{#if user.id == note.user_id}
|
||||
<button class="symbol" onclick={() => drop(note.id)}></button>
|
||||
|
||||
@@ -200,9 +200,10 @@
|
||||
<LineEditor bind:value={project.name} editable={true} onSet={val => update({name:val})} />
|
||||
</div>
|
||||
<div>
|
||||
<button onclick={kanban}>{t('show_kanban')}</button>
|
||||
{t('options')}
|
||||
</div>
|
||||
<div>
|
||||
<button onclick={kanban}><span class="symbol"></span> {t('show_kanban')}</button>
|
||||
<button onclick={toggleSettings}><span class="symbol"></span> {t('settings')}</button>
|
||||
</div>
|
||||
<div>{t('state')}</div>
|
||||
|
||||
@@ -7,6 +7,7 @@ import static de.srsoftware.umbrella.core.Util.mapValues;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.*;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.PERMISSION;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.SETTINGS;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.SOURCE;
|
||||
import static de.srsoftware.umbrella.core.constants.Field.TAGS;
|
||||
import static de.srsoftware.umbrella.core.constants.Module.PROJECT;
|
||||
import static de.srsoftware.umbrella.core.constants.Path.*;
|
||||
|
||||
@@ -192,6 +192,8 @@
|
||||
"items": "Artikel",
|
||||
|
||||
"join_objects" : "{objects} zusammenführen",
|
||||
|
||||
"kanban": "Kanban",
|
||||
"key": "Suchbegriff",
|
||||
|
||||
"language": "Sprache",
|
||||
@@ -307,6 +309,7 @@
|
||||
"project ({id})": "Projekt ({id})",
|
||||
"Project '{project}' was edited": "Projekt '{project}' wurde bearbeitet",
|
||||
"projects": "Projekte",
|
||||
"Projects": "Projekte",
|
||||
"properties": "Eigenschaften",
|
||||
"property": "Eigenschaft",
|
||||
"purpose": "Zweck",
|
||||
@@ -394,6 +397,7 @@
|
||||
"The task '{task}' has been created": "Die Aufgabe '{task}' wurde angelegt",
|
||||
"The task '{task}' has been deleted": "Die Aufgabe '{task}' wurde gelöscht",
|
||||
"The task '{task}' has been deleted by {user}": "Die Aufgabe '{task}' wurde von {user} gelöscht",
|
||||
"The transaction '{entity}' has been deleted by {user}": "Der Umsatz „{entity}“ wurde von {user} gelöscht",
|
||||
"The wiki page '{name}' has been created": "Die Wiki-Seite „{name}“ wurde angelegt",
|
||||
"The wiki page '{name}' has been deleted": "Die Wiki-Seite „{name}“ wurde gelöscht.",
|
||||
"The wiki page '{page}' has been deleted by {user}": "Die Wiki-Seite „{page}“ wurde durch {user} gelöscht.",
|
||||
@@ -425,6 +429,8 @@
|
||||
"upload_file": "Datei hochladen",
|
||||
"user": "Benutzer",
|
||||
"user ({id})": "Benutzer ({id})",
|
||||
"{user} added a new transaction: {entity}": "{user} hat einen neuen Umsatz hinzugefügt: {entity}",
|
||||
"{user} updated the transaction '{entity}'": "{user} hat den Umsatz „{entity}“ aktualisiert",
|
||||
"user_list": "Benutzer-Liste",
|
||||
"user_module" : "Umbrella User-Verwaltung",
|
||||
"user profile": "Benutzer-Profil",
|
||||
@@ -452,6 +458,7 @@
|
||||
"wiki_pages": "Wiki-Seiten",
|
||||
|
||||
"year": "Jahr",
|
||||
"You can view/edit this transaction at {base_url}/account/{id}": "Du kannst diese transaktion unter {base_url}/account/{id} ansehen",
|
||||
"You can view/edit this project at {base_url}/project/{id}/view": "Du kannst dieses Projekt unter {base_url}/project/{id}/view ansehen/bearbeiten.",
|
||||
"You can view/edit this task at {base_url}/task/{id}/view": "Du kannst diese Aufgabe unter {base_url}/task/{id}/view ansehen/bearbeiten.",
|
||||
"You can view/edit this wiki page at {base_url}/wiki/{id}/view": "Du kannst diese Wiki-Seite unter {base_url}/wiki/{id}/view ansehen/bearbeiten.",
|
||||
|
||||
@@ -192,6 +192,8 @@
|
||||
"items": "items",
|
||||
|
||||
"join_objects" : "join {objects}",
|
||||
|
||||
"kanban": "Kanban",
|
||||
"key": "search term",
|
||||
|
||||
"language": "language",
|
||||
@@ -307,6 +309,7 @@
|
||||
"project ({id})": "project ({id})",
|
||||
"Project '{project}' was edited": "Project '{project}' was edited",
|
||||
"projects": "projects",
|
||||
"Projects": "projects",
|
||||
"properties": "properties",
|
||||
"property": "property",
|
||||
"purpose": "purpose",
|
||||
@@ -394,6 +397,7 @@
|
||||
"The task '{task}' has been created": "The task '{task}' has been created",
|
||||
"The task '{task}' has been deleted": "The task '{task}' has been deleted",
|
||||
"The task '{task}' has been deleted by {user}": "The task '{task}' has been deleted by {user}",
|
||||
"The transaction '{entity}' has been deleted by {user}": "The transaction '{entity}' has been deleted by {user}",
|
||||
"The wiki page '{name}' has been created": "The wiki page '{name}' has been created",
|
||||
"The wiki page '{name}' has been deleted": "The wiki page '{name}' has been deleted",
|
||||
"The wiki page '{page}' has been deleted by {user}": "The wiki page '{page}' has been deleted by {user}",
|
||||
@@ -425,6 +429,8 @@
|
||||
"upload_file": "upload file",
|
||||
"user": "user",
|
||||
"user ({id})": "user ({id})",
|
||||
"{user} added a new transaction: {entity}": "{user} added a new transaction: {entity}",
|
||||
"{user} updated the transaction '{entity}'": "{user} updated the transaction '{entity}'",
|
||||
"user_list": "user list",
|
||||
"user_module" : "Umbrella user management",
|
||||
"user profile": "User profile",
|
||||
@@ -452,10 +458,11 @@
|
||||
"wiki_pages": "wiki pages",
|
||||
|
||||
"year": "year",
|
||||
"You have been added to the new project '{project}', created by {user}:\n\n{body}": "You have been added to the new project '{project}', created by {user}:\n\n{body}",
|
||||
"You can view/edit this transaction at {base_url}/account/{id}": "Du kannst diese transaktion unter {base_url}/account/{id} ansehen",
|
||||
"You can view/edit this project at {base_url}/project/{id}/view": "You can view/edit this project at {base_url}/project/{id}/view",
|
||||
"You can view/edit this task at {base_url}/task/{id}/view": "You can view/edit this task at {base_url}/task/{id}/view",
|
||||
"You can view/edit this wiki page at {base_url}/wiki/{id}/view": "You can view/edit this wiki page at {base_url}/wiki/{id}/view",
|
||||
"You have been added to the new project '{project}', created by {user}:\n\n{body}": "You have been added to the new project '{project}', created by {user}:\n\n{body}",
|
||||
"You may change your notification settings at {base_url}/message/settings": "You may change your notification settings at {base_url}/message/settings .",
|
||||
"Your token to create a new password" : "Your token to create a new password",
|
||||
"your_profile": "your profile"
|
||||
|
||||
@@ -542,7 +542,8 @@ select.autocomplete{
|
||||
}
|
||||
|
||||
@media screen and (max-width: 600px) {
|
||||
.grid2{
|
||||
.grid2,
|
||||
.grid3{
|
||||
display: grid;
|
||||
grid-template-columns: auto;
|
||||
}
|
||||
@@ -582,6 +583,10 @@ select.autocomplete{
|
||||
#app nav.expanded .timetracking{
|
||||
grid-column-end: span 2;
|
||||
}
|
||||
|
||||
.autocomplete .suggestions > *{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset.vcard{
|
||||
|
||||
@@ -711,6 +711,10 @@ select.autocomplete{
|
||||
#app nav.expanded .timetracking{
|
||||
grid-column-end: span 2;
|
||||
}
|
||||
|
||||
.autocomplete .suggestions > *{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset.vcard{
|
||||
|
||||
@@ -701,6 +701,10 @@ select.autocomplete{
|
||||
#app nav.expanded .timetracking{
|
||||
grid-column-end: span 2;
|
||||
}
|
||||
|
||||
.autocomplete .suggestions > *{
|
||||
font-size: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset.vcard{
|
||||
|
||||
Reference in New Issue
Block a user