@@ -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]); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | public function saveInsert() |
| 66 | 66 | { |
| 67 | - return function () { |
|
| 67 | + return function() { |
|
| 68 | 68 | $ncfrango = new NCFRango(); |
| 69 | 69 | $cliente = new Cliente(); |
| 70 | 70 | $appSettins = new AppSettings; |
@@ -85,11 +85,11 @@ discard block |
||
| 85 | 85 | public function all() |
| 86 | 86 | { |
| 87 | 87 | //parent::all(); |
| 88 | - return function () { |
|
| 88 | + return function() { |
|
| 89 | 89 | $this->facturarectnumero2 = ''; |
| 90 | 90 | if ($this->idfacturarect !== '') { |
| 91 | 91 | $facturaRectificativa = $this->get($this->idfacturarect); |
| 92 | - $this->loadFromData(['facturarectnumero2' => 'SI' ]); |
|
| 92 | + $this->loadFromData(['facturarectnumero2' => 'SI']); |
|
| 93 | 93 | $this->facturarectnumero2 = 'SI'; |
| 94 | 94 | } else { |
| 95 | 95 | $this->loadFromData(['facturarectnumero2' => 'NO HAY']); |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | break; |
| 75 | 75 | case 'busca_tipo': |
| 76 | 76 | $this->setTemplate(false); |
| 77 | - $where = [new DatabaseWhere( $_REQUEST['tipodocumento'], 'Y')]; |
|
| 77 | + $where = [new DatabaseWhere($_REQUEST['tipodocumento'], 'Y')]; |
|
| 78 | 78 | $tipocomprobantes = $this->views['ListNCFTipo']->model->all($where); |
| 79 | 79 | if ($tipocomprobantes) { |
| 80 | 80 | echo json_encode(['tipocomprobantes' => $tipocomprobantes], JSON_THROW_ON_ERROR); |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $this->loadExtension(new Extension\Controller\EditProveedor()); |
| 46 | 46 | $this->loadExtension(new Extension\Controller\EditFacturaCliente()); |
| 47 | 47 | $this->loadExtension(new Extension\Controller\EditFacturaProveedor()); |
| 48 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 48 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function update() |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | { |
| 29 | 29 | public function createViews(): \Closure |
| 30 | 30 | { |
| 31 | - return function () { |
|
| 31 | + return function() { |
|
| 32 | 32 | parent::createViews(); |
| 33 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
| 34 | - AssetManager::add('js', \FS_ROUTE . '/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 33 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonModals.js'); |
|
| 34 | + AssetManager::add('js', \FS_ROUTE.'/Plugins/fsRepublicaDominicana/Assets/JS/CommonDomFunctions.js'); |
|
| 35 | 35 | |
| 36 | 36 | $ncfTipo = new NCFTipo(); |
| 37 | 37 | $ncfTipos = $ncfTipo->allByType('ventas'); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function createViews() |
| 27 | 27 | { |
| 28 | - return function () { |
|
| 28 | + return function() { |
|
| 29 | 29 | |
| 30 | 30 | $ncfTipoPago = new NCFTipoPago(); |
| 31 | 31 | $ncfTiposPago = $ncfTipoPago->findAllByTipopago('02'); |
@@ -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 | |
| 35 | 35 | $ncfTipo = new NCFTipo(); |
| 36 | 36 | $ncfTipos = $ncfTipo->allByType('compras'); |
@@ -148,17 +148,17 @@ discard block |
||
| 148 | 148 | parent::install(); |
| 149 | 149 | $sql = "INSERT INTO rd_ncftipo (". |
| 150 | 150 | "tipocomprobante, descripcion, estado, clasemovimiento, ventas, compras, contribuyente". |
| 151 | - " ) VALUES " . |
|
| 152 | - "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y')," . |
|
| 153 | - "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y')," . |
|
| 154 | - "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N')," . |
|
| 155 | - "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N')," . |
|
| 156 | - "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y')," . |
|
| 157 | - "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N')," . |
|
| 158 | - "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N')," . |
|
| 159 | - "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y')," . |
|
| 160 | - "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y')," . |
|
| 161 | - "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y')," . |
|
| 151 | + " ) VALUES ". |
|
| 152 | + "('01','FACTURA DE CREDITO FISCAL',true, 'suma','Y','Y','Y'),". |
|
| 153 | + "('02','FACTURA DE CONSUMO',true, 'suma','Y','Y','Y'),". |
|
| 154 | + "('03','NOTA DE DEBITO',true, 'suma','Y','Y','N'),". |
|
| 155 | + "('04','NOTA DE CREDITO',true, 'resta','Y','Y','N'),". |
|
| 156 | + "('11','COMPROBANTE DE COMPRAS',true, 'suma','N','Y','Y'),". |
|
| 157 | + "('12','REGISTRO UNICO DE INGRESOS',true, 'suma','Y','N','N'),". |
|
| 158 | + "('13','COMPROBANTE PARA GASTOS MENORES',true, 'suma','N','Y','N'),". |
|
| 159 | + "('14','COMPROBANTE DE REGIMENES ESPECIALES',true, 'suma','Y','Y','Y'),". |
|
| 160 | + "('15','COMPROBANTE GUBERNAMENTAL',true, 'suma','Y','Y','Y'),". |
|
| 161 | + "('16','COMPROBANTE PARA EXPORTACIONES',true, 'suma','Y','N','Y'),". |
|
| 162 | 162 | "('17','COMPROBANTE PARA PAGOS AL EXTERIOR',true, 'suma','N', 'Y','Y');"; |
| 163 | 163 | return($sql); |
| 164 | 164 | } |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | public function restoreData() |
| 167 | 167 | { |
| 168 | 168 | $dataBase = new DataBase(); |
| 169 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
| 169 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
| 170 | 170 | $dataBase->exec($sqlClean); |
| 171 | 171 | foreach ($this->arrayComprobantes as $arrayItem) { |
| 172 | 172 | $initialData = new NCFTipo($arrayItem); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | public function allFor($type = "ventas", $movimiento = "suma") |
| 179 | 179 | { |
| 180 | - $where = [new DataBaseWhere($type, 'Y'),new DataBaseWhere('clasemovimiento', $movimiento)]; |
|
| 180 | + $where = [new DataBaseWhere($type, 'Y'), new DataBaseWhere('clasemovimiento', $movimiento)]; |
|
| 181 | 181 | return $this->all($where, ['tipocomprobante' => 'ASC'], 0, 50); |
| 182 | 182 | } |
| 183 | 183 | |
@@ -188,14 +188,14 @@ discard block |
||
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | public function tipoCliente($codcliente) { |
| 191 | - $where = [new DatabaseWhere( 'codcliente', $_REQUEST['codcliente'])]; |
|
| 191 | + $where = [new DatabaseWhere('codcliente', $_REQUEST['codcliente'])]; |
|
| 192 | 192 | $clientes = new Cliente(); |
| 193 | 193 | $cliente = $clientes->get($codcliente); |
| 194 | 194 | return ['tipocomprobante' => $cliente->tipocomprobante, 'ncftipopago' => $cliente->ncftipopago]; |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | public function tipoProveedor($codproveedor) { |
| 198 | - $where = [new DatabaseWhere( 'codproveedor', $_REQUEST['codproveedor'])]; |
|
| 198 | + $where = [new DatabaseWhere('codproveedor', $_REQUEST['codproveedor'])]; |
|
| 199 | 199 | $proveedores = new Proveedor(); |
| 200 | 200 | $proveedor = $proveedores->get($codproveedor); |
| 201 | 201 | return ['ncftipopago' => $proveedor->ncftipopago]; |
@@ -93,20 +93,20 @@ |
||
| 93 | 93 | protected function getSQLFrom(): string |
| 94 | 94 | { |
| 95 | 95 | return static::MAIN_TABLE |
| 96 | - . ' LEFT JOIN ' . static::LINES_TABLE . ' ON (' |
|
| 97 | - . static::MAIN_TABLE . '.idfactura = ' . static::LINES_TABLE . '.idfactura)' |
|
| 96 | + . ' LEFT JOIN '.static::LINES_TABLE.' ON (' |
|
| 97 | + . static::MAIN_TABLE.'.idfactura = '.static::LINES_TABLE.'.idfactura)' |
|
| 98 | 98 | // . ' LEFT JOIN '. static::SECONDARY_TABLE . ' ON (' |
| 99 | 99 | // . static::MAIN_TABLE . '.idfacturarect = ' . static::SECONDARY_TABLE_ALIAS . '.idfactura)' |
| 100 | - . ' LEFT JOIN '. static::ALMACENES_TABLE . ' ON (' |
|
| 101 | - . static::MAIN_TABLE . '.codalmacen = ' . static::ALMACENES_TABLE . '.codalmacen)' |
|
| 102 | - . ' LEFT JOIN '. static::NCFTIPO_TABLE . ' ON (' |
|
| 103 | - . static::MAIN_TABLE . '.tipocomprobante = ' . static::NCFTIPO_TABLE . '.tipocomprobante)' |
|
| 104 | - . ' LEFT JOIN ' . static::NCFTIPOPAGO_TABLE . ' ON (' |
|
| 105 | - . static::MAIN_TABLE . '.ncftipopago = ' . static::NCFTIPOPAGO_TABLE . '.codigo)' |
|
| 106 | - . ' LEFT JOIN ' . static::NCFTIPOMOV_TABLE . ' ON (' |
|
| 107 | - . static::MAIN_TABLE . '.ncftipomovimiento = ' . static::NCFTIPOMOV_TABLE . '.codigo)' |
|
| 108 | - . ' LEFT JOIN ' . static::NCFTIPOANUL_TABLE . ' ON (' |
|
| 109 | - . static::MAIN_TABLE . '.ncftipoanulacion = ' . static::NCFTIPOANUL_TABLE . '.codigo)'; |
|
| 100 | + . ' LEFT JOIN '.static::ALMACENES_TABLE.' ON (' |
|
| 101 | + . static::MAIN_TABLE.'.codalmacen = '.static::ALMACENES_TABLE.'.codalmacen)' |
|
| 102 | + . ' LEFT JOIN '.static::NCFTIPO_TABLE.' ON (' |
|
| 103 | + . static::MAIN_TABLE.'.tipocomprobante = '.static::NCFTIPO_TABLE.'.tipocomprobante)' |
|
| 104 | + . ' LEFT JOIN '.static::NCFTIPOPAGO_TABLE.' ON (' |
|
| 105 | + . static::MAIN_TABLE.'.ncftipopago = '.static::NCFTIPOPAGO_TABLE.'.codigo)' |
|
| 106 | + . ' LEFT JOIN '.static::NCFTIPOMOV_TABLE.' ON (' |
|
| 107 | + . static::MAIN_TABLE.'.ncftipomovimiento = '.static::NCFTIPOMOV_TABLE.'.codigo)' |
|
| 108 | + . ' LEFT JOIN '.static::NCFTIPOANUL_TABLE.' ON (' |
|
| 109 | + . static::MAIN_TABLE.'.ncftipoanulacion = '.static::NCFTIPOANUL_TABLE.'.codigo)'; |
|
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | /** |