@@ -184,7 +184,7 @@ |
||
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 (in_array($data[0], [null, ''], true)) { |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | protected function getGroupFields(): string |
70 | 70 | { |
71 | 71 | //return parent::getGroupFields(); // TODO: Change the autogenerated stub |
72 | - return static::MAIN_TABLE.'.idfactura, ' . |
|
73 | - static::MAIN_TABLE.'.idempresa, ' . |
|
74 | - static::MAIN_TABLE.'.codalmacen, ' . |
|
75 | - static::MAIN_TABLE.'.cifnif, ' . |
|
76 | - static::MAIN_TABLE.'.ncftipomovimiento, ' . |
|
77 | - static::MAIN_TABLE.'.numproveedor, ' . |
|
78 | - static::SECONDARY_TABLE_ALIAS.'.numproveedor, ' . |
|
79 | - static::MAIN_TABLE.'.fecha, ' . |
|
80 | - static::ESTADOSDOC_TABLE.'.nombre, ' . |
|
81 | - static::MAIN_TABLE.'.neto, ' . |
|
82 | - static::MAIN_TABLE.'.totaliva' . |
|
72 | + return static::MAIN_TABLE.'.idfactura, '. |
|
73 | + static::MAIN_TABLE.'.idempresa, '. |
|
74 | + static::MAIN_TABLE.'.codalmacen, '. |
|
75 | + static::MAIN_TABLE.'.cifnif, '. |
|
76 | + static::MAIN_TABLE.'.ncftipomovimiento, '. |
|
77 | + static::MAIN_TABLE.'.numproveedor, '. |
|
78 | + static::SECONDARY_TABLE_ALIAS.'.numproveedor, '. |
|
79 | + static::MAIN_TABLE.'.fecha, '. |
|
80 | + static::ESTADOSDOC_TABLE.'.nombre, '. |
|
81 | + static::MAIN_TABLE.'.neto, '. |
|
82 | + static::MAIN_TABLE.'.totaliva'. |
|
83 | 83 | ' '; |
84 | 84 | } |
85 | 85 | |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | protected function getSQLFrom(): string |
91 | 91 | { |
92 | 92 | return static::MAIN_TABLE |
93 | - . ' LEFT JOIN '. static::SECONDARY_TABLE . ' ON (' |
|
94 | - . static::MAIN_TABLE . '.idfacturarect = ' . static::SECONDARY_TABLE_ALIAS . '.idfactura)' |
|
95 | - . ' LEFT JOIN '. static::LINES_TABLE . ' ON (' |
|
96 | - . static::MAIN_TABLE . '.idfactura = ' . static::LINES_TABLE . '.idfactura)' |
|
97 | - . ' LEFT JOIN '. static::PRODS_TABLE . ' ON (' |
|
98 | - . static::LINES_TABLE . '.referencia = ' . static::PRODS_TABLE . '.referencia)' |
|
99 | - . ' LEFT JOIN ' . static::ESTADOSDOC_TABLE . ' ON (' |
|
100 | - . static::MAIN_TABLE . '.idestado = ' . static::ESTADOSDOC_TABLE . '.idestado)'; |
|
93 | + . ' LEFT JOIN '.static::SECONDARY_TABLE.' ON (' |
|
94 | + . static::MAIN_TABLE.'.idfacturarect = '.static::SECONDARY_TABLE_ALIAS.'.idfactura)' |
|
95 | + . ' LEFT JOIN '.static::LINES_TABLE.' ON (' |
|
96 | + . static::MAIN_TABLE.'.idfactura = '.static::LINES_TABLE.'.idfactura)' |
|
97 | + . ' LEFT JOIN '.static::PRODS_TABLE.' ON (' |
|
98 | + . static::LINES_TABLE.'.referencia = '.static::PRODS_TABLE.'.referencia)' |
|
99 | + . ' LEFT JOIN '.static::ESTADOSDOC_TABLE.' ON (' |
|
100 | + . static::MAIN_TABLE.'.idestado = '.static::ESTADOSDOC_TABLE.'.idestado)'; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | private function slowParser() |
134 | 134 | { |
135 | 135 | $dataBase = new DataBase(); |
136 | - $sqlDelete = "DELETE FROM " . $this->tableName() . ";"; |
|
136 | + $sqlDelete = "DELETE FROM ".$this->tableName().";"; |
|
137 | 137 | $dataBase->exec($sqlDelete); |
138 | 138 | |
139 | 139 | [$handle, $totalLines] = $this->utf8FopenRead($this->fileNameTxt); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | while (($raw_string = fgets($handle)) !== false) { |
143 | 143 | $totalLines--; |
144 | 144 | if ($maxLine === 2000) { |
145 | - $query = 'INSERT INTO ' . $this->tableName() . |
|
145 | + $query = 'INSERT INTO '.$this->tableName(). |
|
146 | 146 | ' (rnc, nombre, razonsocial, categoria, inicioactividad, estado, regimenpagos) VALUES '; |
147 | 147 | } |
148 | 148 | $linea = str_getcsv($raw_string, "|"); |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $maxLine--; |
160 | 160 | $lineNumber++; |
161 | 161 | } else { |
162 | - $this->toolBox()->i18nLog()->error("Error RNC TXT Linea: ".count($linea) . " - " . $raw_string); |
|
162 | + $this->toolBox()->i18nLog()->error("Error RNC TXT Linea: ".count($linea)." - ".$raw_string); |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | fclose($handle); |
@@ -171,14 +171,14 @@ discard block |
||
171 | 171 | $fecha = ($colArray[8] === '00/00/0000') |
172 | 172 | ? "2000-01-01" |
173 | 173 | : \date('Y-m-d', strtotime(str_replace("/", "-", $colArray[8]))); |
174 | - return "('" . |
|
175 | - $colArray[0] . "','" . |
|
176 | - str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[1]))) . "','" . |
|
177 | - str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[2]))) . "','" . |
|
178 | - $colArray[3] . "','" . |
|
179 | - $fecha . "','" . |
|
180 | - $colArray[9] . "','" . |
|
181 | - $colArray[10] . "')" . $semiColon; |
|
174 | + return "('". |
|
175 | + $colArray[0]."','". |
|
176 | + str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[1])))."','". |
|
177 | + str_replace('"', '', str_replace("'", "''", str_replace(" ", " ", $colArray[2])))."','". |
|
178 | + $colArray[3]."','". |
|
179 | + $fecha."','". |
|
180 | + $colArray[9]."','". |
|
181 | + $colArray[10]."')".$semiColon; |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | private function utf8FopenRead($fileName) |