Compare commits

..
Author SHA1 Message Date
StephanRichter cfe6c3891a Merge branch 'main' into dev
Build Docker Image / Docker-Build (push) Successful in 2m10s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-07-22 21:39:54 +02:00
StephanRichter 75927c4395 changed dependency (de.srsoftware:tools.jdbc:2.0.7→2.0.8) – bugfix!
Build Docker Image / Docker-Build (push) Successful in 2m30s
Build Docker Image / Clean-Registry (push) Successful in 6s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-22 21:38:51 +02:00
StephanRichter 1f89aa3d9f Merge branch 'main' into dev
Build Docker Image / Docker-Build (push) Successful in 2m36s
Build Docker Image / Clean-Registry (push) Successful in 7s
2026-07-22 19:59:35 +02:00
StephanRichter 6b93cb747b added alternative path for referencing stock items
Build Docker Image / Clean-Registry (push) Canceled after 0s
Build Docker Image / Docker-Build (push) Canceled after 58s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-22 19:59:26 +02:00
StephanRichter 6207ddf8ec Merge branch 'feature/doc-optional-items' into dev
Build Docker Image / Docker-Build (push) Successful in 2m6s
Build Docker Image / Clean-Registry (push) Successful in 7s
2026-07-21 21:27:54 +02:00
StephanRichter 1a79924821 implemented button to make document positions optional
Build Docker Image / Docker-Build (push) Successful in 2m25s
Build Docker Image / Clean-Registry (push) Successful in 6s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-21 21:27:42 +02:00
StephanRichter defb5e3d7b added translations for document type "offer"
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-21 21:27:18 +02:00
StephanRichter 7361dc84c6 Merge branch 'feature/doc-optional-items' into dev
Build Docker Image / Docker-Build (push) Successful in 2m54s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-07-21 20:42:53 +02:00
StephanRichter c7382cb1d3 implemented button to make document positions optional
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-21 20:41:57 +02:00
StephanRichter d9f28e3b6c improced commit-rollback behaviour on multi-step transactions
Build Docker Image / Docker-Build (push) Successful in 2m56s
Build Docker Image / Clean-Registry (push) Successful in 8s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-20 00:22:06 +02:00
StephanRichter 1484ded817 Merge branch 'feature/kanban-timetrack' into dev
Build Docker Image / Docker-Build (push) Successful in 3m15s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-07-19 23:48:18 +02:00
StephanRichter 8d93dbfc11 implemented timetracking as kanban drag target
Build Docker Image / Docker-Build (push) Successful in 4m1s
Build Docker Image / Clean-Registry (push) Successful in 7s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-19 23:47:53 +02:00
StephanRichter a752cd0ae8 improving css
Build Docker Image / Docker-Build (push) Successful in 2m43s
Build Docker Image / Clean-Registry (push) Successful in 6s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-15 18:23:41 +02:00
StephanRichter ef3e228527 fixed typo
Build Docker Image / Docker-Build (push) Successful in 2m30s
Build Docker Image / Clean-Registry (push) Successful in 6s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-13 12:32:51 +02:00
StephanRichter 1fb0a3e552 Merge branch 'feature/translation' into dev
Build Docker Image / Docker-Build (push) Successful in 3m4s
Build Docker Image / Clean-Registry (push) Successful in 5s
2026-07-08 18:23:06 +02:00
StephanRichter 3c249b3a08 fixed english translation
Build Docker Image / Docker-Build (push) Successful in 3m10s
Build Docker Image / Clean-Registry (push) Successful in 6s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-08 18:22:56 +02:00
StephanRichter fa793b1b2a Merge branch 'feature/add_prject_tasks' into dev
Build Docker Image / Docker-Build (push) Successful in 4m18s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-07-06 16:28:45 +02:00
StephanRichter 7788df380e set page title for easy list
Build Docker Image / Docker-Build (push) Successful in 3m8s
Build Docker Image / Clean-Registry (push) Successful in 5s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-07-03 17:11:18 +02:00
StephanRichter 562612c070 Merge branch 'feature/task-navigation' into dev
Build Docker Image / Docker-Build (push) Successful in 3m3s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-07-03 09:29:31 +02:00
StephanRichter 3a430a4d52 Merge branch 'feature/new_task_members' into dev
Build Docker Image / Docker-Build (push) Successful in 3m18s
Build Docker Image / Clean-Registry (push) Successful in 5s
2026-07-01 15:52:06 +02:00
StephanRichter 95c133389d Merge branch 'feature/parent_selector' into dev
Build Docker Image / Docker-Build (push) Successful in 2m57s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-07-01 09:30:11 +02:00
StephanRichter 5a6d9c4e80 Merge branch 'feature/parent_selector' into dev
Build Docker Image / Docker-Build (push) Successful in 4m0s
Build Docker Image / Clean-Registry (push) Successful in 5s
2026-07-01 09:17:49 +02:00
StephanRichter 05de8cfea0 Merge branch 'feature/split_accounts' into dev
Build Docker Image / Docker-Build (push) Successful in 2m36s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-06-30 15:14:02 +02:00
StephanRichter 2fd2566560 Merge branch 'feature/split_accounts' into dev
Build Docker Image / Docker-Build (push) Successful in 2m47s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-06-28 19:30:19 +02:00
StephanRichter 2884e85c4b CSS improvement
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-06-28 19:30:13 +02:00
StephanRichter f91f9a8ea3 Merge branch 'feature/split_accounts' into dev
Build Docker Image / Docker-Build (push) Successful in 2m51s
Build Docker Image / Clean-Registry (push) Successful in 5s
2026-06-28 19:10:40 +02:00
StephanRichter 20bc7a697e improving layout
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-06-28 19:10:33 +02:00
StephanRichter f3391b3b50 Merge branch 'feature/split_accounts' into dev
Build Docker Image / Docker-Build (push) Successful in 3m6s
Build Docker Image / Clean-Registry (push) Failing after 7s
2026-06-28 19:01:55 +02:00
StephanRichter aca0d41ef0 layout improvements
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-06-28 19:01:46 +02:00
StephanRichter cd218cc3b9 Merge branch 'feature/split_accounts' into dev
Build Docker Image / Docker-Build (push) Successful in 2m51s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-06-28 14:21:46 +02:00
StephanRichter fd8187630d added sum of external positions
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-06-28 14:21:40 +02:00
StephanRichter d497305da8 Merge branch 'feature/split_accounts' into dev
Build Docker Image / Docker-Build (push) Successful in 2m50s
Build Docker Image / Clean-Registry (push) Successful in 6s
2026-06-28 13:52:04 +02:00
StephanRichter 4ddfd337b6 swapped external costs
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-06-28 13:51:59 +02:00
StephanRichter 55ea05c2ff Merge branch 'main' into dev
Build Docker Image / Docker-Build (push) Successful in 2m15s
Build Docker Image / Clean-Registry (push) Successful in 5s
2026-06-28 13:23:10 +02:00
StephanRichter e6c0bc0139 Merge branch 'feature/split_accounts' into dev
Build Docker Image / Clean-Registry (push) Has been cancelled
Build Docker Image / Docker-Build (push) Has been cancelled
2026-06-25 13:05:03 +02:00
StephanRichter ac0b61dca0 Merge branch 'main' into dev
Build Docker Image / Clean-Registry (push) Failing after 12m21s
Build Docker Image / Docker-Build (push) Failing after 16m34s
2026-06-17 15:07:52 +02:00
StephanRichter 07492d34de Merge branch 'bugfix/pipeline' into dev
Build Docker Image / Docker-Build (push) Successful in 2m9s
Build Docker Image / Clean-Registry (push) Failing after 10m20s
2026-06-17 09:18:17 +02:00
StephanRichter 9e4158ad19 Merge branch 'bugfix/timecomplete' into dev
Build Docker Image / Clean-Registry (push) Successful in 6s
Build Docker Image / Docker-Build (push) Failing after 14m27s
2026-06-17 09:15:08 +02:00
StephanRichter b81d518a2b Merge branch 'main' into dev
Build Docker Image / Docker-Build (push) Successful in 2m30s
Build Docker Image / Clean-Registry (push) Failing after 12m3s
2026-06-16 08:32:36 +02:00
StephanRichter e17fdbc619 Merge branch 'main' into dev
Build Docker Image / Docker-Build (push) Successful in 2m21s
Build Docker Image / Clean-Registry (push) Successful in 5s
2026-06-16 08:26:56 +02:00
StephanRichter 433ea6ddd3 Merge branch 'main' into dev
Build Docker Image / Clean-Registry (push) Successful in 5s
Build Docker Image / Docker-Build (push) Failing after 14m25s
2026-06-08 10:53:23 +02:00
StephanRichter 6249cdb7b9 re-implemented new transaction form
Build Docker Image / Docker-Build (push) Failing after 5m19s
Build Docker Image / Clean-Registry (push) Failing after 11m53s
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
2026-05-30 22:19:29 +02:00
26 changed files with 431 additions and 34 deletions
@@ -16,7 +16,7 @@ public interface AccountDb {
Collection<UmbrellaUser> getMembers(long accountId);
Optional<Transaction> lastTransaction(long accountId, String source, String dest, double amount);
Optional<Transaction> lastTransaction(long accountId, String source, String destination, Double amount);
Collection<Account> listAccounts(long userId);
@@ -311,12 +311,11 @@ public class AccountingModule extends BaseHandler implements AccountingService {
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();
String destination = dst.has(Field.ID) ? dst.get(Field.ID).toString() : dst.has(Field.DISPLAY) ? dst.get(Field.DISPLAY).toString() : null;
Double amount = null;
if (json.has(Field.AMOUNT) && json.get(Field.AMOUNT) instanceof Number amt) amount = amt.doubleValue();
var transaction = accountDb.lastTransaction(accountId, source, dest, amount);
var transaction = accountDb.lastTransaction(accountId, source, destination, amount);
return transaction.isPresent() ? sendContent(ex,transaction.get()) : notFound(ex);
}
@@ -124,13 +124,16 @@ public class SqliteDb extends BaseDb implements AccountDb {
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);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
@@ -170,22 +173,42 @@ public class SqliteDb extends BaseDb implements AccountDb {
}
@Override
public Optional<Transaction> lastTransaction(long accountId, String source, String dest, double amount) {
public Optional<Transaction> lastTransaction(long accountId, String source, String destination, 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);
var query = select(ALL).from(TABLE_TRANSACTIONS).where(ACCOUNT,equal(accountId));
if (source != null) query = query.where(SOURCE,equal(source));
if (destination != null) query = query.where(DESTINATION,equal(destination));
if (amount != null) query = query.where(AMOUNT,equal(amount));
var rs = query.sort(ID+" DESC").limit(1).exec(db);
Transaction ta = null;
if (rs.next()) ta = Transaction.of(rs);
rs.close();
if (ta == null && amount != null) { // try to search by amount, ignore source and dest
rs = select(ALL).from(TABLE_TRANSACTIONS).where(ACCOUNT, equal(accountId)).where(AMOUNT, equal(amount))
.sort(ID + " DESC").limit(1).exec(db);
if (rs.next()) ta = Transaction.of(rs);
rs.close();
}
if (ta == null && source != null && destination != null) { // try to search by amount, ignore source and dest
rs = select(ALL).from(TABLE_TRANSACTIONS)
.where(SOURCE,equal(source))
.where(DESTINATION,equal(destination))
.where(ACCOUNT, equal(accountId))
.sort(ID + " DESC").limit(1).exec(db);
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));
+1 -1
View File
@@ -41,7 +41,7 @@ subprojects {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
implementation("de.srsoftware:configuration.api:1.0.2")
implementation("de.srsoftware:tools.jdbc:2.0.7")
implementation("de.srsoftware:tools.jdbc:2.0.8")
implementation("de.srsoftware:tools.http:6.0.5")
implementation("de.srsoftware:tools.mime:1.1.4")
implementation("de.srsoftware:tools.logging:1.3.2")
@@ -67,9 +67,16 @@ public class SqliteDb extends BaseDb implements ContactDb{
db.setAutoCommit(false);
Query.delete().from(TABLE_CONTACTS).where(ID,equal(contact.id())).execute(db);
Query.delete().from(TABLE_CONTACTS_USERS).where(CONTACT_ID,equal(contact.id())).execute(db);
db.setAutoCommit(true);
} catch (SQLException e){
try {
db.rollback();
} catch (SQLException ignored){};
throw failedToDropObject(t(CONTACT_WITH_ID, ID,contact.id())).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
@@ -69,9 +69,15 @@ CREATE TABLE IF NOT EXISTS {0} ( {1} VARCHAR(255) PRIMARY KEY, {2} VARCHAR(255)
update(table).set(STATUS).where(STATUS,equal(20)).prepare(db).apply(40).execute();
update(table).set(STATUS).where(STATUS,equal(10)).prepare(db).apply(20).execute();
update(table).set(STATUS).where(STATUS,equal(0)).prepare(db).apply(10).execute();
db.setAutoCommit(true);
} catch (SQLException e) {
try {
db.rollback();
} catch (SQLException ignored) {}
throw new RuntimeException(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
}
@@ -198,11 +198,17 @@ CREATE TABLE IF NOT EXISTS {0} (
rs.close();
delete().from(TABLE_POSITIONS).where(DOCUMENT_ID,equal(docId)).execute(db);
delete().from(TABLE_DOCUMENTS).where(ID,equal(docId)).execute(db);
db.setAutoCommit(true);
if (number != null) return number;
throw failedToDropObject(t(DOCUMENT_WITH_ID, ID,docId));
} catch (SQLException e){
try {
db.rollback();
} catch (SQLException ignored){};
throw failedToDropObject(t(DOCUMENT_WITH_ID, ID,docId)).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
@@ -217,10 +223,16 @@ CREATE TABLE IF NOT EXISTS {0} (
stmt.setLong(2,pos);
stmt.execute();
stmt.close();
db.setAutoCommit(true);
return pos;
} catch (SQLException e) {
try {
db.rollback();
} catch (SQLException ignored){};
throw failedToDropObjectFromObject(POSITION,pos,t(Text.DOCUMENT),docId).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
@@ -582,9 +594,15 @@ CREATE TABLE IF NOT EXISTS {0} (
update(TABLE_POSITIONS).set(POS).where(DOCUMENT_ID,equal(docId)).where(POS,equal(pair.left())).prepare(db).apply(-pair.right()).close();
update(TABLE_POSITIONS).set(POS).where(DOCUMENT_ID,equal(docId)).where(POS,equal(pair.right())).prepare(db).apply(pair.left()).close();
update(TABLE_POSITIONS).set(POS).where(DOCUMENT_ID,equal(docId)).where(POS,equal(-pair.right())).prepare(db).apply(pair.right()).close();
db.setAutoCommit(true);
} catch (SQLException e) {
try {
db.rollback();
} catch (SQLException ignored){};
throw databaseException(FAILED_TO_SWITCH_POSITIONS,"a",pair.left(),"b",pair.right(),docId).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
return pair;
}
+1
View File
@@ -122,6 +122,7 @@
<Route path="/stock/location/:location_id" component={Stock} />
<Route path="/stock/:item_id/view" component={Stock} />
<Route path="/stock/:owner/:owner_id/item/:owner_number" component={Stock} />
<Route path="/stock/:owner/:owner_id/item/:owner_number/view" component={Stock} />
<Route path="/tags" component={TagList} />
<Route path="/tags/use/:tag" component={TagUses} />
<Route path="/task" component={TaskList} />
+36 -4
View File
@@ -4,12 +4,47 @@
import { api } from '../urls.svelte';
import { t } from '../translations.svelte';
import { error, yikes } from '../warn.svelte';
import { msToTime, now } from '../time.svelte';
import { timetrack } from '../user.svelte';
let interval = null;
const router = useTinyRouter();
async function addTime(task_id){
const url = api(`time/track_task/${task_id}`);
const resp = await fetch(url,{
credentials : 'include',
method : 'POST',
body : now()
}); // create new time or return time with assigned tasks
if (resp.ok) {
const track = await resp.json();
timetrack.running = track;
yikes();
} else {
error(resp);
}
}
function go(){
router.navigate('/time');
}
function ondragover(ev){
ev.preventDefault();
}
function ondragleave(ev){
ev.preventDefault();
}
function ondrop(ev){
let task_id = ev.dataTransfer.getData('task');
if (task_id) addTime(task_id);
}
async function stopTrack(){
if (timetrack.running.id){
const url = api(`time/${timetrack.running.id}/stop`);
@@ -28,9 +63,6 @@
}
}
function go(){
router.navigate('/time');
}
function updateElapsed(){
timetrack.elapsed = msToTime(Date.now() - timetrack.start);
@@ -54,7 +86,7 @@
{#if timetrack.running}
<span class="timetracking">
<span class="timetracking" {ondrop} {ondragover} {ondragleave} >
<span onclick={go} >{timetrack.running.subject} {#if timetrack.elapsed}({timetrack.elapsed}){/if}</span>
<button onclick={stopTrack} title={t('stop')} class="symbol"></button>
</span>
@@ -4,7 +4,7 @@
import { error, yikes } from '../../warn.svelte';
import { t } from '../../translations.svelte';
import EntryForm from './add_entry.svelte';
import EntryForm from './add_entry_new.svelte';
import Transaction from './transaction.svelte';
let { id } = $props();
@@ -173,5 +173,5 @@
</table>
</fieldset>
<EntryForm {account} {onSave} />
<EntryForm {account} {onSave} {users} />
{/if}
@@ -0,0 +1,205 @@
<script>
import { useTinyRouter } from 'svelte-tiny-router';
import { t } from '../../translations.svelte';
import { api, post } from '../../urls.svelte';
import { error, yikes } from '../../warn.svelte';
import { user } from '../../user.svelte';
import Autocomplete from '../../Components/Autocomplete.svelte';
import Tags from '../tags/TagList.svelte';
let defaultAccount = {
id : 0,
name : '',
currency : ''
};
let { account = defaultAccount, new_account = false, onSave = () => {}, users } = $props();
let entry = $state({
account,
date : new Date().toISOString().substring(0, 10),
source : {
display: user.name,
id: user.id
},
destination : {},
amount : 0.0,
purpose : {},
tags : []
});
let router = useTinyRouter();
async function dst_selected(destination){
destination = JSON.parse(JSON.stringify(destination));
let source = JSON.parse(JSON.stringify(entry.source));
const url = api(`accounting/${entry.account.id}/tags`)
const res = await post(url,{source,destination});
if (res.ok) {
yikes();
const json = await res.json();
await proposePurpose();
entry.tags = json;
} else error(res);
}
function focusOnEnter(ev,id){
if (ev.key == 'Enter') {
proposePurpose();
document.getElementById(id).focus();
}
}
async function getAccountTags(text){
if (!text) return [];
const url = api(`accounting/${entry.account.id}/tags`)
return await getProposals(text,url);
}
async function getDestinations(text){
const url = api('accounting/destinations');
return await getProposals(text,url);
}
async function getProposals(text,url){
const res = await post(url,text);
if (res.ok){
yikes();
const input = await res.json();
return Object.values(input).map(mapDisplay);
} else {
error(res);
return {};
}
}
async function getPurposes(text) {
const url = api('accounting/purposes');
return await getProposals(text,url);
}
async function getSources(text){
const url = api('accounting/sources');
return await getProposals(text,url);
}
function gotoTags(purpose){
document.getElementById('new_tag_input');
}
function mapDisplay(object){
if (object.display){
return object;
} else if (object.name) {
return {...object, display: object.name};
} else {
return { display : object }
}
}
async function proposePurpose(){
console.log('proposePurpose()');
const amount = entry.amount;
const source = entry.source;
const destination = entry.destination;
const url = api(`accounting/${account.id}/purposes`);
const res = await post(url,{source,destination,amount});
if (res.ok) {
yikes();
var lastTransaction = await res.json();
console.log({lastTransaction,users:JSON.parse(JSON.stringify(users))});
entry.purpose = { display: lastTransaction.purpose};
entry.tags = lastTransaction.tags;
if (lastTransaction.source.value){
if (users[lastTransaction.source.value]){
let user = users[lastTransaction.source.value];
entry.source = { id : +lastTransaction.source.value, display : user.name };
} else entry.source = { display: lastTransaction.source.value };
}
if (lastTransaction.destination.value){
if (users[lastTransaction.destination.value]){
let user = users[lastTransaction.destination.value];
entry.destination = { id : +lastTransaction.destination.value, display : user.name };
} else entry.destination = { display: lastTransaction.destination.value };
}
} else error(res);
}
async function save(){
let data = {
...entry,
purpose: entry.purpose.display
}
let url = api('accounting');
let res = await post(url, data);
if (res.ok) {
yikes();
if (new_account){
router.navigate('/accounting');
return;
}
//entry.tags = [];
onSave();
document.getElementById('date-input').focus();
} else error(res);
}
</script>
<style>
hr{
grid-column: 1 / -1;
margin: 0.5rem 0;
border: 0;
height: 1px;
align-self: center;
background: red;
}
</style>
<fieldset class="grid2 new_transaction">
{#if new_account}
<legend>{t('create_new_object',{object:t('account')})}</legend>
<span style="display:none"></span>
<span>{t('account name')}</span>
<span>
<input type="text" bind:value={entry.account.name} />
</span>
<span>{t('currency')}</span>
<span>
<input type="text" bind:value={entry.account.currency} />
</span>
<hr/>
<span style="grid-column-end: span 2">{t('first transaction')}</span>
{:else}
<legend>{t('add_object',{object:t('transaction')})}</legend>
<span style="display:none"></span>
{/if}
<span>{t('date')}</span>
<span>
<input type="date" bind:value={entry.date} id="date-input" />
</span>
<span>{t('amount')}</span>
<span>
<input type="number" bind:value={entry.amount} onkeyup={e => focusOnEnter(e,'source-input')} />&nbsp;{entry.account.currency}
</span>
<span>{t('source')}</span>
<Autocomplete bind:candidate={entry.source} getCandidates={getSources} id="source-input" />
<span>{t('destination')}</span>
<Autocomplete bind:candidate={entry.destination} getCandidates={getDestinations} onSelect={dst_selected} />
<span>{t('purpose')}</span>
<Autocomplete bind:candidate={entry.purpose} getCandidates={getPurposes} onCommit={gotoTags} id="purpose_input" />
<span>{t('tags')}</span>
<Tags getCandidates={getAccountTags} module={null} bind:tags={entry.tags} onEmptyCommit={save} />
<span></span>
<span>
<button onclick={save}>{t('save')}</button>
</span>
</fieldset>
+7 -1
View File
@@ -1,6 +1,7 @@
<script>
import { onMount } from 'svelte';
import { useTinyRouter } from 'svelte-tiny-router';
import { t } from '../../translations.svelte';
import LineEditor from '../../Components/LineEditor.svelte';
import MarkdownEditor from '../../Components/MarkdownEditor.svelte';
@@ -23,13 +24,17 @@
function movedown(){
movePos(pos.number,1);
}
async function toggleOptional(ev){
const ok = await submit(`${prefix}.optional`,!pos.optional);
if (ok) pos.optional = !pos.optional;
}
</script>
<style>
.move{
vertical-align: middle;
}
tr > *:nth-child(1){
text-align: right;
}
@@ -66,6 +71,7 @@
<span onclick={moveup}>⏫</span>
{/if}
<span onclick={() => drop(pos.number)}>❌</span>
<span class="symbol" onclick={toggleOptional} title={t(pos.optional?'optional position':'fixed position')}>{pos.optional?'':''}</span>
<span onclick={movedown}>⏬</span>
{/if}
</td>
+6 -1
View File
@@ -207,6 +207,11 @@
return false;
}
function ondragstart(ev, task){
dragged = task;
ev.dataTransfer.setData("task",task.id);
}
function openTask(task_id){
window.open(`/task/${task_id}/view`, '_blank').focus();
}
@@ -306,7 +311,7 @@
<div class={['state_'+state, is_custom(state) ? '':'state_custom' ,highlight.user == u.id && highlight.state == state ? 'highlight':'']} ondragover={ev => hover(ev,u.id,state)} ondragleave={e => delete highlight.user} ondrop={ev => drop(u.id,state)} >
{#each Object.values(tasks[u.id][state]).sort(byName) as task}
{#if !filter || task.name.toLowerCase().includes(filter) || (task.tags && task.tags.filter(tag => tag.toLowerCase().includes(filter)).length)}
<Card onclick={e => openTask(task.id)} ondragstart={ev => dragged=task} {task} tag_colors={project.tag_colors} />
<Card onclick={e => openTask(task.id)} ondragstart={ev => ondragstart(ev,task)} {task} tag_colors={project.tag_colors} />
{/if}
{/each}
<div class="add_task" onclick={ev => show_task_form(project.id,u.id,+state)}>
+4
View File
@@ -130,6 +130,10 @@
onMount(load);
</script>
<svelte:head>
<title>Umbrella {t('Easylist')}: {tag}</title>
</svelte:head>
<h2>{t('tasks_for_tag',{tag:decodeURI(tag)})}</h2>
<div class="easylist">
+1 -1
View File
@@ -21,4 +21,4 @@ export function t(key,args = {}){
}
for (var key of Object.keys(args)) set = set.replace(`{${key}}`,args[key]);
return set;
}
}
@@ -63,10 +63,16 @@ public class SqliteDb extends BaseDb implements StockDb {
rs.close();
if (propertyId == null || propertyId == 0) throw failedToStoreObject(t(PROPERTY));
insertInto(TABLE_ITEM_PROPERTIES,ITEM_ID,PROPERTY_ID,VALUE).values(itemId,propertyId,value).execute(db).close();
db.setAutoCommit(true);
return new Property(propertyId,name,value,unit);
} catch (SQLException e) {
try {
db.rollback();
} catch (SQLException ignored){};
throw failedToStoreObject(t(PROPERTY)).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
@@ -601,13 +607,16 @@ public class SqliteDb extends BaseDb implements StockDb {
replaceLocationsTable();
replaceItemsTable();
replaceItemPropsTable();
db.setAutoCommit(true);
} catch (Exception e) {
try {
db.rollback();
} catch (SQLException ignored) {
}
throw databaseException(FAILED_TO_UPDATE_OBJECT, OBJECT, t(TABLE_WITH_NAME,NAME,TABLE_LOCATIONS)).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
@@ -340,7 +340,6 @@ CREATE TABLE IF NOT EXISTS {0} (
var addQuery = replaceInto(TABLE_TASK_DEPENDENCIES, TASK_ID, REQUIRED_TASK_ID);
for (var reqId : task.requiredTasksIds()) addQuery.values(task.id(), reqId);
addQuery.execute(db).close();
db.setAutoCommit(true);
}
task.clean(REQUIRED_TASKS_IDS);
@@ -354,7 +353,14 @@ CREATE TABLE IF NOT EXISTS {0} (
}
return task;
} catch (SQLException e){
try {
db.rollback();
} catch (SQLException ignored){};
throw failedToStoreObject(task.name()).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
@@ -84,10 +84,16 @@ CREATE TABLE IF NOT EXISTS {0} (
db.setAutoCommit(false);
Query.delete().from(TABLE_TASK_TIMES).where(TIME_ID,equal(timeId)).execute(db);
Query.delete().from(TABLE_TIMES).where(ID,equal(timeId)).execute(db);
db.setAutoCommit(false);
return timeId;
} catch (SQLException e) {
try {
db.rollback();
} catch (SQLException ignored) {}
throw failedToDropObject(t(TIME_WITH_ID, ID,timeId)).causedBy(e);
} finally {
try {
db.setAutoCommit(true);
} catch (SQLException ignored){};
}
}
+3
View File
@@ -167,6 +167,7 @@
"filter": "Filter",
"filter by tags": "Nach Tags filtern",
"first_transaction": "erste Transaktion",
"fixed position": "fester Posten",
"footer": "Fuß-Text",
"foreign_id": "externe Kennung",
"forgot_pass" : "Password vergessen?",
@@ -278,7 +279,9 @@
"oidc_Login" : "Anmeldung mit OIDC",
"old_password": "altes Passwort",
"offer": "Angebot",
"option": "Option",
"optional position": "optionaler Posten",
"options": "Optionen",
"organization": "Organisation",
"other party": "Gegenseite",
+5 -2
View File
@@ -167,6 +167,7 @@
"filter": "filter",
"filter by tags": "filter by tags",
"first_transaction": "first transaction",
"fixed position": "fixed position",
"footer": "footer",
"foreign_id": "external ID",
"forgot_pass" : "forgot password?",
@@ -278,7 +279,9 @@
"oidc_Login" : "Login via OIDC",
"old_password": "old password",
"offer": "offer",
"option": "option",
"optional position": "optional position",
"options": "options",
"organization": "organization",
"other party": "other party",
@@ -329,7 +332,7 @@
"saved": "saved",
"save_object": "save {object}",
"search": "search",
"searching…": "searhcing…",
"searching…": "searching…",
"select a new parent for {entity}": "select a new parent for '{entity}'",
"select_company" : "select on of you companies:",
"select_customer": "select customer",
@@ -380,7 +383,7 @@
"subtask": "subtask",
"subtasks": "subtasks",
"succeeding_document": "succeeding document",
"sum external";"sum of external positions",
"sum external":"sum of external positions",
"sum_of_records": "sum of records",
"sums": "sums",
@@ -341,6 +341,14 @@ tr:hover .taglist .tag button {
color: yellow;
}
.positions tr:nth-child(2n){
border-bottom-color: red;
}
.positions tbody tr:last-child{
border-top-color: red;
}
@media screen and (max-width: 900px) {
#app nav a{
background: black;
@@ -356,6 +356,10 @@ span.timetracking {
grid-column-end: span 2;
}
.markdown svg{
display: block;
}
.editable:hover{
border: 1px dotted;
}
@@ -386,6 +390,7 @@ span.timetracking {
table{
min-width: 30vw;
border-collapse: collapse;
}
.start_end{
@@ -481,6 +486,14 @@ select.autocomplete{
width: calc(100% - 50px);
}
.positions tr:nth-child(2n){
border-bottom: 1px solid;
}
.positions tbody tr:last-child{
border-top: 3px solid;
}
@media screen and (min-width: 900px) {
#app nav > button.symbol{
display: none;
@@ -337,6 +337,14 @@ code,
color: black;
}
.positions tr:nth-child(2n){
border-bottom-color: gold;
}
.positions tbody tr:last-child{
border-top-color: gold;
}
@media screen and (max-width: 900px) {
#app nav a{
background: black;
@@ -450,6 +450,10 @@ span.timetracking {
grid-column-end: span 2;
}
.markdown svg{
display: block;
}
.editable:hover{
border: 1px dotted;
}
@@ -480,6 +484,7 @@ span.timetracking {
table{
min-width: 30vw;
border-collapse: collapse;
}
.start_end{
@@ -585,6 +590,14 @@ select.autocomplete{
width: calc(100% - 50px);
}
.positions tr:nth-child(2n){
border-bottom: 1px solid;
}
.positions tbody tr:last-child{
border-top: 3px solid;
}
@media screen and (min-width: 900px) {
#app nav > button.symbol{
display: none;
@@ -288,6 +288,15 @@ tr:hover .taglist .tag button {
background: cyan;
}
.positions tr:nth-child(2n){
border-bottom-color: blue;
}
.positions tbody tr:last-child{
border-top-color: blue;
}
@media screen and (max-width: 900px) {
#app nav a{
background: white;
+13
View File
@@ -449,6 +449,10 @@ span.timetracking {
grid-column-end: span 2;
}
.markdown svg{
display: block;
}
.editable:hover{
border: 1px dotted;
}
@@ -479,6 +483,7 @@ span.timetracking {
table{
min-width: 30vw;
border-collapse: collapse;
}
.start_end{
@@ -574,6 +579,14 @@ select.autocomplete{
width: calc(100% - 50px);
}
.positions tr:nth-child(2n){
border-bottom: 1px solid;
}
.positions tbody tr:last-child{
border-top: 3px solid;
}
@media screen and (min-width: 900px) {
#app nav > button.symbol{
display: none;