Compare commits
3 Commits
0.1.2
...
a9268988e1
| Author | SHA1 | Date | |
|---|---|---|---|
| a9268988e1 | |||
| 6688128d30 | |||
| d955cb02b8 |
@@ -26,7 +26,7 @@ func (d *WorkDay) GetWorkDays(card_uid string, tsFrom, tsTo time.Time) []WorkDay
|
|||||||
|
|
||||||
qStr, err := DB.Prepare(`
|
qStr, err := DB.Prepare(`
|
||||||
WITH all_days AS (
|
WITH all_days AS (
|
||||||
SELECT generate_series($2, $3, INTERVAL '1 day')::DATE AS work_date
|
SELECT generate_series($2::DATE, $3::DATE - INTERVAL '1 day', INTERVAL '1 day')::DATE AS work_date
|
||||||
),
|
),
|
||||||
ordered_bookings AS (
|
ordered_bookings AS (
|
||||||
SELECT
|
SELECT
|
||||||
@@ -141,7 +141,7 @@ func (d *WorkDay) GetWorkDays(card_uid string, tsFrom, tsTo time.Time) []WorkDay
|
|||||||
|
|
||||||
func (d *WorkDay) calcPauseTime() {
|
func (d *WorkDay) calcPauseTime() {
|
||||||
if d.workTime > 6*time.Hour && d.pauseTime < 45*time.Minute {
|
if d.workTime > 6*time.Hour && d.pauseTime < 45*time.Minute {
|
||||||
if d.workTime < 9*time.Hour && d.pauseTime < 30*time.Minute {
|
if d.workTime <= (9*time.Hour) && d.pauseTime < 30*time.Minute {
|
||||||
diff := 30*time.Minute - d.pauseTime
|
diff := 30*time.Minute - d.pauseTime
|
||||||
d.workTime -= diff
|
d.workTime -= diff
|
||||||
d.pauseTime += diff
|
d.pauseTime += diff
|
||||||
@@ -155,7 +155,7 @@ func (d *WorkDay) calcPauseTime() {
|
|||||||
|
|
||||||
// Gets the duration someone worked that day
|
// Gets the duration someone worked that day
|
||||||
func (d *WorkDay) getWorkTime() {
|
func (d *WorkDay) getWorkTime() {
|
||||||
if len(d.Bookings) <= 1 && d.Bookings[0].CounterId == 0 {
|
if len(d.Bookings) < 1 {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var workTime, pauseTime time.Duration
|
var workTime, pauseTime time.Duration
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ templ dayComponent(workDay models.WorkDay) {
|
|||||||
if (workDay.Absence != models.Absence{}) {
|
if (workDay.Absence != models.Absence{}) {
|
||||||
<p>{ workDay.Absence.GetStringType() }</p>
|
<p>{ workDay.Absence.GetStringType() }</p>
|
||||||
}
|
}
|
||||||
if len(workDay.Bookings) <= 1 && (workDay.Absence == models.Absence{}) {
|
if len(workDay.Bookings) < 1 && (workDay.Absence == models.Absence{}) {
|
||||||
<p class="text group-[.edit]:hidden">Keine Buchung gefunden. Bitte Arbeitsstunden oder Grund der Abwesenheit eingeben!</p>
|
<p class="text group-[.edit]:hidden">Keine Buchung gefunden. Bitte Arbeitsstunden oder Grund der Abwesenheit eingeben!</p>
|
||||||
@absenceComponent(workDay)
|
@absenceComponent(workDay)
|
||||||
@newBookingComponent(workDay)
|
@newBookingComponent(workDay)
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ func dayComponent(workDay models.WorkDay) templ.Component {
|
|||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(workDay.Bookings) <= 1 && (workDay.Absence == models.Absence{}) {
|
if len(workDay.Bookings) < 1 && (workDay.Absence == models.Absence{}) {
|
||||||
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<p class=\"text group-[.edit]:hidden\">Keine Buchung gefunden. Bitte Arbeitsstunden oder Grund der Abwesenheit eingeben!</p>")
|
templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "<p class=\"text group-[.edit]:hidden\">Keine Buchung gefunden. Bitte Arbeitsstunden oder Grund der Abwesenheit eingeben!</p>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
|
|||||||
Reference in New Issue
Block a user