Passed
Push — master ( 80c38f...50b0f1 )
by Joe Nilson
02:00
created
Model/NCFTipoPago.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -61,20 +61,20 @@  discard block
 block discarded – undo
61 61
      * @var array
62 62
      */
63 63
     public $arrayTipos = [
64
-        ['tipopago'=>'01','codigo' => '17', 'descripcion' => 'EFECTIVO','estado'=>true],
65
-        ['tipopago'=>'01','codigo' => '18', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO','estado'=>true],
66
-        ['tipopago'=>'01','codigo' => '19', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO','estado'=>true],
67
-        ['tipopago'=>'01','codigo' => '20', 'descripcion' => 'VENTA A CREDITO','estado'=>true],
68
-        ['tipopago'=>'01','codigo' => '21', 'descripcion' => 'BONOS O CERTIFICADOS DE REGALO','estado'=>true],
69
-        ['tipopago'=>'01','codigo' => '22', 'descripcion' => 'PERMUTA','estado'=>true],
70
-        ['tipopago'=>'01','codigo' => '23', 'descripcion' => 'OTRAS FORMAS DE VENTAS','estado'=>true],
71
-        ['tipopago'=>'02','codigo' => '01', 'descripcion' => 'EFECTIVO','estado'=>true],
72
-        ['tipopago'=>'02','codigo' => '02', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO','estado'=>true],
73
-        ['tipopago'=>'02','codigo' => '03', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO','estado'=>true],
74
-        ['tipopago'=>'02','codigo' => '04', 'descripcion' => 'COMPRA A CREDITO','estado'=>true],
75
-        ['tipopago'=>'02','codigo' => '05', 'descripcion' => 'PERMUTA','estado'=>true],
76
-        ['tipopago'=>'02','codigo' => '06', 'descripcion' => 'NOTA DE CREDITO','estado'=>true],
77
-        ['tipopago'=>'02','codigo' => '07', 'descripcion' => 'MIXTO','estado'=>true]
64
+        ['tipopago'=>'01', 'codigo' => '17', 'descripcion' => 'EFECTIVO', 'estado'=>true],
65
+        ['tipopago'=>'01', 'codigo' => '18', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO', 'estado'=>true],
66
+        ['tipopago'=>'01', 'codigo' => '19', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO', 'estado'=>true],
67
+        ['tipopago'=>'01', 'codigo' => '20', 'descripcion' => 'VENTA A CREDITO', 'estado'=>true],
68
+        ['tipopago'=>'01', 'codigo' => '21', 'descripcion' => 'BONOS O CERTIFICADOS DE REGALO', 'estado'=>true],
69
+        ['tipopago'=>'01', 'codigo' => '22', 'descripcion' => 'PERMUTA', 'estado'=>true],
70
+        ['tipopago'=>'01', 'codigo' => '23', 'descripcion' => 'OTRAS FORMAS DE VENTAS', 'estado'=>true],
71
+        ['tipopago'=>'02', 'codigo' => '01', 'descripcion' => 'EFECTIVO', 'estado'=>true],
72
+        ['tipopago'=>'02', 'codigo' => '02', 'descripcion' => 'CHEQUES/TRANSFERENCIAS/DEPOSITO', 'estado'=>true],
73
+        ['tipopago'=>'02', 'codigo' => '03', 'descripcion' => 'TARJETA CRÉDITO/DÉBITO', 'estado'=>true],
74
+        ['tipopago'=>'02', 'codigo' => '04', 'descripcion' => 'COMPRA A CREDITO', 'estado'=>true],
75
+        ['tipopago'=>'02', 'codigo' => '05', 'descripcion' => 'PERMUTA', 'estado'=>true],
76
+        ['tipopago'=>'02', 'codigo' => '06', 'descripcion' => 'NOTA DE CREDITO', 'estado'=>true],
77
+        ['tipopago'=>'02', 'codigo' => '07', 'descripcion' => 'MIXTO', 'estado'=>true]
78 78
     ];
79 79
     
80 80
     /**
@@ -99,27 +99,27 @@  discard block
 block discarded – undo
99 99
     public function install(): string
100 100
     {
101 101
         parent::install();
102
-        return "INSERT INTO rd_ncftipopagos (tipopago, codigo, descripcion, estado) VALUES " .
103
-            "('01','17','EFECTIVO',true), " .
104
-            "('01','18','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), " .
105
-            "('01','19','TARJETA CRÉDITO/DÉBITO',true), " .
106
-            "('01','20','VENTA A CRÉDITO',true), " .
107
-            "('01','21','BONOS O CERTIFICADOS DE REGALO',true), " .
108
-            "('01','22','PERMUTA',true), " .
109
-            "('01','23','OTRAS FORMAS DE VENTAS',true), " .
110
-            "('02','01','EFECTIVO',true), " .
111
-            "('02','02','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), " .
112
-            "('02','03','TARJETA CRÉDITO/DÉBITO',true), " .
113
-            "('02','04','COMPRA A CREDITO',true), " .
114
-            "('02','05','PERMUTA',true), " .
115
-            "('02','06','NOTA DE CREDITO',true), " .
102
+        return "INSERT INTO rd_ncftipopagos (tipopago, codigo, descripcion, estado) VALUES ".
103
+            "('01','17','EFECTIVO',true), ".
104
+            "('01','18','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), ".
105
+            "('01','19','TARJETA CRÉDITO/DÉBITO',true), ".
106
+            "('01','20','VENTA A CRÉDITO',true), ".
107
+            "('01','21','BONOS O CERTIFICADOS DE REGALO',true), ".
108
+            "('01','22','PERMUTA',true), ".
109
+            "('01','23','OTRAS FORMAS DE VENTAS',true), ".
110
+            "('02','01','EFECTIVO',true), ".
111
+            "('02','02','CHEQUES/TRANSFERENCIAS/DEPOSITO',true), ".
112
+            "('02','03','TARJETA CRÉDITO/DÉBITO',true), ".
113
+            "('02','04','COMPRA A CREDITO',true), ".
114
+            "('02','05','PERMUTA',true), ".
115
+            "('02','06','NOTA DE CREDITO',true), ".
116 116
             "('02','07','MIXTO',true);";
117 117
     }
118 118
     
119 119
     public function restoreData()
120 120
     {
121 121
         $dataBase = new DataBase();
122
-        $sqlClean = "DELETE FROM " . $this->tableName() . ";";
122
+        $sqlClean = "DELETE FROM ".$this->tableName().";";
123 123
         $dataBase->exec($sqlClean);
124 124
         foreach ($this->arrayTipos as $arrayItem) {
125 125
             $initialData = new NCFTipoMovimiento($arrayItem);
Please login to merge, or discard this patch.
Model/NCFRango.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -184,7 +184,7 @@
 block discarded – undo
184 184
                 . $idempresa
185 185
                 . ' AND tipocomprobante = '
186 186
                 . $dataBase->var2str($tipocomprobante)
187
-                . ' AND estado = ' . $dataBase->var2str(true)
187
+                . ' AND estado = '.$dataBase->var2str(true)
188 188
                 . ';';
189 189
         $data = $dataBase->select($sql);
190 190
         if (empty($data) === true || in_array($data[0], [null, ''], true)) {
Please login to merge, or discard this patch.
Model/NCFTipo.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
         parent::install();
159 159
         $sql = "INSERT INTO rd_ncftipo (".
160 160
             "tipocomprobante, descripcion, estado, clasemovimiento, ventas, compras, contribuyente".
161
-            " ) VALUES " .
162
-            "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y')," .
163
-            "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y')," .
164
-            "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N')," .
165
-            "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N')," .
166
-            "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y')," .
167
-            "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N')," .
168
-            "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N')," .
169
-            "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y')," .
170
-            "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y')," .
171
-            "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y')," .
161
+            " ) VALUES ".
162
+            "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y'),".
163
+            "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y'),".
164
+            "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N'),".
165
+            "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N'),".
166
+            "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y'),".
167
+            "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N'),".
168
+            "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N'),".
169
+            "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y'),".
170
+            "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y'),".
171
+            "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y'),".
172 172
             "('17','COMPROBANTE PARA PAGOS AL EXTERIOR',true, 'suma','N', 'Y','Y');";
173 173
         return($sql);
174 174
     }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
     public function restoreData()
177 177
     {
178 178
         $dataBase = new DataBase();
179
-        $sqlClean = "DELETE FROM " . $this->tableName() . ";";
179
+        $sqlClean = "DELETE FROM ".$this->tableName().";";
180 180
         $dataBase->exec($sqlClean);
181 181
         foreach ($this->arrayComprobantes as $arrayItem) {
182 182
             $initialData = new NCFTipo($arrayItem);
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
     public function allFor($type = "ventas", $movimiento = "suma")
189 189
     {
190
-        $where = [new DataBaseWhere($type, 'Y'),new DataBaseWhere('clasemovimiento', $movimiento)];
190
+        $where = [new DataBaseWhere($type, 'Y'), new DataBaseWhere('clasemovimiento', $movimiento)];
191 191
         return $this->all($where, ['tipocomprobante' => 'ASC'], 0, 50);
192 192
     }
193 193
 
Please login to merge, or discard this patch.
Model/Join/FiscalReport606.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -72,17 +72,17 @@  discard block
 block discarded – undo
72 72
     protected function getGroupFields(): string
73 73
     {
74 74
         //return parent::getGroupFields(); // TODO: Change the autogenerated stub
75
-        return  static::MAIN_TABLE.'.idfactura, ' .
76
-                static::MAIN_TABLE.'.idempresa, ' .
77
-                static::MAIN_TABLE.'.codalmacen, ' .
78
-                static::MAIN_TABLE.'.cifnif, ' .
79
-                static::MAIN_TABLE.'.ncftipomovimiento, ' .
80
-                static::MAIN_TABLE.'.numeroncf, ' .
81
-                static::SECONDARY_TABLE_ALIAS.'.numeroncf, ' .
82
-                static::MAIN_TABLE.'.fecha, ' .
83
-                static::ESTADOSDOC_TABLE.'.nombre, ' .
84
-                static::MAIN_TABLE.'.neto, ' .
85
-                static::MAIN_TABLE.'.totaliva' .
75
+        return  static::MAIN_TABLE.'.idfactura, '.
76
+                static::MAIN_TABLE.'.idempresa, '.
77
+                static::MAIN_TABLE.'.codalmacen, '.
78
+                static::MAIN_TABLE.'.cifnif, '.
79
+                static::MAIN_TABLE.'.ncftipomovimiento, '.
80
+                static::MAIN_TABLE.'.numeroncf, '.
81
+                static::SECONDARY_TABLE_ALIAS.'.numeroncf, '.
82
+                static::MAIN_TABLE.'.fecha, '.
83
+                static::ESTADOSDOC_TABLE.'.nombre, '.
84
+                static::MAIN_TABLE.'.neto, '.
85
+                static::MAIN_TABLE.'.totaliva'.
86 86
             ' ';
87 87
     }
88 88
 
@@ -93,14 +93,14 @@  discard block
 block discarded – undo
93 93
     protected function getSQLFrom(): string
94 94
     {
95 95
         return static::MAIN_TABLE
96
-            . ' LEFT JOIN '. static::SECONDARY_TABLE . ' ON ('
97
-            . static::MAIN_TABLE . '.idfacturarect = ' . static::SECONDARY_TABLE_ALIAS . '.idfactura)'
98
-            . ' LEFT JOIN '. static::LINES_TABLE . ' ON ('
99
-            . static::MAIN_TABLE . '.idfactura = ' . static::LINES_TABLE . '.idfactura)'
100
-            . ' LEFT JOIN '. static::PRODS_TABLE . ' ON ('
101
-            . static::LINES_TABLE . '.referencia = ' . static::PRODS_TABLE . '.referencia)'
102
-            . ' LEFT JOIN ' . static::ESTADOSDOC_TABLE . ' ON ('
103
-            . static::MAIN_TABLE . '.idestado = ' . static::ESTADOSDOC_TABLE . '.idestado)';
96
+            . ' LEFT JOIN '.static::SECONDARY_TABLE.' ON ('
97
+            . static::MAIN_TABLE.'.idfacturarect = '.static::SECONDARY_TABLE_ALIAS.'.idfactura)'
98
+            . ' LEFT JOIN '.static::LINES_TABLE.' ON ('
99
+            . static::MAIN_TABLE.'.idfactura = '.static::LINES_TABLE.'.idfactura)'
100
+            . ' LEFT JOIN '.static::PRODS_TABLE.' ON ('
101
+            . static::LINES_TABLE.'.referencia = '.static::PRODS_TABLE.'.referencia)'
102
+            . ' LEFT JOIN '.static::ESTADOSDOC_TABLE.' ON ('
103
+            . static::MAIN_TABLE.'.idestado = '.static::ESTADOSDOC_TABLE.'.idestado)';
104 104
     }
105 105
 
106 106
     /**
Please login to merge, or discard this patch.
Model/Join/FiscalReport608.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
             'idempresa' => static::MAIN_TABLE.'.idempresa',
40 40
             'codalmacen' => static::MAIN_TABLE.'.codalmacen',
41 41
             'ncf' => static::MAIN_TABLE.'.numeroncf',
42
-            'tipoanulacion' => 'CASE WHEN ' .
43
-                                static::ESTADOSDOC_TABLE . '.nombre = \'Anulada\' AND ' .
44
-                                static::MAIN_TABLE.'.ncftipoanulacion is null ' .
45
-                                'THEN CONCAT(\'05\',\' - \',\'Corrección de la Información\') ELSE ' .
46
-                                'concat(' . static::MAIN_TABLE.'.ncftipoanulacion, \' - \', ' .
42
+            'tipoanulacion' => 'CASE WHEN '.
43
+                                static::ESTADOSDOC_TABLE.'.nombre = \'Anulada\' AND '.
44
+                                static::MAIN_TABLE.'.ncftipoanulacion is null '.
45
+                                'THEN CONCAT(\'05\',\' - \',\'Corrección de la Información\') ELSE '.
46
+                                'concat('.static::MAIN_TABLE.'.ncftipoanulacion, \' - \', '.
47 47
                                 static::NCFCANCELTYPE_TABLE.'.descripcion) END',
48 48
             'fecha' => $dateFormat.'('.static::MAIN_TABLE.'.fecha,\''.$dateFormatString.'\')',
49
-            'estado' => 'CASE WHEN ' . static::ESTADOSDOC_TABLE .
49
+            'estado' => 'CASE WHEN '.static::ESTADOSDOC_TABLE.
50 50
                         '.nombre = \'Emitida\' THEN \'Activo\' ELSE \'Anulado\' END',
51 51
         ];
52 52
         return $data;
@@ -59,10 +59,10 @@  discard block
 block discarded – undo
59 59
     protected function getSQLFrom(): string
60 60
     {
61 61
         return static::MAIN_TABLE
62
-            . ' JOIN ' . static::ESTADOSDOC_TABLE . ' ON ('
63
-            . static::MAIN_TABLE . '.idestado = ' . static::ESTADOSDOC_TABLE . '.idestado AND '.static::ESTADOSDOC_TABLE.'.nombre = \'Anulada\')'
64
-            . ' LEFT JOIN ' . static::NCFCANCELTYPE_TABLE . ' ON ('
65
-            . static::MAIN_TABLE . '.ncftipoanulacion = ' . static::NCFCANCELTYPE_TABLE . '.codigo)';
62
+            . ' JOIN '.static::ESTADOSDOC_TABLE.' ON ('
63
+            . static::MAIN_TABLE.'.idestado = '.static::ESTADOSDOC_TABLE.'.idestado AND '.static::ESTADOSDOC_TABLE.'.nombre = \'Anulada\')'
64
+            . ' LEFT JOIN '.static::NCFCANCELTYPE_TABLE.' ON ('
65
+            . static::MAIN_TABLE.'.ncftipoanulacion = '.static::NCFCANCELTYPE_TABLE.'.codigo)';
66 66
     }
67 67
 
68 68
     /**
Please login to merge, or discard this patch.