@@ -61,23 +61,23 @@ discard block |
||
| 61 | 61 | * @var array |
| 62 | 62 | */ |
| 63 | 63 | private $arrayTiposMovimiento = [ |
| 64 | - ['tipomovimiento'=>'COM','codigo' => '01', 'descripcion' => 'GASTOS DE PERSONAL', 'estado' => true], |
|
| 65 | - ['tipomovimiento'=>'COM','codigo' => '02', 'descripcion' => 'GASTOS POR TRABAJOS, SUMINISTROS Y SERVICIOS', 'estado' => true], |
|
| 66 | - ['tipomovimiento'=>'COM','codigo' => '03', 'descripcion' => 'ARRENDAMIENTOS', 'estado' => true], |
|
| 67 | - ['tipomovimiento'=>'COM','codigo' => '04', 'descripcion' => 'GASTOS DE ACTIVOS FIJOS', 'estado' => true], |
|
| 68 | - ['tipomovimiento'=>'COM','codigo' => '05', 'descripcion' => 'GASTOS DE REPRESENTACIÓN', 'estado' => true], |
|
| 69 | - ['tipomovimiento'=>'COM','codigo' => '06', 'descripcion' => 'OTRAS DEDUCCIONES ADMITIDAS', 'estado' => true], |
|
| 70 | - ['tipomovimiento'=>'COM','codigo' => '07', 'descripcion' => 'GASTOS FINANCIEROS', 'estado' => true], |
|
| 71 | - ['tipomovimiento'=>'COM','codigo' => '08', 'descripcion' => 'GASTOS EXTRAORDINARIOS', 'estado' => true], |
|
| 72 | - ['tipomovimiento'=>'COM','codigo' => '09', 'descripcion' => 'COMPRAS Y GASTOS QUE FORMARÁN PARTE DEL COSTO DE VENTA', 'estado' => true], |
|
| 73 | - ['tipomovimiento'=>'COM','codigo' => '10', 'descripcion' => 'ADQUISICIONES DE ACTIVOS', 'estado' => true], |
|
| 74 | - ['tipomovimiento'=>'COM','codigo' => '11', 'descripcion' => 'GASTOS DE SEGUROS', 'estado' => true], |
|
| 75 | - ['tipomovimiento'=>'VEN','codigo' => '1', 'descripcion' => 'Ingresos por operaciones (No financieros)', 'estado' => true], |
|
| 76 | - ['tipomovimiento'=>'VEN','codigo' => '2', 'descripcion' => 'Ingresos Financieros', 'estado' => true], |
|
| 77 | - ['tipomovimiento'=>'VEN','codigo' => '3', 'descripcion' => 'Ingresos Extraordinarios', 'estado' => true], |
|
| 78 | - ['tipomovimiento'=>'VEN','codigo' => '4', 'descripcion' => 'Ingresos por Arrendamientos', 'estado' => true], |
|
| 79 | - ['tipomovimiento'=>'VEN','codigo' => '5', 'descripcion' => 'Ingresos por Venta de Activo Depreciable', 'estado' => true], |
|
| 80 | - ['tipomovimiento'=>'VEN','codigo' => '6', 'descripcion' => 'Otros Ingresos', 'estado' => true] |
|
| 64 | + ['tipomovimiento'=>'COM', 'codigo' => '01', 'descripcion' => 'GASTOS DE PERSONAL', 'estado' => true], |
|
| 65 | + ['tipomovimiento'=>'COM', 'codigo' => '02', 'descripcion' => 'GASTOS POR TRABAJOS, SUMINISTROS Y SERVICIOS', 'estado' => true], |
|
| 66 | + ['tipomovimiento'=>'COM', 'codigo' => '03', 'descripcion' => 'ARRENDAMIENTOS', 'estado' => true], |
|
| 67 | + ['tipomovimiento'=>'COM', 'codigo' => '04', 'descripcion' => 'GASTOS DE ACTIVOS FIJOS', 'estado' => true], |
|
| 68 | + ['tipomovimiento'=>'COM', 'codigo' => '05', 'descripcion' => 'GASTOS DE REPRESENTACIÓN', 'estado' => true], |
|
| 69 | + ['tipomovimiento'=>'COM', 'codigo' => '06', 'descripcion' => 'OTRAS DEDUCCIONES ADMITIDAS', 'estado' => true], |
|
| 70 | + ['tipomovimiento'=>'COM', 'codigo' => '07', 'descripcion' => 'GASTOS FINANCIEROS', 'estado' => true], |
|
| 71 | + ['tipomovimiento'=>'COM', 'codigo' => '08', 'descripcion' => 'GASTOS EXTRAORDINARIOS', 'estado' => true], |
|
| 72 | + ['tipomovimiento'=>'COM', 'codigo' => '09', 'descripcion' => 'COMPRAS Y GASTOS QUE FORMARÁN PARTE DEL COSTO DE VENTA', 'estado' => true], |
|
| 73 | + ['tipomovimiento'=>'COM', 'codigo' => '10', 'descripcion' => 'ADQUISICIONES DE ACTIVOS', 'estado' => true], |
|
| 74 | + ['tipomovimiento'=>'COM', 'codigo' => '11', 'descripcion' => 'GASTOS DE SEGUROS', 'estado' => true], |
|
| 75 | + ['tipomovimiento'=>'VEN', 'codigo' => '1', 'descripcion' => 'Ingresos por operaciones (No financieros)', 'estado' => true], |
|
| 76 | + ['tipomovimiento'=>'VEN', 'codigo' => '2', 'descripcion' => 'Ingresos Financieros', 'estado' => true], |
|
| 77 | + ['tipomovimiento'=>'VEN', 'codigo' => '3', 'descripcion' => 'Ingresos Extraordinarios', 'estado' => true], |
|
| 78 | + ['tipomovimiento'=>'VEN', 'codigo' => '4', 'descripcion' => 'Ingresos por Arrendamientos', 'estado' => true], |
|
| 79 | + ['tipomovimiento'=>'VEN', 'codigo' => '5', 'descripcion' => 'Ingresos por Venta de Activo Depreciable', 'estado' => true], |
|
| 80 | + ['tipomovimiento'=>'VEN', 'codigo' => '6', 'descripcion' => 'Otros Ingresos', 'estado' => true] |
|
| 81 | 81 | ]; |
| 82 | 82 | |
| 83 | 83 | /** |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | public function install(): string |
| 103 | 103 | { |
| 104 | 104 | parent::install(); |
| 105 | - return "INSERT INTO rd_ncftipomovimiento (tipomovimiento, codigo, descripcion, estado) VALUES " . |
|
| 105 | + return "INSERT INTO rd_ncftipomovimiento (tipomovimiento, codigo, descripcion, estado) VALUES ". |
|
| 106 | 106 | "('COM','01','GASTOS DE PERSONAL',true), ". |
| 107 | 107 | "('COM','02','GASTOS POR TRABAJOS, SUMINISTROS Y SERVICIOS',true), ". |
| 108 | 108 | "('COM','03','ARRENDAMIENTOS',true), ". |
@@ -125,7 +125,7 @@ discard block |
||
| 125 | 125 | public function restoreData() |
| 126 | 126 | { |
| 127 | 127 | $dataBase = new DataBase(); |
| 128 | - $sqlClean = "DELETE FROM " . $this->tableName() . ";"; |
|
| 128 | + $sqlClean = "DELETE FROM ".$this->tableName().";"; |
|
| 129 | 129 | $dataBase->exec($sqlClean); |
| 130 | 130 | foreach ($this->arrayTiposMovimiento as $arrayItem) { |
| 131 | 131 | $initialData = new NCFTipoMovimiento($arrayItem); |
@@ -61,20 +61,20 @@ discard block |
||
| 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 |
||
| 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); |
@@ -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 (empty($data) === true || in_array($data[0], [null, ''], true)) { |
@@ -158,17 +158,17 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -39,14 +39,14 @@ discard block |
||
| 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 |
||
| 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 | /** |
@@ -92,10 +92,10 @@ |
||
| 92 | 92 | protected function getSQLFrom(): string |
| 93 | 93 | { |
| 94 | 94 | return static::MAIN_TABLE |
| 95 | - . ' LEFT JOIN '. static::SECONDARY_TABLE . ' ON (' |
|
| 96 | - . static::MAIN_TABLE . '.idfacturarect = ' . static::SECONDARY_TABLE_ALIAS . '.idfactura)' |
|
| 97 | - . ' LEFT JOIN ' . static::ESTADOSDOC_TABLE . ' ON (' |
|
| 98 | - . static::MAIN_TABLE . '.idestado = ' . static::ESTADOSDOC_TABLE . '.idestado AND ' |
|
| 95 | + . ' LEFT JOIN '.static::SECONDARY_TABLE.' ON (' |
|
| 96 | + . static::MAIN_TABLE.'.idfacturarect = '.static::SECONDARY_TABLE_ALIAS.'.idfactura)' |
|
| 97 | + . ' LEFT JOIN '.static::ESTADOSDOC_TABLE.' ON (' |
|
| 98 | + . static::MAIN_TABLE.'.idestado = '.static::ESTADOSDOC_TABLE.'.idestado AND ' |
|
| 99 | 99 | . static::ESTADOSDOC_TABLE.'.nombre != \'Anulada\')'; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | |
| 66 | 66 | public function saveBefore(): Closure |
| 67 | 67 | { |
| 68 | - return function () { |
|
| 68 | + return function() { |
|
| 69 | 69 | |
| 70 | 70 | $ncfrango = new NCFRango(); |
| 71 | 71 | $cliente = new Cliente(); |
@@ -103,11 +103,11 @@ discard block |
||
| 103 | 103 | |
| 104 | 104 | public function all(): Closure |
| 105 | 105 | { |
| 106 | - return function () { |
|
| 106 | + return function() { |
|
| 107 | 107 | $this->facturarectnumero2 = ''; |
| 108 | 108 | if ($this->idfacturarect !== '') { |
| 109 | 109 | $facturaRectificativa = $this->get($this->idfacturarect); |
| 110 | - $this->loadFromData(['facturarectnumero2' => 'SI' ]); |
|
| 110 | + $this->loadFromData(['facturarectnumero2' => 'SI']); |
|
| 111 | 111 | $this->facturarectnumero2 = $facturaRectificativa->numero2; |
| 112 | 112 | } else { |
| 113 | 113 | $this->loadFromData(['facturarectnumero2' => 'NO HAY']); |
@@ -81,10 +81,10 @@ |
||
| 81 | 81 | /** |
| 82 | 82 | * @inheritDoc |
| 83 | 83 | */ |
| 84 | - public function show(Response &$response) |
|
| 84 | + public function show(Response & $response) |
|
| 85 | 85 | { |
| 86 | 86 | $response->headers->set('Content-Type', 'text/text; charset=utf-8'); |
| 87 | - $response->headers->set('Content-Disposition', 'attachment;filename=' . $this->getFileName() . '.TXT'); |
|
| 87 | + $response->headers->set('Content-Disposition', 'attachment;filename='.$this->getFileName().'.TXT'); |
|
| 88 | 88 | $response->setContent($this->getDoc()); |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | \ No newline at end of file |
@@ -28,21 +28,21 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | class SalesFooterMod implements SalesModInterface |
| 30 | 30 | { |
| 31 | - public function apply(SalesDocument &$model, array $formData, User $user) |
|
| 31 | + public function apply(SalesDocument & $model, array $formData, User $user) |
|
| 32 | 32 | { |
| 33 | 33 | // TODO: Implement apply() method. |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - public function applyBefore(SalesDocument &$model, array $formData, User $user) |
|
| 36 | + public function applyBefore(SalesDocument & $model, array $formData, User $user) |
|
| 37 | 37 | { |
| 38 | 38 | // TODO: Implement applyBefore() method. |
| 39 | 39 | if ($model->modelClassName() === 'FacturaCliente') { |
| 40 | - $model->numeroncf = isset($formData['numeroncf']) ? (string)$formData['numeroncf'] : $model->numeroncf; |
|
| 41 | - $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string)$formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 42 | - $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string)$formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 43 | - $model->ncftipopago = isset($formData['ncftipopago']) ? (string)$formData['ncftipopago'] : $model->ncftipopago; |
|
| 44 | - $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string)$formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 45 | - $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string)$formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 40 | + $model->numeroncf = isset($formData['numeroncf']) ? (string) $formData['numeroncf'] : $model->numeroncf; |
|
| 41 | + $model->tipocomprobante = isset($formData['tipocomprobante']) ? (string) $formData['tipocomprobante'] : $model->tipocomprobante; |
|
| 42 | + $model->ncffechavencimiento = isset($formData['ncffechavencimiento']) ? (string) $formData['ncffechavencimiento'] : $model->ncffechavencimiento; |
|
| 43 | + $model->ncftipopago = isset($formData['ncftipopago']) ? (string) $formData['ncftipopago'] : $model->ncftipopago; |
|
| 44 | + $model->ncftipomovimiento = isset($formData['ncftipomovimiento']) ? (string) $formData['ncftipomovimiento'] : $model->ncftipomovimiento; |
|
| 45 | + $model->ncftipoanulacion = isset($formData['ncftipoanulacion']) ? (string) $formData['ncftipoanulacion'] : $model->ncftipoanulacion; |
|
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | if (!$model->editable) { |
| 106 | 106 | $invoiceTipoComprobante = $model->tipocomprobante; |
| 107 | 107 | } elseif ($model->editable === true && ($cliente->tipocomprobante !== $model->tipocomprobante) && $model->tipocomprobante !== null) { |
| 108 | - $invoiceTipoComprobante = $model->tipocomprobante; |
|
| 108 | + $invoiceTipoComprobante = $model->tipocomprobante; |
|
| 109 | 109 | } elseif ($model->editable === true && ($cliente->tipocomprobante === $model->tipocomprobante) && $model->tipocomprobante !== null) { |
| 110 | 110 | $invoiceTipoComprobante = $cliente->tipocomprobante; |
| 111 | 111 | } |
@@ -113,15 +113,14 @@ discard block |
||
| 113 | 113 | $options = ['<option value="">------</option>']; |
| 114 | 114 | foreach ($tipoComprobante as $row) { |
| 115 | 115 | $options[] = ($row->tipocomprobante === $invoiceTipoComprobante) ? |
| 116 | - '<option value="' . $row->tipocomprobante . '" selected="">' . $row->descripcion . '</option>' : |
|
| 117 | - '<option value="' . $row->tipocomprobante . '">' . $row->descripcion . '</option>'; |
|
| 116 | + '<option value="'.$row->tipocomprobante.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->tipocomprobante.'">'.$row->descripcion.'</option>'; |
|
| 118 | 117 | } |
| 119 | 118 | |
| 120 | 119 | $attributes = ($model->editable || $model->numeroncf === '') ? 'id="tipocomprobante" name="tipocomprobante" required="" onChange="verificarCorrelativoNCF(this.value,\'Ventas\')"' : 'disabled=""'; |
| 121 | 120 | return '<div class="col-sm-3">' |
| 122 | 121 | . '<div class="form-group">' |
| 123 | 122 | . $i18n->trans('tipocomprobante') |
| 124 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 123 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 125 | 124 | . '</div>' |
| 126 | 125 | . '</div>'; |
| 127 | 126 | } |
@@ -145,15 +144,14 @@ discard block |
||
| 145 | 144 | $options = ['<option value="">------</option>']; |
| 146 | 145 | foreach ($tipoPago as $row) { |
| 147 | 146 | $options[] = ($row->codigo === $invoiceTipoPago) ? |
| 148 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 149 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 147 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 150 | 148 | } |
| 151 | 149 | |
| 152 | 150 | $attributes = $model->editable ? 'name="ncftipopago" required=""' : 'disabled=""'; |
| 153 | 151 | return '<div class="col-sm-2">' |
| 154 | 152 | . '<div class="form-group">' |
| 155 | 153 | . $i18n->trans('ncf-payment-type') |
| 156 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 154 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 157 | 155 | . '</div>' |
| 158 | 156 | . '</div>'; |
| 159 | 157 | } |
@@ -173,15 +171,14 @@ discard block |
||
| 173 | 171 | $options = ['<option value="">------</option>']; |
| 174 | 172 | foreach ($tipoMovimiento as $row) { |
| 175 | 173 | $options[] = ($row->codigo === $invoiceTipoMovimiento) ? |
| 176 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 177 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 174 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 178 | 175 | } |
| 179 | 176 | |
| 180 | 177 | $attributes = $model->editable ? 'name="ncftipomovimiento" required=""' : 'disabled=""'; |
| 181 | 178 | return '<div class="col-sm-3">' |
| 182 | 179 | . '<div class="form-group">' |
| 183 | 180 | . $i18n->trans('ncf-movement-type') |
| 184 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 181 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 185 | 182 | . '</div>' |
| 186 | 183 | . '</div>'; |
| 187 | 184 | } |
@@ -199,15 +196,14 @@ discard block |
||
| 199 | 196 | $options = ['<option value="">------</option>']; |
| 200 | 197 | foreach ($tipoAnulacion as $row) { |
| 201 | 198 | $options[] = ($row->codigo === $invoiceTipoAnulacion) ? |
| 202 | - '<option value="' . $row->codigo . '" selected="">' . $row->descripcion . '</option>' : |
|
| 203 | - '<option value="' . $row->codigo . '">' . $row->descripcion . '</option>'; |
|
| 199 | + '<option value="'.$row->codigo.'" selected="">'.$row->descripcion.'</option>' : '<option value="'.$row->codigo.'">'.$row->descripcion.'</option>'; |
|
| 204 | 200 | } |
| 205 | 201 | |
| 206 | 202 | $attributes = $model->editable ? 'name="ncftipoanulacion"' : 'disabled=""'; |
| 207 | 203 | return '<div class="col-sm-2">' |
| 208 | 204 | . '<div class="form-group">' |
| 209 | 205 | . $i18n->trans('ncf-cancellation-type') |
| 210 | - . '<select ' . $attributes . ' class="form-control">' . implode('', $options) . '</select>' |
|
| 206 | + . '<select '.$attributes.' class="form-control">'.implode('', $options).'</select>' |
|
| 211 | 207 | . '</div>' |
| 212 | 208 | . '</div>'; |
| 213 | 209 | } |
@@ -219,8 +215,8 @@ discard block |
||
| 219 | 215 | ? date('Y-m-d', strtotime($model->ncffechavencimiento)) |
| 220 | 216 | : ''; |
| 221 | 217 | return '<div class="col-sm-2">' |
| 222 | - . '<div class="form-group">' . $i18n->trans('due-date') |
|
| 223 | - . '<input type="date" ' . $attributes . ' value="' . $ncfFechaVencimiento . '" class="form-control"/>' |
|
| 218 | + . '<div class="form-group">'.$i18n->trans('due-date') |
|
| 219 | + . '<input type="date" '.$attributes.' value="'.$ncfFechaVencimiento.'" class="form-control"/>' |
|
| 224 | 220 | . '</div>' |
| 225 | 221 | . '</div>'; |
| 226 | 222 | } |
@@ -239,7 +235,7 @@ discard block |
||
| 239 | 235 | . '<div class="form-group">' |
| 240 | 236 | . $i18n->trans('desc-numeroncf-sales') |
| 241 | 237 | //. '<div class="input-group">' |
| 242 | - . '<input type="text" ' . $attributes . ' value="' . $model->numeroncf . '" class="form-control"/>' |
|
| 238 | + . '<input type="text" '.$attributes.' value="'.$model->numeroncf.'" class="form-control"/>' |
|
| 243 | 239 | // . '<div class="input-group-append">' |
| 244 | 240 | // . '<button class="btn ' . $btnColor .' btn-spin-action" id="btnVerifyNCF"' |
| 245 | 241 | // . 'onclick="purchasesNCFVerify()" ' |