| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  | /* | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * Copyright (C) 2020 Joe Zegarra. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 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; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | use FacturaScripts\Core\Base\DataBase\DataBaseWhere; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  | use FacturaScripts\Core\Base\InitClass; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  | use FacturaScripts\Dinamic\Lib\AssetManager; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  | use FacturaScripts\Dinamic\Model\Cliente; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 28 |  |  | use FacturaScripts\Dinamic\Model\EstadoDocumento; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 29 |  |  | use FacturaScripts\Dinamic\Model\FacturaCliente; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 30 |  |  | use FacturaScripts\Dinamic\Model\Proveedor; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 31 |  |  | use FacturaScripts\Dinamic\Model\FacturaProveedor; | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 32 |  |  | use FacturaScripts\Plugins\fsRepublicaDominicana\Model\NCFRango; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 33 |  |  | use FacturaScripts\Plugins\fsRepublicaDominicana\Model\NCFTipo; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 34 |  |  | use FacturaScripts\Plugins\fsRepublicaDominicana\Model\NCFTipoAnulacion; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 35 |  |  | use FacturaScripts\Plugins\fsRepublicaDominicana\Model\NCFTipoMovimiento; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 36 |  |  | use FacturaScripts\Plugins\fsRepublicaDominicana\Model\NCFTipoPago; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 37 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 38 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 39 |  |  |  * Description of Init | 
            
                                                                                                            
                            
            
                                    
            
            
                | 40 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 41 |  |  |  * @author Joe Zegarra | 
            
                                                                                                            
                            
            
                                    
            
            
                | 42 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  | class Init extends InitClass | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  | { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |     public function init() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |         $this->loadExtension(new Extension\Model\Cliente()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |         $this->loadExtension(new Extension\Model\FacturaCliente()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |         $this->loadExtension(new Extension\Model\FacturaProveedor()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |         $this->loadExtension(new Extension\Model\Producto()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |         $this->loadExtension(new Extension\Controller\EditCliente()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |         $this->loadExtension(new Extension\Controller\EditProveedor()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |         $this->loadExtension(new Extension\Controller\EditFacturaCliente()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |         $this->loadExtension(new Extension\Controller\EditFacturaProveedor()); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |         AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 57 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 58 |  |  |     private function ActualizarEstados() | 
            
                                                                        
                            
            
                                    
            
            
                | 59 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 60 |  |  |         $arrayDocumentos = [ | 
            
                                                                        
                            
            
                                    
            
            
                | 61 |  |  |             'FacturaCliente', | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |             'FacturaProveedor', | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |             'AlbaranCliente', | 
            
                                                                        
                            
            
                                    
            
            
                | 64 |  |  |             'AlbaranProveedor', | 
            
                                                                        
                            
            
                                    
            
            
                | 65 |  |  |             'PedidoCliente', | 
            
                                                                        
                            
            
                                    
            
            
                | 66 |  |  |             'PedidoProveedor' | 
            
                                                                        
                            
            
                                    
            
            
                | 67 |  |  |         ]; | 
            
                                                                        
                            
            
                                    
            
            
                | 68 |  |  |         $estados = new EstadoDocumento(); | 
            
                                                                        
                            
            
                                    
            
            
                | 69 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 70 |  |  |         foreach ($arrayDocumentos as $documento) { | 
            
                                                                        
                            
            
                                    
            
            
                | 71 |  |  |             $lista = $estados->all( | 
            
                                                                        
                            
            
                                    
            
            
                | 72 |  |  |                 [ | 
            
                                                                        
                            
            
                                    
            
            
                | 73 |  |  |                     new DataBaseWhere('nombre', 'Anulada'), | 
            
                                                                        
                            
            
                                    
            
            
                | 74 |  |  |                     new DataBaseWhere('tipodoc', $documento) | 
            
                                                                        
                            
            
                                    
            
            
                | 75 |  |  |                 ] | 
            
                                                                        
                            
            
                                    
            
            
                | 76 |  |  |             ); | 
            
                                                                        
                            
            
                                    
            
            
                | 77 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 78 |  |  |             if (count($lista) === 0) { | 
            
                                                                        
                            
            
                                    
            
            
                | 79 |  |  |                 $nuevoDocumento = new EstadoDocumento(); | 
            
                                                                        
                            
            
                                    
            
            
                | 80 |  |  |                 $nuevoDocumento->nombre = 'Anulada'; | 
            
                                                                        
                            
            
                                    
            
            
                | 81 |  |  |                 $nuevoDocumento->tipodoc = $documento; | 
            
                                                                        
                            
            
                                    
            
            
                | 82 |  |  |                 $nuevoDocumento->icon = 'fas fa-handshake-slash'; | 
            
                                                                        
                            
            
                                    
            
            
                | 83 |  |  |                 $nuevoDocumento->editable = false; | 
            
                                                                        
                            
            
                                    
            
            
                | 84 |  |  |                 $nuevoDocumento->bloquear = true; | 
            
                                                                        
                            
            
                                    
            
            
                | 85 |  |  |                 $nuevoDocumento->actualizastock = 0; | 
            
                                                                        
                            
            
                                    
            
            
                | 86 |  |  |                 $nuevoDocumento->predeterminado = false; | 
            
                                                                        
                            
            
                                    
            
            
                | 87 |  |  |                 $nuevoDocumento->save(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 88 |  |  |             } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 89 |  |  |         } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 90 |  |  |     } | 
            
                                                                                                            
                            
            
                                    
            
            
                | 91 |  |  |      | 
            
                                                                                                            
                            
            
                                    
            
            
                | 92 |  |  |     public function update() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 93 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 94 |  |  |         new NCFTipoPago(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 95 |  |  |         new NCFTipoAnulacion(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 96 |  |  |         new NCFTipoMovimiento(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 97 |  |  |         new NCFTipo(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 98 |  |  |         new NCFRango(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 99 |  |  |         new Cliente(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 100 |  |  |         new FacturaCliente(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 101 |  |  |         new Proveedor(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 102 |  |  |         new FacturaProveedor(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 103 |  |  |         $this->ActualizarEstados(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 104 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 105 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 106 |  |  |  | 
            
                        
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