1
|
|
|
<?php |
2
|
|
|
/* |
3
|
|
|
* Copyright (C) 2021 Joe Nilson <[email protected]> |
4
|
|
|
* |
5
|
|
|
* This program is free software: you can redistribute it and/or modify |
6
|
|
|
* it under the terms of the GNU Lesser General Public License as |
7
|
|
|
* published by the Free Software Foundation, either version 3 of the |
8
|
|
|
* License, or (at your option) any later version. |
9
|
|
|
* |
10
|
|
|
* This program is distributed in the hope that it will be useful, |
11
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
12
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13
|
|
|
* GNU Lesser General Public License for more details. |
14
|
|
|
* You should have received a copy of the GNU Lesser General Public License |
15
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
16
|
|
|
*/ |
17
|
|
|
|
18
|
|
|
namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Controller; |
19
|
|
|
|
20
|
|
|
use FacturaScripts\Dinamic\Lib\AssetManager; |
|
|
|
|
21
|
|
|
use FacturaScripts\Dinamic\Model\NCFTipo; |
|
|
|
|
22
|
|
|
use FacturaScripts\Dinamic\Model\NCFTipoAnulacion; |
|
|
|
|
23
|
|
|
use FacturaScripts\Dinamic\Model\NCFTipoPago; |
|
|
|
|
24
|
|
|
use FacturaScripts\Dinamic\Model\NCFTipoMovimiento; |
|
|
|
|
25
|
|
|
|
26
|
|
|
class EditFacturaProveedor |
27
|
|
|
{ |
28
|
|
|
public function createViews(): \Closure |
29
|
|
|
{ |
30
|
|
|
return function () { |
31
|
|
|
parent::createViews(); |
32
|
|
|
AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
|
|
|
33
|
|
|
AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
34
|
|
|
$ncfTipoPago = new NCFTipoPago(); |
35
|
|
|
$ncfTiposPago = $ncfTipoPago->findAllByTipopago('02'); |
36
|
|
|
$customValuesNTP = []; |
37
|
|
|
$customValuesNTP[] = ['value' => '', 'title' => '-----------']; |
38
|
|
|
foreach ($ncfTiposPago as $tipopago) { |
39
|
|
|
$customValuesNTP[] = ['value' => $tipopago->codigo, 'title' => $tipopago->descripcion]; |
40
|
|
|
} |
41
|
|
|
$columnToModifyNTP = $this->views['EditFacturaProveedor']->columnForName('ncf-payment-type'); |
|
|
|
|
42
|
|
|
if ($columnToModifyNTP) { |
43
|
|
|
$columnToModifyNTP->widget->setValuesFromArray($customValuesNTP); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
$ncfTipoAnulacion = new NCFTipoAnulacion(); |
47
|
|
|
$ncfTiposAnulacion = $ncfTipoAnulacion->all(); |
48
|
|
|
$customValuesNTA = []; |
49
|
|
|
$customValuesNTA[] = ['value' => '', 'title' => '-----------']; |
50
|
|
|
foreach ($ncfTiposAnulacion as $tipoanulacion) { |
51
|
|
|
$customValuesNTA[] = ['value' => $tipoanulacion->codigo, 'title' => $tipoanulacion->descripcion]; |
52
|
|
|
} |
53
|
|
|
$columnToModifyNTA1 = $this->views['EditFacturaProveedor']->columnForName('ncf-cancellation-type'); |
54
|
|
|
if ($columnToModifyNTA1) { |
55
|
|
|
$columnToModifyNTA1->widget->setValuesFromArray($customValuesNTA); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
$ncfTipoMovimiento = new NCFTipoMovimiento(); |
59
|
|
|
$ncfTiposMovimiento = $ncfTipoMovimiento->findAllByTipomovimiento('COM'); |
60
|
|
|
$customValuesNTM = []; |
61
|
|
|
$customValuesNTM[] = ['value' => '', 'title' => '-----------']; |
62
|
|
|
foreach ($ncfTiposMovimiento as $tipomovimiento) { |
63
|
|
|
$customValuesNTM[] = ['value' => $tipomovimiento->codigo, 'title' => $tipomovimiento->descripcion]; |
64
|
|
|
} |
65
|
|
|
$columnToModifyNTM = $this->views['EditFacturaProveedor']->columnForName('ncf-movement-type'); |
66
|
|
|
if ($columnToModifyNTM) { |
67
|
|
|
$columnToModifyNTM->widget->setValuesFromArray($customValuesNTM); |
68
|
|
|
} |
69
|
|
|
}; |
70
|
|
|
} |
71
|
|
|
} |
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