Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc7d84e35f | ||
|
|
5bbcc961e6 | ||
|
|
94b22c1d26 | ||
|
|
3e291171a8 | ||
|
|
7ef5c43901 |
@@ -6,6 +6,7 @@
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
.idea/**/markdown.xml
|
||||
.idea/**/dictionaries
|
||||
.idea/**/shelf
|
||||
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
create_css_files() {
|
||||
cd ui/public || exit 2
|
||||
lessc --source-map less/print.less print.css
|
||||
lessc --source-map less/global.less global.css
|
||||
cd ../..
|
||||
}
|
||||
|
||||
|
||||
install_ui_dependence() {
|
||||
cd ui/ || exit 2
|
||||
npm install
|
||||
cd ..
|
||||
}
|
||||
|
||||
|
||||
install_api_dependence() {
|
||||
cd api/ || exit 2
|
||||
composer install
|
||||
@@ -29,4 +44,4 @@ composer_run() {
|
||||
docker-compose up -d
|
||||
}
|
||||
|
||||
install_api_dependence && build_ui && test_unit && composer_run && test_api
|
||||
create_css_files && install_ui_dependence && install_api_dependence && build_ui && test_unit && composer_run && test_api
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
Aktivität;Dauer;Von;Bis;Kommentar
|
||||
Arbeit;04:19;2021-07-30 13:01;2021-07-30 17:20;
|
||||
Mittagspause ;00:45;2021-07-30 12:16;2021-07-30 13:01;
|
||||
Arbeit;04:22;2021-07-30 07:54;2021-07-30 12:16;
|
||||
Arbeit;03:25;2021-07-29 13:25;2021-07-29 16:50;
|
||||
Mittagspause ;01:01;2021-07-29 12:23;2021-07-29 13:25;
|
||||
Arbeit;04:44;2021-07-29 07:39;2021-07-29 12:23;
|
||||
Arbeit;04:47;2021-07-28 12:49;2021-07-28 17:37;
|
||||
Mittagspause ;00:58;2021-07-28 11:51;2021-07-28 12:49;
|
||||
Arbeit;03:48;2021-07-28 08:02;2021-07-28 11:51;
|
||||
Arbeit;03:49;2021-07-27 12:34;2021-07-27 16:24;
|
||||
Mittagspause ;00:47;2021-07-27 11:47;2021-07-27 12:34;
|
||||
Arbeit;03:20;2021-07-27 08:27;2021-07-27 11:47;
|
||||
Arbeit;04:47;2021-07-26 12:59;2021-07-26 17:47;
|
||||
Mittagspause ;00:52;2021-07-26 12:07;2021-07-26 12:59;
|
||||
Arbeit;03:59;2021-07-26 08:08;2021-07-26 12:07;
|
||||
Arbeit;05:53;2021-07-23 12:43;2021-07-23 18:37;
|
||||
Mittagspause ;00:36;2021-07-23 12:07;2021-07-23 12:43;
|
||||
Arbeit;04:10;2021-07-23 07:57;2021-07-23 12:07;
|
||||
Arbeit;04:09;2021-07-22 12:54;2021-07-22 17:04;
|
||||
Mittagspause ;00:42;2021-07-22 12:11;2021-07-22 12:54;
|
||||
Arbeit;04:16;2021-07-22 07:55;2021-07-22 12:11;
|
||||
Arbeit;03:11;2021-07-21 13:37;2021-07-21 16:48;
|
||||
Mittagspause ;01:07;2021-07-21 12:29;2021-07-21 13:37;
|
||||
Arbeit;04:58;2021-07-21 07:31;2021-07-21 12:29;
|
||||
Arbeit;01:17;2021-07-20 18:44;2021-07-20 20:02;
|
||||
Arbeit;03:50;2021-07-20 13:14;2021-07-20 17:04;
|
||||
Mittagspause ;00:41;2021-07-20 12:32;2021-07-20 13:14;
|
||||
Arbeit;04:55;2021-07-20 07:37;2021-07-20 12:32;
|
||||
Arbeit;03:19;2021-07-19 13:12;2021-07-19 16:31;
|
||||
Mittagspause ;00:52;2021-07-19 12:20;2021-07-19 13:12;
|
||||
Arbeit;04:28;2021-07-19 07:51;2021-07-19 12:20;
|
||||
Arbeit;02:48;2021-07-16 12:55;2021-07-16 15:43;
|
||||
Mittagspause ;00:47;2021-07-16 12:07;2021-07-16 12:55;
|
||||
Arbeit;04:01;2021-07-16 08:06;2021-07-16 12:07;
|
||||
Arbeit;03:38;2021-07-15 13:05;2021-07-15 16:43;
|
||||
Mittagspause ;01:05;2021-07-15 11:59;2021-07-15 13:05;
|
||||
Arbeit;03:56;2021-07-15 08:02;2021-07-15 11:59;
|
||||
Arbeit;03:38;2021-07-14 13:07;2021-07-14 16:45;
|
||||
Mittagspause ;01:00;2021-07-14 12:07;2021-07-14 13:07;
|
||||
Arbeit;04:00;2021-07-14 08:06;2021-07-14 12:07;
|
||||
Arbeit;04:22;2021-07-13 12:53;2021-07-13 17:15;
|
||||
Mittagspause ;01:03;2021-07-13 11:50;2021-07-13 12:53;
|
||||
Arbeit;03:47;2021-07-13 08:02;2021-07-13 11:50;
|
||||
Arbeit;03:26;2021-07-12 13:02;2021-07-12 16:28;
|
||||
Mittagspause ;01:03;2021-07-12 11:58;2021-07-12 13:02;
|
||||
Arbeit;04:14;2021-07-12 07:44;2021-07-12 11:58;
|
||||
Arbeit;03:57;2021-07-09 13:09;2021-07-09 17:06;
|
||||
Mittagspause ;01:06;2021-07-09 12:02;2021-07-09 13:09;
|
||||
Arbeit;03:57;2021-07-09 08:04;2021-07-09 12:02;
|
||||
Arbeit;03:17;2021-07-08 13:12;2021-07-08 16:29;
|
||||
Mittagspause ;01:07;2021-07-08 12:04;2021-07-08 13:12;
|
||||
Arbeit;04:00;2021-07-08 08:03;2021-07-08 12:04;
|
||||
Arbeit;03:41;2021-07-07 13:08;2021-07-07 16:49;
|
||||
Mittagspause ;01:00;2021-07-07 12:07;2021-07-07 13:08;
|
||||
Arbeit;04:05;2021-07-07 08:02;2021-07-07 12:07;
|
||||
Arbeit;02:50;2021-07-06 13:05;2021-07-06 15:55;
|
||||
Mittagspause ;01:05;2021-07-06 11:59;2021-07-06 13:05;
|
||||
Arbeit;03:49;2021-07-06 08:10;2021-07-06 11:59;
|
||||
Arbeit;03:32;2021-07-05 13:00;2021-07-05 16:33;
|
||||
Mittagspause ;00:59;2021-07-05 12:00;2021-07-05 13:00;
|
||||
Arbeit;03:48;2021-07-05 08:12;2021-07-05 12:00;
|
||||
|
Vendored
+7
File diff suppressed because one or more lines are too long
@@ -5,10 +5,12 @@
|
||||
import xIcon from '@iconify-icons/oi/x'
|
||||
import EditByDay from "./Formular/EditByDay.svelte";
|
||||
import EditByWeek from "./Formular/EditByWeek.svelte";
|
||||
import ImportCsv from "./Formular/ImportCsv.svelte";
|
||||
import {TimekeepingDate} from "../../components/TimekeepingDate.svelte";
|
||||
|
||||
const DAILY_EDIT = 0
|
||||
const WEEKLY_EDIT = 1
|
||||
const CSV_IMPORT = 2
|
||||
|
||||
const Controller = {
|
||||
'saveRecord': () => {
|
||||
@@ -65,6 +67,11 @@
|
||||
})
|
||||
}
|
||||
}
|
||||
const CsvController = {
|
||||
'makeTimekeepingList': () => {
|
||||
MenuController.dailyEdit()
|
||||
}
|
||||
}
|
||||
const MenuController = {
|
||||
'dailyEdit': () => {
|
||||
period_of_edit = DAILY_EDIT
|
||||
@@ -75,6 +82,11 @@
|
||||
period_of_edit = WEEKLY_EDIT
|
||||
makeTimekeepingList = WeekController.makeTimekeepingList
|
||||
makeTimekeepingList()
|
||||
},
|
||||
'csvImport': () => {
|
||||
period_of_edit = CSV_IMPORT
|
||||
activeRecordList = []
|
||||
makeTimekeepingList = CsvController.makeTimekeepingList
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,6 +104,7 @@
|
||||
<nav class="menu">
|
||||
<span on:click={MenuController.dailyEdit} class:active={period_of_edit === DAILY_EDIT}>Täglich</span>
|
||||
<span on:click={MenuController.weeklyEdit} class:active={period_of_edit === WEEKLY_EDIT}>Wöchentlich</span>
|
||||
<span on:click={MenuController.csvImport} class:active={period_of_edit === CSV_IMPORT}>Import per CSV</span>
|
||||
</nav>
|
||||
{#if period_of_edit === DAILY_EDIT}
|
||||
<EditByDay bind:activeRecordList bind:activeDate bind:makeTimekeepingList/>
|
||||
@@ -99,6 +112,9 @@
|
||||
{#if period_of_edit === WEEKLY_EDIT}
|
||||
<EditByWeek bind:activeRecordList bind:activeDate bind:makeTimekeepingList/>
|
||||
{/if}
|
||||
{#if period_of_edit === CSV_IMPORT}
|
||||
<ImportCsv bind:activeRecordList bind:makeTimekeepingList/>
|
||||
{/if}
|
||||
<fieldset name="buttons">
|
||||
<button on:click={Controller.saveRecord} type="button">Übernehmen und Weiter
|
||||
<IconifyIcon icon={checkIcon} color="green"/>
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
<script>
|
||||
import Papa from '../../../papaparse.min'
|
||||
export let activeRecordList = []
|
||||
let imported_data = []
|
||||
|
||||
let files = null
|
||||
|
||||
const VerarbeiteDateien = () => {
|
||||
for (const file of files) {
|
||||
VerarbeiteCsv(file)
|
||||
}
|
||||
}
|
||||
|
||||
const VerarbeiteCsv = file => {
|
||||
Papa.parse(file, {
|
||||
header: true,
|
||||
skipEmptyLines: true,
|
||||
complete: results => {
|
||||
let cash_work_days = {}
|
||||
results.data.forEach(item => {
|
||||
// noinspection JSNonASCIINames
|
||||
let activity = item['Aktivität']
|
||||
if (activity.trim() === 'Mittagspause') {
|
||||
return
|
||||
}
|
||||
let work_from = new Date(item['Von'])
|
||||
let work_to = new Date(item['Bis'])
|
||||
let actual_day = work_from.toISOString().substring(0, 10)
|
||||
let actual_work_hours = (work_to - work_from)/(1000*60*60)
|
||||
cash_work_days[actual_day] ??= 0
|
||||
cash_work_days[actual_day] += actual_work_hours
|
||||
})
|
||||
for (let day in cash_work_days) {
|
||||
let hours = cash_work_days[day]
|
||||
let hours_digits = Math.trunc(hours)
|
||||
let minutes_digits = Math.round((hours-hours_digits)*60)
|
||||
let working_time = String(hours_digits).padStart(2, '0') + ":"
|
||||
+ String(minutes_digits).padStart(2, '0') + ':00'
|
||||
activeRecordList.push({workingTime: working_time, workingDay: day})
|
||||
}
|
||||
imported_data = activeRecordList
|
||||
},
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend>Download-Liste</legend>
|
||||
<div class="zelle">
|
||||
<label for="csv-file">Download der Zeiten von <i>aTimeLogger2</i></label>
|
||||
<input type="file" accept="text/csv" id="csv-file" bind:files/>
|
||||
<button type="button" on:click={VerarbeiteDateien}>Upload</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset name="record-data-for-import">
|
||||
<div>
|
||||
{#if imported_data.length < 1}
|
||||
<p>Loading...</p>
|
||||
{:else}
|
||||
<table>
|
||||
<tbody>
|
||||
{#each imported_data as item}
|
||||
<tr>
|
||||
<td>
|
||||
{item.workingDay}
|
||||
</td>
|
||||
<td>
|
||||
{item.workingTime}
|
||||
</td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
</fieldset>
|
||||
Reference in New Issue
Block a user