@openbox/shared-types 0.5.88 → 0.5.89
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.
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { InvoicesDiscountsTypesKeys } from '../../invoices.enums';
|
|
2
|
-
type
|
|
2
|
+
export type InvoicesCalculationsDetailsRequest = {
|
|
3
3
|
id?: string;
|
|
4
|
+
service?: string;
|
|
5
|
+
product?: string;
|
|
4
6
|
quantity: number;
|
|
5
7
|
unitPrice: number;
|
|
6
8
|
price: number;
|
|
@@ -9,45 +11,6 @@ type InvoicesCalculationsDetailsBaseRequest = {
|
|
|
9
11
|
incRenta10: boolean;
|
|
10
12
|
chargeDescription: string;
|
|
11
13
|
};
|
|
12
|
-
/**
|
|
13
|
-
* Invoice calculation details request type that supports either a service OR a product.
|
|
14
|
-
* Each detail must reference exactly one of service or product, not both.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* // Service detail
|
|
18
|
-
* const serviceDetail: InvoicesCalculationsDetailsRequest = {
|
|
19
|
-
* service: "service-id-123",
|
|
20
|
-
* product: null,
|
|
21
|
-
* quantity: 1,
|
|
22
|
-
* unitPrice: 100,
|
|
23
|
-
* price: 100,
|
|
24
|
-
* incIva: true,
|
|
25
|
-
* incRenta5: false,
|
|
26
|
-
* incRenta10: false,
|
|
27
|
-
* chargeDescription: "Service charge"
|
|
28
|
-
* }
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* // Product detail
|
|
32
|
-
* const productDetail: InvoicesCalculationsDetailsRequest = {
|
|
33
|
-
* product: "product-id-123",
|
|
34
|
-
* service: null,
|
|
35
|
-
* quantity: 2,
|
|
36
|
-
* unitPrice: 50,
|
|
37
|
-
* price: 100,
|
|
38
|
-
* incIva: true,
|
|
39
|
-
* incRenta5: false,
|
|
40
|
-
* incRenta10: false,
|
|
41
|
-
* chargeDescription: "Product charge"
|
|
42
|
-
* }
|
|
43
|
-
*/
|
|
44
|
-
export type InvoicesCalculationsDetailsRequest = (InvoicesCalculationsDetailsBaseRequest & {
|
|
45
|
-
service: string;
|
|
46
|
-
product: null;
|
|
47
|
-
}) | (InvoicesCalculationsDetailsBaseRequest & {
|
|
48
|
-
product: string;
|
|
49
|
-
service: null;
|
|
50
|
-
});
|
|
51
14
|
export type InvoicesCalculationsDiscountsRequest = {
|
|
52
15
|
id?: string;
|
|
53
16
|
type: InvoicesDiscountsTypesKeys;
|
|
@@ -60,4 +23,3 @@ export type InvoicesCalculationsCalculateSingleRequest = {
|
|
|
60
23
|
details: InvoicesCalculationsDetailsRequest[];
|
|
61
24
|
discounts: InvoicesCalculationsDiscountsRequest[] | null;
|
|
62
25
|
};
|
|
63
|
-
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { InvoicesDiscountsTypesKeys } from '../../invoices.enums';
|
|
2
|
-
type
|
|
2
|
+
export type InvoicesCalculationsDetailsResponse = {
|
|
3
3
|
id?: string;
|
|
4
|
+
service?: string;
|
|
5
|
+
product?: string;
|
|
4
6
|
quantity: number;
|
|
5
7
|
chargeDescription: string;
|
|
6
8
|
price: number;
|
|
@@ -22,35 +24,6 @@ type InvoicesCalculationsDetailsBaseResponse = {
|
|
|
22
24
|
vNoSujetaToShow: number;
|
|
23
25
|
vGravadaToShow: number;
|
|
24
26
|
};
|
|
25
|
-
/**
|
|
26
|
-
* Invoice calculation details response type that includes calculated values for either a service OR a product.
|
|
27
|
-
* The response will contain the same service/product identifier from the request plus all calculated tax and pricing information.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* // Service detail response
|
|
31
|
-
* const serviceResponse: InvoicesCalculationsDetailsResponse = {
|
|
32
|
-
* service: "service-id-123",
|
|
33
|
-
* product: null,
|
|
34
|
-
* quantity: 1,
|
|
35
|
-
* chargeDescription: "Service charge",
|
|
36
|
-
* price: 100,
|
|
37
|
-
* incIva: true,
|
|
38
|
-
* incRenta5: false,
|
|
39
|
-
* incRenta10: false,
|
|
40
|
-
* // ... calculated fields
|
|
41
|
-
* unitPrice: 100,
|
|
42
|
-
* ivaPrice: 13,
|
|
43
|
-
* ventaPrice: 113,
|
|
44
|
-
* sellingType: 1
|
|
45
|
-
* }
|
|
46
|
-
*/
|
|
47
|
-
export type InvoicesCalculationsDetailsResponse = (InvoicesCalculationsDetailsBaseResponse & {
|
|
48
|
-
service: string;
|
|
49
|
-
product: null;
|
|
50
|
-
}) | (InvoicesCalculationsDetailsBaseResponse & {
|
|
51
|
-
product: string;
|
|
52
|
-
service: null;
|
|
53
|
-
});
|
|
54
27
|
export type InvoicesCalculationsDiscountsResponse = {
|
|
55
28
|
id?: string;
|
|
56
29
|
type: InvoicesDiscountsTypesKeys;
|
|
@@ -94,4 +67,3 @@ export type InvoicesCalculationsCalculateSingleResponse = {
|
|
|
94
67
|
discounts: InvoicesCalculationsDiscountsResponse[];
|
|
95
68
|
totals: InvoicesCalculationsTotalsResponse;
|
|
96
69
|
};
|
|
97
|
-
export {};
|