@acontplus/ng-customer 2.0.3 → 2.2.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 +654 -342
- package/fesm2022/acontplus-ng-customer.mjs.map +1 -1
- package/package.json +5 -8
- package/types/acontplus-ng-customer.d.ts +181 -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,92 @@ 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, IdentificationNumberVo } from '@acontplus/core';
|
|
20
|
+
import { MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
|
|
21
|
+
import { isValidField } from '@acontplus/utils';
|
|
22
|
+
import { map as map$1 } from 'rxjs/operators';
|
|
23
|
+
import * as i4$1 from '@angular/material/menu';
|
|
24
|
+
import { MatMenuModule } from '@angular/material/menu';
|
|
19
25
|
|
|
20
|
-
const MAIN_APP_COMPANY_CUSTOMER_CONFIG = {
|
|
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');
|
|
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
|
+
let cities = [];
|
|
50
|
+
let identificationTypes = [];
|
|
51
|
+
if (Array.isArray(mainData)) {
|
|
52
|
+
cities = mainData[3];
|
|
53
|
+
identificationTypes = mainData[0];
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
cities = mainData.cities;
|
|
57
|
+
identificationTypes = mainData.identificationTypes;
|
|
58
|
+
}
|
|
59
|
+
console.log(mainData);
|
|
60
|
+
result.identificationTypes = identificationTypes.map(item => ({
|
|
61
|
+
id: item.idTipoIdentificacion,
|
|
62
|
+
code: item.codigo,
|
|
63
|
+
value: item.descripcion,
|
|
64
|
+
sriCode: item.codigoSri,
|
|
65
|
+
}));
|
|
66
|
+
result.tipoContribuyentes = mainData[1];
|
|
67
|
+
result.tiempoCreditos = mainData[2] || [];
|
|
68
|
+
result.cities = cities.reduce((acc, ciudade) => {
|
|
69
|
+
const dataExists = acc.find((c) => c.idProvincia === ciudade.idProvincia);
|
|
70
|
+
if (!dataExists) {
|
|
71
|
+
acc.push({
|
|
72
|
+
id: ciudade.idProvincia,
|
|
73
|
+
value: ciudade.provincia,
|
|
74
|
+
cities: [
|
|
75
|
+
{
|
|
76
|
+
id: ciudade.idCiudad,
|
|
77
|
+
value: ciudade.ciudad,
|
|
78
|
+
},
|
|
79
|
+
],
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
dataExists.cities.push({
|
|
84
|
+
id: ciudade.idCiudad,
|
|
85
|
+
value: ciudade.ciudad,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
return acc;
|
|
89
|
+
}, []);
|
|
90
|
+
result.tiposCliente = mainData[4] || [];
|
|
91
|
+
result.empresas = mainData[5] || [];
|
|
92
|
+
result.cargos = mainData[6] || [];
|
|
93
|
+
result.formasPagoSri = mainData[7] || [];
|
|
94
|
+
result.housingTypes = mainData[8] || [];
|
|
95
|
+
result.maritalStatuses = mainData[9] || [];
|
|
96
|
+
result.employees = mainData[10] || [];
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
}
|
|
322
100
|
toModel(dto) {
|
|
323
101
|
return {
|
|
324
102
|
name: `Esto de mapper default - ${dto.name}`,
|
|
@@ -366,10 +144,11 @@ class CompanyCustomerDefaultMapper {
|
|
|
366
144
|
const parsed = JSON.parse(response.payload);
|
|
367
145
|
const tempList = Array.isArray(parsed) ? parsed[0] : parsed.Table;
|
|
368
146
|
console.log(tempList);
|
|
369
|
-
const mapClient = (data) => ({
|
|
147
|
+
const mapClient = (data, index) => ({
|
|
148
|
+
index: index + 1,
|
|
370
149
|
clientId: data.idCliente,
|
|
371
150
|
identificationTypeId: data.idTipoIdentificacion,
|
|
372
|
-
|
|
151
|
+
idCard: data.numeroIdentificacion,
|
|
373
152
|
tradeName: data.nombreComercial,
|
|
374
153
|
legalName: data.nombreFiscal,
|
|
375
154
|
address: data.direccion,
|
|
@@ -380,9 +159,9 @@ class CompanyCustomerDefaultMapper {
|
|
|
380
159
|
identificationType: data.tipoIdentificacion,
|
|
381
160
|
identificationTypeCode: data.codTipoIdentificacion,
|
|
382
161
|
status: data.estado,
|
|
383
|
-
|
|
162
|
+
totalRecords: data.totalRecords,
|
|
384
163
|
});
|
|
385
|
-
const list = tempList.map((item) => mapClient(item));
|
|
164
|
+
const list = tempList.map((item, index) => mapClient(item, index));
|
|
386
165
|
const totalRecords = response.totalRecords ?? (list[0]?.totalRecords || 0);
|
|
387
166
|
return {
|
|
388
167
|
data: list,
|
|
@@ -438,16 +217,25 @@ class CompanyCustomerDefaultMapper {
|
|
|
438
217
|
}
|
|
439
218
|
}
|
|
440
219
|
|
|
441
|
-
class
|
|
220
|
+
class CompanyCustomerHttp {
|
|
442
221
|
apiUrl = '/FactElect/CompanyCustomer/';
|
|
443
222
|
http = inject(HttpClient);
|
|
444
223
|
mapper = inject(COMPANY_CUSTOMER_MAPPER, { optional: true }) ?? new CompanyCustomerDefaultMapper();
|
|
224
|
+
getFormData() {
|
|
225
|
+
const json = JSON.stringify({
|
|
226
|
+
tipo: 2,
|
|
227
|
+
});
|
|
228
|
+
return this.http
|
|
229
|
+
.get(`${this.apiUrl}?json=${json}`)
|
|
230
|
+
.pipe(map(response => this.mapper.toModelFormData(response)));
|
|
231
|
+
}
|
|
445
232
|
list(params) {
|
|
446
233
|
console.log(params);
|
|
447
234
|
const json = JSON.stringify({
|
|
448
235
|
pageIndex: params.pageIndex || 1,
|
|
449
236
|
pageSize: params.pageSize || 10,
|
|
450
237
|
tipo: 1,
|
|
238
|
+
...params,
|
|
451
239
|
});
|
|
452
240
|
return this.http
|
|
453
241
|
.get(`${this.apiUrl}?json=${json}`)
|
|
@@ -482,10 +270,10 @@ class CompanyCustomerService {
|
|
|
482
270
|
isValidPhone(phone) {
|
|
483
271
|
return /^\d{10}$/.test(phone.replace(/\D/g, ''));
|
|
484
272
|
}
|
|
485
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
486
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
273
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerHttp, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
274
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerHttp, providedIn: 'root' });
|
|
487
275
|
}
|
|
488
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
276
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerHttp, decorators: [{
|
|
489
277
|
type: Injectable,
|
|
490
278
|
args: [{
|
|
491
279
|
providedIn: 'root',
|
|
@@ -580,17 +368,312 @@ class CustomerValidators {
|
|
|
580
368
|
}
|
|
581
369
|
}
|
|
582
370
|
|
|
583
|
-
|
|
371
|
+
const MAIN_APP_COMPANY_CUSTOMER_CONFIG = {
|
|
372
|
+
fields: {
|
|
373
|
+
// IDs y referencias
|
|
374
|
+
idTipoIdentificacion: {
|
|
375
|
+
name: 'idTipoIdentificacion',
|
|
376
|
+
required: true,
|
|
377
|
+
visible: true,
|
|
378
|
+
label: 'Tipo de Identificación',
|
|
379
|
+
placeholder: 'Seleccione tipo',
|
|
380
|
+
},
|
|
381
|
+
idFormaPagoSri: {
|
|
382
|
+
name: 'idFormaPagoSri',
|
|
383
|
+
required: false,
|
|
384
|
+
visible: true,
|
|
385
|
+
label: 'Forma de Pago SRI',
|
|
386
|
+
placeholder: 'Seleccione forma de pago',
|
|
387
|
+
},
|
|
388
|
+
idTipoClienteProveedor: {
|
|
389
|
+
name: 'idTipoClienteProveedor',
|
|
390
|
+
required: false,
|
|
391
|
+
visible: true,
|
|
392
|
+
label: 'Tipo de Cliente/Proveedor',
|
|
393
|
+
placeholder: 'Seleccione tipo',
|
|
394
|
+
},
|
|
395
|
+
idSubContribuyente: {
|
|
396
|
+
name: 'idSubContribuyente',
|
|
397
|
+
required: false,
|
|
398
|
+
visible: true,
|
|
399
|
+
label: 'Sub-Contribuyente',
|
|
400
|
+
placeholder: 'Seleccione',
|
|
401
|
+
},
|
|
402
|
+
idTiempoCredito: {
|
|
403
|
+
name: 'idTiempoCredito',
|
|
404
|
+
required: false,
|
|
405
|
+
visible: true,
|
|
406
|
+
label: 'Tiempo de Crédito',
|
|
407
|
+
placeholder: 'Días de crédito',
|
|
408
|
+
},
|
|
409
|
+
idCiudad: {
|
|
410
|
+
name: 'idCiudad',
|
|
411
|
+
required: false,
|
|
412
|
+
visible: true,
|
|
413
|
+
label: 'Ciudad',
|
|
414
|
+
placeholder: 'Seleccione ciudad',
|
|
415
|
+
},
|
|
416
|
+
idCargo: {
|
|
417
|
+
name: 'idCargo',
|
|
418
|
+
required: false,
|
|
419
|
+
visible: true,
|
|
420
|
+
label: 'Cargo',
|
|
421
|
+
placeholder: 'Seleccione cargo',
|
|
422
|
+
},
|
|
423
|
+
idEmpleado: {
|
|
424
|
+
name: 'idEmpleado',
|
|
425
|
+
required: false,
|
|
426
|
+
visible: true,
|
|
427
|
+
label: 'Empleado Responsable',
|
|
428
|
+
placeholder: 'Seleccione empleado',
|
|
429
|
+
},
|
|
430
|
+
// Datos principales
|
|
431
|
+
numeroIdentificacion: {
|
|
432
|
+
name: 'numeroIdentificacion',
|
|
433
|
+
required: true,
|
|
434
|
+
visible: true,
|
|
435
|
+
label: 'RUC / Cédula',
|
|
436
|
+
placeholder: 'Ingrese número de identificación (13 dígitos para RUC)',
|
|
437
|
+
},
|
|
438
|
+
nombreFiscal: {
|
|
439
|
+
name: 'nombreFiscal',
|
|
440
|
+
required: true,
|
|
441
|
+
visible: true,
|
|
442
|
+
label: 'Razón Social / Nombre Fiscal',
|
|
443
|
+
placeholder: 'Ingrese razón social completa',
|
|
444
|
+
},
|
|
445
|
+
nombreComercial: {
|
|
446
|
+
name: 'nombreComercial',
|
|
447
|
+
required: false,
|
|
448
|
+
visible: true,
|
|
449
|
+
label: 'Nombre Comercial',
|
|
450
|
+
placeholder: 'Ingrese nombre comercial',
|
|
451
|
+
},
|
|
452
|
+
direccion: {
|
|
453
|
+
name: 'direccion',
|
|
454
|
+
required: true,
|
|
455
|
+
visible: true,
|
|
456
|
+
label: 'Dirección',
|
|
457
|
+
placeholder: 'Calle principal y secundaria',
|
|
458
|
+
},
|
|
459
|
+
correo: {
|
|
460
|
+
name: 'correo',
|
|
461
|
+
required: false,
|
|
462
|
+
visible: true,
|
|
463
|
+
label: 'Correo Electrónico',
|
|
464
|
+
placeholder: 'ejemplo@correo.com',
|
|
465
|
+
},
|
|
466
|
+
telefono: {
|
|
467
|
+
name: 'telefono',
|
|
468
|
+
required: false,
|
|
469
|
+
visible: true,
|
|
470
|
+
label: 'Teléfono',
|
|
471
|
+
placeholder: '0999999999',
|
|
472
|
+
},
|
|
473
|
+
placa: {
|
|
474
|
+
name: 'placa',
|
|
475
|
+
required: false,
|
|
476
|
+
visible: true,
|
|
477
|
+
label: 'Placa del Vehículo',
|
|
478
|
+
placeholder: 'ABC-1234',
|
|
479
|
+
},
|
|
480
|
+
nota: {
|
|
481
|
+
name: 'nota',
|
|
482
|
+
required: false,
|
|
483
|
+
visible: true,
|
|
484
|
+
label: 'Notas',
|
|
485
|
+
placeholder: 'Observaciones adicionales',
|
|
486
|
+
},
|
|
487
|
+
birthDate: {
|
|
488
|
+
name: 'birthDate',
|
|
489
|
+
required: false,
|
|
490
|
+
visible: true,
|
|
491
|
+
label: 'Fecha de Nacimiento',
|
|
492
|
+
placeholder: 'DD/MM/AAAA',
|
|
493
|
+
},
|
|
494
|
+
// Estados
|
|
495
|
+
estado: {
|
|
496
|
+
name: 'estado',
|
|
497
|
+
required: false,
|
|
498
|
+
visible: true,
|
|
499
|
+
label: 'Activo',
|
|
500
|
+
},
|
|
501
|
+
validationSri: {
|
|
502
|
+
name: 'validationSri',
|
|
503
|
+
required: false,
|
|
504
|
+
visible: true,
|
|
505
|
+
label: 'Validado en SRI',
|
|
506
|
+
},
|
|
507
|
+
configValorBruto: {
|
|
508
|
+
name: 'configValorBruto',
|
|
509
|
+
required: false,
|
|
510
|
+
visible: true,
|
|
511
|
+
label: 'Configurar Valor Bruto',
|
|
512
|
+
},
|
|
513
|
+
},
|
|
514
|
+
// Información de crédito
|
|
515
|
+
showCreditInfo: true,
|
|
516
|
+
creditFields: {
|
|
517
|
+
maritalStatusId: {
|
|
518
|
+
name: 'maritalStatusId',
|
|
519
|
+
required: false,
|
|
520
|
+
visible: true,
|
|
521
|
+
label: 'Estado Civil',
|
|
522
|
+
placeholder: 'Seleccione',
|
|
523
|
+
},
|
|
524
|
+
conyugeNombre: {
|
|
525
|
+
name: 'conyugeNombre',
|
|
526
|
+
required: false,
|
|
527
|
+
visible: true,
|
|
528
|
+
label: 'Nombre del Cónyuge',
|
|
529
|
+
placeholder: 'Ingrese nombre',
|
|
530
|
+
},
|
|
531
|
+
conyugeTel: {
|
|
532
|
+
name: 'conyugeTel',
|
|
533
|
+
required: false,
|
|
534
|
+
visible: true,
|
|
535
|
+
label: 'Teléfono del Cónyuge',
|
|
536
|
+
placeholder: '0999999999',
|
|
537
|
+
},
|
|
538
|
+
refFamNombre: {
|
|
539
|
+
name: 'refFamNombre',
|
|
540
|
+
required: false,
|
|
541
|
+
visible: true,
|
|
542
|
+
label: 'Referencia Familiar',
|
|
543
|
+
placeholder: 'Nombre',
|
|
544
|
+
},
|
|
545
|
+
refFamTel: {
|
|
546
|
+
name: 'refFamTel',
|
|
547
|
+
required: false,
|
|
548
|
+
visible: true,
|
|
549
|
+
label: 'Teléfono Referencia',
|
|
550
|
+
placeholder: '0999999999',
|
|
551
|
+
},
|
|
552
|
+
housingTypeId: {
|
|
553
|
+
name: 'housingTypeId',
|
|
554
|
+
required: false,
|
|
555
|
+
visible: true,
|
|
556
|
+
label: 'Tipo de Vivienda',
|
|
557
|
+
placeholder: 'Seleccione',
|
|
558
|
+
},
|
|
559
|
+
dirVivienda: {
|
|
560
|
+
name: 'dirVivienda',
|
|
561
|
+
required: false,
|
|
562
|
+
visible: true,
|
|
563
|
+
label: 'Dirección de Vivienda',
|
|
564
|
+
placeholder: 'Dirección completa',
|
|
565
|
+
},
|
|
566
|
+
refDomicilio: {
|
|
567
|
+
name: 'refDomicilio',
|
|
568
|
+
required: false,
|
|
569
|
+
visible: true,
|
|
570
|
+
label: 'Referencia de Domicilio',
|
|
571
|
+
placeholder: 'Referencia',
|
|
572
|
+
},
|
|
573
|
+
sector: {
|
|
574
|
+
name: 'sector',
|
|
575
|
+
required: false,
|
|
576
|
+
visible: true,
|
|
577
|
+
label: 'Sector',
|
|
578
|
+
placeholder: 'Ingrese sector',
|
|
579
|
+
},
|
|
580
|
+
barrio: {
|
|
581
|
+
name: 'barrio',
|
|
582
|
+
required: false,
|
|
583
|
+
visible: true,
|
|
584
|
+
label: 'Barrio',
|
|
585
|
+
placeholder: 'Ingrese barrio',
|
|
586
|
+
},
|
|
587
|
+
calle: {
|
|
588
|
+
name: 'calle',
|
|
589
|
+
required: false,
|
|
590
|
+
visible: true,
|
|
591
|
+
label: 'Calle',
|
|
592
|
+
placeholder: 'Calle principal',
|
|
593
|
+
},
|
|
594
|
+
},
|
|
595
|
+
submitButtonText: 'Guardar Cliente',
|
|
596
|
+
cancelButtonText: 'Cancelar',
|
|
597
|
+
};
|
|
598
|
+
// Configuración MÍNIMA para POS
|
|
599
|
+
const POS_COMPANY_CUSTOMER_CONFIG = {
|
|
600
|
+
fields: {
|
|
601
|
+
// Solo lo esencial
|
|
602
|
+
idTipoIdentificacion: {
|
|
603
|
+
name: 'idTipoIdentificacion',
|
|
604
|
+
required: true,
|
|
605
|
+
visible: true,
|
|
606
|
+
label: 'Tipo ID',
|
|
607
|
+
placeholder: 'Tipo',
|
|
608
|
+
},
|
|
609
|
+
numeroIdentificacion: {
|
|
610
|
+
name: 'numeroIdentificacion',
|
|
611
|
+
required: true,
|
|
612
|
+
visible: true,
|
|
613
|
+
label: 'Cédula/RUC',
|
|
614
|
+
placeholder: 'Número de identificación',
|
|
615
|
+
},
|
|
616
|
+
nombreFiscal: {
|
|
617
|
+
name: 'nombreFiscal',
|
|
618
|
+
required: true,
|
|
619
|
+
visible: true,
|
|
620
|
+
label: 'Nombre',
|
|
621
|
+
placeholder: 'Nombre del cliente',
|
|
622
|
+
},
|
|
623
|
+
nombreComercial: {
|
|
624
|
+
name: 'nombreComercial',
|
|
625
|
+
required: false,
|
|
626
|
+
visible: false,
|
|
627
|
+
},
|
|
628
|
+
direccion: {
|
|
629
|
+
name: 'direccion',
|
|
630
|
+
required: false,
|
|
631
|
+
visible: true,
|
|
632
|
+
label: 'Dirección',
|
|
633
|
+
placeholder: 'Dirección',
|
|
634
|
+
},
|
|
635
|
+
correo: {
|
|
636
|
+
name: 'correo',
|
|
637
|
+
required: false,
|
|
638
|
+
visible: false,
|
|
639
|
+
},
|
|
640
|
+
telefono: {
|
|
641
|
+
name: 'telefono',
|
|
642
|
+
required: false,
|
|
643
|
+
visible: true,
|
|
644
|
+
label: 'Teléfono',
|
|
645
|
+
placeholder: 'Teléfono',
|
|
646
|
+
},
|
|
647
|
+
// Resto oculto
|
|
648
|
+
idFormaPagoSri: { name: 'idFormaPagoSri', required: false, visible: false },
|
|
649
|
+
idTipoClienteProveedor: { name: 'idTipoClienteProveedor', required: false, visible: false },
|
|
650
|
+
idSubContribuyente: { name: 'idSubContribuyente', required: false, visible: false },
|
|
651
|
+
idTiempoCredito: { name: 'idTiempoCredito', required: false, visible: false },
|
|
652
|
+
idCiudad: { name: 'idCiudad', required: false, visible: false },
|
|
653
|
+
idCargo: { name: 'idCargo', required: false, visible: false },
|
|
654
|
+
idEmpleado: { name: 'idEmpleado', required: false, visible: false },
|
|
655
|
+
placa: { name: 'placa', required: false, visible: false },
|
|
656
|
+
nota: { name: 'nota', required: false, visible: false },
|
|
657
|
+
birthDate: { name: 'birthDate', required: false, visible: false },
|
|
658
|
+
estado: { name: 'estado', required: false, visible: false },
|
|
659
|
+
validationSri: { name: 'validationSri', required: false, visible: false },
|
|
660
|
+
configValorBruto: { name: 'configValorBruto', required: false, visible: false },
|
|
661
|
+
},
|
|
662
|
+
showCreditInfo: false, // Sin info de crédito en POS
|
|
663
|
+
submitButtonText: 'Agregar',
|
|
664
|
+
cancelButtonText: 'Cancelar',
|
|
665
|
+
};
|
|
666
|
+
|
|
667
|
+
class CompanyCustomerForm {
|
|
584
668
|
formId = input(...(ngDevMode ? [undefined, { debugName: "formId" }] : []));
|
|
585
|
-
customer;
|
|
586
|
-
mode = 'create';
|
|
669
|
+
customer = input({}, ...(ngDevMode ? [{ debugName: "customer" }] : []));
|
|
670
|
+
mode = input('create', ...(ngDevMode ? [{ debugName: "mode" }] : []));
|
|
587
671
|
showButtons = input(true, ...(ngDevMode ? [{ debugName: "showButtons" }] : []));
|
|
588
672
|
submitted = output();
|
|
589
673
|
cancelled = output();
|
|
590
|
-
panelOpenState = signal(false, ...(ngDevMode ? [{ debugName: "panelOpenState" }] : []));
|
|
591
674
|
fb = inject(FormBuilder);
|
|
592
675
|
config = inject(COMPANY_CUSTOMER_FORM_CONFIG, { optional: true }) ?? MAIN_APP_COMPANY_CUSTOMER_CONFIG;
|
|
593
|
-
customerService = inject(
|
|
676
|
+
customerService = inject(COMPANY_CUSTOMER_HTTP_TOKEN, { optional: true }) ?? inject(CompanyCustomerHttp);
|
|
594
677
|
form;
|
|
595
678
|
isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
596
679
|
errorMessage = null;
|
|
@@ -600,7 +683,7 @@ class CompanyCustomerFormComponent {
|
|
|
600
683
|
tiemposCredito = signal([], ...(ngDevMode ? [{ debugName: "tiemposCredito" }] : []));
|
|
601
684
|
tipoContribuyentes = signal([], ...(ngDevMode ? [{ debugName: "tipoContribuyentes" }] : []));
|
|
602
685
|
tiposCliente = signal([], ...(ngDevMode ? [{ debugName: "tiposCliente" }] : []));
|
|
603
|
-
|
|
686
|
+
identificationTypes = signal([], ...(ngDevMode ? [{ debugName: "identificationTypes" }] : []));
|
|
604
687
|
formasPagoSri = signal([], ...(ngDevMode ? [{ debugName: "formasPagoSri" }] : []));
|
|
605
688
|
placas = signal([], ...(ngDevMode ? [{ debugName: "placas" }] : []));
|
|
606
689
|
ciudades = signal([], ...(ngDevMode ? [{ debugName: "ciudades" }] : []));
|
|
@@ -609,21 +692,60 @@ class CompanyCustomerFormComponent {
|
|
|
609
692
|
employees = signal([], ...(ngDevMode ? [{ debugName: "employees" }] : []));
|
|
610
693
|
maritalStatuses = signal([], ...(ngDevMode ? [{ debugName: "maritalStatuses" }] : []));
|
|
611
694
|
housingTypes = signal([], ...(ngDevMode ? [{ debugName: "housingTypes" }] : []));
|
|
612
|
-
showRefresh = signal(true, ...(ngDevMode ? [{ debugName: "showRefresh" }] : []));
|
|
613
695
|
setStep(index) {
|
|
614
696
|
this.step.set(index);
|
|
615
697
|
}
|
|
616
|
-
|
|
617
|
-
this.
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
698
|
+
loadFormData() {
|
|
699
|
+
if (this.mode() === 'edit') {
|
|
700
|
+
return forkJoin([
|
|
701
|
+
from(this.customerService.getFormData()),
|
|
702
|
+
// from(this.customerService.getById(this.params.id)),
|
|
703
|
+
]);
|
|
704
|
+
}
|
|
705
|
+
return from(this.customerService.getFormData());
|
|
621
706
|
}
|
|
622
707
|
ngOnInit() {
|
|
623
708
|
this.buildForm();
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
709
|
+
this.loadFormData().subscribe(response => {
|
|
710
|
+
let mainDataForm = {};
|
|
711
|
+
// const dataCompanyCustomer = {} as any;
|
|
712
|
+
if (Array.isArray(response)) {
|
|
713
|
+
mainDataForm = response[0].data;
|
|
714
|
+
// dataCompanyCustomer = response[1];
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
mainDataForm = response;
|
|
718
|
+
}
|
|
719
|
+
console.log(response);
|
|
720
|
+
this.identificationTypes.set(mainDataForm.identificationTypes);
|
|
721
|
+
/* this.tiemposCredito.set(mainDataForm.tiempoCreditos);
|
|
722
|
+
this.tipoContribuyentes.set(mainDataForm.tipoContribuyentes);
|
|
723
|
+
this.formasPagoSri.set(mainDataForm.formasPagoSri);
|
|
724
|
+
this.tiposCliente.set(mainDataForm.tiposCliente);
|
|
725
|
+
this.ciudades.set(mainDataForm.ciudades);
|
|
726
|
+
this.cargos.set(mainDataForm.cargos);
|
|
727
|
+
this.empresas.set(mainDataForm.empresas);
|
|
728
|
+
this.employees.set(mainDataForm.employees);
|
|
729
|
+
this.maritalStatuses.set(mainDataForm.maritalStatuses);
|
|
730
|
+
this.housingTypes.set(mainDataForm.housingTypes);*/
|
|
731
|
+
if (this.mode() === 'create') {
|
|
732
|
+
const dataIdentificacion = this.identificationTypes().find(ti => ti.sriCode === SRI_DOCUMENT_TYPE.RUC);
|
|
733
|
+
if (dataIdentificacion) {
|
|
734
|
+
this.form.patchValue({
|
|
735
|
+
idTipoIdentificacion: dataIdentificacion.id,
|
|
736
|
+
});
|
|
737
|
+
// this.setIdentificationTypeChange(dataIdentificacion.codigoSri);
|
|
738
|
+
}
|
|
739
|
+
if (this.tiemposCredito().length > 0) {
|
|
740
|
+
this.form.patchValue({
|
|
741
|
+
idTiempoCredito: this.tiemposCredito()[0].id,
|
|
742
|
+
});
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
/* if (this.customer) {
|
|
747
|
+
this.patchFormValue(this.customer());
|
|
748
|
+
}*/
|
|
627
749
|
}
|
|
628
750
|
getDefaultConfig() {
|
|
629
751
|
// Configuración por defecto
|
|
@@ -801,9 +923,9 @@ class CompanyCustomerFormComponent {
|
|
|
801
923
|
}
|
|
802
924
|
this.isLoading.set(true);
|
|
803
925
|
this.errorMessage = null;
|
|
804
|
-
const operation$ = this.mode === 'create'
|
|
926
|
+
const operation$ = this.mode() === 'create'
|
|
805
927
|
? this.customerService.create(customerData)
|
|
806
|
-
: this.customerService.update(this.customer.id, customerData);
|
|
928
|
+
: this.customerService.update(this.customer().id, customerData);
|
|
807
929
|
operation$.subscribe({
|
|
808
930
|
next: (savedCustomer) => {
|
|
809
931
|
this.isLoading.set(false);
|
|
@@ -857,10 +979,10 @@ class CompanyCustomerFormComponent {
|
|
|
857
979
|
$event.stopPropagation();
|
|
858
980
|
console.log('search');
|
|
859
981
|
}
|
|
860
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
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 });
|
|
982
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerForm, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
983
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", 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
984
|
}
|
|
863
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type:
|
|
985
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerForm, decorators: [{
|
|
864
986
|
type: Component,
|
|
865
987
|
args: [{ selector: 'acp-company-customer-form', exportAs: 'acpCustomerForm', imports: [
|
|
866
988
|
ReactiveFormsModule,
|
|
@@ -869,25 +991,215 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImpor
|
|
|
869
991
|
MatExpansionModule,
|
|
870
992
|
MatSelectModule,
|
|
871
993
|
MatIcon,
|
|
872
|
-
Button,
|
|
873
994
|
ToUpperCase,
|
|
874
995
|
InputChip,
|
|
875
996
|
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
|
-
|
|
997
|
+
], 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"] }]
|
|
998
|
+
}], 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"] }] } });
|
|
999
|
+
|
|
1000
|
+
class CompanyCustomerAddEditDialog {
|
|
1001
|
+
formId = signal('companyCustomerFormId', ...(ngDevMode ? [{ debugName: "formId" }] : []));
|
|
1002
|
+
dgRef = inject((MatDialogRef));
|
|
1003
|
+
onCustomerCreated(customer) {
|
|
1004
|
+
console.log('Cliente creado:', customer);
|
|
1005
|
+
// Mostrar notificación de éxito
|
|
1006
|
+
}
|
|
1007
|
+
onCancel() {
|
|
1008
|
+
this.dgRef.close();
|
|
1009
|
+
}
|
|
1010
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerAddEditDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1011
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.6", 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"] }] });
|
|
1012
|
+
}
|
|
1013
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerAddEditDialog, decorators: [{
|
|
1014
|
+
type: Component,
|
|
1015
|
+
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" }]
|
|
1016
|
+
}] });
|
|
1017
|
+
|
|
1018
|
+
class CompanyCustomerAddEditDirective {
|
|
1019
|
+
dgSvc = inject(AdvancedDialogService);
|
|
1020
|
+
companyCustomerSaved = output();
|
|
1021
|
+
id = input(0, ...(ngDevMode ? [{ debugName: "id" }] : []));
|
|
1022
|
+
async onClick(event) {
|
|
1023
|
+
event.stopPropagation();
|
|
1024
|
+
const isEdit = this.id() > 0;
|
|
1025
|
+
const ref = await this.dgSvc.openInWrapper({
|
|
1026
|
+
component: CompanyCustomerAddEditDialog,
|
|
1027
|
+
title: isEdit ? 'Editar Cliente' : 'Nuevo Cliente',
|
|
1028
|
+
icon: isEdit ? 'edit' : 'add',
|
|
1029
|
+
showCloseButton: true,
|
|
1030
|
+
data: {
|
|
1031
|
+
id: this.id(),
|
|
1032
|
+
},
|
|
1033
|
+
}, {
|
|
1034
|
+
size: 'xxl',
|
|
1035
|
+
});
|
|
1036
|
+
ref.afterClosed().subscribe(result => {
|
|
1037
|
+
if (result && typeof result === 'object') {
|
|
1038
|
+
this.companyCustomerSaved.emit(result);
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1042
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerAddEditDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1043
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.6", 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 });
|
|
1044
|
+
}
|
|
1045
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerAddEditDirective, decorators: [{
|
|
1046
|
+
type: Directive,
|
|
1047
|
+
args: [{
|
|
1048
|
+
selector: '[acpCompanyCustomerAddEdit]',
|
|
1049
|
+
}]
|
|
1050
|
+
}], propDecorators: { companyCustomerSaved: [{ type: i0.Output, args: ["companyCustomerSaved"] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], onClick: [{
|
|
1051
|
+
type: HostListener,
|
|
1052
|
+
args: ['click', ['$event']]
|
|
1053
|
+
}] } });
|
|
882
1054
|
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
1055
|
+
const CUSTOMER_API = {
|
|
1056
|
+
BILLING: 'customers',
|
|
1057
|
+
};
|
|
1058
|
+
|
|
1059
|
+
class CustomerSriHttp {
|
|
1060
|
+
http = inject(HttpClient);
|
|
1061
|
+
get url() {
|
|
1062
|
+
// If CUSTOMER_API is not available, I might need to check where it is.
|
|
1063
|
+
// I'll assume the import above is correct for now.
|
|
1064
|
+
return `${CUSTOMER_API.BILLING}/Consultas/`;
|
|
1065
|
+
}
|
|
1066
|
+
getById(identificationNumber) {
|
|
1067
|
+
const idNumber = new IdentificationNumberVo(identificationNumber);
|
|
1068
|
+
const id = idNumber.getId();
|
|
1069
|
+
const endpoint = idNumber.isValidRuc()
|
|
1070
|
+
? `GetRucSRI?Ruc=${id}`
|
|
1071
|
+
: idNumber.isValidCedula()
|
|
1072
|
+
? `GetCedulaSri?Ruc=${id}`
|
|
1073
|
+
: (() => {
|
|
1074
|
+
throw new Error('Número de identificación inválido para SRI');
|
|
1075
|
+
})();
|
|
1076
|
+
// Returning Observable instead of Promise to be more Angular-idiomatic
|
|
1077
|
+
return this.http.get(`${this.url}${endpoint}`).pipe(map$1(response => {
|
|
1078
|
+
const idCard = response.numeroRuc ? response.numeroRuc : response.identificacion;
|
|
1079
|
+
const businessName = response.razonSocial ? response.razonSocial : response.nombreCompleto;
|
|
1080
|
+
const data = {
|
|
1081
|
+
phone: response.telefono,
|
|
1082
|
+
email: response.email,
|
|
1083
|
+
idCard,
|
|
1084
|
+
businessName,
|
|
1085
|
+
address: response.direccion,
|
|
1086
|
+
};
|
|
1087
|
+
return {
|
|
1088
|
+
status: response.error ? 'warning' : 'success',
|
|
1089
|
+
code: response.error ? 'EXTERNAL_API_ERROR' : 'SUCCESS',
|
|
1090
|
+
data,
|
|
1091
|
+
message: response.error ?? 'External API call completed',
|
|
1092
|
+
timestamp: new Date().toISOString(),
|
|
1093
|
+
};
|
|
1094
|
+
}));
|
|
1095
|
+
}
|
|
1096
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CustomerSriHttp, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1097
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CustomerSriHttp, providedIn: 'root' });
|
|
1098
|
+
}
|
|
1099
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CustomerSriHttp, decorators: [{
|
|
1100
|
+
type: Injectable,
|
|
1101
|
+
args: [{
|
|
1102
|
+
providedIn: 'root',
|
|
1103
|
+
}]
|
|
1104
|
+
}] });
|
|
1105
|
+
|
|
1106
|
+
class CompanyCustomerList {
|
|
1107
|
+
http = inject(COMPANY_CUSTOMER_HTTP_TOKEN);
|
|
1108
|
+
canEdit = input(true, ...(ngDevMode ? [{ debugName: "canEdit" }] : []));
|
|
1109
|
+
canAdd = input(true, ...(ngDevMode ? [{ debugName: "canAdd" }] : []));
|
|
1110
|
+
canInactive = input(true, ...(ngDevMode ? [{ debugName: "canInactive" }] : []));
|
|
1111
|
+
canGenerateReport = input(true, ...(ngDevMode ? [{ debugName: "canGenerateReport" }] : []));
|
|
1112
|
+
dataSearch = {
|
|
1113
|
+
textSearch: null,
|
|
1114
|
+
};
|
|
1115
|
+
dataSource = signal([], ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
|
|
1116
|
+
columnsDefs = [
|
|
1117
|
+
{ field: 'index', header: '#' },
|
|
1118
|
+
{ field: 'op', header: 'Op.' },
|
|
1119
|
+
{ field: 'identificationType', header: 'Tipo' },
|
|
1120
|
+
{ field: 'idCard', header: 'Nro. Identificación' },
|
|
1121
|
+
{ field: 'tradeName', header: 'Razón Social' },
|
|
1122
|
+
{ field: 'legalName', header: 'Nombre Comercial' },
|
|
1123
|
+
{ field: 'address', header: 'Dirección' },
|
|
1124
|
+
{ field: 'email', header: 'Correo' },
|
|
1125
|
+
{ field: 'phone', header: 'Teléfono' },
|
|
1126
|
+
{
|
|
1127
|
+
field: 'sriValidation',
|
|
1128
|
+
header: 'Validación Sri',
|
|
1129
|
+
type: 'tag',
|
|
1130
|
+
tag: {
|
|
1131
|
+
true: { text: 'Si', color: 'text-danger' },
|
|
1132
|
+
false: { text: 'No', color: 'text-success' },
|
|
1133
|
+
},
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
field: 'status',
|
|
1137
|
+
header: 'Estado',
|
|
1138
|
+
type: 'tag',
|
|
1139
|
+
tag: {
|
|
1140
|
+
true: { text: 'Activo', color: 'text-primary' },
|
|
1141
|
+
false: { text: 'Inactivo', color: 'text-success' },
|
|
1142
|
+
},
|
|
1143
|
+
},
|
|
1144
|
+
];
|
|
1145
|
+
pageIndex = signal(0, ...(ngDevMode ? [{ debugName: "pageIndex" }] : []));
|
|
1146
|
+
pageSize = signal(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
1147
|
+
pageCount = signal(0, ...(ngDevMode ? [{ debugName: "pageCount" }] : []));
|
|
1148
|
+
refresh() {
|
|
1149
|
+
this.list();
|
|
1150
|
+
}
|
|
1151
|
+
list() {
|
|
1152
|
+
const params = {
|
|
1153
|
+
pageIndex: this.pageIndex() + 1,
|
|
1154
|
+
pageSize: this.pageSize(),
|
|
1155
|
+
checkTextSearch: !!isValidField(this.dataSearch.textSearch),
|
|
1156
|
+
textSearch: isValidField(this.dataSearch.textSearch),
|
|
1157
|
+
};
|
|
1158
|
+
this.http.list(params).subscribe(response => {
|
|
1159
|
+
console.log(response);
|
|
1160
|
+
this.dataSource.set(response.data);
|
|
1161
|
+
this.pageCount.set(response.pagination.totalRecords);
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
ngOnInit() {
|
|
1165
|
+
this.refresh();
|
|
1166
|
+
}
|
|
1167
|
+
handlePageEvent($event) {
|
|
1168
|
+
this.pageIndex.set($event.pageIndex);
|
|
1169
|
+
this.pageSize.set($event.pageSize);
|
|
1170
|
+
this.pageCount.set($event.length);
|
|
1171
|
+
this.refresh();
|
|
1172
|
+
}
|
|
1173
|
+
exportExcel() {
|
|
1174
|
+
/* empty */
|
|
1175
|
+
}
|
|
1176
|
+
exportPdf() {
|
|
1177
|
+
/* empty */
|
|
1178
|
+
}
|
|
1179
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1180
|
+
askToDelete(data) {
|
|
1181
|
+
/* empty */
|
|
1182
|
+
}
|
|
1183
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1184
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", 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"] }] });
|
|
1185
|
+
}
|
|
1186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: CompanyCustomerList, decorators: [{
|
|
1187
|
+
type: Component,
|
|
1188
|
+
args: [{ selector: 'acp-company-customer-list', imports: [
|
|
1189
|
+
DataGrid,
|
|
1190
|
+
MatFormFieldModule,
|
|
1191
|
+
MatInputModule,
|
|
1192
|
+
Button,
|
|
1193
|
+
FormsModule,
|
|
1194
|
+
MatIcon,
|
|
1195
|
+
MatMenuModule,
|
|
1196
|
+
CompanyCustomerAddEditDirective,
|
|
1197
|
+
], 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" }]
|
|
1198
|
+
}], 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
1199
|
|
|
888
1200
|
/**
|
|
889
1201
|
* Generated bundle index. Do not edit.
|
|
890
1202
|
*/
|
|
891
1203
|
|
|
892
|
-
export { COMPANY_CUSTOMER_FORM_CONFIG, COMPANY_CUSTOMER_MAPPER,
|
|
1204
|
+
export { COMPANY_CUSTOMER_FORM_CONFIG, COMPANY_CUSTOMER_HTTP_TOKEN, COMPANY_CUSTOMER_MAPPER, CompanyCustomerAddEditDialog, CompanyCustomerAddEditDirective, CompanyCustomerDefaultMapper, CompanyCustomerForm, CompanyCustomerFormDataResult, CompanyCustomerHttp, CompanyCustomerList, CustomerSriHttp, CustomerValidators, MAIN_APP_COMPANY_CUSTOMER_CONFIG, POS_COMPANY_CUSTOMER_CONFIG };
|
|
893
1205
|
//# sourceMappingURL=acontplus-ng-customer.mjs.map
|