@openbox/shared-types 0.4.85 → 0.4.87
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/lib/invoices/Calculation/CalculateSingle/Response.d.ts +14 -7
- package/lib/invoices/Calculation/CalculateSingle/Response.js +1 -0
- package/lib/invoices/Calculation/CalculateSingle/Response.js.map +1 -1
- package/package.json +1 -1
- package/src/invoices/Calculation/CalculateSingle/Response.ts +25 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InvoicesDocumentTypesEnum } from '../../invoices.enums';
|
|
1
2
|
export type InvoicesCalculationsDetailsResponse = {
|
|
2
3
|
id?: string;
|
|
3
4
|
service: string;
|
|
@@ -30,23 +31,29 @@ export type InvoicesCalculationsTotalsItem = {
|
|
|
30
31
|
style?: string[];
|
|
31
32
|
show: true | false;
|
|
32
33
|
};
|
|
33
|
-
export
|
|
34
|
+
export interface InvoicesCalculationsTotalsResponse {
|
|
34
35
|
totalNoSuj: InvoicesCalculationsTotalsItem;
|
|
35
36
|
totalExenta: InvoicesCalculationsTotalsItem;
|
|
36
37
|
totalGravada: InvoicesCalculationsTotalsItem;
|
|
37
38
|
subTotalVentas: InvoicesCalculationsTotalsItem;
|
|
39
|
+
descuNoSuj: InvoicesCalculationsTotalsItem;
|
|
40
|
+
descuExenta: InvoicesCalculationsTotalsItem;
|
|
41
|
+
descuGravada: InvoicesCalculationsTotalsItem;
|
|
38
42
|
porcentajeDescuento: InvoicesCalculationsTotalsItem;
|
|
39
43
|
totalDescu: InvoicesCalculationsTotalsItem;
|
|
44
|
+
}
|
|
45
|
+
export interface InvoicesCalculationsTotalsResponseFCF extends InvoicesCalculationsTotalsResponse {
|
|
40
46
|
subTotal: InvoicesCalculationsTotalsItem;
|
|
41
47
|
ivaRete1: InvoicesCalculationsTotalsItem;
|
|
42
|
-
|
|
43
|
-
renta5: InvoicesCalculationsTotalsItem;
|
|
44
|
-
renta10: InvoicesCalculationsTotalsItem;
|
|
48
|
+
reteRenta: InvoicesCalculationsTotalsItem;
|
|
45
49
|
montoTotalOperacion: InvoicesCalculationsTotalsItem;
|
|
46
|
-
iva: InvoicesCalculationsTotalsItem;
|
|
47
50
|
totalPagar: InvoicesCalculationsTotalsItem;
|
|
51
|
+
}
|
|
52
|
+
type TotalsByType = {
|
|
53
|
+
[InvoicesDocumentTypesEnum.FCF]: InvoicesCalculationsTotalsResponseFCF;
|
|
48
54
|
};
|
|
49
|
-
export type InvoicesCalculationsCalculateSingleResponse = {
|
|
55
|
+
export type InvoicesCalculationsCalculateSingleResponse<T extends keyof TotalsByType> = {
|
|
50
56
|
details: InvoicesCalculationsDetailsResponse[];
|
|
51
|
-
totals:
|
|
57
|
+
totals: TotalsByType[T];
|
|
52
58
|
};
|
|
59
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../../src/invoices/Calculation/CalculateSingle/Response.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Response.js","sourceRoot":"","sources":["../../../../src/invoices/Calculation/CalculateSingle/Response.ts"],"names":[],"mappings":";;AAAA,yDAAgE"}
|
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { InvoicesDocumentTypesEnum } from '../../invoices.enums'
|
|
2
|
+
|
|
1
3
|
export type InvoicesCalculationsDetailsResponse = {
|
|
2
4
|
// Returns the same information received
|
|
3
5
|
id?: string
|
|
@@ -37,24 +39,40 @@ export type InvoicesCalculationsTotalsItem = {
|
|
|
37
39
|
show: true | false
|
|
38
40
|
}
|
|
39
41
|
|
|
40
|
-
export
|
|
42
|
+
export interface InvoicesCalculationsTotalsResponse {
|
|
43
|
+
// Totales antes de impuestos
|
|
41
44
|
totalNoSuj: InvoicesCalculationsTotalsItem
|
|
42
45
|
totalExenta: InvoicesCalculationsTotalsItem
|
|
43
46
|
totalGravada: InvoicesCalculationsTotalsItem
|
|
44
47
|
subTotalVentas: InvoicesCalculationsTotalsItem
|
|
48
|
+
|
|
49
|
+
// Descuentos
|
|
50
|
+
descuNoSuj: InvoicesCalculationsTotalsItem
|
|
51
|
+
descuExenta: InvoicesCalculationsTotalsItem
|
|
52
|
+
descuGravada: InvoicesCalculationsTotalsItem
|
|
45
53
|
porcentajeDescuento: InvoicesCalculationsTotalsItem
|
|
46
54
|
totalDescu: InvoicesCalculationsTotalsItem
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface InvoicesCalculationsTotalsResponseFCF extends InvoicesCalculationsTotalsResponse {
|
|
58
|
+
// Totales con impuestos
|
|
47
59
|
subTotal: InvoicesCalculationsTotalsItem
|
|
48
60
|
ivaRete1: InvoicesCalculationsTotalsItem
|
|
49
|
-
|
|
50
|
-
renta5: InvoicesCalculationsTotalsItem
|
|
51
|
-
renta10: InvoicesCalculationsTotalsItem
|
|
61
|
+
reteRenta: InvoicesCalculationsTotalsItem
|
|
52
62
|
montoTotalOperacion: InvoicesCalculationsTotalsItem
|
|
53
|
-
iva: InvoicesCalculationsTotalsItem
|
|
54
63
|
totalPagar: InvoicesCalculationsTotalsItem
|
|
55
64
|
}
|
|
56
65
|
|
|
57
|
-
|
|
66
|
+
type TotalsByType = {
|
|
67
|
+
[InvoicesDocumentTypesEnum.FCF]: InvoicesCalculationsTotalsResponseFCF
|
|
68
|
+
// [InvoicesDocumentTypesEnum.CCF]: InvoicesCalculationsTotalsResponse // si no hay campos extra
|
|
69
|
+
// [InvoicesDocumentTypesEnum.FEX]: InvoicesCalculationsTotalsResponse // etc...
|
|
70
|
+
// [InvoicesDocumentTypesEnum.NC]: InvoicesCalculationsTotalsResponse
|
|
71
|
+
// [InvoicesDocumentTypesEnum.ND]: InvoicesCalculationsTotalsResponse
|
|
72
|
+
// [InvoicesDocumentTypesEnum.FC]: InvoicesCalculationsTotalsResponse
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type InvoicesCalculationsCalculateSingleResponse<T extends keyof TotalsByType> = {
|
|
58
76
|
details: InvoicesCalculationsDetailsResponse[]
|
|
59
|
-
totals:
|
|
77
|
+
totals: TotalsByType[T]
|
|
60
78
|
}
|