mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-10-14 16:53:17 +01:00
Only check billable rate restriction if time entry becomes billable
This commit is contained in:
committed by
Gregor Vostrak
parent
f60c9ca457
commit
902270a189
@@ -648,7 +648,7 @@ class TimeEntryController extends Controller
|
||||
$timeEntry = new TimeEntry;
|
||||
$timeEntry->fill($request->validated());
|
||||
// Organizations that can not use billable rates can not create billable time entries
|
||||
if (! $this->canUseBillableRates($organization)) {
|
||||
if ($timeEntry->billable && ! $this->canUseBillableRates($organization)) {
|
||||
$timeEntry->billable = false;
|
||||
}
|
||||
$timeEntry->client()->associate($client);
|
||||
@@ -721,7 +721,7 @@ class TimeEntryController extends Controller
|
||||
$wasBillable = $timeEntry->billable;
|
||||
$timeEntry->fill($request->validated());
|
||||
// Organizations that can not use billable rates can keep or remove the billable flag, but not set it
|
||||
if (! $wasBillable && ! $this->canUseBillableRates($organization)) {
|
||||
if ($timeEntry->billable && ! $wasBillable && ! $this->canUseBillableRates($organization)) {
|
||||
$timeEntry->billable = false;
|
||||
}
|
||||
if ($newMember !== null) {
|
||||
|
||||
Reference in New Issue
Block a user