upconta.frontend-utils 2.4.0 → 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.
@@ -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;