Skip to content

feat(Working Time): whole day timesheets#24

Merged
barredterra merged 6 commits into
version-15from
whole-day-projects
Jun 11, 2026
Merged

feat(Working Time): whole day timesheets#24
barredterra merged 6 commits into
version-15from
whole-day-projects

Conversation

@barredterra

@barredterra barredterra commented Jun 11, 2026

Copy link
Copy Markdown
Member

Adds support for projects that are billed at a fixed day rate instead of by the hour.

Changes

  • New field Whole Day Project on Working Time: if set, all time logs for this project are merged into a single timesheet with 8 billing hours.
  • New custom field Billing Rate per Day on Project: used to derive the hourly billing rate (day rate / 8), so the billed amount always equals the full day rate.
  • The merged timesheet records the actual logged hours internally, fetches each linked Jira issue summary individually (one line per issue, followed by its customer notes), and sets the task and issue URL when unambiguous.
  • Refactor: extracted shared timesheet creation into WorkingTime.insert_timesheet to avoid duplication between regular and whole-day timesheets.

Time logs for other projects are aggregated and billed as before.

@barredterra barredterra changed the title whole day projects feat: whole day timesheets Jun 11, 2026
@greptile-apps

greptile-apps Bot commented Jun 11, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Safe to merge — the whole-day billing path is well-isolated, the shared insert_timesheet refactor is a clean extraction with no behavior change for existing flows, and the DocType JSON follows correct Frappe conventions.

The core logic correctly partitions logs, fixes billing hours to 8, and falls back to hourly rate when no day rate is configured. The two findings are edge-case quality issues that do not affect normal usage.

working_time/working_time/doctype/working_time/working_time.py — the billing rate selection and empty-log handling in create_whole_day_timesheet.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[WorkingTime.on_submit] --> B[create_timesheets]
    B --> C{whole_day_project set?}
    C -- Yes --> D[Partition time_logs by project]
    D --> E[whole_day_logs = logs matching whole_day_project]
    D --> F[regular_logs = all other logs]
    E --> G{Any whole_day_logs?}
    G -- Yes --> H[create_whole_day_timesheet]
    H --> H1[Collect customer_notes per Jira key, internal_notes, tasks]
    H1 --> H2[get_project_details: billing_rate = rate_per_day / 8 or fallback]
    H2 --> H3[Build description lines one per Jira key]
    H3 --> H4[insert_timesheet: hours=actual, billing_hours=8]
    G -- No --> F
    C -- No --> F
    F --> I[aggregate_time_logs: group by project+task+key]
    I --> J[For each group: get_project_details, insert_timesheet]
    H4 --> K[Timesheet inserted]
    J --> K
Loading

Fix All in Cursor

Reviews (2): Last reviewed commit: "refactor: shared get_project_details" | Re-trigger Greptile

Comment thread working_time/working_time/doctype/working_time/working_time.py Outdated
@barredterra

Copy link
Copy Markdown
Member Author

@greptileai

@barredterra barredterra changed the title feat: whole day timesheets feat(Working Time): whole day timesheets Jun 11, 2026
@barredterra

Copy link
Copy Markdown
Member Author

Design discussed and approved with @PatrickDEissler

@barredterra
barredterra merged commit 470f9f2 into version-15 Jun 11, 2026
2 checks passed
@barredterra
barredterra deleted the whole-day-projects branch June 11, 2026 16:02
@barredterra

Copy link
Copy Markdown
Member Author

🎉 This PR is included in version 15.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

0xD0M1M0 pushed a commit to 0xD0M1M0/working_time that referenced this pull request Jun 23, 2026
# [15.5.0](alyf-de/working_time@v15.4.1...v15.5.0) (2026-06-11)

### Features

* **Working Time:** whole day timesheets ([alyf-de#24](alyf-de#24)) ([470f9f2](alyf-de@470f9f2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant