core-tsi 0.0.1
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/README.md +63 -0
- package/core-tsi-0.0.1.tgz +0 -0
- package/fesm2022/core-tsi.mjs +263 -0
- package/fesm2022/core-tsi.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/models/sesion/almacen-sesion.model.d.ts +19 -0
- package/lib/models/sesion/documento-tipo-sesion.model.d.ts +12 -0
- package/lib/models/sesion/inventario-sesion.model.d.ts +16 -0
- package/lib/models/sesion/tipo-afectacion.model.d.ts +5 -0
- package/lib/models/sesion/titulo-listas.model.d.ts +19 -0
- package/lib/models/sesion/unidades-sesion.model.d.ts +13 -0
- package/lib/service/sesion.service.d.ts +41 -0
- package/lib/service/storage.service.d.ts +26 -0
- package/lib/service/theme.service.d.ts +9 -0
- package/package.json +24 -0
- package/public-api.d.ts +3 -0
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# CoreTsi
|
|
2
|
+
|
|
3
|
+
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.2.0.
|
|
4
|
+
|
|
5
|
+
## Code scaffolding
|
|
6
|
+
|
|
7
|
+
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
ng generate component component-name
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ng generate --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Building
|
|
20
|
+
|
|
21
|
+
To build the library, run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ng build core-tsi
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command will compile your project, and the build artifacts will be placed in the `dist/` directory.
|
|
28
|
+
|
|
29
|
+
### Publishing the Library
|
|
30
|
+
|
|
31
|
+
Once the project is built, you can publish your library by following these steps:
|
|
32
|
+
|
|
33
|
+
1. Navigate to the `dist` directory:
|
|
34
|
+
```bash
|
|
35
|
+
cd dist/core-tsi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
2. Run the `npm publish` command to publish your library to the npm registry:
|
|
39
|
+
```bash
|
|
40
|
+
npm publish
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Running unit tests
|
|
44
|
+
|
|
45
|
+
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
ng test
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Running end-to-end tests
|
|
52
|
+
|
|
53
|
+
For end-to-end (e2e) testing, run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
ng e2e
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
|
60
|
+
|
|
61
|
+
## Additional Resources
|
|
62
|
+
|
|
63
|
+
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
|
Binary file
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, signal } from '@angular/core';
|
|
3
|
+
import { getFirstItem, FACTORES } from 'shared-tsi';
|
|
4
|
+
|
|
5
|
+
class StorageService {
|
|
6
|
+
static USER_KEY = "sessionERP";
|
|
7
|
+
static COD_SUC_KEY = "codsuc";
|
|
8
|
+
static FILTRO = 'filtro_consulta';
|
|
9
|
+
static GRILLAS_KEY = 'v_recursosGlosa';
|
|
10
|
+
static TEMA_APP = 'themeApp';
|
|
11
|
+
setData(key, value) {
|
|
12
|
+
localStorage.setItem(key, value);
|
|
13
|
+
}
|
|
14
|
+
getData(key) {
|
|
15
|
+
return localStorage.getItem(key);
|
|
16
|
+
}
|
|
17
|
+
static setAll(value) {
|
|
18
|
+
localStorage.setItem(this.USER_KEY, JSON.stringify(value));
|
|
19
|
+
}
|
|
20
|
+
static getSession() {
|
|
21
|
+
return JSON.parse(localStorage.getItem(this.USER_KEY));
|
|
22
|
+
}
|
|
23
|
+
static obtenerAcceso(accesos, codmod, codacc) {
|
|
24
|
+
let vResponse = null;
|
|
25
|
+
if (accesos != null)
|
|
26
|
+
accesos.forEach((element) => {
|
|
27
|
+
if (element.codmod == codmod && element.codacc == codacc) {
|
|
28
|
+
vResponse = element;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return vResponse;
|
|
32
|
+
}
|
|
33
|
+
//AGREGAR CODSUC AL STORAGE
|
|
34
|
+
static setCodSuc(value) {
|
|
35
|
+
localStorage.setItem(this.COD_SUC_KEY, value.toString());
|
|
36
|
+
}
|
|
37
|
+
static getCodSuc() {
|
|
38
|
+
return Number(localStorage.getItem(this.COD_SUC_KEY));
|
|
39
|
+
}
|
|
40
|
+
//AGREGAR GRILLAS AL STORAGE
|
|
41
|
+
static setGrilla(value) {
|
|
42
|
+
localStorage.setItem(this.GRILLAS_KEY, JSON.stringify(value));
|
|
43
|
+
}
|
|
44
|
+
static getGrilla() {
|
|
45
|
+
const data = JSON.parse(localStorage.getItem(this.GRILLAS_KEY));
|
|
46
|
+
return data ?? [];
|
|
47
|
+
}
|
|
48
|
+
//FILTROS CONSULTA
|
|
49
|
+
static setFiltro(value) {
|
|
50
|
+
localStorage.setItem(this.FILTRO, JSON.stringify(value));
|
|
51
|
+
}
|
|
52
|
+
static getFiltro() {
|
|
53
|
+
return JSON.parse(localStorage.getItem(this.FILTRO));
|
|
54
|
+
}
|
|
55
|
+
static deleteFiltro() {
|
|
56
|
+
localStorage.removeItem(this.FILTRO);
|
|
57
|
+
}
|
|
58
|
+
// TEMA DARK MODE
|
|
59
|
+
static setTema(value) {
|
|
60
|
+
localStorage.setItem(this.TEMA_APP, value);
|
|
61
|
+
}
|
|
62
|
+
static getTema() {
|
|
63
|
+
const tema = localStorage.getItem(this.TEMA_APP);
|
|
64
|
+
return tema ?? 'light';
|
|
65
|
+
}
|
|
66
|
+
removeData(key) {
|
|
67
|
+
localStorage.removeItem(key);
|
|
68
|
+
}
|
|
69
|
+
static clearStorage() {
|
|
70
|
+
const keys = Object.keys(localStorage);
|
|
71
|
+
let count = keys.length;
|
|
72
|
+
while (count--) {
|
|
73
|
+
keys[count] == 'rucUser' ? null : localStorage.removeItem(keys[count]);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StorageService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
77
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StorageService, providedIn: 'root' });
|
|
78
|
+
}
|
|
79
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: StorageService, decorators: [{
|
|
80
|
+
type: Injectable,
|
|
81
|
+
args: [{
|
|
82
|
+
providedIn: 'root'
|
|
83
|
+
}]
|
|
84
|
+
}] });
|
|
85
|
+
|
|
86
|
+
class SesionService {
|
|
87
|
+
getSession() {
|
|
88
|
+
return StorageService.getSession();
|
|
89
|
+
}
|
|
90
|
+
getMonedas() {
|
|
91
|
+
return this.getSession() ? (this.getSession().monedas ?? []).filter(mon => mon.codmon !== 'EUR') : [];
|
|
92
|
+
}
|
|
93
|
+
getVendedores() {
|
|
94
|
+
return this.getSession() ? (this.getSession().vendedores ?? []) : [];
|
|
95
|
+
}
|
|
96
|
+
getMotivos(codigo) {
|
|
97
|
+
const motivos = this.getSession()?.motivos ?? [];
|
|
98
|
+
return motivos.filter((motivo) => motivo.tipdoc == codigo);
|
|
99
|
+
}
|
|
100
|
+
getSituaciones(codigo) {
|
|
101
|
+
const situaciones = this.getSession()?.situaciones ?? [];
|
|
102
|
+
return situaciones.filter((situacion) => situacion.tipdoc == codigo);
|
|
103
|
+
}
|
|
104
|
+
getSucursales() {
|
|
105
|
+
return this.getSession() ? (this.getSession().sucursales ?? []) : [];
|
|
106
|
+
}
|
|
107
|
+
getAlmacenDefecto() {
|
|
108
|
+
const encontrarDefecto = this.getSucursales().find(suc => suc.codsuc == this.getSucursalSelected());
|
|
109
|
+
let codalm = encontrarDefecto ? encontrarDefecto.almacenDefecto : null;
|
|
110
|
+
if (codalm)
|
|
111
|
+
return codalm;
|
|
112
|
+
const firstAlmacen = getFirstItem(this.getAlmacenes());
|
|
113
|
+
codalm = firstAlmacen ? firstAlmacen.codalm : null;
|
|
114
|
+
return codalm;
|
|
115
|
+
}
|
|
116
|
+
getDecimalesPrecioComercial() {
|
|
117
|
+
try {
|
|
118
|
+
const factorPrecio = this.getFactorByKey(FACTORES.numeroDeDecimalesParaPrecioEnComercial.key);
|
|
119
|
+
const numero = Number(factorPrecio);
|
|
120
|
+
return isNaN(numero) ? 2 : numero;
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
return 2;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
getlEmisiones() {
|
|
127
|
+
return this.getSession() ? (this.getSession().lugarEmisions ?? []) : [];
|
|
128
|
+
}
|
|
129
|
+
getTipoDocumentos() {
|
|
130
|
+
return this.getSession() ? (this.getSession().documentoTipos ?? []) : [];
|
|
131
|
+
}
|
|
132
|
+
getIdentidades() {
|
|
133
|
+
return this.getSession() ? (this.getSession().identidades ?? []) : [];
|
|
134
|
+
}
|
|
135
|
+
getTAfectacion() {
|
|
136
|
+
return this.getSession() ? (this.getSession().tipoAfectacionIgvs ?? []) : [];
|
|
137
|
+
}
|
|
138
|
+
getCodUser() {
|
|
139
|
+
return this.getSession() ? this.getSession().coduser : '';
|
|
140
|
+
}
|
|
141
|
+
getSucursalSelected() {
|
|
142
|
+
return StorageService.getCodSuc();
|
|
143
|
+
}
|
|
144
|
+
getIdCia() {
|
|
145
|
+
return this.getSession() ? this.getSession().id_cia : '';
|
|
146
|
+
}
|
|
147
|
+
getCia() {
|
|
148
|
+
return this.getSession() ? this.getSession().cia : '';
|
|
149
|
+
}
|
|
150
|
+
getToken() {
|
|
151
|
+
return this.getSession() ? this.getSession().token : '';
|
|
152
|
+
}
|
|
153
|
+
getRuc() {
|
|
154
|
+
return this.getSession() ? this.getSession().ruc : '';
|
|
155
|
+
}
|
|
156
|
+
getAccesos() {
|
|
157
|
+
return this.getSession() ? this.getSession().accesos : [];
|
|
158
|
+
}
|
|
159
|
+
getInventarios() {
|
|
160
|
+
return this.getSession() ? (this.getSession().inventarios ?? []) : [];
|
|
161
|
+
}
|
|
162
|
+
getAlmacenes() {
|
|
163
|
+
return this.getSession() ? (this.getSession().almacenes ?? []) : [];
|
|
164
|
+
}
|
|
165
|
+
getUnidadesMedida() {
|
|
166
|
+
return this.getSession() ? (this.getSession().unidades ?? []) : [];
|
|
167
|
+
}
|
|
168
|
+
getTituloListas() {
|
|
169
|
+
return this.getSession() ? (this.getSession().tituloListas ?? []) : [];
|
|
170
|
+
}
|
|
171
|
+
getDocumentosTipo(filtro) {
|
|
172
|
+
const documentos = this.getSession()?.documentoTipos ?? [];
|
|
173
|
+
if (filtro) {
|
|
174
|
+
return documentos.filter(doc => filtro.includes(doc.tipdoc));
|
|
175
|
+
}
|
|
176
|
+
return documentos;
|
|
177
|
+
}
|
|
178
|
+
getGrilla(id) {
|
|
179
|
+
const grillas = StorageService.getGrilla();
|
|
180
|
+
const encontrar = grillas.find(item => (item.idform ?? '') == id);
|
|
181
|
+
if (encontrar) {
|
|
182
|
+
const columns = encontrar.columns ?? [];
|
|
183
|
+
const orderColumn = columns.sort((a, b) => (a.order ?? 0) - (b.order ?? 0));
|
|
184
|
+
return orderColumn;
|
|
185
|
+
}
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
getFactores() {
|
|
189
|
+
return this.getSession() ? this.getSession().factores : null;
|
|
190
|
+
}
|
|
191
|
+
getFactorByKey(extraerFactor) {
|
|
192
|
+
const factores = this.getFactores();
|
|
193
|
+
if (factores)
|
|
194
|
+
return factores[extraerFactor];
|
|
195
|
+
}
|
|
196
|
+
getPropiedades() {
|
|
197
|
+
return this.getSession() ? this.getSession().propiedades : null;
|
|
198
|
+
}
|
|
199
|
+
getPropiedadByKey(extraerPropiedad) {
|
|
200
|
+
const propiedades = this.getPropiedades();
|
|
201
|
+
if (propiedades)
|
|
202
|
+
return propiedades[extraerPropiedad];
|
|
203
|
+
}
|
|
204
|
+
getCondicionesPagos() {
|
|
205
|
+
return this.getSession() ? (this.getSession().cPagos ?? []) : [];
|
|
206
|
+
}
|
|
207
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SesionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
208
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SesionService, providedIn: 'root' });
|
|
209
|
+
}
|
|
210
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: SesionService, decorators: [{
|
|
211
|
+
type: Injectable,
|
|
212
|
+
args: [{
|
|
213
|
+
providedIn: 'root'
|
|
214
|
+
}]
|
|
215
|
+
}] });
|
|
216
|
+
|
|
217
|
+
class ThemeService {
|
|
218
|
+
isDarkMode = signal(false);
|
|
219
|
+
constructor() {
|
|
220
|
+
this.loadTheme();
|
|
221
|
+
}
|
|
222
|
+
loadTheme() {
|
|
223
|
+
const temaStorage = StorageService.getTema();
|
|
224
|
+
if (temaStorage === 'dark') {
|
|
225
|
+
document.body.classList.add('dark-mode');
|
|
226
|
+
this.isDarkMode.set(true);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
document.body.classList.remove('dark-mode');
|
|
230
|
+
this.isDarkMode.set(false);
|
|
231
|
+
}
|
|
232
|
+
toggle(value) {
|
|
233
|
+
if (value) {
|
|
234
|
+
this.isDarkMode.set(true);
|
|
235
|
+
StorageService.setTema('dark');
|
|
236
|
+
document.body.classList.add('dark-mode');
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
this.isDarkMode.set(false);
|
|
240
|
+
StorageService.setTema('light');
|
|
241
|
+
document.body.classList.remove('dark-mode');
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ThemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
245
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ThemeService, providedIn: 'root' });
|
|
246
|
+
}
|
|
247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ThemeService, decorators: [{
|
|
248
|
+
type: Injectable,
|
|
249
|
+
args: [{
|
|
250
|
+
providedIn: 'root'
|
|
251
|
+
}]
|
|
252
|
+
}], ctorParameters: () => [] });
|
|
253
|
+
|
|
254
|
+
/*
|
|
255
|
+
* Public API Surface of core-tsi
|
|
256
|
+
*/
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Generated bundle index. Do not edit.
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
export { SesionService, StorageService, ThemeService };
|
|
263
|
+
//# sourceMappingURL=core-tsi.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core-tsi.mjs","sources":["../../../projects/core-tsi/src/lib/service/storage.service.ts","../../../projects/core-tsi/src/lib/service/sesion.service.ts","../../../projects/core-tsi/src/lib/service/theme.service.ts","../../../projects/core-tsi/src/public-api.ts","../../../projects/core-tsi/src/core-tsi.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class StorageService {\r\n\r\n public static USER_KEY: string = \"sessionERP\";\r\n public static COD_SUC_KEY: string = \"codsuc\"\r\n public static FILTRO:string = 'filtro_consulta'\r\n public static GRILLAS_KEY:string = 'v_recursosGlosa'\r\n public static TEMA_APP: string = 'themeApp'\r\n \r\n setData(key: string, value: any) {\r\n localStorage.setItem(key, value);\r\n }\r\n\r\n public getData(key: string) {\r\n return localStorage.getItem(key);\r\n }\r\n\r\n public static setAll(value: any) {\r\n localStorage.setItem(this.USER_KEY, JSON.stringify(value));\r\n }\r\n\r\n public static getSession() {\r\n return JSON.parse(localStorage.getItem(this.USER_KEY));\r\n }\r\n\r\n public static obtenerAcceso(accesos: any, codmod: number, codacc: number): any {\r\n let vResponse: any = null;\r\n if (accesos != null)\r\n accesos.forEach((element: any) => {\r\n if (element.codmod == codmod && element.codacc == codacc) {\r\n vResponse = element;\r\n }\r\n });\r\n return vResponse\r\n }\r\n\r\n //AGREGAR CODSUC AL STORAGE\r\n public static setCodSuc(value:number){\r\n localStorage.setItem(this.COD_SUC_KEY,value.toString())\r\n }\r\n \r\n public static getCodSuc():number{\r\n return Number(localStorage.getItem(this.COD_SUC_KEY))\r\n }\r\n\r\n //AGREGAR GRILLAS AL STORAGE\r\n public static setGrilla(value:any){\r\n localStorage.setItem(this.GRILLAS_KEY,JSON.stringify(value))\r\n }\r\n\r\n public static getGrilla(){\r\n const data = JSON.parse(localStorage.getItem(this.GRILLAS_KEY))\r\n return data ?? []\r\n }\r\n\r\n //FILTROS CONSULTA\r\n\r\n public static setFiltro(value:any){\r\n localStorage.setItem(this.FILTRO,JSON.stringify(value))\r\n }\r\n \r\n public static getFiltro():any{\r\n return JSON.parse(localStorage.getItem(this.FILTRO))\r\n }\r\n\r\n public static deleteFiltro(){\r\n localStorage.removeItem(this.FILTRO);\r\n }\r\n\r\n // TEMA DARK MODE\r\n public static setTema(value:'dark' | 'light'){\r\n localStorage.setItem(this.TEMA_APP,value)\r\n }\r\n\r\n public static getTema(){\r\n const tema = localStorage.getItem(this.TEMA_APP)\r\n return tema ?? 'light'\r\n }\r\n\r\n removeData(key: string) {\r\n localStorage.removeItem(key);\r\n }\r\n\r\n public static clearStorage() {\r\n\r\n const keys = Object.keys(localStorage)\r\n let count = keys.length;\r\n\r\n while (count--) {\r\n keys[count] == 'rucUser' ? null : localStorage.removeItem(keys[count])\r\n }\r\n }\r\n\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport { InventarioSesion } from '../models/sesion/inventario-sesion.model';\r\nimport { AlmacenSesion } from '../models/sesion/almacen-sesion.model';\r\nimport { UnidadesSesion } from '../models/sesion/unidades-sesion.model';\r\nimport { TituloListas } from '../models/sesion/titulo-listas.model';\r\nimport { DocumentosTipo } from '../models/sesion/documento-tipo-sesion.model';\r\nimport { TipoAfeccionSesion } from '../models/sesion/tipo-afectacion.model';\r\nimport { StorageService } from './storage.service';\r\nimport { FACTORES, getFirstItem } from 'shared-tsi';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\n\r\nexport class SesionService {\r\n\r\n getSession() {\r\n return StorageService.getSession()\r\n }\r\n\r\n getMonedas() {\r\n return this.getSession() ? (this.getSession().monedas ?? []).filter(mon => mon.codmon !== 'EUR') : []\r\n }\r\n\r\n getVendedores() {\r\n return this.getSession() ? (this.getSession().vendedores ?? []) : []\r\n }\r\n\r\n getMotivos(codigo: number) {\r\n const motivos = this.getSession()?.motivos ?? [];\r\n return motivos.filter((motivo: any) => motivo.tipdoc == codigo)\r\n }\r\n\r\n getSituaciones(codigo: number) {\r\n const situaciones = this.getSession()?.situaciones ?? [];\r\n return situaciones.filter((situacion: any) => situacion.tipdoc == codigo)\r\n }\r\n\r\n getSucursales() {\r\n return this.getSession() ? (this.getSession().sucursales ?? []) : []\r\n }\r\n\r\n getAlmacenDefecto() {\r\n const encontrarDefecto = this.getSucursales().find(suc => suc.codsuc == this.getSucursalSelected())\r\n let codalm = encontrarDefecto ? encontrarDefecto.almacenDefecto : null\r\n\r\n if (codalm) return codalm\r\n const firstAlmacen = getFirstItem(this.getAlmacenes())\r\n codalm = firstAlmacen ? firstAlmacen.codalm : null\r\n return codalm\r\n }\r\n\r\n getDecimalesPrecioComercial(): number {\r\n try {\r\n const factorPrecio = this.getFactorByKey(FACTORES.numeroDeDecimalesParaPrecioEnComercial.key)\r\n const numero = Number(factorPrecio)\r\n return isNaN(numero) ? 2 : numero\r\n } catch {\r\n return 2\r\n }\r\n }\r\n\r\n getlEmisiones() {\r\n return this.getSession() ? (this.getSession().lugarEmisions ?? []) : []\r\n }\r\n\r\n getTipoDocumentos() {\r\n return this.getSession() ? (this.getSession().documentoTipos ?? []) : []\r\n }\r\n\r\n getIdentidades() {\r\n return this.getSession() ? (this.getSession().identidades ?? []) : []\r\n }\r\n\r\n getTAfectacion(): TipoAfeccionSesion[] {\r\n return this.getSession() ? (this.getSession().tipoAfectacionIgvs ?? []) : []\r\n }\r\n\r\n getCodUser() {\r\n return this.getSession() ? this.getSession().coduser : ''\r\n }\r\n\r\n getSucursalSelected() {\r\n return StorageService.getCodSuc()\r\n }\r\n\r\n getIdCia() {\r\n return this.getSession() ? this.getSession().id_cia : ''\r\n }\r\n\r\n getCia() {\r\n return this.getSession() ? this.getSession().cia : ''\r\n }\r\n\r\n getToken() {\r\n return this.getSession() ? this.getSession().token : ''\r\n }\r\n\r\n getRuc() {\r\n return this.getSession() ? this.getSession().ruc : ''\r\n }\r\n\r\n getAccesos() {\r\n return this.getSession() ? this.getSession().accesos : []\r\n }\r\n\r\n getInventarios(): InventarioSesion[] {\r\n return this.getSession() ? (this.getSession().inventarios ?? []) : []\r\n }\r\n\r\n getAlmacenes(): AlmacenSesion[] {\r\n return this.getSession() ? (this.getSession().almacenes ?? []) : []\r\n }\r\n\r\n getUnidadesMedida(): UnidadesSesion[] {\r\n return this.getSession() ? (this.getSession().unidades ?? []) : []\r\n }\r\n\r\n getTituloListas(): TituloListas[] {\r\n return this.getSession() ? (this.getSession().tituloListas ?? []) : []\r\n }\r\n\r\n getDocumentosTipo(filtro?: number[]): DocumentosTipo[] {\r\n const documentos = this.getSession()?.documentoTipos ?? []\r\n if (filtro) {\r\n return documentos.filter(doc => filtro.includes(doc.tipdoc))\r\n }\r\n return documentos\r\n }\r\n\r\n getGrilla(id: string): any[] {\r\n const grillas = StorageService.getGrilla()\r\n const encontrar = grillas.find(item => (item.idform ?? '') == id)\r\n if (encontrar) {\r\n const columns = encontrar.columns ?? []\r\n const orderColumn = columns.sort((a, b) => (a.order ?? 0) - (b.order ?? 0))\r\n return orderColumn\r\n }\r\n return []\r\n }\r\n\r\n getFactores() {\r\n return this.getSession() ? this.getSession().factores : null\r\n }\r\n\r\n getFactorByKey(extraerFactor: string) {\r\n const factores = this.getFactores()\r\n if (factores) return factores[extraerFactor]\r\n }\r\n\r\n getPropiedades() {\r\n return this.getSession() ? this.getSession().propiedades : null\r\n }\r\n \r\n getPropiedadByKey(extraerPropiedad: string) {\r\n const propiedades = this.getPropiedades()\r\n if (propiedades) return propiedades[extraerPropiedad]\r\n }\r\n\r\n getCondicionesPagos() {\r\n return this.getSession() ? (this.getSession().cPagos ?? []) : []\r\n }\r\n}\r\n","import { Injectable, signal } from '@angular/core';\r\nimport { StorageService } from './storage.service';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\n\r\nexport class ThemeService {\r\n \r\n isDarkMode = signal<boolean>(false)\r\n \r\n constructor() {\r\n this.loadTheme();\r\n }\r\n\r\n loadTheme() {\r\n const temaStorage = StorageService.getTema()\r\n if (temaStorage === 'dark') {\r\n document.body.classList.add('dark-mode')\r\n this.isDarkMode.set(true)\r\n return;\r\n }\r\n document.body.classList.remove('dark-mode')\r\n this.isDarkMode.set(false)\r\n }\r\n\r\n toggle(value: boolean) {\r\n if (value) {\r\n this.isDarkMode.set(true)\r\n StorageService.setTema('dark')\r\n document.body.classList.add('dark-mode')\r\n } else {\r\n this.isDarkMode.set(false)\r\n StorageService.setTema('light')\r\n document.body.classList.remove('dark-mode')\r\n }\r\n }\r\n}\r\n","/*\r\n * Public API Surface of core-tsi\r\n */\r\n\r\nexport * from './lib/service/sesion.service';\r\nexport * from './lib/service/storage.service';\r\nexport * from './lib/service/theme.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAKa,cAAc,CAAA;AAElB,IAAA,OAAO,QAAQ,GAAW,YAAY;AACtC,IAAA,OAAO,WAAW,GAAW,QAAQ;AACrC,IAAA,OAAO,MAAM,GAAU,iBAAiB;AACxC,IAAA,OAAO,WAAW,GAAU,iBAAiB;AAC7C,IAAA,OAAO,QAAQ,GAAW,UAAU;IAE3C,OAAO,CAAC,GAAW,EAAE,KAAU,EAAA;AAC7B,QAAA,YAAY,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC;;AAG3B,IAAA,OAAO,CAAC,GAAW,EAAA;AACxB,QAAA,OAAO,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC;;IAG3B,OAAO,MAAM,CAAC,KAAU,EAAA;AAC7B,QAAA,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;;AAGrD,IAAA,OAAO,UAAU,GAAA;AACtB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;;AAGjD,IAAA,OAAO,aAAa,CAAC,OAAY,EAAE,MAAc,EAAE,MAAc,EAAA;QACtE,IAAI,SAAS,GAAQ,IAAI;QACzB,IAAI,OAAO,IAAI,IAAI;AACjB,YAAA,OAAO,CAAC,OAAO,CAAC,CAAC,OAAY,KAAI;AAC/B,gBAAA,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,IAAI,OAAO,CAAC,MAAM,IAAI,MAAM,EAAE;oBACxD,SAAS,GAAG,OAAO;;AAEvB,aAAC,CAAC;AACJ,QAAA,OAAO,SAAS;;;IAIX,OAAO,SAAS,CAAC,KAAY,EAAA;AAClC,QAAA,YAAY,CAAC,OAAO,CA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
tipinv?: number;
|
|
4
|
+
codalm?: number;
|
|
5
|
+
codsuc?: number;
|
|
6
|
+
sucursal?: string;
|
|
7
|
+
descri?: string;
|
|
8
|
+
abrevi?: string;
|
|
9
|
+
fcreac?: string;
|
|
10
|
+
factua?: string;
|
|
11
|
+
usuari?: string;
|
|
12
|
+
activo?: boolean;
|
|
13
|
+
swterc?: boolean;
|
|
14
|
+
ubigeo?: string;
|
|
15
|
+
direcc?: string;
|
|
16
|
+
consigna?: boolean;
|
|
17
|
+
clases?: any[];
|
|
18
|
+
ubicaciones?: any[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class InventarioSesion {
|
|
2
|
+
id_cia?: number;
|
|
3
|
+
tipinv?: number;
|
|
4
|
+
dtipinv?: string;
|
|
5
|
+
abrevi?: string;
|
|
6
|
+
codsunat?: string;
|
|
7
|
+
fcreac?: string;
|
|
8
|
+
factua?: string;
|
|
9
|
+
usuari?: string;
|
|
10
|
+
swacti?: string;
|
|
11
|
+
activo?: boolean;
|
|
12
|
+
cuenta?: string;
|
|
13
|
+
patron?: string;
|
|
14
|
+
swdefaul?: string;
|
|
15
|
+
clases?: any;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class TituloListas {
|
|
2
|
+
descri?: string;
|
|
3
|
+
id_cia?: number;
|
|
4
|
+
codtit?: number;
|
|
5
|
+
codmon?: string;
|
|
6
|
+
titulo?: string;
|
|
7
|
+
abrevi?: string;
|
|
8
|
+
tipcal?: string;
|
|
9
|
+
factor?: number;
|
|
10
|
+
incigv?: string;
|
|
11
|
+
modpre?: string;
|
|
12
|
+
fcreac?: string;
|
|
13
|
+
factua?: string;
|
|
14
|
+
usuari?: string;
|
|
15
|
+
swacti?: string;
|
|
16
|
+
porcom?: number;
|
|
17
|
+
activo?: boolean;
|
|
18
|
+
clases?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class UnidadesSesion {
|
|
2
|
+
id_cia?: number;
|
|
3
|
+
coduni?: string;
|
|
4
|
+
desuni?: string;
|
|
5
|
+
codsunat?: string;
|
|
6
|
+
abrevi?: string;
|
|
7
|
+
undmedco?: string;
|
|
8
|
+
codiso?: string;
|
|
9
|
+
fcreac?: string;
|
|
10
|
+
factua?: string;
|
|
11
|
+
usuari?: string;
|
|
12
|
+
activo?: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { InventarioSesion } from '../models/sesion/inventario-sesion.model';
|
|
2
|
+
import { AlmacenSesion } from '../models/sesion/almacen-sesion.model';
|
|
3
|
+
import { UnidadesSesion } from '../models/sesion/unidades-sesion.model';
|
|
4
|
+
import { TituloListas } from '../models/sesion/titulo-listas.model';
|
|
5
|
+
import { DocumentosTipo } from '../models/sesion/documento-tipo-sesion.model';
|
|
6
|
+
import { TipoAfeccionSesion } from '../models/sesion/tipo-afectacion.model';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
export declare class SesionService {
|
|
9
|
+
getSession(): any;
|
|
10
|
+
getMonedas(): any;
|
|
11
|
+
getVendedores(): any;
|
|
12
|
+
getMotivos(codigo: number): any;
|
|
13
|
+
getSituaciones(codigo: number): any;
|
|
14
|
+
getSucursales(): any;
|
|
15
|
+
getAlmacenDefecto(): any;
|
|
16
|
+
getDecimalesPrecioComercial(): number;
|
|
17
|
+
getlEmisiones(): any;
|
|
18
|
+
getTipoDocumentos(): any;
|
|
19
|
+
getIdentidades(): any;
|
|
20
|
+
getTAfectacion(): TipoAfeccionSesion[];
|
|
21
|
+
getCodUser(): any;
|
|
22
|
+
getSucursalSelected(): number;
|
|
23
|
+
getIdCia(): any;
|
|
24
|
+
getCia(): any;
|
|
25
|
+
getToken(): any;
|
|
26
|
+
getRuc(): any;
|
|
27
|
+
getAccesos(): any;
|
|
28
|
+
getInventarios(): InventarioSesion[];
|
|
29
|
+
getAlmacenes(): AlmacenSesion[];
|
|
30
|
+
getUnidadesMedida(): UnidadesSesion[];
|
|
31
|
+
getTituloListas(): TituloListas[];
|
|
32
|
+
getDocumentosTipo(filtro?: number[]): DocumentosTipo[];
|
|
33
|
+
getGrilla(id: string): any[];
|
|
34
|
+
getFactores(): any;
|
|
35
|
+
getFactorByKey(extraerFactor: string): any;
|
|
36
|
+
getPropiedades(): any;
|
|
37
|
+
getPropiedadByKey(extraerPropiedad: string): any;
|
|
38
|
+
getCondicionesPagos(): any;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SesionService, never>;
|
|
40
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SesionService>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class StorageService {
|
|
3
|
+
static USER_KEY: string;
|
|
4
|
+
static COD_SUC_KEY: string;
|
|
5
|
+
static FILTRO: string;
|
|
6
|
+
static GRILLAS_KEY: string;
|
|
7
|
+
static TEMA_APP: string;
|
|
8
|
+
setData(key: string, value: any): void;
|
|
9
|
+
getData(key: string): string;
|
|
10
|
+
static setAll(value: any): void;
|
|
11
|
+
static getSession(): any;
|
|
12
|
+
static obtenerAcceso(accesos: any, codmod: number, codacc: number): any;
|
|
13
|
+
static setCodSuc(value: number): void;
|
|
14
|
+
static getCodSuc(): number;
|
|
15
|
+
static setGrilla(value: any): void;
|
|
16
|
+
static getGrilla(): any;
|
|
17
|
+
static setFiltro(value: any): void;
|
|
18
|
+
static getFiltro(): any;
|
|
19
|
+
static deleteFiltro(): void;
|
|
20
|
+
static setTema(value: 'dark' | 'light'): void;
|
|
21
|
+
static getTema(): string;
|
|
22
|
+
removeData(key: string): void;
|
|
23
|
+
static clearStorage(): void;
|
|
24
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<StorageService, never>;
|
|
25
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<StorageService>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class ThemeService {
|
|
3
|
+
isDarkMode: import("@angular/core").WritableSignal<boolean>;
|
|
4
|
+
constructor();
|
|
5
|
+
loadTheme(): void;
|
|
6
|
+
toggle(value: boolean): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
8
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
|
9
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "core-tsi",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"peerDependencies": {
|
|
5
|
+
"shared-tsi": "^0.0.1",
|
|
6
|
+
"@angular/common": "^19.2.0",
|
|
7
|
+
"@angular/core": "^19.2.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"module": "fesm2022/core-tsi.mjs",
|
|
14
|
+
"typings": "index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
"./package.json": {
|
|
17
|
+
"default": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./index.d.ts",
|
|
21
|
+
"default": "./fesm2022/core-tsi.mjs"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
package/public-api.d.ts
ADDED