Roberto Santini 2 лет назад
Родитель
Сommit
e1f86a986c
2 измененных файлов: 8 добавлений и 2 удалений
  1. 7
    2
      app/Http/Controllers/IssueController.php
  2. 1
    0
      app/Models/Issue.php

+ 7
- 2
app/Http/Controllers/IssueController.php Просмотреть файл

@@ -360,6 +360,7 @@ class IssueController extends Controller
360 360
           $tempoImpiegatoOnSite = Issue::getTempoImpiegato($issue->id, [Config::getValue(Config::ATTIVITA_ON_SITE), Config::TECNICO_AGGIUNTIVO], $from, $to, 'Sì');
361 361
           $tempoImpiegatoRemota = Issue::getTempoImpiegato($issue->id, [Config::getValue(Config::ATTIVITA_REMOTA)], $from, $to, 'Sì');
362 362
 
363
+          // dd($tempoImpiegatoOnSite);
363 364
           foreach($tempoImpiegatoOnSite as $tempo){
364 365
             // arrotondamento tempo
365 366
             $ore = $tempo->hours;
@@ -376,15 +377,17 @@ class IssueController extends Controller
376 377
               'quantita' => $ore]
377 378
             );
378 379
 
379
-            if($tempo->activity_id == Config::getValue(Config::ATTIVITA_ON_SITE)){
380
+            // if($tempo->activity->id == Config::getValue(Config::ATTIVITA_ON_SITE)){
380 381
               $collectionIssue->push([
381 382
                 'nome' => "Diritto fisso di uscita - #".$issue->id." - ".$sedeCliente." - ".$data,
382 383
                 'codice' => 'INT-USC',
383 384
                 'quantita' => 1]
384 385
               );
385
-            }
386
+            // }
386 387
           }
387 388
 
389
+          // return;
390
+
388 391
           foreach($tempoImpiegatoRemota as $tempo){
389 392
             $collectionIssue->push([
390 393
               'nome' => "Intervento Tecnico #".$issue->id." ".$issue->subject." - ".Carbon::parse($tempo->spent_on)->format('d/m/Y'),
@@ -402,6 +405,8 @@ class IssueController extends Controller
402 405
         $filename = 'issues';
403 406
       }
404 407
 
408
+      //dump($collectionIssue);
409
+
405 410
       return Excel::download(new IssueExport($collectionIssue), $filename.'.xlsx');
406 411
     }else{
407 412
       Session::flash('flash_message', "Nessun progetto selezionato!");

+ 1
- 0
app/Models/Issue.php Просмотреть файл

@@ -79,6 +79,7 @@ class Issue{
79 79
     $issueResponse = Http::get(config('redmine.url').'/time_entries.json', $params);
80 80
 
81 81
     $last_date = null;
82
+    // dd($issueResponse->object()->time_entries);
82 83
     try{
83 84
       foreach($issueResponse->object()->time_entries as $time){
84 85
         // $collection->push($time);

Загрузка…
Отмена
Сохранить