joenilson /
fsRepublicaDominicana
| 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\Model; |
||
| 19 | |||
| 20 | use Closure; |
||
| 21 | use FacturaScripts\Core\Tools; |
||
| 22 | use FacturaScripts\Dinamic\Model\NCFRango; |
||
|
0 ignored issues
–
show
|
|||
| 23 | use FacturaScripts\Dinamic\Model\NCFTipoMovimiento; |
||
|
0 ignored issues
–
show
The type
FacturaScripts\Dinamic\Model\NCFTipoMovimiento was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 24 | use FacturaScripts\Dinamic\Model\Proveedor; |
||
|
0 ignored issues
–
show
This use statement conflicts with another class in this namespace,
FacturaScripts\Plugins\f...tension\Model\Proveedor. Consider defining an alias.
Let?s assume that you have a directory layout like this: .
|-- OtherDir
| |-- Bar.php
| `-- Foo.php
`-- SomeDir
`-- Foo.php
and let?s assume the following content of // Bar.php
namespace OtherDir;
use SomeDir\Foo; // This now conflicts the class OtherDir\Foo
If both files PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as // Bar.php
namespace OtherDir;
use SomeDir\Foo as SomeDirFoo; // There is no conflict anymore.
Loading history...
The type
FacturaScripts\Dinamic\Model\Proveedor was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 25 | use FacturaScripts\Plugins\fsRepublicaDominicana\Lib\DGII\CommonModelFunctions; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @property $codproveedor |
||
| 29 | */ |
||
| 30 | class FacturaProveedor |
||
| 31 | { |
||
| 32 | /** |
||
| 33 | * @var date |
||
|
0 ignored issues
–
show
The type
FacturaScripts\Plugins\f...na\Extension\Model\date was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 34 | */ |
||
| 35 | public $ncffechavencimiento; |
||
| 36 | /** |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | public $tipocomprobante; |
||
| 40 | /** |
||
| 41 | * @var string |
||
| 42 | */ |
||
| 43 | public $ncftipopago; |
||
| 44 | /** |
||
| 45 | * @var string |
||
| 46 | */ |
||
| 47 | public $ncftipomovimiento; |
||
| 48 | /** |
||
| 49 | * @var string |
||
| 50 | */ |
||
| 51 | public $ncftipoanulacion; |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @var string |
||
| 55 | */ |
||
| 56 | public $numeroncf; |
||
| 57 | |||
| 58 | public $ecf_recibido = null; |
||
| 59 | |||
| 60 | public $ecf_aprobacion_comercial = null; |
||
| 61 | |||
| 62 | public $ecf_codigo_seguridad = null; |
||
| 63 | |||
| 64 | public $ecf_fecha_firma; |
||
| 65 | |||
| 66 | public $ecf_pdf_firmado = null; |
||
| 67 | public $ecf_xml_firmado = null; |
||
| 68 | |||
| 69 | public function saveBefore(): Closure |
||
| 70 | { |
||
| 71 | return function () { |
||
| 72 | $ArrayTipoNCFCompras = ['11', '12', '16', '17','31','32','46','47']; |
||
| 73 | $ncfrango = new NCFRango(); |
||
| 74 | $proveedor = new Proveedor(); |
||
| 75 | $actualProveedor = $proveedor::find($this->codproveedor); |
||
|
0 ignored issues
–
show
|
|||
| 76 | |||
| 77 | if (null === $actualProveedor) { |
||
| 78 | Tools::log()->error("no-supplier-found"); |
||
| 79 | return false; |
||
| 80 | } |
||
| 81 | |||
| 82 | $actualProveedor->idempresa = Tools::settings('default', 'idempresa'); |
||
| 83 | $this->tipocomprobante = $_REQUEST['tipocomprobanter'] ?? $this->tipocomprobante; |
||
| 84 | $this->numeroncf = $_REQUEST['numeroncfr'] ?? $this->numeroncf; |
||
| 85 | $this->ecf_fecha_firma = $_REQUEST['ecf_fecha_firma'] ?? NULL; |
||
| 86 | $tipocomprobante = $this->tipocomprobante; |
||
| 87 | if ($tipocomprobante && !in_array($tipocomprobante, $ArrayTipoNCFCompras, true)) { |
||
| 88 | if (!CommonModelFunctions::setCFRango($actualProveedor, $ncfrango, $tipocomprobante, $this)) { |
||
| 89 | return false; |
||
| 90 | } |
||
| 91 | } |
||
| 92 | if (in_array($this->tipocomprobante, ['03', '04', '33', '34'], true)) { |
||
| 93 | $this->ncftipoanulacion = $_REQUEST['ncftipoanulacionr'] ?? $this->ncftipoanulacion; |
||
| 94 | $this->ncffechavencimiento = $_REQUEST['ncffechavencimientor'] ?? $this->ncffechavencimiento; |
||
| 95 | } |
||
| 96 | $this->ncffechavencimiento = $this->ncffechavencimiento !== '' ? $this->ncffechavencimiento : null; |
||
| 97 | }; |
||
| 98 | } |
||
| 99 | } |
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