|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Copyright (C) 2019 joenilson. |
|
5
|
|
|
* |
|
6
|
|
|
* This library is free software; you can redistribute it and/or |
|
7
|
|
|
* modify it under the terms of the GNU Lesser General Public |
|
8
|
|
|
* License as published by the Free Software Foundation; either |
|
9
|
|
|
* version 3 of the License, or (at your option) any later version. |
|
10
|
|
|
* |
|
11
|
|
|
* This library is distributed in the hope that it will be useful, |
|
12
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
13
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
14
|
|
|
* Lesser General Public License for more details. |
|
15
|
|
|
* |
|
16
|
|
|
* You should have received a copy of the GNU Lesser General Public |
|
17
|
|
|
* License along with this library; if not, write to the Free Software |
|
18
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
19
|
|
|
* MA 02110-1301 USA |
|
20
|
|
|
*/ |
|
21
|
|
|
|
|
22
|
|
|
namespace FacturaScripts\Plugins\fsRepublicaDominicana\Controller; |
|
23
|
|
|
|
|
24
|
|
|
use FacturaScripts\Core\Lib\ExtendedController\ListController; |
|
|
|
|
|
|
25
|
|
|
use FacturaScripts\Plugins\fsRepublicaDominicana\Model\NCFRango; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Description of ListNCFRango |
|
29
|
|
|
* |
|
30
|
|
|
* @author joenilson |
|
31
|
|
|
*/ |
|
32
|
|
|
class ListNCFRango extends ListController |
|
33
|
|
|
{ |
|
34
|
|
|
public function getPageData(): array |
|
35
|
|
|
{ |
|
36
|
|
|
$pageData = parent::getPageData(); |
|
37
|
|
|
$pageData['menu'] = 'accounting'; |
|
38
|
|
|
$pageData['submenu'] = 'Republica Dominicana'; |
|
39
|
|
|
$pageData['title'] = 'ncf-master'; |
|
40
|
|
|
$pageData['icon'] = 'fas fa-list'; |
|
41
|
|
|
|
|
42
|
|
|
return $pageData; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
protected function createViews() |
|
46
|
|
|
{ |
|
47
|
|
|
$this->addView('ListNCFRango', 'NCFRango'); |
|
48
|
|
|
$this->addSearchFields('ListNCFRango', ['tipocomprobante']); |
|
49
|
|
|
$this->addOrderBy('ListNCFRango', ['tipocomprobante','correlativo'], 'tipocomprobante'); |
|
50
|
|
|
|
|
51
|
|
|
$this->setSettings('ListNCFRango', 'modalInsert', 'ncf-rango-insert'); |
|
52
|
|
|
$this->setCustomWidgetValues('ListNCFRango'); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public function setCustomWidgetValues($viewName) |
|
56
|
|
|
{ |
|
57
|
|
|
$customValues = []; |
|
58
|
|
|
$customValues[] = ['value'=>'', 'title'=>'-----------']; |
|
59
|
|
|
foreach(\range('A', 'Z') as $i){ |
|
60
|
|
|
$customValues[] = ['value'=>$i, 'title'=>$i]; |
|
61
|
|
|
} |
|
62
|
|
|
$columnToModify = $this->views[$viewName]->columnModalForName('serie_nueva'); |
|
63
|
|
|
if($columnToModify) { |
|
64
|
|
|
$columnToModify->widget->setValuesFromArray($customValues); |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function execPreviousAction($action) |
|
69
|
|
|
{ |
|
70
|
|
|
switch ($action) { |
|
71
|
|
|
case 'ncf-rango-insert': |
|
72
|
|
|
$valueIdEmpresa = $this->request->request->get('idempresa'); |
|
73
|
|
|
$valueSerie = $this->request->request->get('serie_nueva'); |
|
74
|
|
|
$valueUsuarioCreacion = $this->request->request->get('usuariocreacion'); |
|
75
|
|
|
$valueFechaCreacion = $this->request->request->get('fechacreacion'); |
|
76
|
|
|
$data = $this->request->request->all(); |
|
77
|
|
|
$data['serie']=(isset($valueSerie) and $valueSerie !=='')?$valueSerie:$data['serie']; |
|
78
|
|
|
$data['idempresa']=(isset($valueIdEmpresa) and $valueIdEmpresa !=='')?$valueIdEmpresa:$this->empresa->idempresa; |
|
79
|
|
|
$data['usuariomodificacion']=(isset($valueFechaCreacion) and $valueFechaCreacion !=='')?$this->user->nick:null; |
|
80
|
|
|
$data['usuariocreacion']=(isset($valueUsuarioCreacion) and $valueUsuarioCreacion !=='')?$valueUsuarioCreacion:$this->user->nick; |
|
81
|
|
|
$data['fechacreacion']=(isset($valueFechaCreacion) and $valueFechaCreacion !=='')?$valueFechaCreacion:\date('Y-m-d'); |
|
82
|
|
|
$rangoNuevo = new NCFRango(); |
|
83
|
|
|
$rangoNuevo->loadFromData($data); |
|
84
|
|
|
$rangoNuevo->save(); |
|
85
|
|
|
$this->toolBox()->log()->notice('Rango nuevo guardado exitosamente'); |
|
86
|
|
|
break; |
|
87
|
|
|
} |
|
88
|
|
|
return parent::execPreviousAction($action); |
|
89
|
|
|
} |
|
90
|
|
|
} |
|
91
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths