@openbox/shared-types 0.5.27 → 0.5.28
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/Request.d.ts +8 -0
- package/lib/invoices/Calculation/CalculateSingle/Response.d.ts +32 -12
- package/lib/invoices/invoices.enums.d.ts +4 -0
- package/lib/invoices/invoices.enums.js +6 -1
- package/lib/invoices/invoices.enums.js.map +1 -1
- package/package.json +1 -1
- package/src/invoices/Calculation/CalculateSingle/Request.ts +10 -0
- package/src/invoices/Calculation/CalculateSingle/Response.ts +56 -11
- package/src/invoices/invoices.enums.ts +5 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InvoicesDiscountsTypesKeys } from '../../invoices.enums';
|
|
1
2
|
export type InvoicesCalculationsDetailsRequest = {
|
|
2
3
|
id?: string;
|
|
3
4
|
service: string;
|
|
@@ -9,8 +10,15 @@ export type InvoicesCalculationsDetailsRequest = {
|
|
|
9
10
|
incRenta10: boolean;
|
|
10
11
|
chargeDescription: string;
|
|
11
12
|
};
|
|
13
|
+
export type InvoicesCalculationsDiscountsRequest = {
|
|
14
|
+
id?: string;
|
|
15
|
+
type: InvoicesDiscountsTypesKeys;
|
|
16
|
+
quantity: number;
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
12
19
|
export type InvoicesCalculationsCalculateSingleRequest = {
|
|
13
20
|
documentType: number;
|
|
14
21
|
customer: string;
|
|
15
22
|
details: InvoicesCalculationsDetailsRequest[];
|
|
23
|
+
discounts: InvoicesCalculationsDiscountsRequest[] | null;
|
|
16
24
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InvoicesDiscountsTypesKeys } from '../../invoices.enums';
|
|
1
2
|
export type InvoicesCalculationsDetailsResponse = {
|
|
2
3
|
id?: string;
|
|
3
4
|
service: string;
|
|
@@ -22,6 +23,18 @@ export type InvoicesCalculationsDetailsResponse = {
|
|
|
22
23
|
vNoSujetaToShow: number;
|
|
23
24
|
vGravadaToShow: number;
|
|
24
25
|
};
|
|
26
|
+
export type InvoicesCalculationsDiscountsResponse = {
|
|
27
|
+
id?: string;
|
|
28
|
+
type: InvoicesDiscountsTypesKeys;
|
|
29
|
+
quantity: number;
|
|
30
|
+
description: string;
|
|
31
|
+
descuNoSuj: number;
|
|
32
|
+
descuExenta: number;
|
|
33
|
+
descuGravada: number;
|
|
34
|
+
descuNoSujToShow: number;
|
|
35
|
+
descuExentaToShow: number;
|
|
36
|
+
descuGravadaToShow: number;
|
|
37
|
+
};
|
|
25
38
|
export type InvoicesCalculationsTotalsItem = {
|
|
26
39
|
id: string;
|
|
27
40
|
name: string;
|
|
@@ -29,20 +42,27 @@ export type InvoicesCalculationsTotalsItem = {
|
|
|
29
42
|
amount: number;
|
|
30
43
|
style?: string[];
|
|
31
44
|
show: true | false;
|
|
45
|
+
type?: 'currency' | 'percentage';
|
|
32
46
|
};
|
|
33
|
-
export
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
47
|
+
export interface InvoicesCalculationsTotalsResponse {
|
|
48
|
+
totalNoSuj: InvoicesCalculationsTotalsItem;
|
|
49
|
+
totalExenta: InvoicesCalculationsTotalsItem;
|
|
50
|
+
totalGravada: InvoicesCalculationsTotalsItem;
|
|
51
|
+
subTotalVentas: InvoicesCalculationsTotalsItem;
|
|
52
|
+
descuNoSuj: InvoicesCalculationsTotalsItem;
|
|
53
|
+
descuExenta: InvoicesCalculationsTotalsItem;
|
|
54
|
+
descuGravada: InvoicesCalculationsTotalsItem;
|
|
55
|
+
porcentajeDescuento: InvoicesCalculationsTotalsItem;
|
|
56
|
+
totalDescu: InvoicesCalculationsTotalsItem;
|
|
57
|
+
subTotal: InvoicesCalculationsTotalsItem;
|
|
58
|
+
ivaRete1: InvoicesCalculationsTotalsItem;
|
|
59
|
+
reteRenta: InvoicesCalculationsTotalsItem;
|
|
60
|
+
montoTotalOperacion: InvoicesCalculationsTotalsItem;
|
|
61
|
+
totalIva: InvoicesCalculationsTotalsItem;
|
|
62
|
+
totalPagar: InvoicesCalculationsTotalsItem;
|
|
63
|
+
}
|
|
45
64
|
export type InvoicesCalculationsCalculateSingleResponse = {
|
|
46
65
|
details: InvoicesCalculationsDetailsResponse[];
|
|
66
|
+
discounts: InvoicesCalculationsDiscountsResponse[];
|
|
47
67
|
totals: InvoicesCalculationsTotalsResponse;
|
|
48
68
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvoicesStatusesTypesEnum = exports.InvoicesDocumentTypesEnum = void 0;
|
|
3
|
+
exports.InvoicesDiscountsTypesKeys = exports.InvoicesStatusesTypesEnum = exports.InvoicesDocumentTypesEnum = void 0;
|
|
4
4
|
var InvoicesDocumentTypesEnum;
|
|
5
5
|
(function (InvoicesDocumentTypesEnum) {
|
|
6
6
|
InvoicesDocumentTypesEnum[InvoicesDocumentTypesEnum["FCF"] = 1] = "FCF";
|
|
@@ -20,4 +20,9 @@ var InvoicesStatusesTypesEnum;
|
|
|
20
20
|
InvoicesStatusesTypesEnum[InvoicesStatusesTypesEnum["Presentada"] = 6] = "Presentada";
|
|
21
21
|
InvoicesStatusesTypesEnum[InvoicesStatusesTypesEnum["Contingencia"] = 7] = "Contingencia";
|
|
22
22
|
})(InvoicesStatusesTypesEnum = exports.InvoicesStatusesTypesEnum || (exports.InvoicesStatusesTypesEnum = {}));
|
|
23
|
+
var InvoicesDiscountsTypesKeys;
|
|
24
|
+
(function (InvoicesDiscountsTypesKeys) {
|
|
25
|
+
InvoicesDiscountsTypesKeys["AMOUNT_DISCOUNT"] = "AMOUNT_DISCOUNT";
|
|
26
|
+
InvoicesDiscountsTypesKeys["PERCENTAGE_DISCOUNT"] = "PERCENTAGE_DISCOUNT";
|
|
27
|
+
})(InvoicesDiscountsTypesKeys = exports.InvoicesDiscountsTypesKeys || (exports.InvoicesDiscountsTypesKeys = {}));
|
|
23
28
|
//# sourceMappingURL=invoices.enums.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoices.enums.js","sourceRoot":"","sources":["../../src/invoices/invoices.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,uEAAO,CAAA;IACP,uEAAO,CAAA;IACP,uEAAO,CAAA;IACP,qEAAM,CAAA;IACN,qEAAM,CAAA;IACN,qEAAM,CAAA;AACR,CAAC,EAPW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAOpC;AAED,IAAY,yBAQX;AARD,WAAY,yBAAyB;IACnC,+EAAW,CAAA;IACX,+EAAW,CAAA;IACX,+EAAW,CAAA;IACX,mFAAa,CAAA;IACb,6EAAU,CAAA;IACV,qFAAc,CAAA;IACd,yFAAgB,CAAA;AAClB,CAAC,EARW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAQpC"}
|
|
1
|
+
{"version":3,"file":"invoices.enums.js","sourceRoot":"","sources":["../../src/invoices/invoices.enums.ts"],"names":[],"mappings":";;;AAAA,IAAY,yBAOX;AAPD,WAAY,yBAAyB;IACnC,uEAAO,CAAA;IACP,uEAAO,CAAA;IACP,uEAAO,CAAA;IACP,qEAAM,CAAA;IACN,qEAAM,CAAA;IACN,qEAAM,CAAA;AACR,CAAC,EAPW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAOpC;AAED,IAAY,yBAQX;AARD,WAAY,yBAAyB;IACnC,+EAAW,CAAA;IACX,+EAAW,CAAA;IACX,+EAAW,CAAA;IACX,mFAAa,CAAA;IACb,6EAAU,CAAA;IACV,qFAAc,CAAA;IACd,yFAAgB,CAAA;AAClB,CAAC,EARW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAQpC;AAED,IAAY,0BAGX;AAHD,WAAY,0BAA0B;IACpC,iEAAmC,CAAA;IACnC,yEAA2C,CAAA;AAC7C,CAAC,EAHW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAGrC"}
|
package/package.json
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { InvoicesDiscountsTypesKeys } from '../../invoices.enums'
|
|
2
|
+
|
|
1
3
|
export type InvoicesCalculationsDetailsRequest = {
|
|
2
4
|
id?: string
|
|
3
5
|
service: string
|
|
@@ -10,8 +12,16 @@ export type InvoicesCalculationsDetailsRequest = {
|
|
|
10
12
|
chargeDescription: string
|
|
11
13
|
}
|
|
12
14
|
|
|
15
|
+
export type InvoicesCalculationsDiscountsRequest = {
|
|
16
|
+
id?: string
|
|
17
|
+
type: InvoicesDiscountsTypesKeys
|
|
18
|
+
quantity: number
|
|
19
|
+
description: string
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
export type InvoicesCalculationsCalculateSingleRequest = {
|
|
14
23
|
documentType: number
|
|
15
24
|
customer: string
|
|
16
25
|
details: InvoicesCalculationsDetailsRequest[]
|
|
26
|
+
discounts: InvoicesCalculationsDiscountsRequest[] | null
|
|
17
27
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { InvoicesDiscountsTypesKeys } from '../../invoices.enums'
|
|
2
|
+
|
|
1
3
|
export type InvoicesCalculationsDetailsResponse = {
|
|
2
4
|
// Returns the same information received
|
|
3
5
|
id?: string
|
|
@@ -28,6 +30,24 @@ export type InvoicesCalculationsDetailsResponse = {
|
|
|
28
30
|
vGravadaToShow: number
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
export type InvoicesCalculationsDiscountsResponse = {
|
|
34
|
+
// Returns the same information received
|
|
35
|
+
id?: string
|
|
36
|
+
type: InvoicesDiscountsTypesKeys
|
|
37
|
+
quantity: number
|
|
38
|
+
description: string
|
|
39
|
+
|
|
40
|
+
// returns the calculated information
|
|
41
|
+
descuNoSuj: number
|
|
42
|
+
descuExenta: number
|
|
43
|
+
descuGravada: number
|
|
44
|
+
|
|
45
|
+
// Returns values to show in discounts table
|
|
46
|
+
descuNoSujToShow: number
|
|
47
|
+
descuExentaToShow: number
|
|
48
|
+
descuGravadaToShow: number
|
|
49
|
+
}
|
|
50
|
+
|
|
31
51
|
export type InvoicesCalculationsTotalsItem = {
|
|
32
52
|
id: string
|
|
33
53
|
name: string
|
|
@@ -35,22 +55,47 @@ export type InvoicesCalculationsTotalsItem = {
|
|
|
35
55
|
amount: number
|
|
36
56
|
style?: string[]
|
|
37
57
|
show: true | false
|
|
58
|
+
type?: 'currency' | 'percentage'
|
|
38
59
|
}
|
|
39
60
|
|
|
40
|
-
export type InvoicesCalculationsTotalsResponse = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
61
|
+
// export type InvoicesCalculationsTotalsResponse = {
|
|
62
|
+
// sum: InvoicesCalculationsTotalsItem
|
|
63
|
+
// iva: InvoicesCalculationsTotalsItem
|
|
64
|
+
// subtotal: InvoicesCalculationsTotalsItem
|
|
65
|
+
// ivaRetenido: InvoicesCalculationsTotalsItem
|
|
66
|
+
// ivaPercibido: InvoicesCalculationsTotalsItem
|
|
67
|
+
// renta5: InvoicesCalculationsTotalsItem
|
|
68
|
+
// renta10: InvoicesCalculationsTotalsItem
|
|
69
|
+
// ventasExentas: InvoicesCalculationsTotalsItem
|
|
70
|
+
// ventasNoSujetas: InvoicesCalculationsTotalsItem
|
|
71
|
+
// ventaTotal: InvoicesCalculationsTotalsItem
|
|
72
|
+
// }
|
|
73
|
+
|
|
74
|
+
export interface InvoicesCalculationsTotalsResponse {
|
|
75
|
+
// Totales antes de impuestos
|
|
76
|
+
totalNoSuj: InvoicesCalculationsTotalsItem // ventasNoSujetas
|
|
77
|
+
totalExenta: InvoicesCalculationsTotalsItem // ventasExentas
|
|
78
|
+
totalGravada: InvoicesCalculationsTotalsItem
|
|
79
|
+
subTotalVentas: InvoicesCalculationsTotalsItem // sum
|
|
80
|
+
|
|
81
|
+
// Descuentos
|
|
82
|
+
descuNoSuj: InvoicesCalculationsTotalsItem
|
|
83
|
+
descuExenta: InvoicesCalculationsTotalsItem
|
|
84
|
+
descuGravada: InvoicesCalculationsTotalsItem
|
|
85
|
+
porcentajeDescuento: InvoicesCalculationsTotalsItem
|
|
86
|
+
totalDescu: InvoicesCalculationsTotalsItem
|
|
87
|
+
|
|
88
|
+
// Totales con impuestos
|
|
89
|
+
subTotal: InvoicesCalculationsTotalsItem // subtotal
|
|
90
|
+
ivaRete1: InvoicesCalculationsTotalsItem // ivaRetenido
|
|
91
|
+
reteRenta: InvoicesCalculationsTotalsItem
|
|
92
|
+
montoTotalOperacion: InvoicesCalculationsTotalsItem
|
|
93
|
+
totalIva: InvoicesCalculationsTotalsItem // iva
|
|
94
|
+
totalPagar: InvoicesCalculationsTotalsItem // ventaTotal
|
|
51
95
|
}
|
|
52
96
|
|
|
53
97
|
export type InvoicesCalculationsCalculateSingleResponse = {
|
|
54
98
|
details: InvoicesCalculationsDetailsResponse[]
|
|
99
|
+
discounts: InvoicesCalculationsDiscountsResponse[]
|
|
55
100
|
totals: InvoicesCalculationsTotalsResponse
|
|
56
101
|
}
|