no message

This commit is contained in:
StudioTem committed 2023-04-05 08:37:20 +02:00
1 parent 356dd12566
commit 1f621a6bb4
4 files changed
+85 -8

No files matched your search

+15
View File
@@ -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();
}
}