upconta.frontend-utils 2.3.2 → 2.5.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/.dist/cjs/components/Seeker.d.ts +10 -58
- package/.dist/cjs/components/Seeker.utils.d.ts +14 -38
- package/.dist/cjs/components/Seeker.utils.ec.d.ts +4 -0
- package/.dist/cjs/components/Seeker.utils.mx.d.ts +4 -66
- package/.dist/cjs/components/SeekerMx.d.ts +3 -2
- package/.dist/cjs/components/administrative/FormularioPersonas.d.ts +1 -1
- package/.dist/cjs/components/contability/AccountingVoucherButton.d.ts +9 -0
- package/.dist/cjs/components/contability/AccountingVoucherModal.d.ts +12 -0
- package/.dist/cjs/components/contexts/Empresa.d.ts +1 -0
- package/.dist/cjs/components/index.d.ts +5 -3
- package/.dist/cjs/components/mx/administrative/FormularioPersonasMx.d.ts +1 -1
- package/.dist/cjs/components/mx/administrative/FormularioProductoServicioMx.d.ts +1 -1
- package/.dist/cjs/components/mx/contability/FormularioCuentas.d.ts +1 -1
- package/.dist/cjs/components/production/ProductsServicesForm.d.ts +13 -0
- package/.dist/cjs/index.js +2 -2
- package/.dist/cjs/index.js.map +1 -1
- package/.dist/cjs/libs/filtros.d.ts +3 -3
- package/.dist/cjs/libs/hooks/accounting-rules.d.ts +7 -0
- package/.dist/cjs/libs/index.d.ts +1 -0
- package/.dist/cjs/libs/utils.d.ts +10 -0
- package/.dist/cjs/types/production.d.ts +78 -0
- package/.dist/cjs/types.d.ts +11 -0
- package/.dist/esm/index.js +2 -2
- package/.dist/esm/index.js.map +1 -1
- package/package.json +18 -18
|
@@ -4,10 +4,10 @@ declare const $filtros: {
|
|
|
4
4
|
min?: number;
|
|
5
5
|
max?: number;
|
|
6
6
|
}): string;
|
|
7
|
-
date(value: string | Dayjs | Date, format?: string): string;
|
|
7
|
+
date(value: string | Dayjs | Date | undefined, format?: string): string;
|
|
8
8
|
dateLiteral(value: string | Date): string;
|
|
9
|
-
completeDate(value: string | Dayjs | Date): string;
|
|
10
|
-
month(value: string | Dayjs | Date): string;
|
|
9
|
+
completeDate(value: string | Dayjs | Date | undefined): string;
|
|
10
|
+
month(value: string | Dayjs | Date | undefined): string;
|
|
11
11
|
percent(value?: number | string, arg?: number): string;
|
|
12
12
|
};
|
|
13
13
|
export default $filtros;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type Rules = 'buy' | 'treasuryIngress' | 'treasuryEgress' | 'payment' | 'collection' | 'closure' | 'bill' | 'creditNote' | 'billRefund' | 'factura-diferidos' | 'liquidacion-importacion';
|
|
2
|
+
declare const useAccountingRules: (props: {
|
|
3
|
+
rule?: Rules | Rules[];
|
|
4
|
+
}) => {
|
|
5
|
+
openVoucher: (id?: string) => void;
|
|
6
|
+
};
|
|
7
|
+
export default useAccountingRules;
|
|
@@ -3,3 +3,4 @@ export { default as $reglas } from './reglas';
|
|
|
3
3
|
export { default as $filtros } from './filtros';
|
|
4
4
|
export { default as useVistaPrincipal } from './hooks/vista-principal';
|
|
5
5
|
export { default as useVistaInsertar } from './hooks/vista-insertar';
|
|
6
|
+
export { default as useAccountingRules } from './hooks/accounting-rules';
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import type { NextRouter } from 'next/router';
|
|
3
|
+
/**
|
|
4
|
+
* Identifica el error, de axios o de la aplicación, y retorna el mensaje
|
|
5
|
+
* @param err El error lanzado
|
|
6
|
+
* @returns El mensaje de error
|
|
7
|
+
*/
|
|
8
|
+
export declare const getErrorMessage: (err: any) => Promise<{
|
|
9
|
+
message: string;
|
|
10
|
+
tipo: "error";
|
|
11
|
+
}>;
|
|
3
12
|
/**
|
|
4
13
|
* Hook con utilidades para el funcionamiento de la aplicación
|
|
5
14
|
*/
|
|
@@ -26,6 +35,7 @@ export declare const getApiEndpoint: (endpoint: string, queries?: Record<string,
|
|
|
26
35
|
export declare const getNestedPath: (object: any, path: string) => any;
|
|
27
36
|
export declare const hashear: (mensaje: string) => number;
|
|
28
37
|
export declare const redireccionarLogin: (router: NextRouter, pathLogin?: string) => void;
|
|
38
|
+
export declare const pushToApp: (router: NextRouter, path: string) => void;
|
|
29
39
|
export declare function nDecimals(number: number, decimals?: number): number;
|
|
30
40
|
export declare const rewrites: {
|
|
31
41
|
source: string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Attachment, Movement } from '../';
|
|
2
|
+
export type PorcentajesDeIVA = '0' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '10';
|
|
3
|
+
export type PorcentajesDeICE = '3023' | '3610' | '3620' | '3630' | '3640' | '3670' | '3770' | '3043';
|
|
4
|
+
export type PorcentajesDeIRBPNR = '5001';
|
|
5
|
+
export type InfoAdicional = {
|
|
6
|
+
nombre: string;
|
|
7
|
+
valor: string;
|
|
8
|
+
};
|
|
9
|
+
export type TipoProducto = 'insumo' | 'combo' | 'receta' | 'producto' | 'fabricado';
|
|
10
|
+
export type Bodega = {
|
|
11
|
+
bodega: string;
|
|
12
|
+
amount: number;
|
|
13
|
+
};
|
|
14
|
+
export type RelacionProducto = {
|
|
15
|
+
producto: string;
|
|
16
|
+
cantidad: number;
|
|
17
|
+
nota?: string;
|
|
18
|
+
precio?: number;
|
|
19
|
+
};
|
|
20
|
+
export type Precio = {
|
|
21
|
+
_id?: string;
|
|
22
|
+
cliente?: {
|
|
23
|
+
_id?: string;
|
|
24
|
+
nombre?: string;
|
|
25
|
+
};
|
|
26
|
+
descripcion: string;
|
|
27
|
+
precio: number;
|
|
28
|
+
descuento?: number;
|
|
29
|
+
};
|
|
30
|
+
export interface Producto {
|
|
31
|
+
_id: string;
|
|
32
|
+
code: string;
|
|
33
|
+
auxiliarCode?: string;
|
|
34
|
+
type?: 'product' | 'service';
|
|
35
|
+
price?: number;
|
|
36
|
+
precios: Precio[];
|
|
37
|
+
precioFinal?: number;
|
|
38
|
+
description: string;
|
|
39
|
+
descripciones: Array<string>;
|
|
40
|
+
iva: PorcentajesDeIVA;
|
|
41
|
+
ice?: PorcentajesDeICE;
|
|
42
|
+
icePercentage?: number;
|
|
43
|
+
irbpnr?: PorcentajesDeIRBPNR;
|
|
44
|
+
aditionalInformation?: InfoAdicional[];
|
|
45
|
+
accountingAccount?: string;
|
|
46
|
+
status: 'active' | 'inactive';
|
|
47
|
+
claveProdServ: string;
|
|
48
|
+
claveUnidad: string;
|
|
49
|
+
noDeIdentificacion?: string;
|
|
50
|
+
ieps?: number;
|
|
51
|
+
ivaRet?: number;
|
|
52
|
+
iepsRet?: number;
|
|
53
|
+
isrRet?: number;
|
|
54
|
+
ObjetoImp?: string;
|
|
55
|
+
paraRestaurantes?: boolean;
|
|
56
|
+
categorias: string[];
|
|
57
|
+
categoriasRestaurantes: string[];
|
|
58
|
+
descuento?: number;
|
|
59
|
+
impresora?: string;
|
|
60
|
+
total: number;
|
|
61
|
+
bodegas: Bodega[];
|
|
62
|
+
images: Attachment[];
|
|
63
|
+
relaciones: RelacionProducto[];
|
|
64
|
+
tipoProducto: TipoProducto;
|
|
65
|
+
NoAplicaServicio?: boolean;
|
|
66
|
+
_movements: Movement[];
|
|
67
|
+
precioConDescuento?: number;
|
|
68
|
+
costo?: number;
|
|
69
|
+
costoUltimaCompra?: number;
|
|
70
|
+
}
|
|
71
|
+
export interface Categoria {
|
|
72
|
+
_id: string;
|
|
73
|
+
business: string;
|
|
74
|
+
nombre: string;
|
|
75
|
+
descripcion?: string;
|
|
76
|
+
color: string;
|
|
77
|
+
estado?: string;
|
|
78
|
+
}
|
package/.dist/cjs/types.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { VistaInsertar } from './libs/hooks/vista-insertar';
|
|
1
2
|
export type { Modulo } from './types/Empresa';
|
|
2
3
|
export interface ApiResponse<T> {
|
|
3
4
|
data: T[];
|
|
@@ -29,3 +30,13 @@ export interface Movement {
|
|
|
29
30
|
nota?: string;
|
|
30
31
|
mostrarBadge?: boolean;
|
|
31
32
|
}
|
|
33
|
+
export type Attachment = {
|
|
34
|
+
_id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
mimetype: string;
|
|
37
|
+
fromFileLibrary?: boolean;
|
|
38
|
+
};
|
|
39
|
+
export interface SeekerModalRef {
|
|
40
|
+
form: VistaInsertar['form'];
|
|
41
|
+
onSubmit: VistaInsertar['onSubmit'];
|
|
42
|
+
}
|