@acontplus/ng-customer 2.0.2 → 2.1.0
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 +14 -19
- package/fesm2022/acontplus-ng-customer.mjs +591 -342
- package/fesm2022/acontplus-ng-customer.mjs.map +1 -1
- package/package.json +7 -10
- package/types/acontplus-ng-customer.d.ts +178 -87
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, input, output, signal,
|
|
2
|
+
import { InjectionToken, inject, Injectable, input, output, signal, ChangeDetectionStrategy, ViewEncapsulation, Component, HostListener, Directive } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/forms';
|
|
4
|
-
import { FormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
4
|
+
import { FormBuilder, Validators, ReactiveFormsModule, FormsModule } from '@angular/forms';
|
|
5
5
|
import { HttpClient } from '@angular/common/http';
|
|
6
|
-
import { map } from 'rxjs';
|
|
6
|
+
import { map, forkJoin, from } from 'rxjs';
|
|
7
7
|
import * as i2 from '@angular/material/form-field';
|
|
8
8
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
9
9
|
import * as i3 from '@angular/material/input';
|
|
@@ -11,314 +11,86 @@ import { MatInputModule } from '@angular/material/input';
|
|
|
11
11
|
import * as i4 from '@angular/material/expansion';
|
|
12
12
|
import { MatExpansionModule } from '@angular/material/expansion';
|
|
13
13
|
import { MatIcon } from '@angular/material/icon';
|
|
14
|
-
import { Button,
|
|
14
|
+
import { ToUpperCase, InputChip, Button, AdvancedDialogService, DataGrid } from '@acontplus/ng-components';
|
|
15
15
|
import * as i5 from '@angular/material/select';
|
|
16
16
|
import { MatSelectModule } from '@angular/material/select';
|
|
17
17
|
import * as i6 from '@angular/material/button';
|
|
18
18
|
import { MatButtonModule } from '@angular/material/button';
|
|
19
|
+
import { SRI_DOCUMENT_TYPE } from '@acontplus/core';
|
|
20
|
+
import { MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
|
|
21
|
+
import { isValidField } from '@acontplus/utils';
|
|
22
|
+
import * as i4$1 from '@angular/material/menu';
|
|
23
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
19
24
|
|
|
20
|
-
const
|
|
21
|
-
fields: {
|
|
22
|
-
// IDs y referencias
|
|
23
|
-
idTipoIdentificacion: {
|
|
24
|
-
name: 'idTipoIdentificacion',
|
|
25
|
-
required: true,
|
|
26
|
-
visible: true,
|
|
27
|
-
label: 'Tipo de Identificación',
|
|
28
|
-
placeholder: 'Seleccione tipo',
|
|
29
|
-
},
|
|
30
|
-
idFormaPagoSri: {
|
|
31
|
-
name: 'idFormaPagoSri',
|
|
32
|
-
required: false,
|
|
33
|
-
visible: true,
|
|
34
|
-
label: 'Forma de Pago SRI',
|
|
35
|
-
placeholder: 'Seleccione forma de pago',
|
|
36
|
-
},
|
|
37
|
-
idTipoClienteProveedor: {
|
|
38
|
-
name: 'idTipoClienteProveedor',
|
|
39
|
-
required: false,
|
|
40
|
-
visible: true,
|
|
41
|
-
label: 'Tipo de Cliente/Proveedor',
|
|
42
|
-
placeholder: 'Seleccione tipo',
|
|
43
|
-
},
|
|
44
|
-
idSubContribuyente: {
|
|
45
|
-
name: 'idSubContribuyente',
|
|
46
|
-
required: false,
|
|
47
|
-
visible: true,
|
|
48
|
-
label: 'Sub-Contribuyente',
|
|
49
|
-
placeholder: 'Seleccione',
|
|
50
|
-
},
|
|
51
|
-
idTiempoCredito: {
|
|
52
|
-
name: 'idTiempoCredito',
|
|
53
|
-
required: false,
|
|
54
|
-
visible: true,
|
|
55
|
-
label: 'Tiempo de Crédito',
|
|
56
|
-
placeholder: 'Días de crédito',
|
|
57
|
-
},
|
|
58
|
-
idCiudad: {
|
|
59
|
-
name: 'idCiudad',
|
|
60
|
-
required: false,
|
|
61
|
-
visible: true,
|
|
62
|
-
label: 'Ciudad',
|
|
63
|
-
placeholder: 'Seleccione ciudad',
|
|
64
|
-
},
|
|
65
|
-
idCargo: {
|
|
66
|
-
name: 'idCargo',
|
|
67
|
-
required: false,
|
|
68
|
-
visible: true,
|
|
69
|
-
label: 'Cargo',
|
|
70
|
-
placeholder: 'Seleccione cargo',
|
|
71
|
-
},
|
|
72
|
-
idEmpleado: {
|
|
73
|
-
name: 'idEmpleado',
|
|
74
|
-
required: false,
|
|
75
|
-
visible: true,
|
|
76
|
-
label: 'Empleado Responsable',
|
|
77
|
-
placeholder: 'Seleccione empleado',
|
|
78
|
-
},
|
|
79
|
-
// Datos principales
|
|
80
|
-
numeroIdentificacion: {
|
|
81
|
-
name: 'numeroIdentificacion',
|
|
82
|
-
required: true,
|
|
83
|
-
visible: true,
|
|
84
|
-
label: 'RUC / Cédula',
|
|
85
|
-
placeholder: 'Ingrese número de identificación (13 dígitos para RUC)',
|
|
86
|
-
},
|
|
87
|
-
nombreFiscal: {
|
|
88
|
-
name: 'nombreFiscal',
|
|
89
|
-
required: true,
|
|
90
|
-
visible: true,
|
|
91
|
-
label: 'Razón Social / Nombre Fiscal',
|
|
92
|
-
placeholder: 'Ingrese razón social completa',
|
|
93
|
-
},
|
|
94
|
-
nombreComercial: {
|
|
95
|
-
name: 'nombreComercial',
|
|
96
|
-
required: false,
|
|
97
|
-
visible: true,
|
|
98
|
-
label: 'Nombre Comercial',
|
|
99
|
-
placeholder: 'Ingrese nombre comercial',
|
|
100
|
-
},
|
|
101
|
-
direccion: {
|
|
102
|
-
name: 'direccion',
|
|
103
|
-
required: true,
|
|
104
|
-
visible: true,
|
|
105
|
-
label: 'Dirección',
|
|
106
|
-
placeholder: 'Calle principal y secundaria',
|
|
107
|
-
},
|
|
108
|
-
correo: {
|
|
109
|
-
name: 'correo',
|
|
110
|
-
required: false,
|
|
111
|
-
visible: true,
|
|
112
|
-
label: 'Correo Electrónico',
|
|
113
|
-
placeholder: 'ejemplo@correo.com',
|
|
114
|
-
},
|
|
115
|
-
telefono: {
|
|
116
|
-
name: 'telefono',
|
|
117
|
-
required: false,
|
|
118
|
-
visible: true,
|
|
119
|
-
label: 'Teléfono',
|
|
120
|
-
placeholder: '0999999999',
|
|
121
|
-
},
|
|
122
|
-
placa: {
|
|
123
|
-
name: 'placa',
|
|
124
|
-
required: false,
|
|
125
|
-
visible: true,
|
|
126
|
-
label: 'Placa del Vehículo',
|
|
127
|
-
placeholder: 'ABC-1234',
|
|
128
|
-
},
|
|
129
|
-
nota: {
|
|
130
|
-
name: 'nota',
|
|
131
|
-
required: false,
|
|
132
|
-
visible: true,
|
|
133
|
-
label: 'Notas',
|
|
134
|
-
placeholder: 'Observaciones adicionales',
|
|
135
|
-
},
|
|
136
|
-
birthDate: {
|
|
137
|
-
name: 'birthDate',
|
|
138
|
-
required: false,
|
|
139
|
-
visible: true,
|
|
140
|
-
label: 'Fecha de Nacimiento',
|
|
141
|
-
placeholder: 'DD/MM/AAAA',
|
|
142
|
-
},
|
|
143
|
-
// Estados
|
|
144
|
-
estado: {
|
|
145
|
-
name: 'estado',
|
|
146
|
-
required: false,
|
|
147
|
-
visible: true,
|
|
148
|
-
label: 'Activo',
|
|
149
|
-
},
|
|
150
|
-
validationSri: {
|
|
151
|
-
name: 'validationSri',
|
|
152
|
-
required: false,
|
|
153
|
-
visible: true,
|
|
154
|
-
label: 'Validado en SRI',
|
|
155
|
-
},
|
|
156
|
-
configValorBruto: {
|
|
157
|
-
name: 'configValorBruto',
|
|
158
|
-
required: false,
|
|
159
|
-
visible: true,
|
|
160
|
-
label: 'Configurar Valor Bruto',
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
// Información de crédito
|
|
164
|
-
showCreditInfo: true,
|
|
165
|
-
creditFields: {
|
|
166
|
-
maritalStatusId: {
|
|
167
|
-
name: 'maritalStatusId',
|
|
168
|
-
required: false,
|
|
169
|
-
visible: true,
|
|
170
|
-
label: 'Estado Civil',
|
|
171
|
-
placeholder: 'Seleccione',
|
|
172
|
-
},
|
|
173
|
-
conyugeNombre: {
|
|
174
|
-
name: 'conyugeNombre',
|
|
175
|
-
required: false,
|
|
176
|
-
visible: true,
|
|
177
|
-
label: 'Nombre del Cónyuge',
|
|
178
|
-
placeholder: 'Ingrese nombre',
|
|
179
|
-
},
|
|
180
|
-
conyugeTel: {
|
|
181
|
-
name: 'conyugeTel',
|
|
182
|
-
required: false,
|
|
183
|
-
visible: true,
|
|
184
|
-
label: 'Teléfono del Cónyuge',
|
|
185
|
-
placeholder: '0999999999',
|
|
186
|
-
},
|
|
187
|
-
refFamNombre: {
|
|
188
|
-
name: 'refFamNombre',
|
|
189
|
-
required: false,
|
|
190
|
-
visible: true,
|
|
191
|
-
label: 'Referencia Familiar',
|
|
192
|
-
placeholder: 'Nombre',
|
|
193
|
-
},
|
|
194
|
-
refFamTel: {
|
|
195
|
-
name: 'refFamTel',
|
|
196
|
-
required: false,
|
|
197
|
-
visible: true,
|
|
198
|
-
label: 'Teléfono Referencia',
|
|
199
|
-
placeholder: '0999999999',
|
|
200
|
-
},
|
|
201
|
-
housingTypeId: {
|
|
202
|
-
name: 'housingTypeId',
|
|
203
|
-
required: false,
|
|
204
|
-
visible: true,
|
|
205
|
-
label: 'Tipo de Vivienda',
|
|
206
|
-
placeholder: 'Seleccione',
|
|
207
|
-
},
|
|
208
|
-
dirVivienda: {
|
|
209
|
-
name: 'dirVivienda',
|
|
210
|
-
required: false,
|
|
211
|
-
visible: true,
|
|
212
|
-
label: 'Dirección de Vivienda',
|
|
213
|
-
placeholder: 'Dirección completa',
|
|
214
|
-
},
|
|
215
|
-
refDomicilio: {
|
|
216
|
-
name: 'refDomicilio',
|
|
217
|
-
required: false,
|
|
218
|
-
visible: true,
|
|
219
|
-
label: 'Referencia de Domicilio',
|
|
220
|
-
placeholder: 'Referencia',
|
|
221
|
-
},
|
|
222
|
-
sector: {
|
|
223
|
-
name: 'sector',
|
|
224
|
-
required: false,
|
|
225
|
-
visible: true,
|
|
226
|
-
label: 'Sector',
|
|
227
|
-
placeholder: 'Ingrese sector',
|
|
228
|
-
},
|
|
229
|
-
barrio: {
|
|
230
|
-
name: 'barrio',
|
|
231
|
-
required: false,
|
|
232
|
-
visible: true,
|
|
233
|
-
label: 'Barrio',
|
|
234
|
-
placeholder: 'Ingrese barrio',
|
|
235
|
-
},
|
|
236
|
-
calle: {
|
|
237
|
-
name: 'calle',
|
|
238
|
-
required: false,
|
|
239
|
-
visible: true,
|
|
240
|
-
label: 'Calle',
|
|
241
|
-
placeholder: 'Calle principal',
|
|
242
|
-
},
|
|
243
|
-
},
|
|
244
|
-
submitButtonText: 'Guardar Cliente',
|
|
245
|
-
cancelButtonText: 'Cancelar',
|
|
246
|
-
};
|
|
247
|
-
// Configuración MÍNIMA para POS
|
|
248
|
-
const POS_COMPANY_CUSTOMER_CONFIG = {
|
|
249
|
-
fields: {
|
|
250
|
-
// Solo lo esencial
|
|
251
|
-
idTipoIdentificacion: {
|
|
252
|
-
name: 'idTipoIdentificacion',
|
|
253
|
-
required: true,
|
|
254
|
-
visible: true,
|
|
255
|
-
label: 'Tipo ID',
|
|
256
|
-
placeholder: 'Tipo',
|
|
257
|
-
},
|
|
258
|
-
numeroIdentificacion: {
|
|
259
|
-
name: 'numeroIdentificacion',
|
|
260
|
-
required: true,
|
|
261
|
-
visible: true,
|
|
262
|
-
label: 'Cédula/RUC',
|
|
263
|
-
placeholder: 'Número de identificación',
|
|
264
|
-
},
|
|
265
|
-
nombreFiscal: {
|
|
266
|
-
name: 'nombreFiscal',
|
|
267
|
-
required: true,
|
|
268
|
-
visible: true,
|
|
269
|
-
label: 'Nombre',
|
|
270
|
-
placeholder: 'Nombre del cliente',
|
|
271
|
-
},
|
|
272
|
-
nombreComercial: {
|
|
273
|
-
name: 'nombreComercial',
|
|
274
|
-
required: false,
|
|
275
|
-
visible: false,
|
|
276
|
-
},
|
|
277
|
-
direccion: {
|
|
278
|
-
name: 'direccion',
|
|
279
|
-
required: false,
|
|
280
|
-
visible: true,
|
|
281
|
-
label: 'Dirección',
|
|
282
|
-
placeholder: 'Dirección',
|
|
283
|
-
},
|
|
284
|
-
correo: {
|
|
285
|
-
name: 'correo',
|
|
286
|
-
required: false,
|
|
287
|
-
visible: false,
|
|
288
|
-
},
|
|
289
|
-
telefono: {
|
|
290
|
-
name: 'telefono',
|
|
291
|
-
required: false,
|
|
292
|
-
visible: true,
|
|
293
|
-
label: 'Teléfono',
|
|
294
|
-
placeholder: 'Teléfono',
|
|
295
|
-
},
|
|
296
|
-
// Resto oculto
|
|
297
|
-
idFormaPagoSri: { name: 'idFormaPagoSri', required: false, visible: false },
|
|
298
|
-
idTipoClienteProveedor: { name: 'idTipoClienteProveedor', required: false, visible: false },
|
|
299
|
-
idSubContribuyente: { name: 'idSubContribuyente', required: false, visible: false },
|
|
300
|
-
idTiempoCredito: { name: 'idTiempoCredito', required: false, visible: false },
|
|
301
|
-
idCiudad: { name: 'idCiudad', required: false, visible: false },
|
|
302
|
-
idCargo: { name: 'idCargo', required: false, visible: false },
|
|
303
|
-
idEmpleado: { name: 'idEmpleado', required: false, visible: false },
|
|
304
|
-
placa: { name: 'placa', required: false, visible: false },
|
|
305
|
-
nota: { name: 'nota', required: false, visible: false },
|
|
306
|
-
birthDate: { name: 'birthDate', required: false, visible: false },
|
|
307
|
-
estado: { name: 'estado', required: false, visible: false },
|
|
308
|
-
validationSri: { name: 'validationSri', required: false, visible: false },
|
|
309
|
-
configValorBruto: { name: 'configValorBruto', required: false, visible: false },
|
|
310
|
-
},
|
|
311
|
-
showCreditInfo: false, // Sin info de crédito en POS
|
|
312
|
-
submitButtonText: 'Agregar',
|
|
313
|
-
cancelButtonText: 'Cancelar',
|
|
314
|
-
};
|
|
315
|
-
|
|
316
|
-
const CUSTOMER_SRI_SERVICE = new InjectionToken('CUSTOMER_SRI_SERVICE');
|
|
25
|
+
const CUSTOMER_SRI_HTTP_TOKEN = new InjectionToken('CUSTOMER_SRI_HTTP_TOKEN');
|
|
317
26
|
const COMPANY_CUSTOMER_MAPPER = new InjectionToken('COMPANY_CUSTOMER_MAPPER');
|
|
318
27
|
const COMPANY_CUSTOMER_FORM_CONFIG = new InjectionToken('COMPANY_CUSTOMER_FORM_CONFIG');
|
|
319
|
-
const
|
|
28
|
+
const COMPANY_CUSTOMER_HTTP_TOKEN = new InjectionToken('COMPANY_CUSTOMER_HTTP_TOKEN');
|
|
29
|
+
|
|
30
|
+
class CompanyCustomerFormDataResult {
|
|
31
|
+
identificationTypes = [];
|
|
32
|
+
tipoContribuyentes = [];
|
|
33
|
+
tiempoCreditos = [];
|
|
34
|
+
cities = [];
|
|
35
|
+
tiposCliente = [];
|
|
36
|
+
empresas = [];
|
|
37
|
+
cargos = [];
|
|
38
|
+
formasPagoSri = [];
|
|
39
|
+
housingTypes = [];
|
|
40
|
+
maritalStatuses = [];
|
|
41
|
+
employees = [];
|
|
42
|
+
}
|
|
320
43
|
|
|
321
44
|
class CompanyCustomerDefaultMapper {
|
|
45
|
+
toModelFormData(response) {
|
|
46
|
+
const result = new CompanyCustomerFormDataResult();
|
|
47
|
+
if (response.code === '1') {
|
|
48
|
+
const mainData = JSON.parse(response.payload);
|
|
49
|
+
const cities = Array.isArray(mainData) ? mainData[3] : mainData.cities;
|
|
50
|
+
const identificationTypes = Array.isArray(mainData)
|
|
51
|
+
? mainData[0]
|
|
52
|
+
: mainData.identificationTypes;
|
|
53
|
+
console.log(mainData);
|
|
54
|
+
result.identificationTypes = identificationTypes.map(item => ({
|
|
55
|
+
id: item.idTipoIdentificacion,
|
|
56
|
+
code: item.codigo,
|
|
57
|
+
value: item.descripcion,
|
|
58
|
+
sriCode: item.codigoSri,
|
|
59
|
+
}));
|
|
60
|
+
result.tipoContribuyentes = mainData[1];
|
|
61
|
+
result.tiempoCreditos = mainData[2] || [];
|
|
62
|
+
result.cities = cities.reduce((acc, ciudade) => {
|
|
63
|
+
const dataExists = acc.find((c) => c.idProvincia === ciudade.idProvincia);
|
|
64
|
+
if (!dataExists) {
|
|
65
|
+
acc.push({
|
|
66
|
+
id: ciudade.idProvincia,
|
|
67
|
+
value: ciudade.provincia,
|
|
68
|
+
cities: [
|
|
69
|
+
{
|
|
70
|
+
id: ciudade.idCiudad,
|
|
71
|
+
value: ciudade.ciudad,
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
dataExists.cities.push({
|
|
78
|
+
id: ciudade.idCiudad,
|
|
79
|
+
value: ciudade.ciudad,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return acc;
|
|
83
|
+
}, []);
|
|
84
|
+
result.tiposCliente = mainData[4] || [];
|
|
85
|
+
result.empresas = mainData[5] || [];
|
|
86
|
+
result.cargos = mainData[6] || [];
|
|
87
|
+
result.formasPagoSri = mainData[7] || [];
|
|
88
|
+
result.housingTypes = mainData[8] || [];
|
|
89
|
+
result.maritalStatuses = mainData[9] || [];
|
|
90
|
+
result.employees = mainData[10] || [];
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
322
94
|
toModel(dto) {
|
|
323
95
|
return {
|
|
324
96
|
name: `Esto de mapper default - ${dto.name}`,
|
|
@@ -366,10 +138,11 @@ class CompanyCustomerDefaultMapper {
|
|
|
366
138
|
const parsed = JSON.parse(response.payload);
|
|
367
139
|
const tempList = Array.isArray(parsed) ? parsed[0] : parsed.Table;
|
|
368
140
|
console.log(tempList);
|
|
369
|
-
const mapClient = (data) => ({
|
|
141
|
+
const mapClient = (data, index) => ({
|
|
142
|
+
index: index + 1,
|
|
370
143
|
clientId: data.idCliente,
|
|
371
144
|
identificationTypeId: data.idTipoIdentificacion,
|
|
372
|
-
|
|
145
|
+
idCard: data.numeroIdentificacion,
|
|
373
146
|
tradeName: data.nombreComercial,
|
|
374
147
|
legalName: data.nombreFiscal,
|
|
375
148
|
address: data.direccion,
|
|
@@ -380,9 +153,9 @@ class CompanyCustomerDefaultMapper {
|
|
|
380
153
|
identificationType: data.tipoIdentificacion,
|
|
381
154
|
identificationTypeCode: data.codTipoIdentificacion,
|
|
382
155
|
status: data.estado,
|
|
383
|
-
|
|
156
|
+
totalRecords: data.totalRecords,
|
|
384
157
|
});
|
|
385
|
-
const list = tempList.map((item) => mapClient(item));
|
|
158
|
+
const list = tempList.map((item, index) => mapClient(item, index));
|
|
386
159
|
const totalRecords = response.totalRecords ?? (list[0]?.totalRecords || 0);
|
|
387
160
|
return {
|
|
388
161
|
data: list,
|
|
@@ -438,16 +211,25 @@ class CompanyCustomerDefaultMapper {
|
|
|
438
211
|
}
|
|
439
212
|
}
|
|
440
213
|
|
|
441
|
-
class
|
|
214
|
+
class CompanyCustomerHttp {
|
|
442
215
|
apiUrl = '/FactElect/CompanyCustomer/';
|
|
443
216
|
http = inject(HttpClient);
|
|
444
217
|
mapper = inject(COMPANY_CUSTOMER_MAPPER, { optional: true }) ?? new CompanyCustomerDefaultMapper();
|
|
218
|
+
getFormData() {
|
|
219
|
+
const json = JSON.stringify({
|
|
220
|
+
tipo: 2,
|
|
221
|
+
});
|
|
222
|
+
return this.http
|
|
223
|
+
.get(`${this.apiUrl}?json=${json}`)
|
|
224
|
+
.pipe(map(response => this.mapper.toModelFormData(response)));
|
|
225
|
+
}
|
|
445
226
|
list(params) {
|
|
446
227
|
console.log(params);
|
|
447
228
|
const json = JSON.stringify({
|
|
448
229
|
pageIndex: params.pageIndex || 1,
|
|
449
230
|
pageSize: params.pageSize || 10,
|
|
450
231
|
tipo: 1,
|
|
232
|
+
...params,
|
|
451
233
|
});
|
|
452
234
|
return this.http
|
|
453
235
|
.get(`${this.apiUrl}?json=${json}`)
|
|
@@ -482,10 +264,10 @@ class CompanyCustomerService {
|
|
|
482
264
|
isValidPhone(phone) {
|
|
483
265
|
return /^\d{10}$/.test(phone.replace(/\D/g, ''));
|
|
484
266
|
}
|
|
485
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
486
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.
|
|
267
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerHttp, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
268
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerHttp, providedIn: 'root' });
|
|
487
269
|
}
|
|
488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
270
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerHttp, decorators: [{
|
|
489
271
|
type: Injectable,
|
|
490
272
|
args: [{
|
|
491
273
|
providedIn: 'root',
|
|
@@ -580,17 +362,312 @@ class CustomerValidators {
|
|
|
580
362
|
}
|
|
581
363
|
}
|
|
582
364
|
|
|
583
|
-
|
|
365
|
+
const MAIN_APP_COMPANY_CUSTOMER_CONFIG = {
|
|
366
|
+
fields: {
|
|
367
|
+
// IDs y referencias
|
|
368
|
+
idTipoIdentificacion: {
|
|
369
|
+
name: 'idTipoIdentificacion',
|
|
370
|
+
required: true,
|
|
371
|
+
visible: true,
|
|
372
|
+
label: 'Tipo de Identificación',
|
|
373
|
+
placeholder: 'Seleccione tipo',
|
|
374
|
+
},
|
|
375
|
+
idFormaPagoSri: {
|
|
376
|
+
name: 'idFormaPagoSri',
|
|
377
|
+
required: false,
|
|
378
|
+
visible: true,
|
|
379
|
+
label: 'Forma de Pago SRI',
|
|
380
|
+
placeholder: 'Seleccione forma de pago',
|
|
381
|
+
},
|
|
382
|
+
idTipoClienteProveedor: {
|
|
383
|
+
name: 'idTipoClienteProveedor',
|
|
384
|
+
required: false,
|
|
385
|
+
visible: true,
|
|
386
|
+
label: 'Tipo de Cliente/Proveedor',
|
|
387
|
+
placeholder: 'Seleccione tipo',
|
|
388
|
+
},
|
|
389
|
+
idSubContribuyente: {
|
|
390
|
+
name: 'idSubContribuyente',
|
|
391
|
+
required: false,
|
|
392
|
+
visible: true,
|
|
393
|
+
label: 'Sub-Contribuyente',
|
|
394
|
+
placeholder: 'Seleccione',
|
|
395
|
+
},
|
|
396
|
+
idTiempoCredito: {
|
|
397
|
+
name: 'idTiempoCredito',
|
|
398
|
+
required: false,
|
|
399
|
+
visible: true,
|
|
400
|
+
label: 'Tiempo de Crédito',
|
|
401
|
+
placeholder: 'Días de crédito',
|
|
402
|
+
},
|
|
403
|
+
idCiudad: {
|
|
404
|
+
name: 'idCiudad',
|
|
405
|
+
required: false,
|
|
406
|
+
visible: true,
|
|
407
|
+
label: 'Ciudad',
|
|
408
|
+
placeholder: 'Seleccione ciudad',
|
|
409
|
+
},
|
|
410
|
+
idCargo: {
|
|
411
|
+
name: 'idCargo',
|
|
412
|
+
required: false,
|
|
413
|
+
visible: true,
|
|
414
|
+
label: 'Cargo',
|
|
415
|
+
placeholder: 'Seleccione cargo',
|
|
416
|
+
},
|
|
417
|
+
idEmpleado: {
|
|
418
|
+
name: 'idEmpleado',
|
|
419
|
+
required: false,
|
|
420
|
+
visible: true,
|
|
421
|
+
label: 'Empleado Responsable',
|
|
422
|
+
placeholder: 'Seleccione empleado',
|
|
423
|
+
},
|
|
424
|
+
// Datos principales
|
|
425
|
+
numeroIdentificacion: {
|
|
426
|
+
name: 'numeroIdentificacion',
|
|
427
|
+
required: true,
|
|
428
|
+
visible: true,
|
|
429
|
+
label: 'RUC / Cédula',
|
|
430
|
+
placeholder: 'Ingrese número de identificación (13 dígitos para RUC)',
|
|
431
|
+
},
|
|
432
|
+
nombreFiscal: {
|
|
433
|
+
name: 'nombreFiscal',
|
|
434
|
+
required: true,
|
|
435
|
+
visible: true,
|
|
436
|
+
label: 'Razón Social / Nombre Fiscal',
|
|
437
|
+
placeholder: 'Ingrese razón social completa',
|
|
438
|
+
},
|
|
439
|
+
nombreComercial: {
|
|
440
|
+
name: 'nombreComercial',
|
|
441
|
+
required: false,
|
|
442
|
+
visible: true,
|
|
443
|
+
label: 'Nombre Comercial',
|
|
444
|
+
placeholder: 'Ingrese nombre comercial',
|
|
445
|
+
},
|
|
446
|
+
direccion: {
|
|
447
|
+
name: 'direccion',
|
|
448
|
+
required: true,
|
|
449
|
+
visible: true,
|
|
450
|
+
label: 'Dirección',
|
|
451
|
+
placeholder: 'Calle principal y secundaria',
|
|
452
|
+
},
|
|
453
|
+
correo: {
|
|
454
|
+
name: 'correo',
|
|
455
|
+
required: false,
|
|
456
|
+
visible: true,
|
|
457
|
+
label: 'Correo Electrónico',
|
|
458
|
+
placeholder: 'ejemplo@correo.com',
|
|
459
|
+
},
|
|
460
|
+
telefono: {
|
|
461
|
+
name: 'telefono',
|
|
462
|
+
required: false,
|
|
463
|
+
visible: true,
|
|
464
|
+
label: 'Teléfono',
|
|
465
|
+
placeholder: '0999999999',
|
|
466
|
+
},
|
|
467
|
+
placa: {
|
|
468
|
+
name: 'placa',
|
|
469
|
+
required: false,
|
|
470
|
+
visible: true,
|
|
471
|
+
label: 'Placa del Vehículo',
|
|
472
|
+
placeholder: 'ABC-1234',
|
|
473
|
+
},
|
|
474
|
+
nota: {
|
|
475
|
+
name: 'nota',
|
|
476
|
+
required: false,
|
|
477
|
+
visible: true,
|
|
478
|
+
label: 'Notas',
|
|
479
|
+
placeholder: 'Observaciones adicionales',
|
|
480
|
+
},
|
|
481
|
+
birthDate: {
|
|
482
|
+
name: 'birthDate',
|
|
483
|
+
required: false,
|
|
484
|
+
visible: true,
|
|
485
|
+
label: 'Fecha de Nacimiento',
|
|
486
|
+
placeholder: 'DD/MM/AAAA',
|
|
487
|
+
},
|
|
488
|
+
// Estados
|
|
489
|
+
estado: {
|
|
490
|
+
name: 'estado',
|
|
491
|
+
required: false,
|
|
492
|
+
visible: true,
|
|
493
|
+
label: 'Activo',
|
|
494
|
+
},
|
|
495
|
+
validationSri: {
|
|
496
|
+
name: 'validationSri',
|
|
497
|
+
required: false,
|
|
498
|
+
visible: true,
|
|
499
|
+
label: 'Validado en SRI',
|
|
500
|
+
},
|
|
501
|
+
configValorBruto: {
|
|
502
|
+
name: 'configValorBruto',
|
|
503
|
+
required: false,
|
|
504
|
+
visible: true,
|
|
505
|
+
label: 'Configurar Valor Bruto',
|
|
506
|
+
},
|
|
507
|
+
},
|
|
508
|
+
// Información de crédito
|
|
509
|
+
showCreditInfo: true,
|
|
510
|
+
creditFields: {
|
|
511
|
+
maritalStatusId: {
|
|
512
|
+
name: 'maritalStatusId',
|
|
513
|
+
required: false,
|
|
514
|
+
visible: true,
|
|
515
|
+
label: 'Estado Civil',
|
|
516
|
+
placeholder: 'Seleccione',
|
|
517
|
+
},
|
|
518
|
+
conyugeNombre: {
|
|
519
|
+
name: 'conyugeNombre',
|
|
520
|
+
required: false,
|
|
521
|
+
visible: true,
|
|
522
|
+
label: 'Nombre del Cónyuge',
|
|
523
|
+
placeholder: 'Ingrese nombre',
|
|
524
|
+
},
|
|
525
|
+
conyugeTel: {
|
|
526
|
+
name: 'conyugeTel',
|
|
527
|
+
required: false,
|
|
528
|
+
visible: true,
|
|
529
|
+
label: 'Teléfono del Cónyuge',
|
|
530
|
+
placeholder: '0999999999',
|
|
531
|
+
},
|
|
532
|
+
refFamNombre: {
|
|
533
|
+
name: 'refFamNombre',
|
|
534
|
+
required: false,
|
|
535
|
+
visible: true,
|
|
536
|
+
label: 'Referencia Familiar',
|
|
537
|
+
placeholder: 'Nombre',
|
|
538
|
+
},
|
|
539
|
+
refFamTel: {
|
|
540
|
+
name: 'refFamTel',
|
|
541
|
+
required: false,
|
|
542
|
+
visible: true,
|
|
543
|
+
label: 'Teléfono Referencia',
|
|
544
|
+
placeholder: '0999999999',
|
|
545
|
+
},
|
|
546
|
+
housingTypeId: {
|
|
547
|
+
name: 'housingTypeId',
|
|
548
|
+
required: false,
|
|
549
|
+
visible: true,
|
|
550
|
+
label: 'Tipo de Vivienda',
|
|
551
|
+
placeholder: 'Seleccione',
|
|
552
|
+
},
|
|
553
|
+
dirVivienda: {
|
|
554
|
+
name: 'dirVivienda',
|
|
555
|
+
required: false,
|
|
556
|
+
visible: true,
|
|
557
|
+
label: 'Dirección de Vivienda',
|
|
558
|
+
placeholder: 'Dirección completa',
|
|
559
|
+
},
|
|
560
|
+
refDomicilio: {
|
|
561
|
+
name: 'refDomicilio',
|
|
562
|
+
required: false,
|
|
563
|
+
visible: true,
|
|
564
|
+
label: 'Referencia de Domicilio',
|
|
565
|
+
placeholder: 'Referencia',
|
|
566
|
+
},
|
|
567
|
+
sector: {
|
|
568
|
+
name: 'sector',
|
|
569
|
+
required: false,
|
|
570
|
+
visible: true,
|
|
571
|
+
label: 'Sector',
|
|
572
|
+
placeholder: 'Ingrese sector',
|
|
573
|
+
},
|
|
574
|
+
barrio: {
|
|
575
|
+
name: 'barrio',
|
|
576
|
+
required: false,
|
|
577
|
+
visible: true,
|
|
578
|
+
label: 'Barrio',
|
|
579
|
+
placeholder: 'Ingrese barrio',
|
|
580
|
+
},
|
|
581
|
+
calle: {
|
|
582
|
+
name: 'calle',
|
|
583
|
+
required: false,
|
|
584
|
+
visible: true,
|
|
585
|
+
label: 'Calle',
|
|
586
|
+
placeholder: 'Calle principal',
|
|
587
|
+
},
|
|
588
|
+
},
|
|
589
|
+
submitButtonText: 'Guardar Cliente',
|
|
590
|
+
cancelButtonText: 'Cancelar',
|
|
591
|
+
};
|
|
592
|
+
// Configuración MÍNIMA para POS
|
|
593
|
+
const POS_COMPANY_CUSTOMER_CONFIG = {
|
|
594
|
+
fields: {
|
|
595
|
+
// Solo lo esencial
|
|
596
|
+
idTipoIdentificacion: {
|
|
597
|
+
name: 'idTipoIdentificacion',
|
|
598
|
+
required: true,
|
|
599
|
+
visible: true,
|
|
600
|
+
label: 'Tipo ID',
|
|
601
|
+
placeholder: 'Tipo',
|
|
602
|
+
},
|
|
603
|
+
numeroIdentificacion: {
|
|
604
|
+
name: 'numeroIdentificacion',
|
|
605
|
+
required: true,
|
|
606
|
+
visible: true,
|
|
607
|
+
label: 'Cédula/RUC',
|
|
608
|
+
placeholder: 'Número de identificación',
|
|
609
|
+
},
|
|
610
|
+
nombreFiscal: {
|
|
611
|
+
name: 'nombreFiscal',
|
|
612
|
+
required: true,
|
|
613
|
+
visible: true,
|
|
614
|
+
label: 'Nombre',
|
|
615
|
+
placeholder: 'Nombre del cliente',
|
|
616
|
+
},
|
|
617
|
+
nombreComercial: {
|
|
618
|
+
name: 'nombreComercial',
|
|
619
|
+
required: false,
|
|
620
|
+
visible: false,
|
|
621
|
+
},
|
|
622
|
+
direccion: {
|
|
623
|
+
name: 'direccion',
|
|
624
|
+
required: false,
|
|
625
|
+
visible: true,
|
|
626
|
+
label: 'Dirección',
|
|
627
|
+
placeholder: 'Dirección',
|
|
628
|
+
},
|
|
629
|
+
correo: {
|
|
630
|
+
name: 'correo',
|
|
631
|
+
required: false,
|
|
632
|
+
visible: false,
|
|
633
|
+
},
|
|
634
|
+
telefono: {
|
|
635
|
+
name: 'telefono',
|
|
636
|
+
required: false,
|
|
637
|
+
visible: true,
|
|
638
|
+
label: 'Teléfono',
|
|
639
|
+
placeholder: 'Teléfono',
|
|
640
|
+
},
|
|
641
|
+
// Resto oculto
|
|
642
|
+
idFormaPagoSri: { name: 'idFormaPagoSri', required: false, visible: false },
|
|
643
|
+
idTipoClienteProveedor: { name: 'idTipoClienteProveedor', required: false, visible: false },
|
|
644
|
+
idSubContribuyente: { name: 'idSubContribuyente', required: false, visible: false },
|
|
645
|
+
idTiempoCredito: { name: 'idTiempoCredito', required: false, visible: false },
|
|
646
|
+
idCiudad: { name: 'idCiudad', required: false, visible: false },
|
|
647
|
+
idCargo: { name: 'idCargo', required: false, visible: false },
|
|
648
|
+
idEmpleado: { name: 'idEmpleado', required: false, visible: false },
|
|
649
|
+
placa: { name: 'placa', required: false, visible: false },
|
|
650
|
+
nota: { name: 'nota', required: false, visible: false },
|
|
651
|
+
birthDate: { name: 'birthDate', required: false, visible: false },
|
|
652
|
+
estado: { name: 'estado', required: false, visible: false },
|
|
653
|
+
validationSri: { name: 'validationSri', required: false, visible: false },
|
|
654
|
+
configValorBruto: { name: 'configValorBruto', required: false, visible: false },
|
|
655
|
+
},
|
|
656
|
+
showCreditInfo: false, // Sin info de crédito en POS
|
|
657
|
+
submitButtonText: 'Agregar',
|
|
658
|
+
cancelButtonText: 'Cancelar',
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
class CompanyCustomerForm {
|
|
584
662
|
formId = input(...(ngDevMode ? [undefined, { debugName: "formId" }] : []));
|
|
585
|
-
customer;
|
|
586
|
-
mode = 'create';
|
|
663
|
+
customer = input({}, ...(ngDevMode ? [{ debugName: "customer" }] : []));
|
|
664
|
+
mode = input('create', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
587
665
|
showButtons = input(true, ...(ngDevMode ? [{ debugName: "showButtons" }] : []));
|
|
588
666
|
submitted = output();
|
|
589
667
|
cancelled = output();
|
|
590
|
-
panelOpenState = signal(false, ...(ngDevMode ? [{ debugName: "panelOpenState" }] : []));
|
|
591
668
|
fb = inject(FormBuilder);
|
|
592
669
|
config = inject(COMPANY_CUSTOMER_FORM_CONFIG, { optional: true }) ?? MAIN_APP_COMPANY_CUSTOMER_CONFIG;
|
|
593
|
-
customerService = inject(
|
|
670
|
+
customerService = inject(COMPANY_CUSTOMER_HTTP_TOKEN, { optional: true }) ?? inject(CompanyCustomerHttp);
|
|
594
671
|
form;
|
|
595
672
|
isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
596
673
|
errorMessage = null;
|
|
@@ -600,7 +677,7 @@ class CompanyCustomerFormComponent {
|
|
|
600
677
|
tiemposCredito = signal([], ...(ngDevMode ? [{ debugName: "tiemposCredito" }] : []));
|
|
601
678
|
tipoContribuyentes = signal([], ...(ngDevMode ? [{ debugName: "tipoContribuyentes" }] : []));
|
|
602
679
|
tiposCliente = signal([], ...(ngDevMode ? [{ debugName: "tiposCliente" }] : []));
|
|
603
|
-
|
|
680
|
+
identificationTypes = signal([], ...(ngDevMode ? [{ debugName: "identificationTypes" }] : []));
|
|
604
681
|
formasPagoSri = signal([], ...(ngDevMode ? [{ debugName: "formasPagoSri" }] : []));
|
|
605
682
|
placas = signal([], ...(ngDevMode ? [{ debugName: "placas" }] : []));
|
|
606
683
|
ciudades = signal([], ...(ngDevMode ? [{ debugName: "ciudades" }] : []));
|
|
@@ -609,21 +686,54 @@ class CompanyCustomerFormComponent {
|
|
|
609
686
|
employees = signal([], ...(ngDevMode ? [{ debugName: "employees" }] : []));
|
|
610
687
|
maritalStatuses = signal([], ...(ngDevMode ? [{ debugName: "maritalStatuses" }] : []));
|
|
611
688
|
housingTypes = signal([], ...(ngDevMode ? [{ debugName: "housingTypes" }] : []));
|
|
612
|
-
showRefresh = signal(true, ...(ngDevMode ? [{ debugName: "showRefresh" }] : []));
|
|
613
689
|
setStep(index) {
|
|
614
690
|
this.step.set(index);
|
|
615
691
|
}
|
|
616
|
-
|
|
617
|
-
this.
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
692
|
+
loadFormData() {
|
|
693
|
+
if (this.mode() === 'edit') {
|
|
694
|
+
return forkJoin([
|
|
695
|
+
from(this.customerService.getFormData()),
|
|
696
|
+
// from(this.customerService.getById(this.params.id)),
|
|
697
|
+
]);
|
|
698
|
+
}
|
|
699
|
+
return from(this.customerService.getFormData());
|
|
621
700
|
}
|
|
622
701
|
ngOnInit() {
|
|
623
702
|
this.buildForm();
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
703
|
+
this.loadFormData().subscribe(response => {
|
|
704
|
+
const mainDataForm = Array.isArray(response)
|
|
705
|
+
? response[0].data
|
|
706
|
+
: response;
|
|
707
|
+
console.log(response);
|
|
708
|
+
this.identificationTypes.set(mainDataForm.identificationTypes);
|
|
709
|
+
/* this.tiemposCredito.set(mainDataForm.tiempoCreditos);
|
|
710
|
+
this.tipoContribuyentes.set(mainDataForm.tipoContribuyentes);
|
|
711
|
+
this.formasPagoSri.set(mainDataForm.formasPagoSri);
|
|
712
|
+
this.tiposCliente.set(mainDataForm.tiposCliente);
|
|
713
|
+
this.ciudades.set(mainDataForm.ciudades);
|
|
714
|
+
this.cargos.set(mainDataForm.cargos);
|
|
715
|
+
this.empresas.set(mainDataForm.empresas);
|
|
716
|
+
this.employees.set(mainDataForm.employees);
|
|
717
|
+
this.maritalStatuses.set(mainDataForm.maritalStatuses);
|
|
718
|
+
this.housingTypes.set(mainDataForm.housingTypes);*/
|
|
719
|
+
if (this.mode() === 'create') {
|
|
720
|
+
const dataIdentificacion = this.identificationTypes().find(ti => ti.sriCode === SRI_DOCUMENT_TYPE.RUC);
|
|
721
|
+
if (dataIdentificacion) {
|
|
722
|
+
this.form.patchValue({
|
|
723
|
+
idTipoIdentificacion: dataIdentificacion.id,
|
|
724
|
+
});
|
|
725
|
+
// this.setIdentificationTypeChange(dataIdentificacion.codigoSri);
|
|
726
|
+
}
|
|
727
|
+
if (this.tiemposCredito().length > 0) {
|
|
728
|
+
this.form.patchValue({
|
|
729
|
+
idTiempoCredito: this.tiemposCredito()[0].id,
|
|
730
|
+
});
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
/* if (this.customer) {
|
|
735
|
+
this.patchFormValue(this.customer());
|
|
736
|
+
}*/
|
|
627
737
|
}
|
|
628
738
|
getDefaultConfig() {
|
|
629
739
|
// Configuración por defecto
|
|
@@ -801,9 +911,9 @@ class CompanyCustomerFormComponent {
|
|
|
801
911
|
}
|
|
802
912
|
this.isLoading.set(true);
|
|
803
913
|
this.errorMessage = null;
|
|
804
|
-
const operation$ = this.mode === 'create'
|
|
914
|
+
const operation$ = this.mode() === 'create'
|
|
805
915
|
? this.customerService.create(customerData)
|
|
806
|
-
: this.customerService.update(this.customer.id, customerData);
|
|
916
|
+
: this.customerService.update(this.customer().id, customerData);
|
|
807
917
|
operation$.subscribe({
|
|
808
918
|
next: (savedCustomer) => {
|
|
809
919
|
this.isLoading.set(false);
|
|
@@ -857,10 +967,10 @@ class CompanyCustomerFormComponent {
|
|
|
857
967
|
$event.stopPropagation();
|
|
858
968
|
console.log('search');
|
|
859
969
|
}
|
|
860
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.
|
|
861
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: CompanyCustomerFormComponent, isStandalone: true, selector: "acp-company-customer-form", inputs: { formId: { classPropertyName: "formId", publicName: "formId", isSignal: true, isRequired: false, transformFunction: null }, customer: { classPropertyName: "customer", publicName: "customer", isSignal: false, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: false, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted", cancelled: "cancelled" }, exportAs: ["acpCustomerForm"], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [id]=\"formId()\" class=\"mb-2\">\n @if (errorMessage) {\n <div class=\"alert alert-error\">{{ errorMessage }}</div>\n }\n <mat-accordion class=\"mb-2\">\n <mat-expansion-panel [expanded]=\"step() === 0\" (opened)=\"setStep(0)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>account_circle</mat-icon>\n Datos Principales\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div class=\"d-grid gap-2 mx-3 mt-2\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n @if (isFieldVisible('idTipoIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('idTipoIdentificacion') }} </mat-label>\n <mat-select\n formControlName=\"idTipoIdentificacion\"\n (selectionChange)=\"identificationTypeChange($event)\"\n >\n @for (item of tiposIdentificacion(); track $index) {\n <mat-option [value]=\"item.idTipoIdentificacion\">{{ item.descripcion }}</mat-option>\n }\n </mat-select>\n @if (form.get('idTipoIdentificacion')?.invalid &&\n form.get('idTipoIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('idTipoIdentificacion') }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n\n <div class=\"col\">\n <!-- N\u00FAmero de Identificaci\u00F3n -->\n @if (isFieldVisible('numeroIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('numeroIdentificacion') }} </mat-label>\n <input\n matInput\n formControlName=\"numeroIdentificacion\"\n [placeholder]=\"getFieldPlaceholder('numeroIdentificacion')\"\n />\n @if (form.get('numeroIdentificacion')?.invalid &&\n form.get('numeroIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('numeroIdentificacion') }}</mat-error>\n }\n <ng-container matSuffix>\n <button type=\"button\" mat-icon-button (click)=\"searchIdentificacion($event)\">\n <mat-icon>search</mat-icon>\n </button>\n </ng-container>\n </mat-form-field>\n }\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('nombreFiscal')){\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreFiscal') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreFiscal\"\n [placeholder]=\"getFieldPlaceholder('nombreFiscal')\"\n acpToUpperCase\n />\n @if (form.get('nombreFiscal')?.invalid && form.get('nombreFiscal')?.touched) {\n <mat-error> {{ getErrorMessage('nombreFiscal') }}</mat-error>\n }\n </mat-form-field>\n </div>\n\n } @if (isFieldVisible('nombreComercial')) {\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreComercial') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreComercial\"\n [placeholder]=\"getFieldPlaceholder('nombreComercial')\"\n acpToUpperCase\n type=\"text\"\n />\n </mat-form-field>\n </div>\n\n }\n </div>\n\n @if (isFieldVisible('direccion')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('direccion') }}:</mat-label>\n <input\n matInput\n formControlName=\"direccion\"\n [placeholder]=\"getFieldPlaceholder('direccion')\"\n acpToUpperCase\n />\n @if (form.get('direccion')?.invalid && form.get('direccion')?.touched) {\n <mat-error>{{ getErrorMessage('direccion') }}</mat-error>\n }\n </mat-form-field>\n }\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('correo')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"emails\" [labelText]=\"getFieldLabel('correo')\" />\n </div>\n } @if (isFieldVisible('telefono')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"telephones\" [labelText]=\"getFieldLabel('telefono')\" />\n </div>\n }\n </div>\n </div>\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Siguiente\"\n (handleClick)=\"nextStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 1\" (opened)=\"setStep(1)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n Comercial </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"d-grid gap-2 mx-3\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Forma de pago: </mat-label>\n <mat-select formControlName=\"idFormaPagoSri\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of formasPagoSri(); track $index) {\n <mat-option [value]=\"item.idFormaPagoSri\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tiempo Cr\u00E9dito: </mat-label>\n <mat-select formControlName=\"idTiempoCredito\">\n @for (item of tiemposCredito(); track $index) {\n <mat-option [value]=\"item.idTiempoCredito\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo Cliente: </mat-label>\n <mat-select formControlName=\"idTipoClienteProveedor\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n @for (item of tiposCliente(); track $index) {\n <mat-option [value]=\"item.idTipoClienteProveedor\">\n {{ item.descripcion }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Empleado: </mat-label>\n <mat-select formControlName=\"idEmpleado\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of employees(); track $index) {\n <mat-option [value]=\"item.idEmpleado\"> {{ item.nombreCompleto }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field>\n <mat-label>Country</mat-label>\n <input matInput />\n </mat-form-field>\n </div>\n\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Atr\u00E1s\"\n (handleClick)=\"prevStep()\"\n />\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Siguiente\"\n (handleClick)=\"nextStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 2\" (opened)=\"setStep(2)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n de Cr\u00E9dito </mat-panel-title>\n </mat-expansion-panel-header>\n\n <section class=\"d-grid gap-2 mx-2\" formGroupName=\"dataInfoCred\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Estado Civil: </mat-label>\n <mat-select formControlName=\"maritalStatusId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of maritalStatuses(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo de Vivienda: </mat-label>\n <mat-select formControlName=\"housingTypeId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of housingTypes(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Nombre del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeNombre\" placeholder=\"Nombre del c\u00F3nyuge\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia Familiar:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono Referencia:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Direcci\u00F3n de Vivienda</mat-label>\n <textarea\n matInput\n formControlName=\"dirVivienda\"\n placeholder=\"Direcci\u00F3n completa de la vivienda (Sector, Barrio y Calle)\"\n ></textarea>\n </mat-form-field>\n\n <div\n class=\"row row-cols-xxl-3 row-cols-xl-3 row-cols-lg-3 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Sector:</mat-label>\n <input matInput formControlName=\"sector\" placeholder=\"Nombre del sector\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Barrio:</mat-label>\n <input matInput formControlName=\"barrio\" placeholder=\"Nombre del barrio\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Calle:</mat-label>\n <input matInput formControlName=\"calle\" placeholder=\"Nombre de la calle\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia de Domicilio</mat-label>\n <textarea\n matInput\n formControlName=\"refDomicilio\"\n placeholder=\"Descripci\u00F3n detallada del punto de referencia\"\n ></textarea>\n </mat-form-field>\n </section>\n\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Atr\u00E1s\"\n (handleClick)=\"prevStep()\"\n />\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Siguiente\"\n (handleClick)=\"nextStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 3\" (opened)=\"setStep(3)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Notas</mat-panel-title>\n </mat-expansion-panel-header>\n\n @if (isFieldVisible('nota')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nota') }} </mat-label>\n <textarea\n matInput\n formControlName=\"nota\"\n [placeholder]=\"getFieldPlaceholder('nota')\"\n rows=\"3\"\n ></textarea>\n </mat-form-field>\n }\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Atr\u00E1s\"\n (handleClick)=\"prevStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n </mat-accordion>\n\n <!-- Buttons -->\n @if (showButtons()){\n <div class=\"form-actions\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\" [disabled]=\"isLoading()\">\n {{ config.cancelButtonText }}\n </button>\n\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"isLoading() || form.invalid\">\n @if (!isLoading()) {\n <span>{{ config.submitButtonText }}</span>\n } @else {\n <span>Guardando...</span>\n }\n </button>\n </div>\n\n }\n</form>\n", styles: [".alert{padding:12px 16px;border-radius:6px;margin-bottom:20px;font-size:14px}.alert.alert-error{background-color:#fef2f2;border:1px solid #fecaca;color:#991b1b}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i4.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i4.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "directive", type: i4.MatExpansionPanelActionRow, selector: "mat-action-row" }, { kind: "component", type: i4.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i4.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }, { kind: "directive", type: ToUpperCase, selector: "[acpToUpperCase]" }, { kind: "component", type: InputChip, selector: "acp-input-chip", inputs: ["chips", "labelText", "placelholder"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
970
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
971
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: CompanyCustomerForm, isStandalone: true, selector: "acp-company-customer-form", inputs: { formId: { classPropertyName: "formId", publicName: "formId", isSignal: true, isRequired: false, transformFunction: null }, customer: { classPropertyName: "customer", publicName: "customer", isSignal: true, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { submitted: "submitted", cancelled: "cancelled" }, exportAs: ["acpCustomerForm"], ngImport: i0, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [id]=\"formId()\" class=\"mb-2\">\n @if (errorMessage) {\n <div class=\"alert alert-error\">{{ errorMessage }}</div>\n }\n <mat-accordion class=\"mb-2\">\n <mat-expansion-panel [expanded]=\"step() === 0\" (opened)=\"setStep(0)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>account_circle</mat-icon>\n Datos Principales\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div class=\"d-grid gap-2 mx-3 mt-2\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n @if (isFieldVisible('idTipoIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('idTipoIdentificacion') }} </mat-label>\n <mat-select\n formControlName=\"idTipoIdentificacion\"\n (selectionChange)=\"identificationTypeChange($event)\"\n >\n @for (item of identificationTypes(); track $index) {\n <mat-option [value]=\"item.id\">{{ item.value }}</mat-option>\n }\n </mat-select>\n @if (form.get('idTipoIdentificacion')?.invalid &&\n form.get('idTipoIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('idTipoIdentificacion') }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n\n <div class=\"col\">\n <!-- N\u00FAmero de Identificaci\u00F3n -->\n @if (isFieldVisible('numeroIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('numeroIdentificacion') }} </mat-label>\n <input\n matInput\n formControlName=\"numeroIdentificacion\"\n [placeholder]=\"getFieldPlaceholder('numeroIdentificacion')\"\n />\n @if (form.get('numeroIdentificacion')?.invalid &&\n form.get('numeroIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('numeroIdentificacion') }}</mat-error>\n }\n <ng-container matSuffix>\n <button type=\"button\" mat-icon-button (click)=\"searchIdentificacion($event)\">\n <mat-icon>search</mat-icon>\n </button>\n </ng-container>\n </mat-form-field>\n }\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('nombreFiscal')){\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreFiscal') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreFiscal\"\n [placeholder]=\"getFieldPlaceholder('nombreFiscal')\"\n acpToUpperCase\n />\n @if (form.get('nombreFiscal')?.invalid && form.get('nombreFiscal')?.touched) {\n <mat-error> {{ getErrorMessage('nombreFiscal') }}</mat-error>\n }\n </mat-form-field>\n </div>\n\n } @if (isFieldVisible('nombreComercial')) {\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreComercial') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreComercial\"\n [placeholder]=\"getFieldPlaceholder('nombreComercial')\"\n acpToUpperCase\n type=\"text\"\n />\n </mat-form-field>\n </div>\n\n }\n </div>\n\n @if (isFieldVisible('direccion')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('direccion') }}:</mat-label>\n <input\n matInput\n formControlName=\"direccion\"\n [placeholder]=\"getFieldPlaceholder('direccion')\"\n acpToUpperCase\n />\n @if (form.get('direccion')?.invalid && form.get('direccion')?.touched) {\n <mat-error>{{ getErrorMessage('direccion') }}</mat-error>\n }\n </mat-form-field>\n }\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('correo')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"emails\" [labelText]=\"getFieldLabel('correo')\" />\n </div>\n } @if (isFieldVisible('telefono')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"telephones\" [labelText]=\"getFieldLabel('telefono')\" />\n </div>\n }\n </div>\n </div>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 1\" (opened)=\"setStep(1)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n Comercial </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"d-grid gap-2 mx-3\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Forma de pago: </mat-label>\n <mat-select formControlName=\"idFormaPagoSri\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of formasPagoSri(); track $index) {\n <mat-option [value]=\"item.idFormaPagoSri\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tiempo Cr\u00E9dito: </mat-label>\n <mat-select formControlName=\"idTiempoCredito\">\n @for (item of tiemposCredito(); track $index) {\n <mat-option [value]=\"item.idTiempoCredito\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo Cliente: </mat-label>\n <mat-select formControlName=\"idTipoClienteProveedor\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n @for (item of tiposCliente(); track $index) {\n <mat-option [value]=\"item.idTipoClienteProveedor\">\n {{ item.descripcion }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Empleado: </mat-label>\n <mat-select formControlName=\"idEmpleado\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of employees(); track $index) {\n <mat-option [value]=\"item.idEmpleado\"> {{ item.nombreCompleto }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field>\n <mat-label>Country</mat-label>\n <input matInput />\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 2\" (opened)=\"setStep(2)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n de Cr\u00E9dito </mat-panel-title>\n </mat-expansion-panel-header>\n\n <section class=\"d-grid gap-2 mx-2\" formGroupName=\"dataInfoCred\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Estado Civil: </mat-label>\n <mat-select formControlName=\"maritalStatusId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of maritalStatuses(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo de Vivienda: </mat-label>\n <mat-select formControlName=\"housingTypeId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of housingTypes(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Nombre del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeNombre\" placeholder=\"Nombre del c\u00F3nyuge\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia Familiar:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono Referencia:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Direcci\u00F3n de Vivienda</mat-label>\n <textarea\n matInput\n formControlName=\"dirVivienda\"\n placeholder=\"Direcci\u00F3n completa de la vivienda (Sector, Barrio y Calle)\"\n ></textarea>\n </mat-form-field>\n\n <div\n class=\"row row-cols-xxl-3 row-cols-xl-3 row-cols-lg-3 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Sector:</mat-label>\n <input matInput formControlName=\"sector\" placeholder=\"Nombre del sector\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Barrio:</mat-label>\n <input matInput formControlName=\"barrio\" placeholder=\"Nombre del barrio\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Calle:</mat-label>\n <input matInput formControlName=\"calle\" placeholder=\"Nombre de la calle\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia de Domicilio</mat-label>\n <textarea\n matInput\n formControlName=\"refDomicilio\"\n placeholder=\"Descripci\u00F3n detallada del punto de referencia\"\n ></textarea>\n </mat-form-field>\n </section>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 3\" (opened)=\"setStep(3)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Notas</mat-panel-title>\n </mat-expansion-panel-header>\n\n @if (isFieldVisible('nota')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nota') }} </mat-label>\n <textarea\n matInput\n formControlName=\"nota\"\n [placeholder]=\"getFieldPlaceholder('nota')\"\n rows=\"3\"\n ></textarea>\n </mat-form-field>\n }\n </mat-expansion-panel>\n </mat-accordion>\n\n <!-- Buttons -->\n @if (showButtons()){\n <div class=\"form-actions\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\" [disabled]=\"isLoading()\">\n {{ config.cancelButtonText }}\n </button>\n\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"isLoading() || form.invalid\">\n @if (!isLoading()) {\n <span>{{ config.submitButtonText }}</span>\n } @else {\n <span>Guardando...</span>\n }\n </button>\n </div>\n\n }\n</form>\n", styles: [".alert{padding:12px 16px;border-radius:6px;margin-bottom:20px;font-size:14px}.alert.alert-error{background-color:#fef2f2;border:1px solid #fecaca;color:#991b1b}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i4.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i4.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i4.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i4.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: ToUpperCase, selector: "[acpToUpperCase]" }, { kind: "component", type: InputChip, selector: "acp-input-chip", inputs: ["chips", "labelText", "placelholder"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i6.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
862
972
|
}
|
|
863
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.
|
|
973
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerForm, decorators: [{
|
|
864
974
|
type: Component,
|
|
865
975
|
args: [{ selector: 'acp-company-customer-form', exportAs: 'acpCustomerForm', imports: [
|
|
866
976
|
ReactiveFormsModule,
|
|
@@ -869,25 +979,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
869
979
|
MatExpansionModule,
|
|
870
980
|
MatSelectModule,
|
|
871
981
|
MatIcon,
|
|
872
|
-
Button,
|
|
873
982
|
ToUpperCase,
|
|
874
983
|
InputChip,
|
|
875
984
|
MatButtonModule,
|
|
876
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [id]=\"formId()\" class=\"mb-2\">\n @if (errorMessage) {\n <div class=\"alert alert-error\">{{ errorMessage }}</div>\n }\n <mat-accordion class=\"mb-2\">\n <mat-expansion-panel [expanded]=\"step() === 0\" (opened)=\"setStep(0)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>account_circle</mat-icon>\n Datos Principales\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div class=\"d-grid gap-2 mx-3 mt-2\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n @if (isFieldVisible('idTipoIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('idTipoIdentificacion') }} </mat-label>\n <mat-select\n formControlName=\"idTipoIdentificacion\"\n (selectionChange)=\"identificationTypeChange($event)\"\n >\n @for (item of tiposIdentificacion(); track $index) {\n <mat-option [value]=\"item.idTipoIdentificacion\">{{ item.descripcion }}</mat-option>\n }\n </mat-select>\n @if (form.get('idTipoIdentificacion')?.invalid &&\n form.get('idTipoIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('idTipoIdentificacion') }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n\n <div class=\"col\">\n <!-- N\u00FAmero de Identificaci\u00F3n -->\n @if (isFieldVisible('numeroIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('numeroIdentificacion') }} </mat-label>\n <input\n matInput\n formControlName=\"numeroIdentificacion\"\n [placeholder]=\"getFieldPlaceholder('numeroIdentificacion')\"\n />\n @if (form.get('numeroIdentificacion')?.invalid &&\n form.get('numeroIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('numeroIdentificacion') }}</mat-error>\n }\n <ng-container matSuffix>\n <button type=\"button\" mat-icon-button (click)=\"searchIdentificacion($event)\">\n <mat-icon>search</mat-icon>\n </button>\n </ng-container>\n </mat-form-field>\n }\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('nombreFiscal')){\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreFiscal') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreFiscal\"\n [placeholder]=\"getFieldPlaceholder('nombreFiscal')\"\n acpToUpperCase\n />\n @if (form.get('nombreFiscal')?.invalid && form.get('nombreFiscal')?.touched) {\n <mat-error> {{ getErrorMessage('nombreFiscal') }}</mat-error>\n }\n </mat-form-field>\n </div>\n\n } @if (isFieldVisible('nombreComercial')) {\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreComercial') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreComercial\"\n [placeholder]=\"getFieldPlaceholder('nombreComercial')\"\n acpToUpperCase\n type=\"text\"\n />\n </mat-form-field>\n </div>\n\n }\n </div>\n\n @if (isFieldVisible('direccion')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('direccion') }}:</mat-label>\n <input\n matInput\n formControlName=\"direccion\"\n [placeholder]=\"getFieldPlaceholder('direccion')\"\n acpToUpperCase\n />\n @if (form.get('direccion')?.invalid && form.get('direccion')?.touched) {\n <mat-error>{{ getErrorMessage('direccion') }}</mat-error>\n }\n </mat-form-field>\n }\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('correo')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"emails\" [labelText]=\"getFieldLabel('correo')\" />\n </div>\n } @if (isFieldVisible('telefono')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"telephones\" [labelText]=\"getFieldLabel('telefono')\" />\n </div>\n }\n </div>\n </div>\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Siguiente\"\n (handleClick)=\"nextStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 1\" (opened)=\"setStep(1)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n Comercial </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"d-grid gap-2 mx-3\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Forma de pago: </mat-label>\n <mat-select formControlName=\"idFormaPagoSri\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of formasPagoSri(); track $index) {\n <mat-option [value]=\"item.idFormaPagoSri\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tiempo Cr\u00E9dito: </mat-label>\n <mat-select formControlName=\"idTiempoCredito\">\n @for (item of tiemposCredito(); track $index) {\n <mat-option [value]=\"item.idTiempoCredito\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo Cliente: </mat-label>\n <mat-select formControlName=\"idTipoClienteProveedor\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n @for (item of tiposCliente(); track $index) {\n <mat-option [value]=\"item.idTipoClienteProveedor\">\n {{ item.descripcion }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Empleado: </mat-label>\n <mat-select formControlName=\"idEmpleado\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of employees(); track $index) {\n <mat-option [value]=\"item.idEmpleado\"> {{ item.nombreCompleto }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field>\n <mat-label>Country</mat-label>\n <input matInput />\n </mat-form-field>\n </div>\n\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Atr\u00E1s\"\n (handleClick)=\"prevStep()\"\n />\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Siguiente\"\n (handleClick)=\"nextStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 2\" (opened)=\"setStep(2)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n de Cr\u00E9dito </mat-panel-title>\n </mat-expansion-panel-header>\n\n <section class=\"d-grid gap-2 mx-2\" formGroupName=\"dataInfoCred\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Estado Civil: </mat-label>\n <mat-select formControlName=\"maritalStatusId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of maritalStatuses(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo de Vivienda: </mat-label>\n <mat-select formControlName=\"housingTypeId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of housingTypes(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Nombre del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeNombre\" placeholder=\"Nombre del c\u00F3nyuge\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia Familiar:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono Referencia:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Direcci\u00F3n de Vivienda</mat-label>\n <textarea\n matInput\n formControlName=\"dirVivienda\"\n placeholder=\"Direcci\u00F3n completa de la vivienda (Sector, Barrio y Calle)\"\n ></textarea>\n </mat-form-field>\n\n <div\n class=\"row row-cols-xxl-3 row-cols-xl-3 row-cols-lg-3 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Sector:</mat-label>\n <input matInput formControlName=\"sector\" placeholder=\"Nombre del sector\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Barrio:</mat-label>\n <input matInput formControlName=\"barrio\" placeholder=\"Nombre del barrio\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Calle:</mat-label>\n <input matInput formControlName=\"calle\" placeholder=\"Nombre de la calle\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia de Domicilio</mat-label>\n <textarea\n matInput\n formControlName=\"refDomicilio\"\n placeholder=\"Descripci\u00F3n detallada del punto de referencia\"\n ></textarea>\n </mat-form-field>\n </section>\n\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Atr\u00E1s\"\n (handleClick)=\"prevStep()\"\n />\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Siguiente\"\n (handleClick)=\"nextStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 3\" (opened)=\"setStep(3)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Notas</mat-panel-title>\n </mat-expansion-panel-header>\n\n @if (isFieldVisible('nota')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nota') }} </mat-label>\n <textarea\n matInput\n formControlName=\"nota\"\n [placeholder]=\"getFieldPlaceholder('nota')\"\n rows=\"3\"\n ></textarea>\n </mat-form-field>\n }\n <mat-action-row>\n <acp-button\n variant=\"info\"\n matStyle=\"filled\"\n type=\"button\"\n text=\"Atr\u00E1s\"\n (handleClick)=\"prevStep()\"\n />\n </mat-action-row>\n </mat-expansion-panel>\n </mat-accordion>\n\n <!-- Buttons -->\n @if (showButtons()){\n <div class=\"form-actions\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\" [disabled]=\"isLoading()\">\n {{ config.cancelButtonText }}\n </button>\n\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"isLoading() || form.invalid\">\n @if (!isLoading()) {\n <span>{{ config.submitButtonText }}</span>\n } @else {\n <span>Guardando...</span>\n }\n </button>\n </div>\n\n }\n</form>\n", styles: [".alert{padding:12px 16px;border-radius:6px;margin-bottom:20px;font-size:14px}.alert.alert-error{background-color:#fef2f2;border:1px solid #fecaca;color:#991b1b}\n"] }]
|
|
877
|
-
}], propDecorators: { formId: [{ type: i0.Input, args: [{ isSignal: true, alias: "formId", required: false }] }], customer: [{
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
985
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\" [id]=\"formId()\" class=\"mb-2\">\n @if (errorMessage) {\n <div class=\"alert alert-error\">{{ errorMessage }}</div>\n }\n <mat-accordion class=\"mb-2\">\n <mat-expansion-panel [expanded]=\"step() === 0\" (opened)=\"setStep(0)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-icon>account_circle</mat-icon>\n Datos Principales\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div class=\"d-grid gap-2 mx-3 mt-2\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n @if (isFieldVisible('idTipoIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('idTipoIdentificacion') }} </mat-label>\n <mat-select\n formControlName=\"idTipoIdentificacion\"\n (selectionChange)=\"identificationTypeChange($event)\"\n >\n @for (item of identificationTypes(); track $index) {\n <mat-option [value]=\"item.id\">{{ item.value }}</mat-option>\n }\n </mat-select>\n @if (form.get('idTipoIdentificacion')?.invalid &&\n form.get('idTipoIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('idTipoIdentificacion') }}</mat-error>\n }\n </mat-form-field>\n }\n </div>\n\n <div class=\"col\">\n <!-- N\u00FAmero de Identificaci\u00F3n -->\n @if (isFieldVisible('numeroIdentificacion')) {\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('numeroIdentificacion') }} </mat-label>\n <input\n matInput\n formControlName=\"numeroIdentificacion\"\n [placeholder]=\"getFieldPlaceholder('numeroIdentificacion')\"\n />\n @if (form.get('numeroIdentificacion')?.invalid &&\n form.get('numeroIdentificacion')?.touched) {\n <mat-error> {{ getErrorMessage('numeroIdentificacion') }}</mat-error>\n }\n <ng-container matSuffix>\n <button type=\"button\" mat-icon-button (click)=\"searchIdentificacion($event)\">\n <mat-icon>search</mat-icon>\n </button>\n </ng-container>\n </mat-form-field>\n }\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('nombreFiscal')){\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreFiscal') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreFiscal\"\n [placeholder]=\"getFieldPlaceholder('nombreFiscal')\"\n acpToUpperCase\n />\n @if (form.get('nombreFiscal')?.invalid && form.get('nombreFiscal')?.touched) {\n <mat-error> {{ getErrorMessage('nombreFiscal') }}</mat-error>\n }\n </mat-form-field>\n </div>\n\n } @if (isFieldVisible('nombreComercial')) {\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nombreComercial') }} </mat-label>\n <input\n matInput\n autocomplete=\"off\"\n formControlName=\"nombreComercial\"\n [placeholder]=\"getFieldPlaceholder('nombreComercial')\"\n acpToUpperCase\n type=\"text\"\n />\n </mat-form-field>\n </div>\n\n }\n </div>\n\n @if (isFieldVisible('direccion')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('direccion') }}:</mat-label>\n <input\n matInput\n formControlName=\"direccion\"\n [placeholder]=\"getFieldPlaceholder('direccion')\"\n acpToUpperCase\n />\n @if (form.get('direccion')?.invalid && form.get('direccion')?.touched) {\n <mat-error>{{ getErrorMessage('direccion') }}</mat-error>\n }\n </mat-form-field>\n }\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n @if (isFieldVisible('correo')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"emails\" [labelText]=\"getFieldLabel('correo')\" />\n </div>\n } @if (isFieldVisible('telefono')) {\n <div class=\"col\">\n <acp-input-chip [chips]=\"telephones\" [labelText]=\"getFieldLabel('telefono')\" />\n </div>\n }\n </div>\n </div>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 1\" (opened)=\"setStep(1)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n Comercial </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"d-grid gap-2 mx-3\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Forma de pago: </mat-label>\n <mat-select formControlName=\"idFormaPagoSri\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of formasPagoSri(); track $index) {\n <mat-option [value]=\"item.idFormaPagoSri\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tiempo Cr\u00E9dito: </mat-label>\n <mat-select formControlName=\"idTiempoCredito\">\n @for (item of tiemposCredito(); track $index) {\n <mat-option [value]=\"item.idTiempoCredito\"> {{ item.descripcion }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-2 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo Cliente: </mat-label>\n <mat-select formControlName=\"idTipoClienteProveedor\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n @for (item of tiposCliente(); track $index) {\n <mat-option [value]=\"item.idTipoClienteProveedor\">\n {{ item.descripcion }}\n </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Empleado: </mat-label>\n <mat-select formControlName=\"idEmpleado\">\n <mat-option [value]=\"0\">--Ninguno--</mat-option>\n\n @for (item of employees(); track $index) {\n <mat-option [value]=\"item.idEmpleado\"> {{ item.nombreCompleto }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field>\n <mat-label>Country</mat-label>\n <input matInput />\n </mat-form-field>\n </div>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 2\" (opened)=\"setStep(2)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Informaci\u00F3n de Cr\u00E9dito </mat-panel-title>\n </mat-expansion-panel-header>\n\n <section class=\"d-grid gap-2 mx-2\" formGroupName=\"dataInfoCred\">\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Estado Civil: </mat-label>\n <mat-select formControlName=\"maritalStatusId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of maritalStatuses(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tipo de Vivienda: </mat-label>\n <mat-select formControlName=\"housingTypeId\">\n <mat-option [value]=\"0\">Seleccionar...</mat-option>\n\n @for (item of housingTypes(); track $index) {\n <mat-option [value]=\"item.id\"> {{ item.name }} </mat-option>\n }\n </mat-select>\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Nombre del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeNombre\" placeholder=\"Nombre del c\u00F3nyuge\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono del C\u00F3nyuge:</mat-label>\n <input matInput formControlName=\"conyugeTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <div\n class=\"row row-cols-xxl-2 row-cols-xl-2 row-cols-lg-2 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia Familiar:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Tel\u00E9fono Referencia:</mat-label>\n <input matInput formControlName=\"refFamTel\" placeholder=\"09xxxxxxxx\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Direcci\u00F3n de Vivienda</mat-label>\n <textarea\n matInput\n formControlName=\"dirVivienda\"\n placeholder=\"Direcci\u00F3n completa de la vivienda (Sector, Barrio y Calle)\"\n ></textarea>\n </mat-form-field>\n\n <div\n class=\"row row-cols-xxl-3 row-cols-xl-3 row-cols-lg-3 row-cols-md-2 row-cols-sm-1 row-cols-1 g-1\"\n >\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Sector:</mat-label>\n <input matInput formControlName=\"sector\" placeholder=\"Nombre del sector\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Barrio:</mat-label>\n <input matInput formControlName=\"barrio\" placeholder=\"Nombre del barrio\" />\n </mat-form-field>\n </div>\n <div class=\"col\">\n <mat-form-field class=\"w-100\">\n <mat-label>Calle:</mat-label>\n <input matInput formControlName=\"calle\" placeholder=\"Nombre de la calle\" />\n </mat-form-field>\n </div>\n </div>\n\n <mat-form-field class=\"w-100\">\n <mat-label>Referencia de Domicilio</mat-label>\n <textarea\n matInput\n formControlName=\"refDomicilio\"\n placeholder=\"Descripci\u00F3n detallada del punto de referencia\"\n ></textarea>\n </mat-form-field>\n </section>\n </mat-expansion-panel>\n\n <mat-expansion-panel [expanded]=\"step() === 3\" (opened)=\"setStep(3)\" hideToggle>\n <mat-expansion-panel-header>\n <mat-panel-title> Notas</mat-panel-title>\n </mat-expansion-panel-header>\n\n @if (isFieldVisible('nota')) {\n\n <mat-form-field class=\"w-100\">\n <mat-label> {{ getFieldLabel('nota') }} </mat-label>\n <textarea\n matInput\n formControlName=\"nota\"\n [placeholder]=\"getFieldPlaceholder('nota')\"\n rows=\"3\"\n ></textarea>\n </mat-form-field>\n }\n </mat-expansion-panel>\n </mat-accordion>\n\n <!-- Buttons -->\n @if (showButtons()){\n <div class=\"form-actions\">\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"onCancel()\" [disabled]=\"isLoading()\">\n {{ config.cancelButtonText }}\n </button>\n\n <button type=\"submit\" class=\"btn btn-primary\" [disabled]=\"isLoading() || form.invalid\">\n @if (!isLoading()) {\n <span>{{ config.submitButtonText }}</span>\n } @else {\n <span>Guardando...</span>\n }\n </button>\n </div>\n\n }\n</form>\n", styles: [".alert{padding:12px 16px;border-radius:6px;margin-bottom:20px;font-size:14px}.alert.alert-error{background-color:#fef2f2;border:1px solid #fecaca;color:#991b1b}\n"] }]
|
|
986
|
+
}], propDecorators: { formId: [{ type: i0.Input, args: [{ isSignal: true, alias: "formId", required: false }] }], customer: [{ type: i0.Input, args: [{ isSignal: true, alias: "customer", required: false }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], submitted: [{ type: i0.Output, args: ["submitted"] }], cancelled: [{ type: i0.Output, args: ["cancelled"] }] } });
|
|
987
|
+
|
|
988
|
+
class CompanyCustomerAddEditDialog {
|
|
989
|
+
formId = signal('companyCustomerFormId', ...(ngDevMode ? [{ debugName: "formId" }] : []));
|
|
990
|
+
dgRef = inject((MatDialogRef));
|
|
991
|
+
onCustomerCreated(customer) {
|
|
992
|
+
console.log('Cliente creado:', customer);
|
|
993
|
+
// Mostrar notificación de éxito
|
|
994
|
+
}
|
|
995
|
+
onCancel() {
|
|
996
|
+
this.dgRef.close();
|
|
997
|
+
}
|
|
998
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerAddEditDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
999
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.1", type: CompanyCustomerAddEditDialog, isStandalone: true, selector: "acp-company-customer-add-edit-dialog", ngImport: i0, template: "<mat-dialog-content>\n <div class=\"page-container\">\n <acp-company-customer-form\n [formId]=\"formId()\"\n #form\n mode=\"create\"\n (submitted)=\"onCustomerCreated($event)\"\n (cancelled)=\"onCancel()\"\n [showButtons]=\"false\"\n ></acp-company-customer-form>\n </div>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <div class=\"hstack gap-2\">\n <acp-button\n type=\"submit\"\n icon=\"save\"\n [form]=\"formId()\"\n [text]=\"form.isLoading() ? 'Guardando...' : 'Guardar'\"\n [variant]=\"'success'\"\n [matStyle]=\"'filled'\"\n [disabled]=\"form.form.invalid || form.isLoading()\"\n />\n <acp-button\n type=\"button\"\n variant=\"dark\"\n text=\"Cerrar\"\n matStyle=\"filled\"\n (handleClick)=\"onCancel()\"\n />\n </div>\n</mat-dialog-actions>\n", dependencies: [{ kind: "component", type: CompanyCustomerForm, selector: "acp-company-customer-form", inputs: ["formId", "customer", "mode", "showButtons"], outputs: ["submitted", "cancelled"], exportAs: ["acpCustomerForm"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }] });
|
|
1000
|
+
}
|
|
1001
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerAddEditDialog, decorators: [{
|
|
1002
|
+
type: Component,
|
|
1003
|
+
args: [{ selector: 'acp-company-customer-add-edit-dialog', imports: [CompanyCustomerForm, MatDialogContent, MatDialogActions, Button], template: "<mat-dialog-content>\n <div class=\"page-container\">\n <acp-company-customer-form\n [formId]=\"formId()\"\n #form\n mode=\"create\"\n (submitted)=\"onCustomerCreated($event)\"\n (cancelled)=\"onCancel()\"\n [showButtons]=\"false\"\n ></acp-company-customer-form>\n </div>\n</mat-dialog-content>\n<mat-dialog-actions align=\"end\">\n <div class=\"hstack gap-2\">\n <acp-button\n type=\"submit\"\n icon=\"save\"\n [form]=\"formId()\"\n [text]=\"form.isLoading() ? 'Guardando...' : 'Guardar'\"\n [variant]=\"'success'\"\n [matStyle]=\"'filled'\"\n [disabled]=\"form.form.invalid || form.isLoading()\"\n />\n <acp-button\n type=\"button\"\n variant=\"dark\"\n text=\"Cerrar\"\n matStyle=\"filled\"\n (handleClick)=\"onCancel()\"\n />\n </div>\n</mat-dialog-actions>\n" }]
|
|
1004
|
+
}] });
|
|
1005
|
+
|
|
1006
|
+
class CompanyCustomerAddEditDirective {
|
|
1007
|
+
dgSvc = inject(AdvancedDialogService);
|
|
1008
|
+
companyCustomerSaved = output();
|
|
1009
|
+
id = input(0, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1010
|
+
async onClick(event) {
|
|
1011
|
+
event.stopPropagation();
|
|
1012
|
+
const isEdit = this.id() > 0;
|
|
1013
|
+
const ref = await this.dgSvc.openInWrapper({
|
|
1014
|
+
component: CompanyCustomerAddEditDialog,
|
|
1015
|
+
title: isEdit ? 'Editar Cliente' : 'Nuevo Cliente',
|
|
1016
|
+
icon: isEdit ? 'edit' : 'add',
|
|
1017
|
+
showCloseButton: true,
|
|
1018
|
+
data: {
|
|
1019
|
+
id: this.id(),
|
|
1020
|
+
},
|
|
1021
|
+
}, {
|
|
1022
|
+
size: 'xxl',
|
|
1023
|
+
});
|
|
1024
|
+
ref.afterClosed().subscribe(result => {
|
|
1025
|
+
if (result && typeof result === 'object') {
|
|
1026
|
+
this.companyCustomerSaved.emit(result);
|
|
1027
|
+
}
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerAddEditDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1031
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.1", type: CompanyCustomerAddEditDirective, isStandalone: true, selector: "[acpCompanyCustomerAddEdit]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { companyCustomerSaved: "companyCustomerSaved" }, host: { listeners: { "click": "onClick($event)" } }, ngImport: i0 });
|
|
1032
|
+
}
|
|
1033
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerAddEditDirective, decorators: [{
|
|
1034
|
+
type: Directive,
|
|
1035
|
+
args: [{
|
|
1036
|
+
selector: '[acpCompanyCustomerAddEdit]',
|
|
1037
|
+
}]
|
|
1038
|
+
}], propDecorators: { companyCustomerSaved: [{ type: i0.Output, args: ["companyCustomerSaved"] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], onClick: [{
|
|
1039
|
+
type: HostListener,
|
|
1040
|
+
args: ['click', ['$event']]
|
|
1041
|
+
}] } });
|
|
882
1042
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1043
|
+
class CompanyCustomerList {
|
|
1044
|
+
http = inject(COMPANY_CUSTOMER_HTTP_TOKEN);
|
|
1045
|
+
canEdit = input(true, ...(ngDevMode ? [{ debugName: "canEdit" }] : []));
|
|
1046
|
+
canAdd = input(true, ...(ngDevMode ? [{ debugName: "canAdd" }] : []));
|
|
1047
|
+
canInactive = input(true, ...(ngDevMode ? [{ debugName: "canInactive" }] : []));
|
|
1048
|
+
canGenerateReport = input(true, ...(ngDevMode ? [{ debugName: "canGenerateReport" }] : []));
|
|
1049
|
+
dataSearch = {
|
|
1050
|
+
textSearch: null,
|
|
1051
|
+
};
|
|
1052
|
+
dataSource = signal([], ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
|
|
1053
|
+
columnsDefs = [
|
|
1054
|
+
{ field: 'index', header: '#' },
|
|
1055
|
+
{ field: 'op', header: 'Op.' },
|
|
1056
|
+
{ field: 'identificationType', header: 'Tipo' },
|
|
1057
|
+
{ field: 'idCard', header: 'Nro. Identificación' },
|
|
1058
|
+
{ field: 'tradeName', header: 'Razón Social' },
|
|
1059
|
+
{ field: 'legalName', header: 'Nombre Comercial' },
|
|
1060
|
+
{ field: 'address', header: 'Dirección' },
|
|
1061
|
+
{ field: 'email', header: 'Correo' },
|
|
1062
|
+
{ field: 'phone', header: 'Teléfono' },
|
|
1063
|
+
{
|
|
1064
|
+
field: 'sriValidation',
|
|
1065
|
+
header: 'Validación Sri',
|
|
1066
|
+
type: 'tag',
|
|
1067
|
+
tag: {
|
|
1068
|
+
true: { text: 'Si', color: 'text-danger' },
|
|
1069
|
+
false: { text: 'No', color: 'text-success' },
|
|
1070
|
+
},
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
field: 'status',
|
|
1074
|
+
header: 'Estado',
|
|
1075
|
+
type: 'tag',
|
|
1076
|
+
tag: {
|
|
1077
|
+
true: { text: 'Activo', color: 'text-primary' },
|
|
1078
|
+
false: { text: 'Inactivo', color: 'text-success' },
|
|
1079
|
+
},
|
|
1080
|
+
},
|
|
1081
|
+
];
|
|
1082
|
+
pageIndex = signal(0, ...(ngDevMode ? [{ debugName: "pageIndex" }] : []));
|
|
1083
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
1084
|
+
pageCount = signal(0, ...(ngDevMode ? [{ debugName: "pageCount" }] : []));
|
|
1085
|
+
refresh() {
|
|
1086
|
+
this.list();
|
|
1087
|
+
}
|
|
1088
|
+
list() {
|
|
1089
|
+
const params = {
|
|
1090
|
+
pageIndex: this.pageIndex() + 1,
|
|
1091
|
+
pageSize: this.pageSize(),
|
|
1092
|
+
checkTextSearch: !!isValidField(this.dataSearch.textSearch),
|
|
1093
|
+
textSearch: isValidField(this.dataSearch.textSearch),
|
|
1094
|
+
};
|
|
1095
|
+
this.http.list(params).subscribe(response => {
|
|
1096
|
+
console.log(response);
|
|
1097
|
+
this.dataSource.set(response.data);
|
|
1098
|
+
this.pageCount.set(response.pagination.totalRecords);
|
|
1099
|
+
});
|
|
1100
|
+
}
|
|
1101
|
+
ngOnInit() {
|
|
1102
|
+
this.refresh();
|
|
1103
|
+
}
|
|
1104
|
+
handlePageEvent($event) {
|
|
1105
|
+
this.pageIndex.set($event.pageIndex);
|
|
1106
|
+
this.pageSize.set($event.pageSize);
|
|
1107
|
+
this.pageCount.set($event.length);
|
|
1108
|
+
this.refresh();
|
|
1109
|
+
}
|
|
1110
|
+
exportExcel() {
|
|
1111
|
+
/* empty */
|
|
1112
|
+
}
|
|
1113
|
+
exportPdf() {
|
|
1114
|
+
/* empty */
|
|
1115
|
+
}
|
|
1116
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1117
|
+
askToDelete(data) {
|
|
1118
|
+
/* empty */
|
|
1119
|
+
}
|
|
1120
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1121
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.1", type: CompanyCustomerList, isStandalone: true, selector: "acp-company-customer-list", inputs: { canEdit: { classPropertyName: "canEdit", publicName: "canEdit", isSignal: true, isRequired: false, transformFunction: null }, canAdd: { classPropertyName: "canAdd", publicName: "canAdd", isSignal: true, isRequired: false, transformFunction: null }, canInactive: { classPropertyName: "canInactive", publicName: "canInactive", isSignal: true, isRequired: false, transformFunction: null }, canGenerateReport: { classPropertyName: "canGenerateReport", publicName: "canGenerateReport", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<acp-data-grid\n [showToolbar]=\"true\"\n [toolbarTemplate]=\"headerToolbar\"\n [data]=\"dataSource()\"\n [columns]=\"columnsDefs\"\n [cellTemplate]=\"{\n op: templateOp,\n }\"\n [length]=\"pageCount()\"\n [pageIndex]=\"pageIndex()\"\n [pageSize]=\"pageSize()\"\n (page)=\"handlePageEvent($event)\"\n/>\n<ng-template #headerToolbar>\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <mat-form-field>\n <mat-label>Buscar</mat-label>\n <input matInput [(ngModel)]=\"dataSearch.textSearch\" />\n <ng-container matSuffix>\n <acp-button variant=\"secondary\" icon=\"refresh\" matStyle=\"icon\" (handleClick)=\"refresh()\" />\n </ng-container>\n </mat-form-field>\n\n <div class=\"ms-auto d-flex flex-row gap-2\">\n @if (canGenerateReport()) {\n <acp-button\n variant=\"info\"\n icon=\"download\"\n matStyle=\"filled\"\n text=\"Exportar Reporte\"\n [matMenuTriggerFor]=\"exportMenu\"\n />\n }\n <mat-menu #exportMenu=\"matMenu\">\n <button mat-menu-item (click)=\"exportExcel()\">\n <mat-icon>table_view</mat-icon>\n <span>Exportar a Excel</span>\n </button>\n <button mat-menu-item (click)=\"exportPdf()\">\n <mat-icon>picture_as_pdf</mat-icon>\n <span>Exportar a PDF</span>\n </button>\n </mat-menu>\n\n @if (canAdd()) {\n <acp-button\n acpCompanyCustomerAddEdit\n (companyCustomerSaved)=\"refresh()\"\n variant=\"success\"\n icon=\"add\"\n matStyle=\"filled\"\n text=\"Nuevo\"\n />\n }\n\n <acp-button variant=\"secondary\" icon=\"refresh\" matStyle=\"icon\" (handleClick)=\"refresh()\" />\n </div>\n </div>\n</ng-template>\n\n<ng-template #templateOp let-data>\n @if (canEdit()){\n <acp-button\n acpCompanyCustomerAddEdit\n (companyCustomerSaved)=\"refresh()\"\n [id]=\"data.idCliente\"\n variant=\"success\"\n icon=\"edit\"\n matStyle=\"icon\"\n />\n } @if (!data.esConsumidorFinal) {\n <acp-button (handleClick)=\"askToDelete(data)\" variant=\"danger\" icon=\"delete\" matStyle=\"icon\" />\n }\n</ng-template>\n", dependencies: [{ kind: "component", type: DataGrid, selector: "acp-data-grid", inputs: ["showToolbar", "showColumnMenuButton", "toolbarTitle", "toolbarTemplate", "data", "columns", "length", "loading", "emptyValuePlaceholder", "trackBy", "cellTemplate", "headerTemplate", "headerExtraTemplate", "noResultTemplate", "paginationTemplate", "summaryTemplate", "size", "headerCellTemplate", "expandable", "expansionTemplate", "closeOthersOnExpand", "pageOnFront", "showPaginator", "pageDisabled", "showFirstLastButtons", "pageIndex", "pageSize", "pageSizeOptions", "hidePageSize", "infiniteScroll", "infiniteScrollThreshold", "infiniteScrollDisabled", "keyboardNavigation", "highlightedRowIndex", "sortOnFront", "sortActive", "sortDirection", "sortDisableClear", "sortDisabled", "sortStart", "rowHover", "rowStriped", "rowSelectable", "multiSelectable", "multiSelectionWithClick", "hideRowSelectionCheckbox", "disableRowClickSelection", "rowClassFormatter", "rowSelected", "rowSelectionFormatter", "cellSelectable", "useContentRowTemplate", "useContentHeaderRowTemplate", "useContentFooterRowTemplate", "showSummary", "noResultText"], outputs: ["page", "sortChange", "rowClick", "rowSelectedChange", "selectionChange", "cellClick", "cellSelectedChange", "expansionChange", "rowContextMenu", "infiniteScrollLoad", "focusedRowChange"], exportAs: ["dataGrid"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i3.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: Button, selector: "acp-button", inputs: ["variant", "text", "icon", "disabled", "type", "matStyle", "customClass", "reportFormat", "extended", "title", "ariaLabel", "name", "id", "form", "tabIndex", "testId"], outputs: ["handleClick"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i4$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i4$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i4$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: CompanyCustomerAddEditDirective, selector: "[acpCompanyCustomerAddEdit]", inputs: ["id"], outputs: ["companyCustomerSaved"] }] });
|
|
1122
|
+
}
|
|
1123
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.1", ngImport: i0, type: CompanyCustomerList, decorators: [{
|
|
1124
|
+
type: Component,
|
|
1125
|
+
args: [{ selector: 'acp-company-customer-list', imports: [
|
|
1126
|
+
DataGrid,
|
|
1127
|
+
MatFormFieldModule,
|
|
1128
|
+
MatInputModule,
|
|
1129
|
+
Button,
|
|
1130
|
+
FormsModule,
|
|
1131
|
+
MatIcon,
|
|
1132
|
+
MatMenuModule,
|
|
1133
|
+
CompanyCustomerAddEditDirective,
|
|
1134
|
+
], template: "<acp-data-grid\n [showToolbar]=\"true\"\n [toolbarTemplate]=\"headerToolbar\"\n [data]=\"dataSource()\"\n [columns]=\"columnsDefs\"\n [cellTemplate]=\"{\n op: templateOp,\n }\"\n [length]=\"pageCount()\"\n [pageIndex]=\"pageIndex()\"\n [pageSize]=\"pageSize()\"\n (page)=\"handlePageEvent($event)\"\n/>\n<ng-template #headerToolbar>\n <div class=\"d-flex flex-row gap-2 align-items-center\">\n <mat-form-field>\n <mat-label>Buscar</mat-label>\n <input matInput [(ngModel)]=\"dataSearch.textSearch\" />\n <ng-container matSuffix>\n <acp-button variant=\"secondary\" icon=\"refresh\" matStyle=\"icon\" (handleClick)=\"refresh()\" />\n </ng-container>\n </mat-form-field>\n\n <div class=\"ms-auto d-flex flex-row gap-2\">\n @if (canGenerateReport()) {\n <acp-button\n variant=\"info\"\n icon=\"download\"\n matStyle=\"filled\"\n text=\"Exportar Reporte\"\n [matMenuTriggerFor]=\"exportMenu\"\n />\n }\n <mat-menu #exportMenu=\"matMenu\">\n <button mat-menu-item (click)=\"exportExcel()\">\n <mat-icon>table_view</mat-icon>\n <span>Exportar a Excel</span>\n </button>\n <button mat-menu-item (click)=\"exportPdf()\">\n <mat-icon>picture_as_pdf</mat-icon>\n <span>Exportar a PDF</span>\n </button>\n </mat-menu>\n\n @if (canAdd()) {\n <acp-button\n acpCompanyCustomerAddEdit\n (companyCustomerSaved)=\"refresh()\"\n variant=\"success\"\n icon=\"add\"\n matStyle=\"filled\"\n text=\"Nuevo\"\n />\n }\n\n <acp-button variant=\"secondary\" icon=\"refresh\" matStyle=\"icon\" (handleClick)=\"refresh()\" />\n </div>\n </div>\n</ng-template>\n\n<ng-template #templateOp let-data>\n @if (canEdit()){\n <acp-button\n acpCompanyCustomerAddEdit\n (companyCustomerSaved)=\"refresh()\"\n [id]=\"data.idCliente\"\n variant=\"success\"\n icon=\"edit\"\n matStyle=\"icon\"\n />\n } @if (!data.esConsumidorFinal) {\n <acp-button (handleClick)=\"askToDelete(data)\" variant=\"danger\" icon=\"delete\" matStyle=\"icon\" />\n }\n</ng-template>\n" }]
|
|
1135
|
+
}], propDecorators: { canEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "canEdit", required: false }] }], canAdd: [{ type: i0.Input, args: [{ isSignal: true, alias: "canAdd", required: false }] }], canInactive: [{ type: i0.Input, args: [{ isSignal: true, alias: "canInactive", required: false }] }], canGenerateReport: [{ type: i0.Input, args: [{ isSignal: true, alias: "canGenerateReport", required: false }] }] } });
|
|
887
1136
|
|
|
888
1137
|
/**
|
|
889
1138
|
* Generated bundle index. Do not edit.
|
|
890
1139
|
*/
|
|
891
1140
|
|
|
892
|
-
export { COMPANY_CUSTOMER_FORM_CONFIG, COMPANY_CUSTOMER_MAPPER,
|
|
1141
|
+
export { COMPANY_CUSTOMER_FORM_CONFIG, COMPANY_CUSTOMER_HTTP_TOKEN, COMPANY_CUSTOMER_MAPPER, CUSTOMER_SRI_HTTP_TOKEN, CompanyCustomerAddEditDialog, CompanyCustomerAddEditDirective, CompanyCustomerDefaultMapper, CompanyCustomerForm, CompanyCustomerFormDataResult, CompanyCustomerHttp, CompanyCustomerList, CustomerValidators, MAIN_APP_COMPANY_CUSTOMER_CONFIG, POS_COMPANY_CUSTOMER_CONFIG };
|
|
893
1142
|
//# sourceMappingURL=acontplus-ng-customer.mjs.map
|