@silexpert/core 1.3.72-1 → 1.3.73

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.
Files changed (92) hide show
  1. package/dist/cjs/api/resources/PaymentExpectationCustomer.d.ts +1 -4
  2. package/dist/cjs/api/resources/PaymentExpectationCustomer.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/PaymentExpectationCustomer.js +0 -6
  4. package/dist/cjs/api/resources/PaymentExpectationCustomer.js.map +1 -1
  5. package/dist/cjs/api/resources/Recurrence.d.ts +2 -1
  6. package/dist/cjs/api/resources/Recurrence.d.ts.map +1 -1
  7. package/dist/cjs/api/resources/Recurrence.js +6 -0
  8. package/dist/cjs/api/resources/Recurrence.js.map +1 -1
  9. package/dist/cjs/types/Enum/PrestationType.d.ts.map +1 -1
  10. package/dist/cjs/types/Enum/PrestationType.js +61 -57
  11. package/dist/cjs/types/Enum/PrestationType.js.map +1 -1
  12. package/dist/cjs/types/Interface/api/recurrence/Query.d.ts +5 -0
  13. package/dist/cjs/types/Interface/api/recurrence/Query.d.ts.map +1 -0
  14. package/dist/cjs/types/Interface/api/recurrence/Query.js +27 -0
  15. package/dist/cjs/types/Interface/api/recurrence/Query.js.map +1 -0
  16. package/dist/cjs/types/Interface/api/recurrence/Read.d.ts +7 -0
  17. package/dist/cjs/types/Interface/api/recurrence/Read.d.ts.map +1 -0
  18. package/dist/cjs/types/Interface/api/recurrence/Read.js +3 -0
  19. package/dist/cjs/types/Interface/api/recurrence/Read.js.map +1 -0
  20. package/dist/cjs/types/Interface/api/society/Export.d.ts +1 -1
  21. package/dist/cjs/types/Interface/api/society/Export.d.ts.map +1 -1
  22. package/dist/cjs/types/Interface/api/society/Export.js.map +1 -1
  23. package/dist/cjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts +1 -2
  24. package/dist/cjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts.map +1 -1
  25. package/dist/cjs/types/Interface/api/society/SocietyWithStatsCaParams.js.map +1 -1
  26. package/dist/cjs/types/Interface/api/stripe/Create.d.ts +1 -6
  27. package/dist/cjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
  28. package/dist/cjs/types/Interface/api/stripe/Create.js +4 -18
  29. package/dist/cjs/types/Interface/api/stripe/Create.js.map +1 -1
  30. package/dist/cjs/types/index.d.ts +2 -0
  31. package/dist/cjs/types/index.d.ts.map +1 -1
  32. package/dist/cjs/types/index.js +2 -0
  33. package/dist/cjs/types/index.js.map +1 -1
  34. package/dist/cjs/utils/prestation.d.ts.map +1 -1
  35. package/dist/cjs/utils/prestation.js +22 -16
  36. package/dist/cjs/utils/prestation.js.map +1 -1
  37. package/dist/cjs/utils/vat/registration.d.ts +1 -0
  38. package/dist/cjs/utils/vat/registration.d.ts.map +1 -1
  39. package/dist/cjs/utils/vat/registration.js +5 -1
  40. package/dist/cjs/utils/vat/registration.js.map +1 -1
  41. package/dist/mjs/api/resources/PaymentExpectationCustomer.d.ts +1 -4
  42. package/dist/mjs/api/resources/PaymentExpectationCustomer.d.ts.map +1 -1
  43. package/dist/mjs/api/resources/PaymentExpectationCustomer.js +0 -6
  44. package/dist/mjs/api/resources/PaymentExpectationCustomer.js.map +1 -1
  45. package/dist/mjs/api/resources/Recurrence.d.ts +2 -1
  46. package/dist/mjs/api/resources/Recurrence.d.ts.map +1 -1
  47. package/dist/mjs/api/resources/Recurrence.js +6 -0
  48. package/dist/mjs/api/resources/Recurrence.js.map +1 -1
  49. package/dist/mjs/types/Enum/PrestationType.d.ts.map +1 -1
  50. package/dist/mjs/types/Enum/PrestationType.js +61 -57
  51. package/dist/mjs/types/Enum/PrestationType.js.map +1 -1
  52. package/dist/mjs/types/Interface/api/recurrence/Query.d.ts +5 -0
  53. package/dist/mjs/types/Interface/api/recurrence/Query.d.ts.map +1 -0
  54. package/dist/mjs/types/Interface/api/recurrence/Query.js +24 -0
  55. package/dist/mjs/types/Interface/api/recurrence/Query.js.map +1 -0
  56. package/dist/mjs/types/Interface/api/recurrence/Read.d.ts +7 -0
  57. package/dist/mjs/types/Interface/api/recurrence/Read.d.ts.map +1 -0
  58. package/dist/mjs/types/Interface/api/recurrence/Read.js +2 -0
  59. package/dist/mjs/types/Interface/api/recurrence/Read.js.map +1 -0
  60. package/dist/mjs/types/Interface/api/society/Export.d.ts +1 -1
  61. package/dist/mjs/types/Interface/api/society/Export.d.ts.map +1 -1
  62. package/dist/mjs/types/Interface/api/society/Export.js.map +1 -1
  63. package/dist/mjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts +1 -2
  64. package/dist/mjs/types/Interface/api/society/SocietyWithStatsCaParams.d.ts.map +1 -1
  65. package/dist/mjs/types/Interface/api/society/SocietyWithStatsCaParams.js.map +1 -1
  66. package/dist/mjs/types/Interface/api/stripe/Create.d.ts +1 -6
  67. package/dist/mjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
  68. package/dist/mjs/types/Interface/api/stripe/Create.js +5 -18
  69. package/dist/mjs/types/Interface/api/stripe/Create.js.map +1 -1
  70. package/dist/mjs/types/index.d.ts +2 -0
  71. package/dist/mjs/types/index.d.ts.map +1 -1
  72. package/dist/mjs/types/index.js +2 -0
  73. package/dist/mjs/types/index.js.map +1 -1
  74. package/dist/mjs/utils/prestation.d.ts.map +1 -1
  75. package/dist/mjs/utils/prestation.js +20 -14
  76. package/dist/mjs/utils/prestation.js.map +1 -1
  77. package/dist/mjs/utils/vat/registration.d.ts +1 -0
  78. package/dist/mjs/utils/vat/registration.d.ts.map +1 -1
  79. package/dist/mjs/utils/vat/registration.js +5 -1
  80. package/dist/mjs/utils/vat/registration.js.map +1 -1
  81. package/package.json +1 -1
  82. package/ts/api/resources/PaymentExpectationCustomer.ts +0 -11
  83. package/ts/api/resources/Recurrence.ts +13 -1
  84. package/ts/types/Enum/PrestationType.ts +61 -57
  85. package/ts/types/Interface/api/recurrence/Query.ts +12 -0
  86. package/ts/types/Interface/api/recurrence/Read.ts +7 -0
  87. package/ts/types/Interface/api/society/Export.ts +1 -1
  88. package/ts/types/Interface/api/society/SocietyWithStatsCaParams.ts +1 -2
  89. package/ts/types/Interface/api/stripe/Create.ts +4 -15
  90. package/ts/types/index.ts +2 -0
  91. package/ts/utils/prestation.ts +22 -15
  92. package/ts/utils/vat/registration.ts +10 -5
@@ -2,9 +2,9 @@ import * as dayjs from 'dayjs';
2
2
  import { isDefined } from 'class-validator';
3
3
  import { reverse, sumBy } from 'lodash';
4
4
  import {
5
+ AnyCerfa3310_Century,
5
6
  Cerfa2571_2023,
6
7
  Cerfa2573_2024,
7
- Cerfa3310_2023,
8
8
  Cerfa3514_2022,
9
9
  CerfaType,
10
10
  CustomerVatType,
@@ -17,7 +17,7 @@ import {
17
17
  RegistrationTickState,
18
18
  TaxType,
19
19
  } from '../../types';
20
- import { Cerfa3517_2023 } from '../../types/Interface/api/cerfa/3517';
20
+ import { AnyCerfa3517Century } from '../../types/Interface/api/cerfa/3517';
21
21
 
22
22
  const waitingState: ReadRegistrationTick = {
23
23
  state: RegistrationTickState.IN_PROGRESS,
@@ -147,9 +147,10 @@ export function getTypeAndAmountFromRegistration(registration: IRegistration): {
147
147
  amount: number | null;
148
148
  collectable: number;
149
149
  deductible: number;
150
+ amountBase?: number;
150
151
  } {
151
152
  if (registration.idCerfaType === CerfaType.CERFA_3310) {
152
- const payload = registration.payload.cerfa3310 as Cerfa3310_2023;
153
+ const payload = registration.payload.cerfa3310 as AnyCerfa3310_Century;
153
154
  const other = { collectable: payload.vat?.grossDue, deductible: payload.vat?.deductible.total };
154
155
  if (payload?.isNil) return { type: CustomerVatType.VAT_TO_NIL, amount: 0, ...other };
155
156
  if (payload?.toPay?.total > 0) return { type: CustomerVatType.VAT_TO_PAY, amount: payload.toPay.total, ...other };
@@ -169,8 +170,12 @@ export function getTypeAndAmountFromRegistration(registration: IRegistration): {
169
170
  return { type: CustomerVatType.VAT_TO_PAY, amount: 0, ...other };
170
171
  }
171
172
  if (registration.idCerfaType === CerfaType.CERFA_3517) {
172
- const payload = registration.payload.cerfa3517 as Cerfa3517_2023;
173
- const other = { collectable: payload.other.total, deductible: payload.deductible.total };
173
+ const payload = registration.payload.cerfa3517 as AnyCerfa3517Century;
174
+ const other = {
175
+ collectable: payload.other.total,
176
+ deductible: payload.deductible.total,
177
+ amountBase: payload?.total,
178
+ };
174
179
  if (payload?.isNil) return { type: CustomerVatType.VAT_TO_NIL, amount: 0, ...other };
175
180
  if (payload?.recapitulation?.toPay > 0)
176
181
  return { type: CustomerVatType.VAT_TO_PAY, amount: payload?.recapitulation?.toPay, ...other };