File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public function assets(): void
4242
4343 public function newBtnFields (): array
4444 {
45- return [];
45+ return [' servicio_btn ' ];
4646 }
4747
4848 public function newFields (): array
@@ -61,9 +61,28 @@ public function renderField(SalesDocument $model, string $field): ?string
6161 return $ this ->servicio ($ model );
6262 }
6363
64+ if ($ field == 'servicio_btn ' ) {
65+ return $ this ->servicioBtn ($ model );
66+ }
67+
6468 return null ;
6569 }
6670
71+ private static function servicioBtn (SalesDocument $ model ): string
72+ {
73+ if (false === $ model ->hasColumn ('idservicio ' ) || empty ($ model ->{'idservicio ' })) {
74+ return '' ;
75+ }
76+
77+ return '<div class="col-sm-auto"> '
78+ . '<div class="mb-2"> '
79+ . '<a href="EditServicioAT?code= ' . $ model ->{'idservicio ' } . '" class="btn btn-warning text-black"> '
80+ . '<i class="fa-solid fa-headset"></i> ' . Tools::trans ('service ' )
81+ . '</a> '
82+ . '</div> '
83+ . '</div> ' ;
84+ }
85+
6786 private static function servicio (SalesDocument $ model ): string
6887 {
6988 return $ model ->hasColumn ('idservicio ' ) && false === empty ($ model ->{'idservicio ' }) ? '<div class="col-sm-6"> '
You can’t perform that action at this time.
0 commit comments