@@ -75,21 +75,21 @@ |
||
| 75 | 75 | public function install(): string |
| 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); |
@@ -93,10 +93,10 @@ |
||
| 93 | 93 | public function getTaxByProduct($idproducto, $rdtaxid, $use = 'venta'): ?ImpuestoProducto |
| 94 | 94 | { |
| 95 | 95 | $dataBase = new DataBase(); |
| 96 | - $sql = "SELECT * FROM impuestosproductos WHERE idproducto = " . |
|
| 97 | - (int)$idproducto . |
|
| 98 | - " AND codimpuesto = '" . $dataBase->escapeString($rdtaxid) . "'" . |
|
| 99 | - " AND " . $use . " = true" . ";"; |
|
| 96 | + $sql = "SELECT * FROM impuestosproductos WHERE idproducto = ". |
|
| 97 | + (int) $idproducto. |
|
| 98 | + " AND codimpuesto = '".$dataBase->escapeString($rdtaxid)."'". |
|
| 99 | + " AND ".$use." = true".";"; |
|
| 100 | 100 | $data = $dataBase->select($sql); |
| 101 | 101 | if (empty($data) === true || in_array($data[0], [null, ''], true)) { |
| 102 | 102 | return null; |
@@ -30,10 +30,10 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | public function createViews(): Closure |
| 32 | 32 | { |
| 33 | - return function () { |
|
| 34 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
| 35 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 36 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/BusquedaRNCDGII.js'); |
|
| 33 | + return function() { |
|
| 34 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
| 35 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 36 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/BusquedaRNCDGII.js'); |
|
| 37 | 37 | $ncfTipo = new NCFTipo(); |
| 38 | 38 | $ncfTipos = $ncfTipo->allFor('ventas', 'suma'); |
| 39 | 39 | $customValues = []; |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | public function execPreviousAction(): Closure |
| 64 | 64 | { |
| 65 | - return function ($action) { |
|
| 65 | + return function($action) { |
|
| 66 | 66 | switch ($action) { |
| 67 | 67 | case 'busca_rnc': |
| 68 | 68 | $this->setTemplate(false); |
@@ -120,16 +120,16 @@ discard block |
||
| 120 | 120 | 'tipocomprobante' => '17', 'descripcion' => 'COMPROBANTE PARA PAGOS AL EXTERIOR', 'clasemovimiento'=>'suma', |
| 121 | 121 | 'ventas'=>'N', 'compras'=>'Y', 'contribuyente'=>'Y', 'estado' => true |
| 122 | 122 | ], |
| 123 | - ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 124 | - ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 125 | - ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ], |
|
| 126 | - ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento' => 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ], |
|
| 127 | - ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 128 | - ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ], |
|
| 129 | - ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 130 | - ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 131 | - ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 132 | - ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 123 | + ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 124 | + ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 125 | + ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true], |
|
| 126 | + ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento' => 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true], |
|
| 127 | + ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 128 | + ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true], |
|
| 129 | + ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 130 | + ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 131 | + ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento' => 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 132 | + ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento' => 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 133 | 133 | ); |
| 134 | 134 | |
| 135 | 135 | /** |
@@ -168,27 +168,27 @@ discard block |
||
| 168 | 168 | parent::install(); |
| 169 | 169 | $sql = "INSERT INTO rd_ncftipo (". |
| 170 | 170 | "tipocomprobante, descripcion, estado, clasemovimiento, ventas, compras, contribuyente". |
| 171 | - " ) VALUES " . |
|
| 172 | - "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y')," . |
|
| 173 | - "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y')," . |
|
| 174 | - "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N')," . |
|
| 175 | - "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N')," . |
|
| 176 | - "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y')," . |
|
| 177 | - "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N')," . |
|
| 178 | - "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N')," . |
|
| 179 | - "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y')," . |
|
| 180 | - "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y')," . |
|
| 181 | - "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y')," . |
|
| 182 | - "('17','COMPROBANTE PARA PAGOS AL EXTERIOR',true, 'suma','N', 'Y','Y')," . |
|
| 183 | - "('31','FACTURA DE CRÉDITO FISCAL ELECTRÓNICA',true,'suma','Y','Y','Y')," . |
|
| 184 | - "('32','FACTURA DE CONSUMO ELECTRÓNICA',true,'suma','Y','Y','Y')," . |
|
| 185 | - "('33','NOTA DE DÉBITO ELECTRÓNICA',true,'suma','Y','Y','N')," . |
|
| 186 | - "('34','NOTA DE CRÉDITO ELECTRÓNICA',true,'resta','Y','Y','N')," . |
|
| 187 | - "('41','COMPROBANTE ELECTRÓNICO DE COMPRAS',true,'suma','N','Y','Y')," . |
|
| 188 | - "('43','COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES',true,'suma','N','Y','N')," . |
|
| 189 | - "('44','COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES',true,'suma','Y','Y','Y')," . |
|
| 190 | - "('45','COMPROBANTE ELECTRÓNICO GUBERNAMENTAL',true,'suma','Y','Y','Y')," . |
|
| 191 | - "('46','COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES',true,'suma','Y','Y','Y')," . |
|
| 171 | + " ) VALUES ". |
|
| 172 | + "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y'),". |
|
| 173 | + "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y'),". |
|
| 174 | + "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N'),". |
|
| 175 | + "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N'),". |
|
| 176 | + "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y'),". |
|
| 177 | + "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N'),". |
|
| 178 | + "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N'),". |
|
| 179 | + "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y'),". |
|
| 180 | + "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y'),". |
|
| 181 | + "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y'),". |
|
| 182 | + "('17','COMPROBANTE PARA PAGOS AL EXTERIOR',true, 'suma','N', 'Y','Y'),". |
|
| 183 | + "('31','FACTURA DE CRÉDITO FISCAL ELECTRÓNICA',true,'suma','Y','Y','Y'),". |
|
| 184 | + "('32','FACTURA DE CONSUMO ELECTRÓNICA',true,'suma','Y','Y','Y'),". |
|
| 185 | + "('33','NOTA DE DÉBITO ELECTRÓNICA',true,'suma','Y','Y','N'),". |
|
| 186 | + "('34','NOTA DE CRÉDITO ELECTRÓNICA',true,'resta','Y','Y','N'),". |
|
| 187 | + "('41','COMPROBANTE ELECTRÓNICO DE COMPRAS',true,'suma','N','Y','Y'),". |
|
| 188 | + "('43','COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES',true,'suma','N','Y','N'),". |
|
| 189 | + "('44','COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES',true,'suma','Y','Y','Y'),". |
|
| 190 | + "('45','COMPROBANTE ELECTRÓNICO GUBERNAMENTAL',true,'suma','Y','Y','Y'),". |
|
| 191 | + "('46','COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES',true,'suma','Y','Y','Y'),". |
|
| 192 | 192 | "('47','COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR',true,'suma','N','Y','Y');"; |
| 193 | 193 | return($sql); |
| 194 | 194 | } |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | public function restoreData() |
| 197 | 197 | { |
| 198 | 198 | $dataBase = new DataBase(); |
| 199 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
| 199 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
| 200 | 200 | $dataBase->exec($sqlClean); |
| 201 | 201 | foreach ($this->arrayComprobantes as $arrayItem) { |
| 202 | 202 | $initialData = new NCFTipo($arrayItem); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | public function allFor($type = "ventas", $movimiento = "suma") |
| 209 | 209 | { |
| 210 | - $where = [new DataBaseWhere($type, 'Y'),new DataBaseWhere('clasemovimiento', $movimiento)]; |
|
| 210 | + $where = [new DataBaseWhere($type, 'Y'), new DataBaseWhere('clasemovimiento', $movimiento)]; |
|
| 211 | 211 | return $this->all($where, ['tipocomprobante' => 'ASC'], 0, 50); |
| 212 | 212 | } |
| 213 | 213 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $this->loadExtension(new Extension\Controller\EditProducto()); |
| 65 | 65 | $this->loadExtension(new Extension\Controller\EditSettings()); |
| 66 | 66 | |
| 67 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 67 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 68 | 68 | SalesLineHTML::addMod(new Mod\SalesLineMod()); |
| 69 | 69 | SalesFooterHTML::addMod(new Mod\SalesFooterMod()); |
| 70 | 70 | PurchasesFooterHTML::addMod(new Mod\PurchasesFooterMod()); |
@@ -145,22 +145,22 @@ discard block |
||
| 145 | 145 | private function actualizarECF(): void |
| 146 | 146 | { |
| 147 | 147 | $arrayECF = [ |
| 148 | - ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 149 | - ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 150 | - ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ], |
|
| 151 | - ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento'=> 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ], |
|
| 152 | - ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 153 | - ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true ], |
|
| 154 | - ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 155 | - ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 156 | - ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 157 | - ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true ], |
|
| 148 | + ['tipocomprobante' => '31', 'descripcion' => 'FACTURA DE CRÉDITO FISCAL ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 149 | + ['tipocomprobante' => '32', 'descripcion' => 'FACTURA DE CONSUMO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 150 | + ['tipocomprobante' => '33', 'descripcion' => 'NOTA DE DÉBITO ELECTRÓNICA', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true], |
|
| 151 | + ['tipocomprobante' => '34', 'descripcion' => 'NOTA DE CRÉDITO ELECTRÓNICA', 'clasemovimiento'=> 'resta', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true], |
|
| 152 | + ['tipocomprobante' => '41', 'descripcion' => 'COMPROBANTE ELECTRÓNICO DE COMPRAS', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 153 | + ['tipocomprobante' => '43', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA GASTOS MENORES', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'N', 'estado' => true], |
|
| 154 | + ['tipocomprobante' => '44', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA REGÍMENES ESPECIALES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 155 | + ['tipocomprobante' => '45', 'descripcion' => 'COMPROBANTE ELECTRÓNICO GUBERNAMENTAL', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 156 | + ['tipocomprobante' => '46', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA EXPORTACIONES', 'clasemovimiento'=> 'suma', 'ventas' => 'Y', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 157 | + ['tipocomprobante' => '47', 'descripcion' => 'COMPROBANTE ELECTRÓNICO PARA PAGOS AL EXTERIOR', 'clasemovimiento'=> 'suma', 'ventas' => 'N', 'compras' => 'Y', 'contribuyente' => 'Y', 'estado' => true], |
|
| 158 | 158 | ]; |
| 159 | 159 | |
| 160 | 160 | $tipoComprobantes = new NCFTipo(); |
| 161 | 161 | foreach ($arrayECF as $ecf) { |
| 162 | 162 | $registro = $tipoComprobantes->get($ecf['tipocomprobante']); |
| 163 | - if($registro === false) { |
|
| 163 | + if ($registro === false) { |
|
| 164 | 164 | $registro = new NCFTipo(); |
| 165 | 165 | $registro->tipocomprobante = $ecf['tipocomprobante']; |
| 166 | 166 | $registro->descripcion = $ecf['descripcion']; |
@@ -68,36 +68,36 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | // imprimimos el nombre corto de la empresa |
| 70 | 70 | if ($printer->print_comp_shortname) { |
| 71 | - static::$escpos->text(static::sanitize($company->nombrecorto) . "\n"); |
|
| 71 | + static::$escpos->text(static::sanitize($company->nombrecorto)."\n"); |
|
| 72 | 72 | static::$escpos->setTextSize($printer->head_font_size, $printer->head_font_size); |
| 73 | 73 | |
| 74 | 74 | // imprimimos el nombre de la empresa |
| 75 | - static::$escpos->text(static::sanitize($company->nombre) . "\n"); |
|
| 75 | + static::$escpos->text(static::sanitize($company->nombre)."\n"); |
|
| 76 | 76 | } else { |
| 77 | 77 | // imprimimos el nombre de la empresa |
| 78 | - static::$escpos->text(static::sanitize($company->nombre) . "\n"); |
|
| 78 | + static::$escpos->text(static::sanitize($company->nombre)."\n"); |
|
| 79 | 79 | static::$escpos->setTextSize($printer->head_font_size, $printer->head_font_size); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static::$escpos->setJustification(); |
| 83 | 83 | |
| 84 | 84 | // imprimimos la dirección de la empresa |
| 85 | - static::$escpos->text(static::sanitize($company->direccion) . "\n"); |
|
| 86 | - static::$escpos->text(static::sanitize("CP: " . $company->codpostal . ', ' . $company->ciudad) . "\n"); |
|
| 87 | - static::$escpos->text(static::sanitize($company->tipoidfiscal . ': ' . $company->cifnif) . "\n\n"); |
|
| 85 | + static::$escpos->text(static::sanitize($company->direccion)."\n"); |
|
| 86 | + static::$escpos->text(static::sanitize("CP: ".$company->codpostal.', '.$company->ciudad)."\n"); |
|
| 87 | + static::$escpos->text(static::sanitize($company->tipoidfiscal.': '.$company->cifnif)."\n\n"); |
|
| 88 | 88 | |
| 89 | 89 | if ($printer->print_comp_tlf) { |
| 90 | 90 | if (false === empty($company->telefono1) && false === empty($company->telefono2)) { |
| 91 | - static::$escpos->text(static::sanitize($company->telefono1 . ' / ' . $company->telefono2) . "\n"); |
|
| 91 | + static::$escpos->text(static::sanitize($company->telefono1.' / '.$company->telefono2)."\n"); |
|
| 92 | 92 | } elseif (false === empty($company->telefono1)) { |
| 93 | - static::$escpos->text(static::sanitize($company->telefono1) . "\n"); |
|
| 93 | + static::$escpos->text(static::sanitize($company->telefono1)."\n"); |
|
| 94 | 94 | } elseif (false === empty($company->telefono2)) { |
| 95 | - static::$escpos->text(static::sanitize($company->telefono2) . "\n"); |
|
| 95 | + static::$escpos->text(static::sanitize($company->telefono2)."\n"); |
|
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | // imprimimos el título del documento |
| 100 | - static::$escpos->text(static::sanitize($title) . "\n"); |
|
| 100 | + static::$escpos->text(static::sanitize($title)."\n"); |
|
| 101 | 101 | |
| 102 | 102 | static::setHeaderTPV($model, $printer); |
| 103 | 103 | |
@@ -115,19 +115,19 @@ discard block |
||
| 115 | 115 | ) |
| 116 | 116 | ) { |
| 117 | 117 | static::$escpos->text(static::sanitize( |
| 118 | - static::$i18n->trans('date') . ': ' . $model->fecha . ' ' . $model->hora |
|
| 119 | - ) . "\n"); |
|
| 118 | + static::$i18n->trans('date').': '.$model->fecha.' '.$model->hora |
|
| 119 | + )."\n"); |
|
| 120 | 120 | static::$escpos->text(static::sanitize( |
| 121 | - static::$i18n->trans('customer') . ': ' . $model->nombrecliente |
|
| 122 | - ) . "\n"); |
|
| 123 | - if(strlen($model->cifnif) == 9) { |
|
| 121 | + static::$i18n->trans('customer').': '.$model->nombrecliente |
|
| 122 | + )."\n"); |
|
| 123 | + if (strlen($model->cifnif) == 9) { |
|
| 124 | 124 | static::$escpos->text(static::sanitize( |
| 125 | - static::$i18n->trans('title-cifnif-rnc') . ': ' . $model->cifnif |
|
| 126 | - ) . "\n\n"); |
|
| 125 | + static::$i18n->trans('title-cifnif-rnc').': '.$model->cifnif |
|
| 126 | + )."\n\n"); |
|
| 127 | 127 | } else { |
| 128 | 128 | static::$escpos->text(static::sanitize( |
| 129 | - static::$i18n->trans('title-cifnif-ci') . ': ' . $model->cifnif |
|
| 130 | - ) . "\n\n"); |
|
| 129 | + static::$i18n->trans('title-cifnif-ci').': '.$model->cifnif |
|
| 130 | + )."\n\n"); |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
@@ -135,21 +135,21 @@ discard block |
||
| 135 | 135 | |
| 136 | 136 | if (property_exists($model, 'tipocomprobante') && $model->tipocomprobante) { |
| 137 | 137 | static::$escpos->text(static::sanitize( |
| 138 | - static::$i18n->trans('tipo_comprobante') . ': ' . |
|
| 138 | + static::$i18n->trans('tipo_comprobante').': '. |
|
| 139 | 139 | $model->descripcionTipoComprobante() |
| 140 | - ). "\n"); |
|
| 140 | + )."\n"); |
|
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | if (property_exists($model, 'numeroncf') && $model->numeroncf) { |
| 144 | 144 | static::$escpos->text(static::sanitize( |
| 145 | - static::$i18n->trans('ncf-number') . ': ' . $model->numeroncf |
|
| 146 | - ). "\n"); |
|
| 145 | + static::$i18n->trans('ncf-number').': '.$model->numeroncf |
|
| 146 | + )."\n"); |
|
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | if (property_exists($model, 'ncffechavencimiento') && $model->ncffechavencimiento) { |
| 150 | 150 | static::$escpos->text(static::sanitize( |
| 151 | - static::$i18n->trans('due-date') . ': ' . $model->ncffechavencimiento |
|
| 152 | - ). "\n\n"); |
|
| 151 | + static::$i18n->trans('due-date').': '.$model->ncffechavencimiento |
|
| 152 | + )."\n\n"); |
|
| 153 | 153 | } else { |
| 154 | 154 | static::$escpos->text("\n\n"); |
| 155 | 155 | } |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | // añadimos la cabecera |
| 160 | 160 | if ($printer->head) { |
| 161 | 161 | static::$escpos->setJustification(Printer::JUSTIFY_CENTER); |
| 162 | - static::$escpos->text(static::sanitize($printer->head) . "\n\n"); |
|
| 162 | + static::$escpos->text(static::sanitize($printer->head)."\n\n"); |
|
| 163 | 163 | static::$escpos->setJustification(); |
| 164 | 164 | } |
| 165 | 165 | } |
@@ -62,13 +62,13 @@ |
||
| 62 | 62 | protected function createViews() |
| 63 | 63 | { |
| 64 | 64 | $this->addView('ListNCFTipoPago-1', 'NCFTipoPago', 'sales', 'fa-solid fa-store'); |
| 65 | - $this->addSearchFields('ListNCFTipoPago-1', ['tipopago','codigo','descripcion']); |
|
| 65 | + $this->addSearchFields('ListNCFTipoPago-1', ['tipopago', 'codigo', 'descripcion']); |
|
| 66 | 66 | $this->addOrderBy('ListNCFTipoPago-1', ['codigo'], 'code'); |
| 67 | 67 | $this->addOrderBy('ListNCFTipoPago-1', ['descripcion'], 'description'); |
| 68 | 68 | $this->addRestoreButton('ListNCFTipoPago-1'); |
| 69 | 69 | |
| 70 | 70 | $this->addView('ListNCFTipoPago-2', 'NCFTipoPago', 'purchases', 'fa-solid fa-credit-card'); |
| 71 | - $this->addSearchFields('ListNCFTipoPago-2', ['tipopago','codigo','descripcion']); |
|
| 71 | + $this->addSearchFields('ListNCFTipoPago-2', ['tipopago', 'codigo', 'descripcion']); |
|
| 72 | 72 | $this->addOrderBy('ListNCFTipoPago-2', ['codigo'], 'code'); |
| 73 | 73 | $this->addOrderBy('ListNCFTipoPago-2', ['descripcion'], 'description'); |
| 74 | 74 | $this->addRestoreButton('ListNCFTipoPago-2'); |
@@ -68,13 +68,13 @@ |
||
| 68 | 68 | 'sales', |
| 69 | 69 | 'fa-solid fa-store' |
| 70 | 70 | ); |
| 71 | - $this->addSearchFields('ListNCFTipoMovimiento-1', ['tipomovimiento','codigo','descripcion']); |
|
| 71 | + $this->addSearchFields('ListNCFTipoMovimiento-1', ['tipomovimiento', 'codigo', 'descripcion']); |
|
| 72 | 72 | $this->addOrderBy('ListNCFTipoMovimiento-1', ['id'], 'code'); |
| 73 | 73 | $this->addOrderBy('ListNCFTipoMovimiento-1', ['descripcion'], 'description'); |
| 74 | 74 | $this->addRestoreButton('ListNCFTipoMovimiento-1'); |
| 75 | 75 | |
| 76 | 76 | $this->addView('ListNCFTipoMovimiento-2', 'NCFTipoMovimiento', 'purchases', 'fa-solid fa-credit-card'); |
| 77 | - $this->addSearchFields('ListNCFTipoMovimiento-2', ['tipomovimiento','codigo','descripcion']); |
|
| 77 | + $this->addSearchFields('ListNCFTipoMovimiento-2', ['tipomovimiento', 'codigo', 'descripcion']); |
|
| 78 | 78 | $this->addOrderBy('ListNCFTipoMovimiento-2', ['id'], 'code'); |
| 79 | 79 | $this->addOrderBy('ListNCFTipoMovimiento-2', ['descripcion'], 'description'); |
| 80 | 80 | $this->addRestoreButton('ListNCFTipoMovimiento-2'); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | class SalesLineMod implements SalesLineModInterface |
| 29 | 29 | { |
| 30 | 30 | |
| 31 | - public function apply(SalesDocument &$model, array &$lines, array $formData): void |
|
| 31 | + public function apply(SalesDocument & $model, array &$lines, array $formData): void |
|
| 32 | 32 | { |
| 33 | 33 | // TODO: Implement apply() method. |
| 34 | 34 | } |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | * @param string $id |
| 40 | 40 | * @return void |
| 41 | 41 | */ |
| 42 | - public function applyToLine(array $formData, SalesDocumentLine &$line, string $id): void |
|
| 42 | + public function applyToLine(array $formData, SalesDocumentLine & $line, string $id): void |
|
| 43 | 43 | { |
| 44 | - $line->rdtaxisc = $formData['rdtaxisc_' . $id] ?? null; |
|
| 45 | - $line->rdtaxcdt = $formData['rdtaxcdt_' . $id] ?? null; |
|
| 44 | + $line->rdtaxisc = $formData['rdtaxisc_'.$id] ?? null; |
|
| 45 | + $line->rdtaxcdt = $formData['rdtaxcdt_'.$id] ?? null; |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function assets(): void |
@@ -90,8 +90,7 @@ discard block |
||
| 90 | 90 | protected function rdTax($i18n, $idlinea, $line, $model, $field): string |
| 91 | 91 | { |
| 92 | 92 | $attributes = $model->editable ? |
| 93 | - 'name="'. $field .'_' . $idlinea . '"' : |
|
| 94 | - 'disabled=""'; |
|
| 93 | + 'name="'.$field.'_'.$idlinea.'"' : 'disabled=""'; |
|
| 95 | 94 | |
| 96 | 95 | $title = $this->rdTaxTitle($i18n, $field); |
| 97 | 96 | $lineTax = $this->productoTaxValue($line->idproducto, $field); |
@@ -100,14 +99,14 @@ discard block |
||
| 100 | 99 | |
| 101 | 100 | return '<div class="col-6">' |
| 102 | 101 | . $title |
| 103 | - . '<input type="number" ' . $attributes . ' value="' . $fieldValue. '" class="form-control" readonly=""/>' |
|
| 102 | + . '<input type="number" '.$attributes.' value="'.$fieldValue.'" class="form-control" readonly=""/>' |
|
| 104 | 103 | . '</div>' |
| 105 | 104 | . '</div>'; |
| 106 | 105 | } |
| 107 | 106 | |
| 108 | 107 | protected function rdTaxTitle($i18n, $field): string |
| 109 | 108 | { |
| 110 | - return '<div class="mb-2">' . $i18n->trans($field); |
|
| 109 | + return '<div class="mb-2">'.$i18n->trans($field); |
|
| 111 | 110 | } |
| 112 | 111 | |
| 113 | 112 | protected function productoTaxValue($idproducto, $rdtaxid): ?ImpuestoProducto |