mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 04:32:15 +01:00
automatically set the project billable default in time entry create modal
This commit is contained in:
committed by
Constantin Graf
parent
9b0cf37bc7
commit
4281736a6d
@@ -70,6 +70,19 @@ const timeEntryDefaultValues = {
|
|||||||
|
|
||||||
const timeEntry = ref({ ...timeEntryDefaultValues });
|
const timeEntry = ref({ ...timeEntryDefaultValues });
|
||||||
|
|
||||||
|
watch(
|
||||||
|
() => timeEntry.value.project_id,
|
||||||
|
(value) => {
|
||||||
|
if (value) {
|
||||||
|
// check if project is billable by default and set billable accordingly
|
||||||
|
const project = props.projects.find((p) => p.id === value);
|
||||||
|
if (project) {
|
||||||
|
timeEntry.value.billable = project.is_billable;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const localStart = ref(
|
const localStart = ref(
|
||||||
getLocalizedDayJs(timeEntryDefaultValues.start).format()
|
getLocalizedDayJs(timeEntryDefaultValues.start).format()
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user