@acontplus/ng-common 1.0.1 → 1.0.3
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 +260 -141
- package/fesm2022/acontplus-ng-common.mjs +361 -57
- package/fesm2022/acontplus-ng-common.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acontplus-ng-common.d.ts +180 -24
|
@@ -119,6 +119,145 @@ interface ReportPort {
|
|
|
119
119
|
getFileName(response: any): string;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
/**
|
|
123
|
+
* Códigos de reportes de ventas
|
|
124
|
+
*/
|
|
125
|
+
declare enum SALE_CODE_REPORT {
|
|
126
|
+
/**
|
|
127
|
+
* SALE REPORT RENTABILIDAD
|
|
128
|
+
*/
|
|
129
|
+
SRR = "SRR",
|
|
130
|
+
/**
|
|
131
|
+
* SALE REPORT RENTABILIDAD CUSTOM
|
|
132
|
+
*/
|
|
133
|
+
SRRC = "SRRC",
|
|
134
|
+
/**
|
|
135
|
+
* SALE REPORT INVOICE GENERAL
|
|
136
|
+
*/
|
|
137
|
+
FG = "FG"
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Códigos de reportes de compras
|
|
141
|
+
*/
|
|
142
|
+
declare enum PURCHASE_CODE_REPORT {
|
|
143
|
+
/**
|
|
144
|
+
* REPORTE COMPRAS NOTA HIDDEN
|
|
145
|
+
*/
|
|
146
|
+
RCNH = "RCNH",
|
|
147
|
+
/**
|
|
148
|
+
* REPORTE LIQUIDACION COMPRA
|
|
149
|
+
*/
|
|
150
|
+
RLC = "RLC"
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Códigos de reportes de contabilidad
|
|
154
|
+
*/
|
|
155
|
+
declare enum ACCOUNTING_CODE_REPORT {
|
|
156
|
+
/**
|
|
157
|
+
* REPORTE CONTABLE ESTADO GENERAL RESULTADO
|
|
158
|
+
*/
|
|
159
|
+
RCEGR = "RCEGR",
|
|
160
|
+
/**
|
|
161
|
+
* ASIENTO CONTABLE ESTADO DE FLUJO DE PAGO
|
|
162
|
+
*/
|
|
163
|
+
ACEDFP = "ACEDFP",
|
|
164
|
+
/**
|
|
165
|
+
* ASIENTO CONTABLE ESTADO LIBRO CAJA
|
|
166
|
+
*/
|
|
167
|
+
ACELC = "ACELC"
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Códigos de reportes de clientes
|
|
171
|
+
*/
|
|
172
|
+
declare enum CUSTOMER_CODE_REPORT {
|
|
173
|
+
/**
|
|
174
|
+
* REPORTE CLIENTE LISTADO
|
|
175
|
+
*/
|
|
176
|
+
RCL = "RCL"
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Códigos de reportes de inventario
|
|
180
|
+
*/
|
|
181
|
+
declare enum INVENTORY_CODE_REPORT {
|
|
182
|
+
/**
|
|
183
|
+
* REPORTE KARDEX
|
|
184
|
+
*/
|
|
185
|
+
RK = "RK",
|
|
186
|
+
/**
|
|
187
|
+
* CONSOLIDADO DE ARTICULOS AGRUPADO
|
|
188
|
+
*/
|
|
189
|
+
CDAA = "CDAA",
|
|
190
|
+
/**
|
|
191
|
+
* CONSOLIDADO DE ARTICULOS
|
|
192
|
+
*/
|
|
193
|
+
CDA = "CDA",
|
|
194
|
+
/**
|
|
195
|
+
* INVENTARIO REPORTE VALORACION
|
|
196
|
+
*/
|
|
197
|
+
STOCK_VALORACION = "INVRV",
|
|
198
|
+
/**
|
|
199
|
+
* INVENTARIO ARTICULO TABLA
|
|
200
|
+
*/
|
|
201
|
+
ARTICULO_PVP = "INVAT",
|
|
202
|
+
/**
|
|
203
|
+
* REPORTE DE ARTICULOS FRACCIONADOS
|
|
204
|
+
*/
|
|
205
|
+
RAF = "RAF",
|
|
206
|
+
/**
|
|
207
|
+
* REPORTE DE CADUCIDAD DE ARTICULOS
|
|
208
|
+
*/
|
|
209
|
+
RCAA = "RCAA",
|
|
210
|
+
/**
|
|
211
|
+
* REPORTE DE ARTICULO STOCK VALORACION
|
|
212
|
+
*/
|
|
213
|
+
RASR = "RASR",
|
|
214
|
+
/**
|
|
215
|
+
* REPORTE CONSOLIDACION DETALLE
|
|
216
|
+
*/
|
|
217
|
+
RCD = "RCD",
|
|
218
|
+
/**
|
|
219
|
+
* REPORTE TRANSFERENCIA BODEGA
|
|
220
|
+
*/
|
|
221
|
+
RTB = "RTB"
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Códigos de documentos electrónicos
|
|
225
|
+
*/
|
|
226
|
+
declare enum ELECTRONIC_DOCUMENT_CODE {
|
|
227
|
+
/**
|
|
228
|
+
* FACTURA
|
|
229
|
+
*/
|
|
230
|
+
FV = "FV",
|
|
231
|
+
/**
|
|
232
|
+
* NOTA DE ENTREGA
|
|
233
|
+
*/
|
|
234
|
+
NE = "NE",
|
|
235
|
+
/**
|
|
236
|
+
* NOTA DE CREDITO
|
|
237
|
+
*/
|
|
238
|
+
NC = "NC",
|
|
239
|
+
/**
|
|
240
|
+
* NOTA DE DEBITO
|
|
241
|
+
*/
|
|
242
|
+
ND = "ND",
|
|
243
|
+
/**
|
|
244
|
+
* GUIA DE REMISION
|
|
245
|
+
*/
|
|
246
|
+
GR = "GR",
|
|
247
|
+
/**
|
|
248
|
+
* ORDEN DE PEDIDO
|
|
249
|
+
*/
|
|
250
|
+
NORMAL = "NORMAL"
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Formatos de reporte disponibles
|
|
254
|
+
*/
|
|
255
|
+
declare enum REPORT_FORMAT {
|
|
256
|
+
PDF = "pdf",
|
|
257
|
+
EXCEL = "excel",
|
|
258
|
+
WORD = "word"
|
|
259
|
+
}
|
|
260
|
+
|
|
122
261
|
declare const API_PATHS: {
|
|
123
262
|
readonly WHATSAPP: "/api/common/whatsapp-cloud";
|
|
124
263
|
readonly REPORTS: "/api/reports";
|
|
@@ -149,7 +288,6 @@ declare class ReportFacade {
|
|
|
149
288
|
|
|
150
289
|
declare class WhatsAppMessagingFacade {
|
|
151
290
|
private readonly messagingPort;
|
|
152
|
-
private readonly messageBuilder;
|
|
153
291
|
sendSimpleText(to: string, message: string, previewUrl?: boolean): Observable<WhatsAppResponse>;
|
|
154
292
|
sendTemplateText(to: string, templateName: string, params?: string[], languageCode?: string): Observable<WhatsAppResponse>;
|
|
155
293
|
sendDocument(to: string, documentUrl: string, caption?: string, filename?: string): Observable<WhatsAppResponse>;
|
|
@@ -248,38 +386,53 @@ interface ReportDocumentData {
|
|
|
248
386
|
codEstab?: string;
|
|
249
387
|
id?: number;
|
|
250
388
|
serie?: string;
|
|
389
|
+
[key: string]: any;
|
|
251
390
|
}
|
|
252
391
|
interface ReportParams {
|
|
253
392
|
hasService?: boolean;
|
|
254
393
|
reportParams: string;
|
|
255
394
|
dataParams: string;
|
|
256
395
|
}
|
|
396
|
+
interface ReportConfig {
|
|
397
|
+
codigo: string;
|
|
398
|
+
hasService: boolean;
|
|
399
|
+
useV1Api: boolean;
|
|
400
|
+
idField: string;
|
|
401
|
+
extraDataParams?: Record<string, any>;
|
|
402
|
+
includeEstabInData?: boolean;
|
|
403
|
+
includeCodigoInData?: boolean;
|
|
404
|
+
hasParams?: boolean;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Builder para construir parámetros de reportes
|
|
408
|
+
* Clase utilitaria con métodos estáticos
|
|
409
|
+
*/
|
|
257
410
|
declare class ReportParamsBuilder {
|
|
258
|
-
private readonly reportConfigs;
|
|
411
|
+
private static readonly reportConfigs;
|
|
259
412
|
/**
|
|
260
413
|
* Construye los parámetros de reporte según el tipo de documento
|
|
261
414
|
*/
|
|
262
|
-
buildParams(docData: ReportDocumentData, format?: 'pdf' | 'excel' | 'word'): ReportParams;
|
|
415
|
+
static buildParams(docData: ReportDocumentData, format?: 'pdf' | 'excel' | 'word'): ReportParams;
|
|
263
416
|
/**
|
|
264
417
|
* Determina si debe usar la API v1 según el tipo de documento
|
|
265
418
|
*/
|
|
266
|
-
shouldUseV1Api(codDoc: string): boolean;
|
|
419
|
+
static shouldUseV1Api(codDoc: string): boolean;
|
|
267
420
|
/**
|
|
268
421
|
* Obtiene la configuración para un tipo de documento
|
|
269
422
|
*/
|
|
270
|
-
private getReportConfig;
|
|
423
|
+
private static getReportConfig;
|
|
271
424
|
/**
|
|
272
425
|
* Construye los parámetros del reporte
|
|
273
426
|
*/
|
|
274
|
-
private buildReportParams;
|
|
427
|
+
private static buildReportParams;
|
|
275
428
|
/**
|
|
276
429
|
* Construye los parámetros de datos
|
|
277
430
|
*/
|
|
278
|
-
private buildDataParams;
|
|
431
|
+
private static buildDataParams;
|
|
279
432
|
/**
|
|
280
|
-
*
|
|
433
|
+
* Construye las opciones completas para generar un reporte
|
|
281
434
|
*/
|
|
282
|
-
|
|
435
|
+
static build(docData: ReportDocumentData, format?: 'pdf' | 'excel' | 'word', returnBlob?: boolean): {
|
|
283
436
|
data: ReportParams;
|
|
284
437
|
format: "pdf" | "excel" | "word";
|
|
285
438
|
useV1Api: boolean;
|
|
@@ -288,13 +441,15 @@ declare class ReportParamsBuilder {
|
|
|
288
441
|
/**
|
|
289
442
|
* Obtiene la lista de tipos de documento soportados
|
|
290
443
|
*/
|
|
291
|
-
getSupportedDocumentTypes(): string[];
|
|
444
|
+
static getSupportedDocumentTypes(): string[];
|
|
292
445
|
/**
|
|
293
446
|
* Verifica si un tipo de documento está soportado
|
|
294
447
|
*/
|
|
295
|
-
isDocumentTypeSupported(codDoc: string): boolean;
|
|
296
|
-
|
|
297
|
-
|
|
448
|
+
static isDocumentTypeSupported(codDoc: string): boolean;
|
|
449
|
+
/**
|
|
450
|
+
* Registra un nuevo tipo de reporte dinámicamente
|
|
451
|
+
*/
|
|
452
|
+
static registerReportType(codDoc: string, config: ReportConfig): void;
|
|
298
453
|
}
|
|
299
454
|
|
|
300
455
|
interface DocumentDeliveryData {
|
|
@@ -307,16 +462,18 @@ interface WhatsAppMessages {
|
|
|
307
462
|
main: string;
|
|
308
463
|
promo: string;
|
|
309
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Builder para construir mensajes de WhatsApp
|
|
467
|
+
* Clase utilitaria con métodos estáticos
|
|
468
|
+
*/
|
|
310
469
|
declare class WhatsAppMessageBuilder {
|
|
311
|
-
buildDocumentDeliveryMessages(data: DocumentDeliveryData): WhatsAppMessages;
|
|
312
|
-
buildWelcomeMessage(customerName: string, establishmentName: string): string;
|
|
313
|
-
buildOrderConfirmationMessage(orderNumber: string, customerName: string): string;
|
|
314
|
-
buildPaymentReminderMessage(customerName: string, amount: number, dueDate: string): string;
|
|
315
|
-
private buildMainMessage;
|
|
316
|
-
private buildPromoMessage;
|
|
317
|
-
private getDocumentTypeDisplay;
|
|
318
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<WhatsAppMessageBuilder, never>;
|
|
319
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<WhatsAppMessageBuilder>;
|
|
470
|
+
static buildDocumentDeliveryMessages(data: DocumentDeliveryData): WhatsAppMessages;
|
|
471
|
+
static buildWelcomeMessage(customerName: string, establishmentName: string): string;
|
|
472
|
+
static buildOrderConfirmationMessage(orderNumber: string, customerName: string): string;
|
|
473
|
+
static buildPaymentReminderMessage(customerName: string, amount: number, dueDate: string): string;
|
|
474
|
+
private static buildMainMessage;
|
|
475
|
+
private static buildPromoMessage;
|
|
476
|
+
private static getDocumentTypeDisplay;
|
|
320
477
|
}
|
|
321
478
|
|
|
322
479
|
/**
|
|
@@ -416,7 +573,6 @@ declare class WhatsAppSender implements OnInit {
|
|
|
416
573
|
private readonly whatsappFacade;
|
|
417
574
|
private readonly reportFacade;
|
|
418
575
|
private readonly snackBar;
|
|
419
|
-
private readonly reportBuilder;
|
|
420
576
|
whatsappForm: FormGroup;
|
|
421
577
|
isLoading: i0.WritableSignal<boolean>;
|
|
422
578
|
messageLength: number;
|
|
@@ -451,5 +607,5 @@ declare class WhatsAppSender implements OnInit {
|
|
|
451
607
|
static ɵcmp: i0.ɵɵComponentDeclaration<WhatsAppSender, "acp-whatsapp-sender", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
452
608
|
}
|
|
453
609
|
|
|
454
|
-
export { API_PATHS, DOCUMENT_TYPES, FileMapperUtil, GreenWhatsAppAdapter, MetaWhatsAppAdapter, PRINTER_PORT, PhoneFormatterUtil, PrinterAdapter, PrinterFacade, REPORT_PORT, ReportAdapter, ReportFacade, ReportParamsBuilder, WHATSAPP_MESSAGING_PORT, WhatsAppMessageBuilder, WhatsAppMessagingFacade, WhatsAppSender };
|
|
610
|
+
export { ACCOUNTING_CODE_REPORT, API_PATHS, CUSTOMER_CODE_REPORT, DOCUMENT_TYPES, ELECTRONIC_DOCUMENT_CODE, FileMapperUtil, GreenWhatsAppAdapter, INVENTORY_CODE_REPORT, MetaWhatsAppAdapter, PRINTER_PORT, PURCHASE_CODE_REPORT, PhoneFormatterUtil, PrinterAdapter, PrinterFacade, REPORT_FORMAT, REPORT_PORT, ReportAdapter, ReportFacade, ReportParamsBuilder, SALE_CODE_REPORT, WHATSAPP_MESSAGING_PORT, WhatsAppMessageBuilder, WhatsAppMessagingFacade, WhatsAppSender };
|
|
455
611
|
export type { ApiResponse, DocumentData, DocumentDeliveryData, DocumentDeliveryParams, PhoneValidationResult, PrintConfig, PrintParams, PrinterPort, ReportDocumentData, ReportOptions, ReportParams, ReportPort, WhatsAppDocumentMessage, WhatsAppDocumentRequest, WhatsAppDocumentTemplateMessage, WhatsAppDocumentTemplateRequest, WhatsAppMessageResponse, WhatsAppMessages, WhatsAppMessagingPort, WhatsAppProviderStatus, WhatsAppResponse, WhatsAppSendConfig, WhatsAppStatusResponse, WhatsAppTemplateMessage, WhatsAppTextMessage, WhatsAppTextRequest, WhatsAppTextTemplateRequest };
|