@silexpert/core 1.3.85-0 → 1.3.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.
Files changed (74) hide show
  1. package/dist/cjs/api/resources/Payment.d.ts +1 -1
  2. package/dist/cjs/api/resources/Payment.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Payment.js +1 -1
  4. package/dist/cjs/api/resources/Payment.js.map +1 -1
  5. package/dist/cjs/api/resources/PaymentExpectation.d.ts +2 -1
  6. package/dist/cjs/api/resources/PaymentExpectation.d.ts.map +1 -1
  7. package/dist/cjs/api/resources/PaymentExpectation.js +3 -0
  8. package/dist/cjs/api/resources/PaymentExpectation.js.map +1 -1
  9. package/dist/cjs/types/Enum/Log.d.ts +3 -1
  10. package/dist/cjs/types/Enum/Log.d.ts.map +1 -1
  11. package/dist/cjs/types/Enum/Log.js +2 -0
  12. package/dist/cjs/types/Enum/Log.js.map +1 -1
  13. package/dist/cjs/types/Interface/api/payment/Params.d.ts +14 -1
  14. package/dist/cjs/types/Interface/api/payment/Params.d.ts.map +1 -1
  15. package/dist/cjs/types/Interface/api/payment/Params.js +84 -0
  16. package/dist/cjs/types/Interface/api/payment/Params.js.map +1 -1
  17. package/dist/cjs/types/Interface/models/IPayment.d.ts +2 -0
  18. package/dist/cjs/types/Interface/models/IPayment.d.ts.map +1 -1
  19. package/dist/cjs/types/Interface/models/IPayment.js.map +1 -1
  20. package/dist/cjs/utils/vat/3310/century23.d.ts.map +1 -1
  21. package/dist/cjs/utils/vat/3310/century23.js +38 -60
  22. package/dist/cjs/utils/vat/3310/century23.js.map +1 -1
  23. package/dist/cjs/utils/vat/3310/century24.d.ts.map +1 -1
  24. package/dist/cjs/utils/vat/3310/century24.js +38 -60
  25. package/dist/cjs/utils/vat/3310/century24.js.map +1 -1
  26. package/dist/cjs/utils/vat/3310/century25.d.ts.map +1 -1
  27. package/dist/cjs/utils/vat/3310/century25.js +41 -63
  28. package/dist/cjs/utils/vat/3310/century25.js.map +1 -1
  29. package/dist/cjs/utils/vat/utils.d.ts +1 -1
  30. package/dist/cjs/utils/vat/utils.d.ts.map +1 -1
  31. package/dist/cjs/utils/vat/utils.js +5 -5
  32. package/dist/cjs/utils/vat/utils.js.map +1 -1
  33. package/dist/mjs/api/resources/Payment.d.ts +1 -1
  34. package/dist/mjs/api/resources/Payment.d.ts.map +1 -1
  35. package/dist/mjs/api/resources/Payment.js +1 -1
  36. package/dist/mjs/api/resources/Payment.js.map +1 -1
  37. package/dist/mjs/api/resources/PaymentExpectation.d.ts +2 -1
  38. package/dist/mjs/api/resources/PaymentExpectation.d.ts.map +1 -1
  39. package/dist/mjs/api/resources/PaymentExpectation.js +3 -0
  40. package/dist/mjs/api/resources/PaymentExpectation.js.map +1 -1
  41. package/dist/mjs/types/Enum/Log.d.ts +3 -1
  42. package/dist/mjs/types/Enum/Log.d.ts.map +1 -1
  43. package/dist/mjs/types/Enum/Log.js +2 -0
  44. package/dist/mjs/types/Enum/Log.js.map +1 -1
  45. package/dist/mjs/types/Interface/api/payment/Params.d.ts +14 -1
  46. package/dist/mjs/types/Interface/api/payment/Params.d.ts.map +1 -1
  47. package/dist/mjs/types/Interface/api/payment/Params.js +98 -1
  48. package/dist/mjs/types/Interface/api/payment/Params.js.map +1 -1
  49. package/dist/mjs/types/Interface/models/IPayment.d.ts +2 -0
  50. package/dist/mjs/types/Interface/models/IPayment.d.ts.map +1 -1
  51. package/dist/mjs/types/Interface/models/IPayment.js.map +1 -1
  52. package/dist/mjs/utils/vat/3310/century23.d.ts.map +1 -1
  53. package/dist/mjs/utils/vat/3310/century23.js +19 -41
  54. package/dist/mjs/utils/vat/3310/century23.js.map +1 -1
  55. package/dist/mjs/utils/vat/3310/century24.d.ts.map +1 -1
  56. package/dist/mjs/utils/vat/3310/century24.js +19 -41
  57. package/dist/mjs/utils/vat/3310/century24.js.map +1 -1
  58. package/dist/mjs/utils/vat/3310/century25.d.ts.map +1 -1
  59. package/dist/mjs/utils/vat/3310/century25.js +18 -40
  60. package/dist/mjs/utils/vat/3310/century25.js.map +1 -1
  61. package/dist/mjs/utils/vat/utils.d.ts +1 -1
  62. package/dist/mjs/utils/vat/utils.d.ts.map +1 -1
  63. package/dist/mjs/utils/vat/utils.js +5 -5
  64. package/dist/mjs/utils/vat/utils.js.map +1 -1
  65. package/package.json +3 -3
  66. package/ts/api/resources/Payment.ts +1 -1
  67. package/ts/api/resources/PaymentExpectation.ts +5 -0
  68. package/ts/types/Enum/Log.ts +2 -0
  69. package/ts/types/Interface/api/payment/Params.ts +74 -3
  70. package/ts/types/Interface/models/IPayment.ts +2 -0
  71. package/ts/utils/vat/3310/century23.ts +19 -41
  72. package/ts/utils/vat/3310/century24.ts +19 -41
  73. package/ts/utils/vat/3310/century25.ts +19 -40
  74. package/ts/utils/vat/utils.ts +6 -5
@@ -3,7 +3,7 @@ import { VatType } from '../../types/Enum/Vat';
3
3
  export declare function getAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision?: number, isAbs?: boolean): number;
4
4
  export declare function setZeroIfIsNegative(value: number): number;
5
5
  export declare function getTaxAmountByAccountNumber(accountingEntries: IAccountingEntry[], accountsNumber: string[], precision?: number, logging?: boolean, isAbs?: boolean): number;
6
- export declare function textFormatting(value: any, length?: number | null): string | null;
6
+ export declare function textFormatting(value: any, length?: number | null, start?: number): string | null;
7
7
  export declare function getTaxesIncludedAmount(amountHt: number, idVat: number, isRounded?: boolean): number;
8
8
  export declare function getTaxesExcludedAmount(amountTtc: number, idVat: number, isRounded?: boolean): number;
9
9
  export declare function getInternalInvoicingVatByZipCode(zipCode: string | null): VatType;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../ts/utils/vat/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AACjF,OAAO,EAAO,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,wBAAgB,wBAAwB,C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,UAAQ,EACf,KAAK,UAAQ,GACZ,MAAM,CA0BR;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,GAAE,MAAM,GAAG,IAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAiBtG;AAED,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,UAAO,UAMvF;AAED,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,UAAO,UAMxF;AAED,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAOhF"}
@@ -30,7 +30,7 @@ export function getTaxAmountByAccountNumber(accountingEntries, accountsNumber, p
30
30
  accountingEntry.account.number.toString().startsWith(number)) {
31
31
  // eslint-disable-next-line no-console
32
32
  if (logging)
33
- console.log('\'\'');
33
+ console.log("''");
34
34
  // eslint-disable-next-line no-console
35
35
  if (logging)
36
36
  console.log(accountingEntry);
@@ -44,20 +44,20 @@ export function getTaxAmountByAccountNumber(accountingEntries, accountsNumber, p
44
44
  return isAbs ? Math.abs(accTmp) : accTmp;
45
45
  }, precision));
46
46
  }
47
- export function textFormatting(value, length = null) {
47
+ export function textFormatting(value, length = null, start) {
48
48
  if (value && typeof value === 'string') {
49
- let formattedValue = value.replace(/[\u2018\u2019]/g, '\''); // Suppression des "Curly Quotes"
49
+ let formattedValue = value.replace(/[\u2018\u2019]/g, "'"); // Suppression des "Curly Quotes"
50
50
  formattedValue = formattedValue.replace(/&/g, ''); // Suppression des &
51
51
  formattedValue = formattedValue.replace(/!/g, ''); // Suppression des !
52
52
  formattedValue = formattedValue.replace(/[\t]/g, ''); // Suppression des tabulations
53
- formattedValue = formattedValue.replace(/`/g, '\''); // Suppression des `
53
+ formattedValue = formattedValue.replace(/`/g, "'"); // Suppression des `
54
54
  formattedValue = formattedValue.replace(/"/g, ''); // Suppression des "
55
55
  formattedValue = formattedValue.replace(/^ */, ''); // Suppression des espaces de début
56
56
  formattedValue = formattedValue.replace(/ *$/, ''); // Suppression des espaces de fin
57
57
  formattedValue = formattedValue.replace(/€/g, 'EUR');
58
58
  formattedValue = formattedValue.replace(/œ/g, 'oe');
59
59
  if (length)
60
- formattedValue = formattedValue.slice(0, length);
60
+ formattedValue = formattedValue.slice(start ?? 0, (start ?? 0) + length);
61
61
  return formattedValue;
62
62
  }
63
63
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../ts/utils/vat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAW,MAAM,sBAAsB,CAAC;AAEpD,MAAM,UAAU,wBAAwB,CACtC,iBAAqC,EACrC,cAAwB,EACxB,SAAS,GAAG,CAAC,EACb,KAAK,GAAG,KAAK;IAEb,MAAM,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,MAAM,CACnB,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE;QACpD,IAAI,MAAM,GAAG,GAAG,CAAC;QACjB,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7B,IACE,eAAe,CAAC,OAAO;gBACvB,eAAe,CAAC,OAAO,CAAC,MAAM;gBAC9B,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAC5D,CAAC;gBACD,MAAM,IAAI,eAAe,CAAC,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC;gBACzD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,OAAO,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AAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3F,OAAO,GAAG,CAAC,MAAM,CAAC;IACpB,CAAC;SAAM,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAClG,OAAO,GAAG,CAAC,YAAY,CAAC;IAC1B,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC;AACnB,CAAC","sourcesContent":["import { round as _round, uniqBy as _uniqBy } from 'lodash';\nimport { IAccountingEntry } from '../../types/Interface/models/IAccountingEntry';\nimport { Vat, VatType } from '../../types/Enum/Vat';\n\nexport function getAmountByAccountNumber(\n accountingEntries: IAccountingEntry[],\n accountsNumber: string[],\n precision = 0,\n isAbs = false,\n): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n const result = _round(\n accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (\n accountingEntry.account &&\n accountingEntry.account.number &&\n accountingEntry.account.number.toString().startsWith(number)\n ) {\n accTmp += accountingEntry.debit - accountingEntry.credit;\n return true;\n }\n return false;\n });\n return accTmp;\n }, 0),\n precision,\n );\n return isAbs ? Math.abs(result) : result;\n}\n\nexport function setZeroIfIsNegative(value: number): number {\n return value < 0 ? 0 : value;\n}\n\nexport function getTaxAmountByAccountNumber(\n accountingEntries: IAccountingEntry[],\n accountsNumber: string[],\n precision = 0,\n logging = false,\n isAbs = false,\n): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n return _round(\n accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (\n accountingEntry.account &&\n accountingEntry.account.number &&\n accountingEntry.account.number.toString().startsWith(number)\n ) {\n // eslint-disable-next-line no-console\n if (logging) console.log('\\'\\'');\n // eslint-disable-next-line no-console\n if (logging) console.log(accountingEntry);\n\n accTmp +=\n (accountingEntry.debit - accountingEntry.credit) *\n ((Object.values(Vat).find((v) => v.id === accountingEntry.idVat)?.value ?? 0) / 100);\n return true;\n }\n return false;\n });\n return isAbs ? Math.abs(accTmp) : accTmp;\n }, precision),\n );\n}\n\nexport function textFormatting(value: any, length: number | null = null): string | null {\n if (value && typeof value === 'string') {\n let formattedValue = value.replace(/[\\u2018\\u2019]/g, '\\''); // Suppression des \"Curly Quotes\"\n formattedValue = formattedValue.replace(/&/g, ''); // Suppression des &\n formattedValue = formattedValue.replace(/!/g, ''); // Suppression des !\n formattedValue = formattedValue.replace(/[\\t]/g, ''); // Suppression des tabulations\n formattedValue = formattedValue.replace(/`/g, '\\''); // Suppression des `\n formattedValue = formattedValue.replace(/\"/g, ''); // Suppression des \"\n formattedValue = formattedValue.replace(/^ */, ''); // Suppression des espaces de début\n formattedValue = formattedValue.replace(/ *$/, ''); // Suppression des espaces de fin\n formattedValue = formattedValue.replace(/€/g, 'EUR');\n formattedValue = formattedValue.replace(/œ/g, 'oe');\n if (length) formattedValue = formattedValue.slice(0, length);\n return formattedValue;\n }\n return null;\n}\n\nexport function getTaxesIncludedAmount(amountHt: number, idVat: number, isRounded = true) {\n const vatRate = Object.values(Vat).find((v) => v.id === idVat)?.value ?? 20;\n const amountNotRounded = amountHt * ((100 + vatRate) / 100);\n\n if (!isRounded) return amountNotRounded;\n return Math.round(amountNotRounded * 100) / 100;\n}\n\nexport function getTaxesExcludedAmount(amountTtc: number, idVat: number, isRounded = true) {\n const vatRate = Object.values(Vat).find((v) => v.id === idVat)?.value ?? 20;\n const amountNotRounded = amountTtc / ((100 + vatRate) / 100);\n\n if (!isRounded) return amountNotRounded;\n return Math.round(amountNotRounded * 100) / 100;\n}\n\nexport function getInternalInvoicingVatByZipCode(zipCode: string | null): VatType {\n if (zipCode?.startsWith('971') || zipCode?.startsWith('972') || zipCode?.startsWith('974')) {\n return Vat.TX_8_5;\n } else if (zipCode?.startsWith('973') || zipCode?.startsWith('976') || zipCode?.startsWith('977')) {\n return Vat.WITHOUT_TAXE;\n }\n return Vat.TX_20;\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../ts/utils/vat/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE5D,OAAO,EAAE,GAAG,EAAW,MAAM,sBAAsB,CAAC;AAEpD,MAAM,UAAU,wBAAwB,CACtC,iBAAqC,EACrC,cAAwB,EACxB,SAAS,GAAG,CAAC,EACb,KAAK,GAAG,KAAK;IAEb,MAAM,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAG,MAAM,CACnB,qBAAqB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,eAAe,EAAE,EAAE;QACpD,IAAI,MAAM,GAAG,GAAG,CAAC;QACjB,cAAc,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YAC7B,IACE,eAAe,CAAC,OAAO;gBACvB,eAAe,CAAC,OAAO,CAAC,MAAM;gBAC9B,eAAe,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAC5D,CAAC;gBACD,MAAM,IAAI,eAAe,CAAC,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC;gBACzD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,CAAC,EACL,SAAS,CACV,CAAC;IACF,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC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AAO,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3F,OAAO,GAAG,CAAC,MAAM,CAAC;IACpB,CAAC;SAAM,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QAClG,OAAO,GAAG,CAAC,YAAY,CAAC;IAC1B,CAAC;IACD,OAAO,GAAG,CAAC,KAAK,CAAC;AACnB,CAAC","sourcesContent":["import { round as _round, uniqBy as _uniqBy } from 'lodash';\nimport { IAccountingEntry } from '../../types/Interface/models/IAccountingEntry';\nimport { Vat, VatType } from '../../types/Enum/Vat';\n\nexport function getAmountByAccountNumber(\n accountingEntries: IAccountingEntry[],\n accountsNumber: string[],\n precision = 0,\n isAbs = false,\n): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n const result = _round(\n accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (\n accountingEntry.account &&\n accountingEntry.account.number &&\n accountingEntry.account.number.toString().startsWith(number)\n ) {\n accTmp += accountingEntry.debit - accountingEntry.credit;\n return true;\n }\n return false;\n });\n return accTmp;\n }, 0),\n precision,\n );\n return isAbs ? Math.abs(result) : result;\n}\n\nexport function setZeroIfIsNegative(value: number): number {\n return value < 0 ? 0 : value;\n}\n\nexport function getTaxAmountByAccountNumber(\n accountingEntries: IAccountingEntry[],\n accountsNumber: string[],\n precision = 0,\n logging = false,\n isAbs = false,\n): number {\n const accountingEntriesUniq = _uniqBy(accountingEntries, 'id');\n return _round(\n accountingEntriesUniq.reduce((acc, accountingEntry) => {\n let accTmp = acc;\n accountsNumber.some((number) => {\n if (\n accountingEntry.account &&\n accountingEntry.account.number &&\n accountingEntry.account.number.toString().startsWith(number)\n ) {\n // eslint-disable-next-line no-console\n if (logging) console.log(\"''\");\n // eslint-disable-next-line no-console\n if (logging) console.log(accountingEntry);\n\n accTmp +=\n (accountingEntry.debit - accountingEntry.credit) *\n ((Object.values(Vat).find((v) => v.id === accountingEntry.idVat)?.value ?? 0) / 100);\n return true;\n }\n return false;\n });\n return isAbs ? Math.abs(accTmp) : accTmp;\n }, precision),\n );\n}\n\nexport function textFormatting(value: any, length: number | null = null, start?: number): string | null {\n if (value && typeof value === 'string') {\n let formattedValue = value.replace(/[\\u2018\\u2019]/g, \"'\"); // Suppression des \"Curly Quotes\"\n formattedValue = formattedValue.replace(/&/g, ''); // Suppression des &\n formattedValue = formattedValue.replace(/!/g, ''); // Suppression des !\n formattedValue = formattedValue.replace(/[\\t]/g, ''); // Suppression des tabulations\n\n formattedValue = formattedValue.replace(/`/g, \"'\"); // Suppression des `\n formattedValue = formattedValue.replace(/\"/g, ''); // Suppression des \"\n formattedValue = formattedValue.replace(/^ */, ''); // Suppression des espaces de début\n formattedValue = formattedValue.replace(/ *$/, ''); // Suppression des espaces de fin\n formattedValue = formattedValue.replace(/€/g, 'EUR');\n formattedValue = formattedValue.replace(/œ/g, 'oe');\n if (length) formattedValue = formattedValue.slice(start ?? 0, (start ?? 0) + length);\n return formattedValue;\n }\n return null;\n}\n\nexport function getTaxesIncludedAmount(amountHt: number, idVat: number, isRounded = true) {\n const vatRate = Object.values(Vat).find((v) => v.id === idVat)?.value ?? 20;\n const amountNotRounded = amountHt * ((100 + vatRate) / 100);\n\n if (!isRounded) return amountNotRounded;\n return Math.round(amountNotRounded * 100) / 100;\n}\n\nexport function getTaxesExcludedAmount(amountTtc: number, idVat: number, isRounded = true) {\n const vatRate = Object.values(Vat).find((v) => v.id === idVat)?.value ?? 20;\n const amountNotRounded = amountTtc / ((100 + vatRate) / 100);\n\n if (!isRounded) return amountNotRounded;\n return Math.round(amountNotRounded * 100) / 100;\n}\n\nexport function getInternalInvoicingVatByZipCode(zipCode: string | null): VatType {\n if (zipCode?.startsWith('971') || zipCode?.startsWith('972') || zipCode?.startsWith('974')) {\n return Vat.TX_8_5;\n } else if (zipCode?.startsWith('973') || zipCode?.startsWith('976') || zipCode?.startsWith('977')) {\n return Vat.WITHOUT_TAXE;\n }\n return Vat.TX_20;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.3.85-0",
3
+ "version": "1.3.87",
4
4
  "description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
5
5
  "homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
6
6
  "main": "dist/cjs/index.js",
@@ -64,7 +64,7 @@
64
64
  "types": "dist/cjs/index.d.ts",
65
65
  "dependencies": {
66
66
  "@types/geojson": "^7946.0.16",
67
- "@types/mailparser": "^3.4.6",
67
+ "@types/mailparser": "^3.4.5",
68
68
  "axios": "0.22.0",
69
69
  "browser-or-node": "^3.0.0",
70
70
  "class-transformer": "^0.5.1",
@@ -72,7 +72,7 @@
72
72
  "dayjs": "^1.11.11",
73
73
  "ejs": "^3.1.9",
74
74
  "libphonenumber-js": "^1.12.10",
75
- "mailparser": "^3.7.4",
75
+ "mailparser": "^3.4.0",
76
76
  "rxjs": "^7.8.2",
77
77
  "sms-segments-calculator": "^1.2.0",
78
78
  "stripe": "^18.1.1",
@@ -95,7 +95,7 @@ export class Payment extends Resource {
95
95
  });
96
96
  }
97
97
 
98
- getBillingPortal(params: QueryStripeSubscriptionId): Promise<string> {
98
+ getAllPaymentMethods(params: QueryStripeSubscriptionId): Promise<string> {
99
99
  return this.axios.$get('/stripe/payments/methods', { params });
100
100
  }
101
101
 
@@ -6,6 +6,7 @@ import {
6
6
  IPaymentExpectation,
7
7
  QueryGetPaymentExpectation,
8
8
  QueryGetPaymentExpectationPaginated,
9
+ QueryStripeSubscriptionId,
9
10
  RetrievePaymentMethodsParams,
10
11
  } from '../../types';
11
12
  import { Resource } from '../Resource';
@@ -52,6 +53,10 @@ export class PaymentExpectation extends Resource {
52
53
  return this.axios.$get('/stripe/payments/methods', { params });
53
54
  }
54
55
 
56
+ createPortal(payload: QueryStripeSubscriptionId): Promise<string> {
57
+ return this.axios.$get('/stripe/payments/portals', { params: payload });
58
+ }
59
+
55
60
  /**
56
61
  * Créé une session Stripe avec les informations client
57
62
  * Attention : les montants sont retournés x100
@@ -56,6 +56,8 @@ export enum LogType {
56
56
  PARTNER = 44,
57
57
  LEGAL_FORM = 45,
58
58
  TIME_SLOTS = 46,
59
+ MANUAL_BALANCE = 47,
60
+ MANUAL_PREVIOUS_BALANCE = 48,
59
61
  }
60
62
 
61
63
  export const LogTypeDetail = {
@@ -1,4 +1,4 @@
1
- import { IsBoolean, IsInt, IsNumber, IsOptional } from 'class-validator';
1
+ import { IsBoolean, IsDate, IsInt, IsNumber, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
3
  import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
4
 
@@ -25,5 +25,76 @@ export class UpdatePayment {
25
25
  @ApiPropertyOptional()
26
26
  @IsOptional()
27
27
  @IsNumber()
28
- amountPayed: number;
29
- }
28
+ amount?: number;
29
+
30
+ @ApiPropertyOptional()
31
+ @IsOptional()
32
+ @IsNumber()
33
+ amountPayed?: number;
34
+
35
+ @ApiPropertyOptional()
36
+ @IsOptional()
37
+ @IsInt()
38
+ idExercice?: number;
39
+
40
+ @ApiPropertyOptional()
41
+ @IsOptional()
42
+ @IsInt()
43
+ idPaymentMethod?: number;
44
+
45
+ @ApiPropertyOptional()
46
+ @IsOptional()
47
+ @IsInt()
48
+ idPrestation?: number;
49
+
50
+ @ApiPropertyOptional()
51
+ @IsOptional()
52
+ @ToBoolean()
53
+ @IsBoolean()
54
+ isAsset?: boolean;
55
+
56
+ @ApiPropertyOptional()
57
+ @IsOptional()
58
+ @ToBoolean()
59
+ @IsBoolean()
60
+ isFree?: boolean;
61
+
62
+ @ApiPropertyOptional()
63
+ @IsOptional()
64
+ @ToBoolean()
65
+ @IsBoolean()
66
+ isOverpaid?: boolean;
67
+
68
+ @ApiPropertyOptional()
69
+ @IsOptional()
70
+ @ToBoolean()
71
+ @IsBoolean()
72
+ isHiddenCustomer?: boolean;
73
+
74
+ @ApiPropertyOptional()
75
+ @IsOptional()
76
+ @ToBoolean()
77
+ @IsBoolean()
78
+ noInternalInvoice?: boolean;
79
+
80
+ @ApiPropertyOptional()
81
+ @IsOptional()
82
+ @ToBoolean()
83
+ @IsBoolean()
84
+ isDebtSpreading?: boolean;
85
+
86
+ @ApiPropertyOptional()
87
+ @IsOptional()
88
+ @IsString()
89
+ comment?: string;
90
+
91
+ @ApiPropertyOptional()
92
+ @IsOptional()
93
+ @IsString()
94
+ internComment?: string;
95
+
96
+ @ApiPropertyOptional()
97
+ @IsOptional()
98
+ @IsDate()
99
+ datePayment?: Date;
100
+ }
@@ -21,10 +21,12 @@ export interface IPayment {
21
21
  isCollectable?: boolean;
22
22
  isAsset?: boolean;
23
23
  isFree?: boolean;
24
+ isDebtSpreading?: boolean;
24
25
  isHiddenCustomer?: boolean;
25
26
  dateOverdue?: Date | null;
26
27
  datePayment: Date;
27
28
  comment?: string | null;
29
+ internComment?: string | null;
28
30
  done?: boolean | null;
29
31
  refInternalInvoicing?: number;
30
32
  noInternalInvoice?: boolean;
@@ -960,33 +960,11 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
960
960
  key: 'BA',
961
961
  value: null,
962
962
  isMultiple: false,
963
- tags: [
964
- {
965
- tag: 'TexteLibre1',
966
- description: 'FTX Commentaires type 1, ligne 1 1ère zone de 512',
967
- value: textFormatting(comment, 512),
968
- },
969
- {
970
- tag: 'TexteLibre2',
971
- description: 'FTX Commentaires type 1, ligne 2 2ème zone de 512',
972
- value: comment && (comment?.length ?? 0) > 512 ? textFormatting(comment.slice(512, 1024)) : null,
973
- },
974
- {
975
- tag: 'TexteLibre3',
976
- description: 'FTX Commentaires type 1, ligne 3 3ème zone de 512',
977
- value: comment && (comment?.length ?? 0) > 1024 ? textFormatting(comment.slice(1024, 1536)) : null,
978
- },
979
- {
980
- tag: 'TexteLibre4',
981
- description: 'FTX Commentaires type 1, ligne 4 4ème zone de 512',
982
- value: comment && (comment?.length ?? 0) > 1536 ? textFormatting(comment.slice(1536, 2048)) : null,
983
- },
984
- {
985
- tag: 'TexteLibre5',
986
- description: 'FTX Commentaires type 1, ligne 5 5ème zone de 512',
987
- value: comment && (comment?.length ?? 0) > 2048 ? textFormatting(comment.slice(2048, 2560)) : null,
988
- },
989
- ],
963
+ tags: [1, 2, 3, 4, 5].map((i) => ({
964
+ tag: `TexteLibre${i}` as 'TexteLibre1',
965
+ description: `FTX Commentaires type ${i}`,
966
+ value: textFormatting(comment, 512, 512 * (i - 1)) || null,
967
+ })),
990
968
  },
991
969
  {
992
970
  key: 'BB',
@@ -1070,7 +1048,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1070
1048
  tag: 'Valeur',
1071
1049
  isMultiple: false,
1072
1050
  description:
1073
- 'MOA Livraisons d\'electricité, de gaz naturel, de chaleur ou de froid imposables en France, base hors taxe',
1051
+ "MOA Livraisons d'electricité, de gaz naturel, de chaleur ou de froid imposables en France, base hors taxe",
1074
1052
  value: data.taxedOperations.energyDelivery,
1075
1053
  },
1076
1054
  {
@@ -1078,7 +1056,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1078
1056
  tag: 'Valeur',
1079
1057
  isMultiple: false,
1080
1058
  description:
1081
- 'MOA Achats de biens ou de prestations de services réalisés auprès d\'un assujetti non établi en France, art 283-1 du CGI',
1059
+ "MOA Achats de biens ou de prestations de services réalisés auprès d'un assujetti non établi en France, art 283-1 du CGI",
1082
1060
  value: data.taxedOperations.purchaseOfServicesNotInFrance,
1083
1061
  },
1084
1062
  {
@@ -1127,7 +1105,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1127
1105
  key: 'DC',
1128
1106
  tag: 'Valeur',
1129
1107
  isMultiple: false,
1130
- description: 'MOA Livraisons intracommunautaires à destination d\'une personne assujettie 100077',
1108
+ description: "MOA Livraisons intracommunautaires à destination d'une personne assujettie 100077",
1131
1109
  value: data.untaxedOperations.intracommunityDelivery,
1132
1110
  },
1133
1111
  {
@@ -1149,7 +1127,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1149
1127
  tag: 'Valeur',
1150
1128
  isMultiple: false,
1151
1129
  description:
1152
- 'MOA Livraisons d\'electricité, de gaz naturel, de chaleur ou de froid non imposables en France 100122',
1130
+ "MOA Livraisons d'electricité, de gaz naturel, de chaleur ou de froid non imposables en France 100122",
1153
1131
  value: data.untaxedOperations.energyDelivery,
1154
1132
  },
1155
1133
  {
@@ -1356,7 +1334,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1356
1334
  tag: 'Valeur',
1357
1335
  isMultiple: false,
1358
1336
  description:
1359
- 'PCD Pourcentage de déduction applicable pour la période s\'il est différent de 100% Valeur entière et au plus 2 décimales',
1337
+ "PCD Pourcentage de déduction applicable pour la période s'il est différent de 100% Valeur entière et au plus 2 décimales",
1360
1338
  value:
1361
1339
  isDefined(data.vat.deductible.coefficient) && data.vat.deductible.coefficient !== 100
1362
1340
  ? data.vat.deductible.coefficient
@@ -1387,7 +1365,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1387
1365
  key: 'HJ',
1388
1366
  tag: 'Valeur',
1389
1367
  isMultiple: false,
1390
- description: 'CCITBX Mention membre d\'un groupe Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =',
1368
+ description: "CCITBX Mention membre d'un groupe Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =",
1391
1369
  value: null,
1392
1370
  },
1393
1371
  {
@@ -1593,7 +1571,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1593
1571
  tag: 'Valeur',
1594
1572
  isMultiple: false,
1595
1573
  description:
1596
- 'CCITBX Mention de qualité de représentant d\'un assujetti unique Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =',
1574
+ "CCITBX Mention de qualité de représentant d'un assujetti unique Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =",
1597
1575
  value: null,
1598
1576
  },
1599
1577
  {
@@ -1614,7 +1592,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1614
1592
  key: 'MD',
1615
1593
  tag: 'Valeur',
1616
1594
  isMultiple: false,
1617
- description: 'MOA Retenue de TVA sur droits d\'auteur taxe due',
1595
+ description: "MOA Retenue de TVA sur droits d'auteur taxe due",
1618
1596
  value: data.vat.otherRate.author.tax,
1619
1597
  },
1620
1598
  {
@@ -1635,7 +1613,7 @@ export function getCerfa3310Century23RegistrationFields(data: Cerfa3310_2023): A
1635
1613
  key: 'MG',
1636
1614
  tag: 'Valeur',
1637
1615
  isMultiple: false,
1638
- description: 'MOA Retenue de TVA sur droits d\'auteur base HT',
1616
+ description: "MOA Retenue de TVA sur droits d'auteur base HT",
1639
1617
  value: data.vat.otherRate.oldRate.base,
1640
1618
  },
1641
1619
  {
@@ -1821,12 +1799,12 @@ export const cerfa3310Century23Fields: CerfaPayloadForm[] = [
1821
1799
  type: 'number',
1822
1800
  },
1823
1801
  {
1824
- label: 'B3 - Achats d\'electricité, de gaz naturel, de chaleur ou de froid imposables en France',
1802
+ label: "B3 - Achats d'electricité, de gaz naturel, de chaleur ou de froid imposables en France",
1825
1803
  key: 'taxedOperations.energyDelivery',
1826
1804
  type: 'number',
1827
1805
  },
1828
1806
  {
1829
- label: 'B4 - Achats de biens ou de prestations de services réalisés auprès d\'un assujetti non établi en France',
1807
+ label: "B4 - Achats de biens ou de prestations de services réalisés auprès d'un assujetti non établi en France",
1830
1808
  key: 'taxedOperations.regularizations',
1831
1809
  type: 'number',
1832
1810
  },
@@ -1856,7 +1834,7 @@ export const cerfa3310Century23Fields: CerfaPayloadForm[] = [
1856
1834
  type: 'number',
1857
1835
  },
1858
1836
  {
1859
- label: 'F3 - Livraisons d\'électricité, de gaz naturel, de chaleur ou de froid non imposables en France',
1837
+ label: "F3 - Livraisons d'électricité, de gaz naturel, de chaleur ou de froid non imposables en France",
1860
1838
  key: 'untaxedOperations.energyDelivery',
1861
1839
  type: 'number',
1862
1840
  },
@@ -1886,7 +1864,7 @@ export const cerfa3310Century23Fields: CerfaPayloadForm[] = [
1886
1864
  type: 'number',
1887
1865
  },
1888
1866
  {
1889
- label: 'F9 - Opérations internes réalisées entre membres d\'un assujetti unique',
1867
+ label: "F9 - Opérations internes réalisées entre membres d'un assujetti unique",
1890
1868
  key: 'untaxedOperations.internalUniq',
1891
1869
  type: 'number',
1892
1870
  },
@@ -1973,7 +1951,7 @@ export const cerfa3310Century23Fields: CerfaPayloadForm[] = [
1973
1951
  type: 'number',
1974
1952
  },
1975
1953
  {
1976
- label: '29 - Taxes assimilées calculées sur l\'annexe n° 3310 A',
1954
+ label: "29 - Taxes assimilées calculées sur l'annexe n° 3310 A",
1977
1955
  key: 'credit.assimiledTaxes',
1978
1956
  type: 'number',
1979
1957
  },
@@ -965,33 +965,11 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
965
965
  key: 'BA',
966
966
  value: null,
967
967
  isMultiple: false,
968
- tags: [
969
- {
970
- tag: 'TexteLibre1',
971
- description: 'FTX Commentaires type 1, ligne 1 1ère zone de 512',
972
- value: textFormatting(comment, 512),
973
- },
974
- {
975
- tag: 'TexteLibre2',
976
- description: 'FTX Commentaires type 1, ligne 2 2ème zone de 512',
977
- value: comment && (comment?.length ?? 0) > 512 ? textFormatting(comment.slice(512, 1024)) : null,
978
- },
979
- {
980
- tag: 'TexteLibre3',
981
- description: 'FTX Commentaires type 1, ligne 3 3ème zone de 512',
982
- value: comment && (comment?.length ?? 0) > 1024 ? textFormatting(comment.slice(1024, 1536)) : null,
983
- },
984
- {
985
- tag: 'TexteLibre4',
986
- description: 'FTX Commentaires type 1, ligne 4 4ème zone de 512',
987
- value: comment && (comment?.length ?? 0) > 1536 ? textFormatting(comment.slice(1536, 2048)) : null,
988
- },
989
- {
990
- tag: 'TexteLibre5',
991
- description: 'FTX Commentaires type 1, ligne 5 5ème zone de 512',
992
- value: comment && (comment?.length ?? 0) > 2048 ? textFormatting(comment.slice(2048, 2560)) : null,
993
- },
994
- ],
968
+ tags: [1, 2, 3, 4, 5].map((i) => ({
969
+ tag: `TexteLibre${i}` as 'TexteLibre1',
970
+ description: `FTX Commentaires type ${i}`,
971
+ value: textFormatting(comment, 512, 512 * (i - 1)) || null,
972
+ })),
995
973
  },
996
974
  {
997
975
  key: 'BB',
@@ -1075,7 +1053,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1075
1053
  tag: 'Valeur',
1076
1054
  isMultiple: false,
1077
1055
  description:
1078
- 'MOA Livraisons d\'electricité, de gaz naturel, de chaleur ou de froid imposables en France, base hors taxe',
1056
+ "MOA Livraisons d'electricité, de gaz naturel, de chaleur ou de froid imposables en France, base hors taxe",
1079
1057
  value: data.taxedOperations.energyDelivery,
1080
1058
  },
1081
1059
  {
@@ -1083,7 +1061,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1083
1061
  tag: 'Valeur',
1084
1062
  isMultiple: false,
1085
1063
  description:
1086
- 'MOA Achats de biens ou de prestations de services réalisés auprès d\'un assujetti non établi en France, art 283-1 du CGI',
1064
+ "MOA Achats de biens ou de prestations de services réalisés auprès d'un assujetti non établi en France, art 283-1 du CGI",
1087
1065
  value: data.taxedOperations.purchaseOfServicesNotInFrance,
1088
1066
  },
1089
1067
  {
@@ -1146,7 +1124,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1146
1124
  key: 'DC',
1147
1125
  tag: 'Valeur',
1148
1126
  isMultiple: false,
1149
- description: 'MOA Livraisons intracommunautaires à destination d\'une personne assujettie 100077',
1127
+ description: "MOA Livraisons intracommunautaires à destination d'une personne assujettie 100077",
1150
1128
  value: data.untaxedOperations.intracommunityDelivery,
1151
1129
  },
1152
1130
  {
@@ -1168,7 +1146,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1168
1146
  tag: 'Valeur',
1169
1147
  isMultiple: false,
1170
1148
  description:
1171
- 'MOA Livraisons d\'electricité, de gaz naturel, de chaleur ou de froid non imposables en France 100122',
1149
+ "MOA Livraisons d'electricité, de gaz naturel, de chaleur ou de froid non imposables en France 100122",
1172
1150
  value: data.untaxedOperations.energyDelivery,
1173
1151
  },
1174
1152
  {
@@ -1375,7 +1353,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1375
1353
  tag: 'Valeur',
1376
1354
  isMultiple: false,
1377
1355
  description:
1378
- 'PCD Pourcentage de déduction applicable pour la période s\'il est différent de 100% Valeur entière et au plus 2 décimales',
1356
+ "PCD Pourcentage de déduction applicable pour la période s'il est différent de 100% Valeur entière et au plus 2 décimales",
1379
1357
  value:
1380
1358
  isDefined(data.vat.deductible.coefficient) && data.vat.deductible.coefficient !== 100
1381
1359
  ? data.vat.deductible.coefficient
@@ -1406,7 +1384,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1406
1384
  key: 'HJ',
1407
1385
  tag: 'Valeur',
1408
1386
  isMultiple: false,
1409
- description: 'CCITBX Mention membre d\'un groupe Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =',
1387
+ description: "CCITBX Mention membre d'un groupe Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =",
1410
1388
  value: null,
1411
1389
  },
1412
1390
  {
@@ -1613,7 +1591,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1613
1591
  tag: 'Valeur',
1614
1592
  isMultiple: false,
1615
1593
  description:
1616
- 'CCITBX Mention de qualité de représentant d\'un assujetti unique Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =',
1594
+ "CCITBX Mention de qualité de représentant d'un assujetti unique Table TBX avec X pour sélectionné, CCI/7037 = CAV/1131 =",
1617
1595
  value: null,
1618
1596
  },
1619
1597
  {
@@ -1634,7 +1612,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1634
1612
  key: 'MD',
1635
1613
  tag: 'Valeur',
1636
1614
  isMultiple: false,
1637
- description: 'MOA Retenue de TVA sur droits d\'auteur taxe due',
1615
+ description: "MOA Retenue de TVA sur droits d'auteur taxe due",
1638
1616
  value: data.vat.otherRate.author.tax,
1639
1617
  },
1640
1618
  {
@@ -1655,7 +1633,7 @@ export function getCerfa3310Century24RegistrationFields(data: Cerfa3310_2024): A
1655
1633
  key: 'MG',
1656
1634
  tag: 'Valeur',
1657
1635
  isMultiple: false,
1658
- description: 'MOA Retenue de TVA sur droits d\'auteur base HT',
1636
+ description: "MOA Retenue de TVA sur droits d'auteur base HT",
1659
1637
  value: data.vat.otherRate.oldRate.base,
1660
1638
  },
1661
1639
  {
@@ -1842,12 +1820,12 @@ export const cerfa3310Century24Fields: CerfaPayloadForm[] = [
1842
1820
  type: 'number',
1843
1821
  },
1844
1822
  {
1845
- label: 'B3 - Achats d\'electricité, de gaz naturel, de chaleur ou de froid imposables en France',
1823
+ label: "B3 - Achats d'electricité, de gaz naturel, de chaleur ou de froid imposables en France",
1846
1824
  key: 'taxedOperations.energyDelivery',
1847
1825
  type: 'number',
1848
1826
  },
1849
1827
  {
1850
- label: 'B4 - Achats de biens ou de prestations de services réalisés auprès d\'un assujetti non établi en France',
1828
+ label: "B4 - Achats de biens ou de prestations de services réalisés auprès d'un assujetti non établi en France",
1851
1829
  key: 'taxedOperations.regularizations',
1852
1830
  type: 'number',
1853
1831
  },
@@ -1877,7 +1855,7 @@ export const cerfa3310Century24Fields: CerfaPayloadForm[] = [
1877
1855
  type: 'number',
1878
1856
  },
1879
1857
  {
1880
- label: 'F3 - Livraisons d\'électricité, de gaz naturel, de chaleur ou de froid non imposables en France',
1858
+ label: "F3 - Livraisons d'électricité, de gaz naturel, de chaleur ou de froid non imposables en France",
1881
1859
  key: 'untaxedOperations.energyDelivery',
1882
1860
  type: 'number',
1883
1861
  },
@@ -1907,7 +1885,7 @@ export const cerfa3310Century24Fields: CerfaPayloadForm[] = [
1907
1885
  type: 'number',
1908
1886
  },
1909
1887
  {
1910
- label: 'F9 - Opérations internes réalisées entre membres d\'un assujetti unique',
1888
+ label: "F9 - Opérations internes réalisées entre membres d'un assujetti unique",
1911
1889
  key: 'untaxedOperations.internalUniq',
1912
1890
  type: 'number',
1913
1891
  },
@@ -1994,7 +1972,7 @@ export const cerfa3310Century24Fields: CerfaPayloadForm[] = [
1994
1972
  type: 'number',
1995
1973
  },
1996
1974
  {
1997
- label: '29 - Taxes assimilées calculées sur l\'annexe n° 3310 A',
1975
+ label: "29 - Taxes assimilées calculées sur l'annexe n° 3310 A",
1998
1976
  key: 'credit.assimiledTaxes',
1999
1977
  type: 'number',
2000
1978
  },