|
|
@@ -154,14 +154,14 @@ class Budget extends Model
|
|
154
|
154
|
public function scopeCurrentlyActive(Builder $query): Builder
|
|
155
|
155
|
{
|
|
156
|
156
|
return $query->active()
|
|
157
|
|
- ->where('start_date', '<=', now())
|
|
158
|
|
- ->where('end_date', '>=', now());
|
|
|
157
|
+ ->where('start_date', '<=', company_now())
|
|
|
158
|
+ ->where('end_date', '>=', company_now());
|
|
159
|
159
|
}
|
|
160
|
160
|
|
|
161
|
161
|
protected function isCurrentlyInPeriod(): Attribute
|
|
162
|
162
|
{
|
|
163
|
163
|
return Attribute::get(function () {
|
|
164
|
|
- return now()->between($this->start_date, $this->end_date);
|
|
|
164
|
+ return company_now()->between($this->start_date, $this->end_date);
|
|
165
|
165
|
});
|
|
166
|
166
|
}
|
|
167
|
167
|
|
|
|
@@ -174,7 +174,7 @@ class Budget extends Model
|
|
174
|
174
|
throw new \RuntimeException('Budget cannot be approved.');
|
|
175
|
175
|
}
|
|
176
|
176
|
|
|
177
|
|
- $approvedAt ??= now();
|
|
|
177
|
+ $approvedAt ??= company_now();
|
|
178
|
178
|
|
|
179
|
179
|
$this->update([
|
|
180
|
180
|
'status' => BudgetStatus::Active,
|
|
|
@@ -191,7 +191,7 @@ class Budget extends Model
|
|
191
|
191
|
throw new \RuntimeException('Budget cannot be closed.');
|
|
192
|
192
|
}
|
|
193
|
193
|
|
|
194
|
|
- $closedAt ??= now();
|
|
|
194
|
+ $closedAt ??= company_now();
|
|
195
|
195
|
|
|
196
|
196
|
$this->update([
|
|
197
|
197
|
'status' => BudgetStatus::Closed,
|