@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | self::$i18n = new Translator(); |
79 | 79 | } |
80 | 80 | |
81 | - if(self::$type_operation === 'sales') { |
|
81 | + if (self::$type_operation === 'sales') { |
|
82 | 82 | return [ |
83 | 83 | self::TYPE_OPERATION_DOCUMENT_SALES_IPO => self::$i18n->trans('ncf-sales-income-type-ipo'), |
84 | 84 | self::TYPE_OPERATION_DOCUMENT_SALES_IF => self::$i18n->trans('ncf-sales-income-type-if'), |
@@ -111,6 +111,6 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public static function defaultValue() |
113 | 113 | { |
114 | - return (self::$type_operation === 'sales')?self::TYPE_OPERATION_DOCUMENT_SALES_IPO:self::TYPE_OPERATION_DOCUMENT_PURCHASES_GP; |
|
114 | + return (self::$type_operation === 'sales') ?self::TYPE_OPERATION_DOCUMENT_SALES_IPO : self::TYPE_OPERATION_DOCUMENT_PURCHASES_GP; |
|
115 | 115 | } |
116 | 116 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | |
174 | 174 | protected function saveUpdate(array $values = array()) |
175 | 175 | { |
176 | - if($this->id and isset($this->usuariomodificacion_view)) { |
|
176 | + if ($this->id and isset($this->usuariomodificacion_view)) { |
|
177 | 177 | $this->fechamodificacion = \date('d-m-Y'); |
178 | 178 | $this->usuariomodificacion = $this->usuariomodificacion_view; |
179 | 179 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | . $idempresa |
190 | 190 | . ' AND tipocomprobante = ' |
191 | 191 | . $dataBase->var2str($tipocomprobante) |
192 | - . ' AND estado = ' . $dataBase->var2str(TRUE) |
|
192 | + . ' AND estado = '.$dataBase->var2str(TRUE) |
|
193 | 193 | . ';'; |
194 | 194 | $data = $dataBase->select($sql); |
195 | 195 | return new NCFRango($data[0]); |
@@ -77,13 +77,13 @@ |
||
77 | 77 | parent::install(); |
78 | 78 | return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES " . |
79 | 79 | "('01','Deterioro de Factura Pre-Imprensa',true), " . |
80 | - "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
81 | - "('03','Impresión defectuosa',true), " . |
|
82 | - "('04','Duplicidad de Factura',true), " . |
|
83 | - "('05','Corrección de la Información',true), " . |
|
84 | - "('06','Cambio de Productos',true), " . |
|
85 | - "('07','Devolución de Productos',true), " . |
|
86 | - "('08','Omisión de Productos',true);"; |
|
80 | + "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
81 | + "('03','Impresión defectuosa',true), " . |
|
82 | + "('04','Duplicidad de Factura',true), " . |
|
83 | + "('05','Corrección de la Información',true), " . |
|
84 | + "('06','Cambio de Productos',true), " . |
|
85 | + "('07','Devolución de Productos',true), " . |
|
86 | + "('08','Omisión de Productos',true);"; |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | public function restoreData() |
@@ -75,21 +75,21 @@ |
||
75 | 75 | public function install() |
76 | 76 | { |
77 | 77 | parent::install(); |
78 | - return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES " . |
|
79 | - "('01','Deterioro de Factura Pre-Imprensa',true), " . |
|
80 | - "('02','Errores de Impresión (Factura Pre-Impresa)',true), " . |
|
81 | - "('03','Impresión defectuosa',true), " . |
|
82 | - "('04','Duplicidad de Factura',true), " . |
|
83 | - "('05','Corrección de la Información',true), " . |
|
84 | - "('06','Cambio de Productos',true), " . |
|
85 | - "('07','Devolución de Productos',true), " . |
|
78 | + return "INSERT INTO rd_ncftipoanulacion (codigo, descripcion, estado) VALUES ". |
|
79 | + "('01','Deterioro de Factura Pre-Imprensa',true), ". |
|
80 | + "('02','Errores de Impresión (Factura Pre-Impresa)',true), ". |
|
81 | + "('03','Impresión defectuosa',true), ". |
|
82 | + "('04','Duplicidad de Factura',true), ". |
|
83 | + "('05','Corrección de la Información',true), ". |
|
84 | + "('06','Cambio de Productos',true), ". |
|
85 | + "('07','Devolución de Productos',true), ". |
|
86 | 86 | "('08','Omisión de Productos',true);"; |
87 | 87 | } |
88 | 88 | |
89 | 89 | public function restoreData() |
90 | 90 | { |
91 | 91 | $dataBase = new DataBase(); |
92 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
92 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
93 | 93 | $dataBase->exec($sqlClean); |
94 | 94 | foreach ($this->arrayTipoAnulacion as $arrayItem) { |
95 | 95 | $initialData = new NCFTipoAnulacion($arrayItem); |
@@ -59,7 +59,7 @@ |
||
59 | 59 | |
60 | 60 | public function saveInsert() |
61 | 61 | { |
62 | - return function () { |
|
62 | + return function() { |
|
63 | 63 | $ncfrango = new NCFRango(); |
64 | 64 | $cliente = new Cliente(); |
65 | 65 | $appSettins = new AppSettings; |
@@ -16,15 +16,15 @@ discard block |
||
16 | 16 | * along with fsRepublicaDominicana. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 | */ |
18 | 18 | |
19 | - namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Model; |
|
19 | + namespace FacturaScripts\Plugins\fsRepublicaDominicana\Extension\Model; |
|
20 | 20 | |
21 | - class Cliente |
|
22 | - { |
|
21 | + class Cliente |
|
22 | + { |
|
23 | 23 | /** |
24 | - * Type of NCF to generate to the customer |
|
25 | - * |
|
26 | - * @var string |
|
27 | - */ |
|
24 | + * Type of NCF to generate to the customer |
|
25 | + * |
|
26 | + * @var string |
|
27 | + */ |
|
28 | 28 | public $codsubtipodoc; |
29 | 29 | /** |
30 | 30 | * Payment type based on DGII table |
@@ -32,4 +32,4 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public $ncftipopago; |
34 | 34 | |
35 | - } |
|
35 | + } |
@@ -61,20 +61,20 @@ discard block |
||
61 | 61 | * @var array |
62 | 62 | */ |
63 | 63 | public $arrayTipos = array( |
64 | - array ('tipopago'=>'01','codigo' => '17', 'descripcion' => 'EFECTIVO','estado'=>true), |
|
65 | - array ('tipopago'=>'01','codigo' => '18', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO','estado'=>true), |
|
66 | - array ('tipopago'=>'01','codigo' => '19', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO','estado'=>true), |
|
67 | - array ('tipopago'=>'01','codigo' => '20', 'descripcion' => 'VENTA A CREDITO','estado'=>true), |
|
68 | - array ('tipopago'=>'01','codigo' => '21', 'descripcion' => 'BONOS O CERTIFICADOS DE REGALO','estado'=>true), |
|
69 | - array ('tipopago'=>'01','codigo' => '22', 'descripcion' => 'PERMUTA','estado'=>true), |
|
70 | - array ('tipopago'=>'01','codigo' => '23', 'descripcion' => 'OTRAS FORMAS DE VENTAS','estado'=>true), |
|
71 | - array ('tipopago'=>'02','codigo' => '01', 'descripcion' => 'EFECTIVO','estado'=>true), |
|
72 | - array ('tipopago'=>'02','codigo' => '02', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO','estado'=>true), |
|
73 | - array ('tipopago'=>'02','codigo' => '03', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO','estado'=>true), |
|
74 | - array ('tipopago'=>'02','codigo' => '04', 'descripcion' => 'COMPRA A CREDITO','estado'=>true), |
|
75 | - array ('tipopago'=>'02','codigo' => '05', 'descripcion' => 'PERMUTA','estado'=>true), |
|
76 | - array ('tipopago'=>'02','codigo' => '06', 'descripcion' => 'NOTA DE CREDITO','estado'=>true), |
|
77 | - array ('tipopago'=>'02','codigo' => '07', 'descripcion' => 'MIXTO','estado'=>true) |
|
64 | + array('tipopago'=>'01', 'codigo' => '17', 'descripcion' => 'EFECTIVO', 'estado'=>true), |
|
65 | + array('tipopago'=>'01', 'codigo' => '18', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO', 'estado'=>true), |
|
66 | + array('tipopago'=>'01', 'codigo' => '19', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO', 'estado'=>true), |
|
67 | + array('tipopago'=>'01', 'codigo' => '20', 'descripcion' => 'VENTA A CREDITO', 'estado'=>true), |
|
68 | + array('tipopago'=>'01', 'codigo' => '21', 'descripcion' => 'BONOS O CERTIFICADOS DE REGALO', 'estado'=>true), |
|
69 | + array('tipopago'=>'01', 'codigo' => '22', 'descripcion' => 'PERMUTA', 'estado'=>true), |
|
70 | + array('tipopago'=>'01', 'codigo' => '23', 'descripcion' => 'OTRAS FORMAS DE VENTAS', 'estado'=>true), |
|
71 | + array('tipopago'=>'02', 'codigo' => '01', 'descripcion' => 'EFECTIVO', 'estado'=>true), |
|
72 | + array('tipopago'=>'02', 'codigo' => '02', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO', 'estado'=>true), |
|
73 | + array('tipopago'=>'02', 'codigo' => '03', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO', 'estado'=>true), |
|
74 | + array('tipopago'=>'02', 'codigo' => '04', 'descripcion' => 'COMPRA A CREDITO', 'estado'=>true), |
|
75 | + array('tipopago'=>'02', 'codigo' => '05', 'descripcion' => 'PERMUTA', 'estado'=>true), |
|
76 | + array('tipopago'=>'02', 'codigo' => '06', 'descripcion' => 'NOTA DE CREDITO', 'estado'=>true), |
|
77 | + array('tipopago'=>'02', 'codigo' => '07', 'descripcion' => 'MIXTO', 'estado'=>true) |
|
78 | 78 | ); |
79 | 79 | |
80 | 80 | /** |
@@ -102,27 +102,27 @@ discard block |
||
102 | 102 | public function install() |
103 | 103 | { |
104 | 104 | parent::install(); |
105 | - return "INSERT INTO rd_ncftipopagos (tipopago, codigo, descripcion, estado) VALUES " . |
|
106 | - "('01','17','EFECTIVO',true), " . |
|
107 | - "('01','18','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), " . |
|
108 | - "('01','19','TARJETA CRÉDITO/DÉBITO',true), " . |
|
109 | - "('01','20','VENTA A CRÉDITO',true), " . |
|
110 | - "('01','21','BONOS O CERTIFICADOS DE REGALO',true), " . |
|
111 | - "('01','22','PERMUTA',true), " . |
|
112 | - "('01','23','OTRAS FORMAS DE VENTAS',true), " . |
|
113 | - "('02','01','EFECTIVO',true), " . |
|
114 | - "('02','02','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), " . |
|
115 | - "('02','03','TARJETA CRÉDITO/DÉBITO',true), " . |
|
116 | - "('02','04','COMPRA A CREDITO',true), " . |
|
117 | - "('02','05','PERMUTA',true), " . |
|
118 | - "('02','06','NOTA DE CREDITO',true), " . |
|
105 | + return "INSERT INTO rd_ncftipopagos (tipopago, codigo, descripcion, estado) VALUES ". |
|
106 | + "('01','17','EFECTIVO',true), ". |
|
107 | + "('01','18','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), ". |
|
108 | + "('01','19','TARJETA CRÉDITO/DÉBITO',true), ". |
|
109 | + "('01','20','VENTA A CRÉDITO',true), ". |
|
110 | + "('01','21','BONOS O CERTIFICADOS DE REGALO',true), ". |
|
111 | + "('01','22','PERMUTA',true), ". |
|
112 | + "('01','23','OTRAS FORMAS DE VENTAS',true), ". |
|
113 | + "('02','01','EFECTIVO',true), ". |
|
114 | + "('02','02','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), ". |
|
115 | + "('02','03','TARJETA CRÉDITO/DÉBITO',true), ". |
|
116 | + "('02','04','COMPRA A CREDITO',true), ". |
|
117 | + "('02','05','PERMUTA',true), ". |
|
118 | + "('02','06','NOTA DE CREDITO',true), ". |
|
119 | 119 | "('02','07','MIXTO',true);"; |
120 | 120 | } |
121 | 121 | |
122 | 122 | public function restoreData() |
123 | 123 | { |
124 | 124 | $dataBase = new DataBase(); |
125 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
125 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
126 | 126 | $dataBase->exec($sqlClean); |
127 | 127 | foreach ($this->arrayTipos as $arrayItem) { |
128 | 128 | $initialData = new NCFTipoMovimiento($arrayItem); |
@@ -61,23 +61,23 @@ discard block |
||
61 | 61 | * @var array |
62 | 62 | */ |
63 | 63 | private $arrayTiposMovimiento = array( |
64 | - array ('tipomovimiento'=>'COM','codigo' => '01', 'descripcion' => 'GASTOS DE PERSONAL', 'estado' => true), |
|
65 | - array ('tipomovimiento'=>'COM','codigo' => '02', 'descripcion' => 'GASTOS POR TRABAJOS, SUMINISTROS Y SERVICIOS', 'estado' => true), |
|
66 | - array ('tipomovimiento'=>'COM','codigo' => '03', 'descripcion' => 'ARRENDAMIENTOS', 'estado' => true), |
|
67 | - array ('tipomovimiento'=>'COM','codigo' => '04', 'descripcion' => 'GASTOS DE ACTIVOS FIJOS', 'estado' => true), |
|
68 | - array ('tipomovimiento'=>'COM','codigo' => '05', 'descripcion' => 'GASTOS DE REPRESENTACIÓN', 'estado' => true), |
|
69 | - array ('tipomovimiento'=>'COM','codigo' => '06', 'descripcion' => 'OTRAS DEDUCCIONES ADMITIDAS', 'estado' => true), |
|
70 | - array ('tipomovimiento'=>'COM','codigo' => '07', 'descripcion' => 'GASTOS FINANCIEROS', 'estado' => true), |
|
71 | - array ('tipomovimiento'=>'COM','codigo' => '08', 'descripcion' => 'GASTOS EXTRAORDINARIOS', 'estado' => true), |
|
72 | - array ('tipomovimiento'=>'COM','codigo' => '09', 'descripcion' => 'COMPRAS Y GASTOS QUE FORMARÁN PARTE DEL COSTO DE VENTA', 'estado' => true), |
|
73 | - array ('tipomovimiento'=>'COM','codigo' => '10', 'descripcion' => 'ADQUISICIONES DE ACTIVOS', 'estado' => true), |
|
74 | - array ('tipomovimiento'=>'COM','codigo' => '11', 'descripcion' => 'GASTOS DE SEGUROS', 'estado' => true), |
|
75 | - array ('tipomovimiento'=>'VEN','codigo' => '1', 'descripcion' => 'Ingresos por operaciones (No financieros)', 'estado' => true), |
|
76 | - array ('tipomovimiento'=>'VEN','codigo' => '2', 'descripcion' => 'Ingresos Financieros', 'estado' => true), |
|
77 | - array ('tipomovimiento'=>'VEN','codigo' => '3', 'descripcion' => 'Ingresos Extraordinarios', 'estado' => true), |
|
78 | - array ('tipomovimiento'=>'VEN','codigo' => '4', 'descripcion' => 'Ingresos por Arrendamientos', 'estado' => true), |
|
79 | - array ('tipomovimiento'=>'VEN','codigo' => '5', 'descripcion' => 'Ingresos por Venta de Activo Depreciable', 'estado' => true), |
|
80 | - array ('tipomovimiento'=>'VEN','codigo' => '6', 'descripcion' => 'Otros Ingresos', 'estado' => true) |
|
64 | + array('tipomovimiento'=>'COM', 'codigo' => '01', 'descripcion' => 'GASTOS DE PERSONAL', 'estado' => true), |
|
65 | + array('tipomovimiento'=>'COM', 'codigo' => '02', 'descripcion' => 'GASTOS POR TRABAJOS, SUMINISTROS Y SERVICIOS', 'estado' => true), |
|
66 | + array('tipomovimiento'=>'COM', 'codigo' => '03', 'descripcion' => 'ARRENDAMIENTOS', 'estado' => true), |
|
67 | + array('tipomovimiento'=>'COM', 'codigo' => '04', 'descripcion' => 'GASTOS DE ACTIVOS FIJOS', 'estado' => true), |
|
68 | + array('tipomovimiento'=>'COM', 'codigo' => '05', 'descripcion' => 'GASTOS DE REPRESENTACIÓN', 'estado' => true), |
|
69 | + array('tipomovimiento'=>'COM', 'codigo' => '06', 'descripcion' => 'OTRAS DEDUCCIONES ADMITIDAS', 'estado' => true), |
|
70 | + array('tipomovimiento'=>'COM', 'codigo' => '07', 'descripcion' => 'GASTOS FINANCIEROS', 'estado' => true), |
|
71 | + array('tipomovimiento'=>'COM', 'codigo' => '08', 'descripcion' => 'GASTOS EXTRAORDINARIOS', 'estado' => true), |
|
72 | + array('tipomovimiento'=>'COM', 'codigo' => '09', 'descripcion' => 'COMPRAS Y GASTOS QUE FORMARÁN PARTE DEL COSTO DE VENTA', 'estado' => true), |
|
73 | + array('tipomovimiento'=>'COM', 'codigo' => '10', 'descripcion' => 'ADQUISICIONES DE ACTIVOS', 'estado' => true), |
|
74 | + array('tipomovimiento'=>'COM', 'codigo' => '11', 'descripcion' => 'GASTOS DE SEGUROS', 'estado' => true), |
|
75 | + array('tipomovimiento'=>'VEN', 'codigo' => '1', 'descripcion' => 'Ingresos por operaciones (No financieros)', 'estado' => true), |
|
76 | + array('tipomovimiento'=>'VEN', 'codigo' => '2', 'descripcion' => 'Ingresos Financieros', 'estado' => true), |
|
77 | + array('tipomovimiento'=>'VEN', 'codigo' => '3', 'descripcion' => 'Ingresos Extraordinarios', 'estado' => true), |
|
78 | + array('tipomovimiento'=>'VEN', 'codigo' => '4', 'descripcion' => 'Ingresos por Arrendamientos', 'estado' => true), |
|
79 | + array('tipomovimiento'=>'VEN', 'codigo' => '5', 'descripcion' => 'Ingresos por Venta de Activo Depreciable', 'estado' => true), |
|
80 | + array('tipomovimiento'=>'VEN', 'codigo' => '6', 'descripcion' => 'Otros Ingresos', 'estado' => true) |
|
81 | 81 | ); |
82 | 82 | |
83 | 83 | /** |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | public function install() |
106 | 106 | { |
107 | 107 | parent::install(); |
108 | - return "INSERT INTO rd_ncftipomovimiento (tipomovimiento, codigo, descripcion, estado) VALUES " . |
|
108 | + return "INSERT INTO rd_ncftipomovimiento (tipomovimiento, codigo, descripcion, estado) VALUES ". |
|
109 | 109 | "('COM','01','GASTOS DE PERSONAL',true), ". |
110 | 110 | "('COM','02','GASTOS POR TRABAJOS, SUMINISTROS Y SERVICIOS',true), ". |
111 | 111 | "('COM','03','ARRENDAMIENTOS',true), ". |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public function restoreData() |
129 | 129 | { |
130 | 130 | $dataBase = new DataBase(); |
131 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
131 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
132 | 132 | $dataBase->exec($sqlClean); |
133 | 133 | foreach ($this->arrayTiposMovimiento as $arrayItem) { |
134 | 134 | $initialData = new NCFTipoMovimiento($arrayItem); |
@@ -27,10 +27,10 @@ |
||
27 | 27 | { |
28 | 28 | public function createViews(): \Closure |
29 | 29 | { |
30 | - return function () { |
|
30 | + return function() { |
|
31 | 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'); |
|
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 | 34 | $ncfTipoPago = new NCFTipoPago(); |
35 | 35 | $ncfTiposPago = $ncfTipoPago->findAllByTipopago('02'); |
36 | 36 | $customValuesNTP = []; |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | |
52 | 52 | public function saveInsert() |
53 | 53 | { |
54 | - return function () { |
|
55 | - $ArrayTipoNCFCompras = ['11','12','16','17']; |
|
54 | + return function() { |
|
55 | + $ArrayTipoNCFCompras = ['11', '12', '16', '17']; |
|
56 | 56 | $ncfrango = new NCFRango(); |
57 | 57 | $cliente = new Proveedor(); |
58 | 58 | $appSettings = new AppSettings; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $codsubtipodoc = $this->codsubtipodoc; |
62 | 62 | $ncfRangoToUse = $ncfrango->getByTipoComprobante($actualProveedor->idempresa, $codsubtipodoc); |
63 | 63 | |
64 | - if(in_array($codsubtipodoc, $ArrayTipoNCFCompras, true)) { |
|
64 | + if (in_array($codsubtipodoc, $ArrayTipoNCFCompras, true)) { |
|
65 | 65 | $ncf = $ncfRangoToUse->generateNCF(); |
66 | 66 | $this->numproveedor = $ncf; |
67 | 67 | $this->ncffechavencimiento = $ncfRangoToUse->fechavencimiento; |