mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
no message
This commit is contained in:
1 parent
356dd12566
commit
1f621a6bb4
4 files changed
+85
-8
No files matched your search
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services\Karat;
|
||||
|
||||
use App\Models\Timesheet;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Arr;
|
||||
@@ -129,5 +130,19 @@ class KaratService
|
||||
\App\Models\Project::whereIn('code', $codesInDbThatAreNotInKaratAnymore)->delete();
|
||||
}
|
||||
|
||||
public function syncTimesheets() {
|
||||
$notSyncedTimesheets = Timesheet::whereNull('synced_to_karat')->get();
|
||||
|
||||
$notSyncedTimesheets->each(function ($timesheet) {
|
||||
$this->syncTimesheet($timesheet);
|
||||
});
|
||||
}
|
||||
|
||||
private function syncTimesheet(Timesheet $timesheet) {
|
||||
$this->api->setTimesheet($timesheet);
|
||||
|
||||
$timesheet->synced_to_karat = true;
|
||||
$timesheet->save();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user