Ver código fonte

Stat tree edit (wip)

Vijayakrishnan 3 anos atrás
pai
commit
006a33e2d4

+ 16 - 0
app/Models/StatTreeLine.php

@@ -119,6 +119,22 @@ class StatTreeLine extends Model
             }
         }
 
+        // report columns
+        foreach ($this->reportColumns as $srcReportColumn) {
+            $newStatTreeLineReportColumn = new StatTreeLineReportColumn();
+            $nextId = DB::select("select nextval('stat_tree_line_report_column_id_seq')");
+            $newStatTreeLineReportColumn->id = $nextId[0]->nextval;
+            $newStatTreeLineReportColumn->uid = Uuid::uuid4();
+            $newStatTreeLineReportColumn->stat_tree_line_id = $newStatTreeLine->id;
+            $newStatTreeLineReportColumn->label = $srcReportColumn->label;
+            $newStatTreeLineReportColumn->position_index = $srcReportColumn->position_index;
+            $newStatTreeLineReportColumn->display_key = $srcReportColumn->display_key;
+            $newStatTreeLineReportColumn->display_function = $srcReportColumn->display_function;
+            $newStatTreeLineReportColumn->record_route_name = $srcReportColumn->record_route_name;
+            $newStatTreeLineReportColumn->stat_tree_id = $newStatTree->id;
+            $newStatTreeLineReportColumn->save();
+        }
+
         foreach ($this->children as $child) {
             $child->copy($newStatTreeLine, $newStatTree);
         }

+ 5 - 0
resources/views/app/stat-tree/stat-tree-lines/view-data.blade.php

@@ -11,6 +11,11 @@
                 Report columns not configured for this report!
             </div>
         @else
+            <div class="mb-2 d-flex flex-wrap">
+                @foreach($line->lineClauses as $lineClause)
+                    <div class="border rounded px-2 py-1 mr-2 bg-light">{{$lineClause->clause_label}}</div>
+                @endforeach
+            </div>
             <table class="table table-sm table-striped table-bordered">
                 <thead>
                 <tr>