tax-cl 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/modules.xml +8 -0
- package/.idea/tax-cl.iml +12 -0
- package/.idea/vcs.xml +6 -0
- package/lib/config.js +18 -12
- package/lib/index.js +11 -8
- package/package.json +1 -1
package/.idea/tax-cl.iml
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$">
|
|
5
|
+
<excludeFolder url="file://$MODULE_DIR$/temp" />
|
|
6
|
+
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
|
|
7
|
+
<excludeFolder url="file://$MODULE_DIR$/tmp" />
|
|
8
|
+
</content>
|
|
9
|
+
<orderEntry type="inheritedJdk" />
|
|
10
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
11
|
+
</component>
|
|
12
|
+
</module>
|
package/.idea/vcs.xml
ADDED
package/lib/config.js
CHANGED
|
@@ -10,7 +10,8 @@ var UTA = {
|
|
|
10
10
|
2019: 595476,
|
|
11
11
|
2020: 612348,
|
|
12
12
|
2021: 650052,
|
|
13
|
-
2022:
|
|
13
|
+
2022: 733884,
|
|
14
|
+
2023: 741228 // 2023-01
|
|
14
15
|
|
|
15
16
|
}; // Valor UF al 31 de diciembre en https://www.sii.cl/valores_y_fechas/index_valores_y_fechas.html
|
|
16
17
|
|
|
@@ -19,7 +20,8 @@ var UF = {
|
|
|
19
20
|
2019: 28309.94,
|
|
20
21
|
2020: 29070.33,
|
|
21
22
|
2021: 30991.74,
|
|
22
|
-
2022:
|
|
23
|
+
2022: 35110.98,
|
|
24
|
+
2023: 35287.50 // 2023-01-31
|
|
23
25
|
|
|
24
26
|
};
|
|
25
27
|
var RETENCION = {
|
|
@@ -57,7 +59,9 @@ var TOPE_IMPONIBLE_MENSUAL = {
|
|
|
57
59
|
// https://www.spensiones.cl/portal/institucional/594/w3-article-13843.html
|
|
58
60
|
2021: 81.6,
|
|
59
61
|
// https://www.spensiones.cl/portal/institucional/594/w3-article-14366.html
|
|
60
|
-
2022: 81.6
|
|
62
|
+
2022: 81.6,
|
|
63
|
+
// https://www.spensiones.cl/portal/institucional/594/w3-article-15178.html
|
|
64
|
+
2023: 81.6 // https://www.spensiones.cl/portal/institucional/594/w3-article-15486.html
|
|
61
65
|
|
|
62
66
|
};
|
|
63
67
|
|
|
@@ -74,20 +78,22 @@ function obtenerTramosImpositivos(uta) {
|
|
|
74
78
|
}
|
|
75
79
|
|
|
76
80
|
function getConfig(operacionRenta) {
|
|
77
|
-
var
|
|
81
|
+
var commercialYear = operacionRenta - 1;
|
|
78
82
|
|
|
79
|
-
if (!TOPE_IMPONIBLE_MENSUAL[
|
|
80
|
-
var validos = Object.keys(TOPE_IMPONIBLE_MENSUAL).
|
|
83
|
+
if (!TOPE_IMPONIBLE_MENSUAL[commercialYear]) {
|
|
84
|
+
var validos = Object.keys(TOPE_IMPONIBLE_MENSUAL).map(function (year) {
|
|
85
|
+
return parseInt(year) + 1;
|
|
86
|
+
}).join(', ');
|
|
81
87
|
throw new Error("El a\xF1o ingresado es incorrecto. Los valores v\xE1lidos son: ".concat(validos));
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
return {
|
|
85
91
|
OPERACION_RENTA: operacionRenta,
|
|
86
|
-
UTA: UTA[
|
|
87
|
-
UF: UF[
|
|
88
|
-
RETENCION: RETENCION[
|
|
89
|
-
COBERTURA_PARCIAL: COBERTURA_PARCIAL[
|
|
90
|
-
TOPE_IMPONIBLE_MENSUAL: TOPE_IMPONIBLE_MENSUAL[
|
|
91
|
-
TRAMOS_IMPOSITIVOS: obtenerTramosImpositivos(UTA[
|
|
92
|
+
UTA: UTA[commercialYear],
|
|
93
|
+
UF: UF[commercialYear],
|
|
94
|
+
RETENCION: RETENCION[commercialYear] / 100,
|
|
95
|
+
COBERTURA_PARCIAL: COBERTURA_PARCIAL[commercialYear] / 100,
|
|
96
|
+
TOPE_IMPONIBLE_MENSUAL: TOPE_IMPONIBLE_MENSUAL[commercialYear],
|
|
97
|
+
TRAMOS_IMPOSITIVOS: obtenerTramosImpositivos(UTA[commercialYear])
|
|
92
98
|
};
|
|
93
99
|
}
|
package/lib/index.js
CHANGED
|
@@ -23,7 +23,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
23
23
|
|
|
24
24
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
25
|
|
|
26
|
-
var OPERACION_RENTA_ACTUAL =
|
|
26
|
+
var OPERACION_RENTA_ACTUAL = 2023;
|
|
27
27
|
var config = (0, _config.getConfig)(OPERACION_RENTA_ACTUAL);
|
|
28
28
|
/**
|
|
29
29
|
* Configura el año de la operación renta para los cálculos.
|
|
@@ -52,16 +52,18 @@ function calcularGastos(sueldoAnual) {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
var COTIZACIONES_OBLIGATORIAS = [{
|
|
55
|
-
name: "Seguro de invalidez y sobrevivencia",
|
|
56
|
-
percent: 1.
|
|
55
|
+
name: "Seguro de invalidez y sobrevivencia (SIS)",
|
|
56
|
+
percent: 1.54,
|
|
57
|
+
// https://www.spensiones.cl/portal/institucional/594/w3-propertyvalue-9917.html#recuadros_articulo_4130_0
|
|
57
58
|
variable: false
|
|
58
59
|
}, {
|
|
59
|
-
name: "Seguro de la ley de accidentes del trabajo y enfermedades profesionales",
|
|
60
|
-
percent: 0.
|
|
60
|
+
name: "Seguro de la ley de accidentes del trabajo y enfermedades profesionales (ATEP)",
|
|
61
|
+
percent: 0.90,
|
|
61
62
|
variable: false
|
|
62
63
|
}, {
|
|
63
|
-
name: "Seguro de acompañamiento niños y niñas",
|
|
64
|
-
percent: 0.
|
|
64
|
+
name: "Seguro de acompañamiento niños y niñas (Ley SANNA)",
|
|
65
|
+
percent: 0.03,
|
|
66
|
+
// https://www.chileatiende.gob.cl/fichas/53276-seguro-para-el-acompanamiento-de-ninos-y-ninas-afectados-por-una-condicion-grave-de-salud-ley-sanna
|
|
65
67
|
variable: false
|
|
66
68
|
}, {
|
|
67
69
|
name: "Salud",
|
|
@@ -73,7 +75,8 @@ var COTIZACIONES_OBLIGATORIAS = [{
|
|
|
73
75
|
variable: true
|
|
74
76
|
}, {
|
|
75
77
|
name: "Comisión AFP",
|
|
76
|
-
percent: 0.
|
|
78
|
+
percent: 0.58,
|
|
79
|
+
// AFP Modelo https://www.spensiones.cl/apps/estcom/estcom.php
|
|
77
80
|
variable: false
|
|
78
81
|
}];
|
|
79
82
|
exports.COTIZACIONES_OBLIGATORIAS = COTIZACIONES_OBLIGATORIAS;
|