@openbox/shared-types 0.5.27 → 0.5.29

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,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 type InvoicesCalculationsTotalsResponse = {
34
- sum: InvoicesCalculationsTotalsItem;
35
- iva: InvoicesCalculationsTotalsItem;
36
- subtotal: InvoicesCalculationsTotalsItem;
37
- ivaRetenido: InvoicesCalculationsTotalsItem;
38
- ivaPercibido: InvoicesCalculationsTotalsItem;
39
- renta5: InvoicesCalculationsTotalsItem;
40
- renta10: InvoicesCalculationsTotalsItem;
41
- ventasExentas: InvoicesCalculationsTotalsItem;
42
- ventasNoSujetas: InvoicesCalculationsTotalsItem;
43
- ventaTotal: InvoicesCalculationsTotalsItem;
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
  };
@@ -12,16 +12,16 @@ export type InvoicesCreateSingleHeader = {
12
12
  creditFor?: string;
13
13
  };
14
14
  export type InvoicesCreateSingleTotals = {
15
- sum: number;
16
- iva: number;
17
- subtotal: number;
18
- ivaRetenido: number;
15
+ subTotalVentas: number;
16
+ totalIva: number;
17
+ subTotal: number;
18
+ ivaRete1: number;
19
19
  ivaPercibido: number;
20
20
  renta5: number;
21
21
  renta10: number;
22
- ventasExentas: number;
23
- ventasNoSujetas: number;
24
- ventaTotal: number;
22
+ totalExenta: number;
23
+ totalNoSuj: number;
24
+ totalPagar: number;
25
25
  };
26
26
  export type InvoicesCreateSingleDetail = {
27
27
  service: string;
@@ -24,16 +24,16 @@ export type Invoices = {
24
24
  customerNrc: string;
25
25
  customerGiro: string;
26
26
  customerPassport: string;
27
- sum: number;
28
- iva: number;
27
+ subTotalVentas: number;
28
+ totalIva: number;
29
29
  ivaPercibido: number;
30
30
  renta5: number;
31
31
  renta10: number;
32
- subtotal: number;
33
- ivaRetenido: number;
34
- ventasExentas: number;
35
- ventasNoSujetas: number;
36
- ventaTotal: number;
32
+ subTotal: number;
33
+ ivaRete1: number;
34
+ totalExenta: number;
35
+ totalNoSuj: number;
36
+ totalPagar: number;
37
37
  ventaTotalText: string;
38
38
  origin: string;
39
39
  invoiceDate: Date;
@@ -15,3 +15,7 @@ export declare enum InvoicesStatusesTypesEnum {
15
15
  Presentada = 6,
16
16
  Contingencia = 7
17
17
  }
18
+ export declare enum InvoicesDiscountsTypesKeys {
19
+ AMOUNT_DISCOUNT = "AMOUNT_DISCOUNT",
20
+ PERCENTAGE_DISCOUNT = "PERCENTAGE_DISCOUNT"
21
+ }
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "@openbox/shared-types",
3
- "version": "0.5.27",
3
+ "version": "0.5.29",
4
4
  "description": "Shared Types for Openbox Cloud. ",
5
5
  "types": "lib/index.d.js",
6
6
  "main": "lib/index.js",
@@ -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
- sum: InvoicesCalculationsTotalsItem
42
- iva: InvoicesCalculationsTotalsItem
43
- subtotal: InvoicesCalculationsTotalsItem
44
- ivaRetenido: InvoicesCalculationsTotalsItem
45
- ivaPercibido: InvoicesCalculationsTotalsItem
46
- renta5: InvoicesCalculationsTotalsItem
47
- renta10: InvoicesCalculationsTotalsItem
48
- ventasExentas: InvoicesCalculationsTotalsItem
49
- ventasNoSujetas: InvoicesCalculationsTotalsItem
50
- ventaTotal: InvoicesCalculationsTotalsItem
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 // previously ventasNoSujetas
77
+ totalExenta: InvoicesCalculationsTotalsItem // previously ventasExentas
78
+ totalGravada: InvoicesCalculationsTotalsItem
79
+ subTotalVentas: InvoicesCalculationsTotalsItem // previously 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 // previously subtotal
90
+ ivaRete1: InvoicesCalculationsTotalsItem // previously ivaRetenido
91
+ reteRenta: InvoicesCalculationsTotalsItem
92
+ montoTotalOperacion: InvoicesCalculationsTotalsItem
93
+ totalIva: InvoicesCalculationsTotalsItem // previously iva
94
+ totalPagar: InvoicesCalculationsTotalsItem // previously ventaTotal
51
95
  }
52
96
 
53
97
  export type InvoicesCalculationsCalculateSingleResponse = {
54
98
  details: InvoicesCalculationsDetailsResponse[]
99
+ discounts: InvoicesCalculationsDiscountsResponse[]
55
100
  totals: InvoicesCalculationsTotalsResponse
56
101
  }
@@ -13,16 +13,16 @@ export type InvoicesCreateSingleHeader = {
13
13
  }
14
14
 
15
15
  export type InvoicesCreateSingleTotals = {
16
- sum: number
17
- iva: number
18
- subtotal: number
19
- ivaRetenido: number
16
+ subTotalVentas: number // previously sum
17
+ totalIva: number // previously iva
18
+ subTotal: number // previously subtotal
19
+ ivaRete1: number // previously ivaRetenido
20
20
  ivaPercibido: number
21
21
  renta5: number
22
22
  renta10: number
23
- ventasExentas: number
24
- ventasNoSujetas: number
25
- ventaTotal: number
23
+ totalExenta: number // previously ventasExentas
24
+ totalNoSuj: number // previously ventasNoSujetas
25
+ totalPagar: number // previously ventaTotal
26
26
  }
27
27
 
28
28
  export type InvoicesCreateSingleDetail = {
@@ -25,16 +25,16 @@ export type Invoices = {
25
25
  customerNrc: string
26
26
  customerGiro: string
27
27
  customerPassport: string
28
- sum: number
29
- iva: number
28
+ subTotalVentas: number // previously sum
29
+ totalIva: number // previously iva
30
30
  ivaPercibido: number
31
31
  renta5: number
32
32
  renta10: number
33
- subtotal: number
34
- ivaRetenido: number
35
- ventasExentas: number
36
- ventasNoSujetas: number
37
- ventaTotal: number
33
+ subTotal: number // previously subtotal
34
+ ivaRete1: number // previously ivaRetenido
35
+ totalExenta: number // previously ventasExentas
36
+ totalNoSuj: number // previously ventasNoSujetas
37
+ totalPagar: number // previously ventaTotal
38
38
  ventaTotalText: string
39
39
  origin: string
40
40
  invoiceDate: Date
@@ -16,3 +16,8 @@ export enum InvoicesStatusesTypesEnum {
16
16
  Presentada = 6,
17
17
  Contingencia = 7,
18
18
  }
19
+
20
+ export enum InvoicesDiscountsTypesKeys {
21
+ AMOUNT_DISCOUNT = 'AMOUNT_DISCOUNT',
22
+ PERCENTAGE_DISCOUNT = 'PERCENTAGE_DISCOUNT',
23
+ }