@silexpert/core 1.1.140 → 1.1.141

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 (134) hide show
  1. package/es/api/resources/AccountingFiles.js.map +1 -1
  2. package/es/api/resources/BalanceSheet.d.ts +1 -0
  3. package/es/api/resources/BalanceSheet.d.ts.map +1 -1
  4. package/es/api/resources/BalanceSheet.js +3 -0
  5. package/es/api/resources/BalanceSheet.js.map +1 -1
  6. package/es/api/resources/Revision.d.ts +6 -1
  7. package/es/api/resources/Revision.d.ts.map +1 -1
  8. package/es/api/resources/Revision.js +16 -1
  9. package/es/api/resources/Revision.js.map +1 -1
  10. package/es/api/resources/RevisionGuide.d.ts +2 -2
  11. package/es/api/resources/RevisionGuide.d.ts.map +1 -1
  12. package/es/api/resources/RevisionGuide.js.map +1 -1
  13. package/es/api/resources/VatControl.d.ts +3 -1
  14. package/es/api/resources/VatControl.d.ts.map +1 -1
  15. package/es/api/resources/VatControl.js +6 -0
  16. package/es/api/resources/VatControl.js.map +1 -1
  17. package/es/types/Enum/BalanceSheetQuestion.d.ts.map +1 -1
  18. package/es/types/Enum/BalanceSheetQuestion.js.map +1 -1
  19. package/es/types/Enum/BrandClementine.js +2 -2
  20. package/es/types/Enum/BrandClementine.js.map +1 -1
  21. package/es/types/Enum/BrandPourcentage.js +2 -2
  22. package/es/types/Enum/BrandPourcentage.js.map +1 -1
  23. package/es/types/Enum/RevisionGuide.d.ts +28 -0
  24. package/es/types/Enum/RevisionGuide.d.ts.map +1 -1
  25. package/es/types/Enum/RevisionGuide.js +183 -0
  26. package/es/types/Enum/RevisionGuide.js.map +1 -1
  27. package/es/types/Enum/VatControl.d.ts +12 -0
  28. package/es/types/Enum/VatControl.d.ts.map +1 -0
  29. package/es/types/Enum/VatControl.js +195 -0
  30. package/es/types/Enum/VatControl.js.map +1 -0
  31. package/es/types/Interface/api/balanceSheet/VatControl.d.ts +13 -0
  32. package/es/types/Interface/api/balanceSheet/VatControl.d.ts.map +1 -0
  33. package/es/types/Interface/api/balanceSheet/VatControl.js +2 -0
  34. package/es/types/Interface/api/balanceSheet/VatControl.js.map +1 -0
  35. package/es/types/Interface/api/cerfa/3310.d.ts +47 -0
  36. package/es/types/Interface/api/cerfa/3310.d.ts.map +1 -1
  37. package/es/types/Interface/api/cerfa/3310.js.map +1 -1
  38. package/es/types/Interface/api/registration/CreateRegistration.d.ts +1 -0
  39. package/es/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
  40. package/es/types/Interface/api/registration/CreateRegistration.js +7 -0
  41. package/es/types/Interface/api/registration/CreateRegistration.js.map +1 -1
  42. package/es/types/Interface/api/revision/Create.d.ts +26 -0
  43. package/es/types/Interface/api/revision/Create.d.ts.map +1 -0
  44. package/es/types/Interface/api/revision/Create.js +133 -0
  45. package/es/types/Interface/api/revision/Create.js.map +1 -0
  46. package/es/types/Interface/api/revision/Query.d.ts +8 -0
  47. package/es/types/Interface/api/revision/Query.d.ts.map +1 -1
  48. package/es/types/Interface/api/revision/Query.js +24 -0
  49. package/es/types/Interface/api/revision/Query.js.map +1 -1
  50. package/es/types/Interface/api/vatControl/CreateVatControl.d.ts +5 -0
  51. package/es/types/Interface/api/vatControl/CreateVatControl.d.ts.map +1 -0
  52. package/es/types/Interface/api/vatControl/CreateVatControl.js +26 -0
  53. package/es/types/Interface/api/vatControl/CreateVatControl.js.map +1 -0
  54. package/es/types/Interface/api/vatControl/QueryVatControl.d.ts +4 -0
  55. package/es/types/Interface/api/vatControl/QueryVatControl.d.ts.map +1 -0
  56. package/es/types/Interface/api/vatControl/QueryVatControl.js +21 -0
  57. package/es/types/Interface/api/vatControl/QueryVatControl.js.map +1 -0
  58. package/es/types/Interface/models/ISupervisionPendingPoint.d.ts +10 -0
  59. package/es/types/Interface/models/ISupervisionPendingPoint.d.ts.map +1 -1
  60. package/es/types/Interface/models/ISupervisionPendingPoint.js.map +1 -1
  61. package/es/types/Interface/models/ISupervisionPendingPointReply.d.ts +13 -0
  62. package/es/types/Interface/models/ISupervisionPendingPointReply.d.ts.map +1 -0
  63. package/es/types/Interface/models/ISupervisionPendingPointReply.js +2 -0
  64. package/es/types/Interface/models/ISupervisionPendingPointReply.js.map +1 -0
  65. package/es/types/index.d.ts +6 -0
  66. package/es/types/index.d.ts.map +1 -1
  67. package/es/types/index.js +6 -0
  68. package/es/types/index.js.map +1 -1
  69. package/es/utils/phone.js +1 -1
  70. package/es/utils/phone.js.map +1 -1
  71. package/es/utils/vat/3310/century23.js +65 -65
  72. package/es/utils/vat/3310/century23.js.map +1 -1
  73. package/js/api/resources/AccountingFiles.js.map +1 -1
  74. package/js/api/resources/BalanceSheet.js +3 -0
  75. package/js/api/resources/BalanceSheet.js.map +1 -1
  76. package/js/api/resources/Revision.js +20 -1
  77. package/js/api/resources/Revision.js.map +1 -1
  78. package/js/api/resources/RevisionGuide.js.map +1 -1
  79. package/js/api/resources/VatControl.js +6 -0
  80. package/js/api/resources/VatControl.js.map +1 -1
  81. package/js/types/Enum/BalanceSheetQuestion.js.map +1 -1
  82. package/js/types/Enum/BrandClementine.js +2 -2
  83. package/js/types/Enum/BrandClementine.js.map +1 -1
  84. package/js/types/Enum/BrandPourcentage.js +2 -2
  85. package/js/types/Enum/BrandPourcentage.js.map +1 -1
  86. package/js/types/Enum/RevisionGuide.js +311 -0
  87. package/js/types/Enum/RevisionGuide.js.map +1 -1
  88. package/js/types/Enum/VatControl.js +162 -0
  89. package/js/types/Enum/VatControl.js.map +1 -0
  90. package/js/types/Interface/api/balanceSheet/VatControl.js +6 -0
  91. package/js/types/Interface/api/balanceSheet/VatControl.js.map +1 -0
  92. package/js/types/Interface/api/cerfa/3310.js.map +1 -1
  93. package/js/types/Interface/api/registration/CreateRegistration.js +1 -0
  94. package/js/types/Interface/api/registration/CreateRegistration.js.map +1 -1
  95. package/js/types/Interface/api/revision/Create.js +45 -0
  96. package/js/types/Interface/api/revision/Create.js.map +1 -0
  97. package/js/types/Interface/api/revision/Query.js +9 -1
  98. package/js/types/Interface/api/revision/Query.js.map +1 -1
  99. package/js/types/Interface/api/vatControl/CreateVatControl.js +27 -0
  100. package/js/types/Interface/api/vatControl/CreateVatControl.js.map +1 -0
  101. package/js/types/Interface/api/vatControl/QueryVatControl.js +26 -0
  102. package/js/types/Interface/api/vatControl/QueryVatControl.js.map +1 -0
  103. package/js/types/Interface/models/ISupervisionPendingPoint.js.map +1 -1
  104. package/js/types/Interface/models/ISupervisionPendingPointReply.js +6 -0
  105. package/js/types/Interface/models/ISupervisionPendingPointReply.js.map +1 -0
  106. package/js/types/index.js +96 -36
  107. package/js/types/index.js.map +1 -1
  108. package/js/utils/phone.js +1 -1
  109. package/js/utils/phone.js.map +1 -1
  110. package/js/utils/vat/3310/century23.js +65 -65
  111. package/js/utils/vat/3310/century23.js.map +1 -1
  112. package/package.json +1 -1
  113. package/ts/api/resources/AccountingFiles.ts +1 -1
  114. package/ts/api/resources/BalanceSheet.ts +4 -0
  115. package/ts/api/resources/Revision.ts +22 -2
  116. package/ts/api/resources/RevisionGuide.ts +2 -2
  117. package/ts/api/resources/VatControl.ts +10 -1
  118. package/ts/types/Enum/BalanceSheetQuestion.ts +0 -1
  119. package/ts/types/Enum/BrandClementine.ts +2 -2
  120. package/ts/types/Enum/BrandPourcentage.ts +2 -2
  121. package/ts/types/Enum/RevisionGuide.ts +197 -1
  122. package/ts/types/Enum/VatControl.ts +198 -0
  123. package/ts/types/Interface/api/balanceSheet/VatControl.ts +10 -0
  124. package/ts/types/Interface/api/cerfa/3310.ts +49 -0
  125. package/ts/types/Interface/api/registration/CreateRegistration.ts +6 -0
  126. package/ts/types/Interface/api/revision/Create.ts +105 -0
  127. package/ts/types/Interface/api/revision/Query.ts +22 -0
  128. package/ts/types/Interface/api/vatControl/CreateVatControl.ts +14 -0
  129. package/ts/types/Interface/api/vatControl/QueryVatControl.ts +10 -0
  130. package/ts/types/Interface/models/ISupervisionPendingPoint.ts +10 -0
  131. package/ts/types/Interface/models/ISupervisionPendingPointReply.ts +16 -0
  132. package/ts/types/index.ts +6 -0
  133. package/ts/utils/phone.ts +1 -1
  134. package/ts/utils/vat/3310/century23.ts +26 -26
package/js/utils/phone.js CHANGED
@@ -14,7 +14,7 @@ var _Role = require("../types/Enum/Role");
14
14
  var _RoleDetail = require("../types/Enum/RoleDetail");
15
15
  function formatPhoneNumberToE164(phoneNumber, prefix = '+33') {
16
16
  if (!phoneNumber) return null;
17
- if (phoneNumber.charAt(0) !== '+' && phoneNumber.charAt(0) === '0') {
17
+ if (phoneNumber.charAt(0) !== '+') {
18
18
  const numberInt = phoneNumber.replace(/\D/g, '');
19
19
  if (prefix) {
20
20
  if (numberInt.length === 10 && numberInt.charAt(0) === '0') {
@@ -1 +1 @@
1
- {"version":3,"file":"phone.js","names":["formatPhoneNumberToE164","exports","getPhoneNumberWithoutPrefix","countSegmentsFromMessage","getPhoneNumberFromRoles","formatPhoneNumberToNational","_smsSegmentsCalculator","require","_Phone","_Role","_RoleDetail","phoneNumber","prefix","charAt","numberInt","replace","length","substring","number","Object","keys","PhonePrefix","map","index","forEach","message","SegmentedMessage","segmentsCount","roles","attribute","some","role","Role","FRONT_OFFICE","EXPERT_ACCOUNTANT","includes","RoleDetail","FRONT_OFFICE_EXPRESS","COMMERCIAL","FACTURATION","CUSTOMER_SUCCESS","JURIDIC","JURIDICAL_SUPPORT","SOCIAL","phoneWithoutSpace","startsWith"],"sources":["../../ts/utils/phone.ts"],"sourcesContent":["import { SegmentedMessage } from 'sms-segments-calculator';\nimport { PhonePrefix } from '../types/Enum/Phone';\nimport { Role } from '../types/Enum/Role';\nimport { RoleDetail } from '../types/Enum/RoleDetail';\n\nexport function formatPhoneNumberToE164(phoneNumber: string | null, prefix = '+33'): string | null {\n if (!phoneNumber) return null;\n if (phoneNumber.charAt(0) !== '+' && phoneNumber.charAt(0) === '0') {\n const numberInt = phoneNumber.replace(/\\D/g, '');\n if (prefix) {\n if (numberInt.length === 10 && numberInt.charAt(0) === '0') {\n return `${prefix}${numberInt.substring(1)}`;\n }\n return `${prefix}${numberInt}`;\n }\n if (numberInt.charAt(0) === '0' && numberInt.length === 10) return `+33${numberInt.substring(1)}`;\n return numberInt;\n }\n return phoneNumber;\n}\n\nexport function getPhoneNumberWithoutPrefix(phoneNumber: string): string {\n let number = phoneNumber;\n // @ts-ignore\n Object.keys(PhonePrefix).map((index) => PhonePrefix[index].prefix).forEach((prefix) => {\n number = number.replace(prefix, '');\n });\n return number;\n}\n\nexport function countSegmentsFromMessage(message: string): number {\n return new SegmentedMessage(message, 'auto').segmentsCount;\n}\n\nexport function getPhoneNumberFromRoles(roles: number[], attribute: 'phoneNumber' | 'phoneNumberPourcentage' | 'phoneNumberStatutsExpress' = 'phoneNumber'): string | null {\n if (roles.some((role) => [Role.FRONT_OFFICE, Role.EXPERT_ACCOUNTANT].includes(role))) {\n return RoleDetail.FRONT_OFFICE[attribute];\n }\n\n if (roles.some((role) => [Role.FRONT_OFFICE_EXPRESS].includes(role))) {\n return RoleDetail.FRONT_OFFICE_EXPRESS[attribute];\n }\n\n if (roles.some((role) => [Role.COMMERCIAL].includes(role))) {\n return RoleDetail.COMMERCIAL[attribute];\n }\n\n if (roles.some((role) => [Role.FACTURATION].includes(role))) {\n return RoleDetail.FACTURATION[attribute];\n }\n\n if (roles.some((role) => [Role.CUSTOMER_SUCCESS].includes(role))) {\n return RoleDetail.CUSTOMER_SUCCESS[attribute];\n }\n\n if (roles.some((role) => [Role.JURIDIC, Role.JURIDICAL_SUPPORT].includes(role))) {\n return RoleDetail.JURIDIC[attribute];\n }\n\n if (roles.some((role) => [Role.SOCIAL].includes(role))) {\n return RoleDetail.SOCIAL[attribute];\n }\n\n return null;\n}\n\nexport function formatPhoneNumberToNational(phoneNumber: string): string {\n\n const phoneWithoutSpace = phoneNumber.replace(/ /g, '');\n\n if (phoneWithoutSpace?.startsWith('+33')) {\n return phoneWithoutSpace.replace('+33', '0');\n }\n\n // Fonction à mettre à jour en fonction des cas de notre bdd\n return phoneWithoutSpace;\n}"],"mappings":"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"}
1
+ {"version":3,"file":"phone.js","names":["formatPhoneNumberToE164","exports","getPhoneNumberWithoutPrefix","countSegmentsFromMessage","getPhoneNumberFromRoles","formatPhoneNumberToNational","_smsSegmentsCalculator","require","_Phone","_Role","_RoleDetail","phoneNumber","prefix","charAt","numberInt","replace","length","substring","number","Object","keys","PhonePrefix","map","index","forEach","message","SegmentedMessage","segmentsCount","roles","attribute","some","role","Role","FRONT_OFFICE","EXPERT_ACCOUNTANT","includes","RoleDetail","FRONT_OFFICE_EXPRESS","COMMERCIAL","FACTURATION","CUSTOMER_SUCCESS","JURIDIC","JURIDICAL_SUPPORT","SOCIAL","phoneWithoutSpace","startsWith"],"sources":["../../ts/utils/phone.ts"],"sourcesContent":["import { SegmentedMessage } from 'sms-segments-calculator';\nimport { PhonePrefix } from '../types/Enum/Phone';\nimport { Role } from '../types/Enum/Role';\nimport { RoleDetail } from '../types/Enum/RoleDetail';\n\nexport function formatPhoneNumberToE164(phoneNumber: string | null, prefix = '+33'): string | null {\n if (!phoneNumber) return null;\n if (phoneNumber.charAt(0) !== '+') {\n const numberInt = phoneNumber.replace(/\\D/g, '');\n if (prefix) {\n if (numberInt.length === 10 && numberInt.charAt(0) === '0') {\n return `${prefix}${numberInt.substring(1)}`;\n }\n return `${prefix}${numberInt}`;\n }\n if (numberInt.charAt(0) === '0' && numberInt.length === 10) return `+33${numberInt.substring(1)}`;\n return numberInt;\n }\n return phoneNumber;\n}\n\nexport function getPhoneNumberWithoutPrefix(phoneNumber: string): string {\n let number = phoneNumber;\n // @ts-ignore\n Object.keys(PhonePrefix).map((index) => PhonePrefix[index].prefix).forEach((prefix) => {\n number = number.replace(prefix, '');\n });\n return number;\n}\n\nexport function countSegmentsFromMessage(message: string): number {\n return new SegmentedMessage(message, 'auto').segmentsCount;\n}\n\nexport function getPhoneNumberFromRoles(roles: number[], attribute: 'phoneNumber' | 'phoneNumberPourcentage' | 'phoneNumberStatutsExpress' = 'phoneNumber'): string | null {\n if (roles.some((role) => [Role.FRONT_OFFICE, Role.EXPERT_ACCOUNTANT].includes(role))) {\n return RoleDetail.FRONT_OFFICE[attribute];\n }\n\n if (roles.some((role) => [Role.FRONT_OFFICE_EXPRESS].includes(role))) {\n return RoleDetail.FRONT_OFFICE_EXPRESS[attribute];\n }\n\n if (roles.some((role) => [Role.COMMERCIAL].includes(role))) {\n return RoleDetail.COMMERCIAL[attribute];\n }\n\n if (roles.some((role) => [Role.FACTURATION].includes(role))) {\n return RoleDetail.FACTURATION[attribute];\n }\n\n if (roles.some((role) => [Role.CUSTOMER_SUCCESS].includes(role))) {\n return RoleDetail.CUSTOMER_SUCCESS[attribute];\n }\n\n if (roles.some((role) => [Role.JURIDIC, Role.JURIDICAL_SUPPORT].includes(role))) {\n return RoleDetail.JURIDIC[attribute];\n }\n\n if (roles.some((role) => [Role.SOCIAL].includes(role))) {\n return RoleDetail.SOCIAL[attribute];\n }\n\n return null;\n}\n\nexport function formatPhoneNumberToNational(phoneNumber: string): string {\n\n const phoneWithoutSpace = phoneNumber.replace(/ /g, '');\n\n if (phoneWithoutSpace?.startsWith('+33')) {\n return phoneWithoutSpace.replace('+33', '0');\n }\n\n // Fonction à mettre à jour en fonction des cas de notre bdd\n return phoneWithoutSpace;\n}"],"mappings":"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"}
@@ -15,7 +15,7 @@ var _utils = require("../utils");
15
15
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
17
  function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries = []) {
18
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103;
18
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, _194, _195, _196, _197, _198, _199, _200, _201, _202, _203, _204, _205, _206, _207, _208, _209, _210, _211, _212, _213, _214, _215, _216, _217, _218, _219, _220, _221, _222;
19
19
  const shouldHaveVatCode = (0, _classValidator.isDefined)((_a = payload.setting) === null || _a === void 0 ? void 0 : _a.tvaCode) && (0, _classValidator.isDefined)(payload.society.siret);
20
20
  const vats = Object.values(_Vat.Vat);
21
21
  const frenchVat = vats.filter(v => !v.isVatImportation && !v.isVatIntracom).map(v => v.id);
@@ -49,57 +49,57 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
49
49
  // Opérations taxées -
50
50
  const taxedServicesEntries = vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
51
51
  const servicesAccounts = ['701', '702', '703', '704', '705', '706', '707', '708', '472'];
52
- const taxedServicesFromFrance = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries, servicesAccounts, 0, true));
53
- const taxedOther = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withTaxVat.includes(ae.idVat)), ['775'], 0, true));
52
+ const taxedServicesFromFrance = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries, servicesAccounts, 0, true)) + ((_d = (_c = (_b = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _b === void 0 ? void 0 : _b.france) === null || _c === void 0 ? void 0 : _c.base20) !== null && _d !== void 0 ? _d : 0) + ((_g = (_f = (_e = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _e === void 0 ? void 0 : _e.france) === null || _f === void 0 ? void 0 : _f.base10) !== null && _g !== void 0 ? _g : 0) + ((_k = (_j = (_h = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _h === void 0 ? void 0 : _h.france) === null || _j === void 0 ? void 0 : _j.base8Dot5) !== null && _k !== void 0 ? _k : 0) + ((_o = (_m = (_l = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _l === void 0 ? void 0 : _l.france) === null || _m === void 0 ? void 0 : _m.base5Dot5) !== null && _o !== void 0 ? _o : 0) + ((_r = (_q = (_p = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _p === void 0 ? void 0 : _p.france) === null || _q === void 0 ? void 0 : _q.base2Dot1) !== null && _r !== void 0 ? _r : 0);
53
+ const taxedOther = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withTaxVat.includes(ae.idVat)), ['775'], 0, true)) + ((_u = (_t = (_s = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _s === void 0 ? void 0 : _s.other) === null || _t === void 0 ? void 0 : _t.base20) !== null && _u !== void 0 ? _u : 0) + ((_x = (_w = (_v = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _v === void 0 ? void 0 : _v.other) === null || _w === void 0 ? void 0 : _w.base10) !== null && _x !== void 0 ? _x : 0) + ((_0 = (_z = (_y = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _y === void 0 ? void 0 : _y.other) === null || _z === void 0 ? void 0 : _z.base5Dot5) !== null && _0 !== void 0 ? _0 : 0) + ((_3 = (_2 = (_1 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _1 === void 0 ? void 0 : _1.other) === null || _2 === void 0 ? void 0 : _2.base2Dot1) !== null && _3 !== void 0 ? _3 : 0);
54
54
  const intracommunityServiceAccounts = ['604', '611', '612', '613', '614', '615', '616', '617', '618', '619', '62'];
55
55
  const intracommunityServiceEntries = vatEntries.filter(ae => withTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat));
56
56
  // Case A3
57
57
  const taxedPurchaseOfIntracommunityService = 0; /* setZeroIfIsNegative(getAmountByAccountNumber(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true)); */
58
58
  const taxedImportEntries = vatEntries.filter(ae => importationVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
59
59
  const taxedImportAccounts = ['6'];
60
- const taxedImport = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts, 0, true));
60
+ const taxedImport = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts, 0, true)) + ((_6 = (_5 = (_4 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _4 === void 0 ? void 0 : _4.importations) === null || _5 === void 0 ? void 0 : _5.base20) !== null && _6 !== void 0 ? _6 : 0) + ((_9 = (_8 = (_7 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _7 === void 0 ? void 0 : _7.importations) === null || _8 === void 0 ? void 0 : _8.base10) !== null && _9 !== void 0 ? _9 : 0) + ((_12 = (_11 = (_10 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _10 === void 0 ? void 0 : _10.importations) === null || _11 === void 0 ? void 0 : _11.base8Dot5) !== null && _12 !== void 0 ? _12 : 0) + ((_15 = (_14 = (_13 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _13 === void 0 ? void 0 : _13.importations) === null || _14 === void 0 ? void 0 : _14.base5Dot5) !== null && _15 !== void 0 ? _15 : 0) + ((_18 = (_17 = (_16 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _16 === void 0 ? void 0 : _16.importations) === null || _17 === void 0 ? void 0 : _17.base2Dot1) !== null && _18 !== void 0 ? _18 : 0);
61
61
  const intracommunityAccounts2 = ['601', '602', '603', '605', '606', '607', '651'];
62
62
  const taxedIntracommunityAcquisitions = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), [...intracommunityAccounts2, ...intracommunityServiceAccounts], 0, true);
63
63
  // Opérations non taxées
64
- const untaxedExportationNotInEurope = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true));
65
- const untaxedOther = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['70', '71', '72', '73', '75', '77', '78', '790', '792', '793', '794', '795', '796', '797', '798', '799'], 0, true)); // 02/08/23 - ne plus prendre en compte les comptes 76,74,791 - Chloé R.
66
- const untaxedImport = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true));
67
- const untaxedIntracomunity = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), intracommunityAccounts2, 0, true));
64
+ const untaxedExportationNotInEurope = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true)) + ((_21 = (_20 = (_19 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _19 === void 0 ? void 0 : _19.untaxed) === null || _20 === void 0 ? void 0 : _20.exportation) !== null && _21 !== void 0 ? _21 : 0);
65
+ const untaxedOther = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['70', '71', '72', '73', '75', '77', '78', '790', '792', '793', '794', '795', '796', '797', '798', '799'], 0, true)) + ((_24 = (_23 = (_22 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _22 === void 0 ? void 0 : _22.untaxed) === null || _23 === void 0 ? void 0 : _23.other) !== null && _24 !== void 0 ? _24 : 0); // 02/08/23 - ne plus prendre en compte les comptes 76,74,791 - Chloé R.
66
+ const untaxedImport = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true)) + ((_27 = (_26 = (_25 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _25 === void 0 ? void 0 : _25.untaxed) === null || _26 === void 0 ? void 0 : _26.importation) !== null && _27 !== void 0 ? _27 : 0);
67
+ const untaxedIntracomunity = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), intracommunityAccounts2, 0, true)) + ((_30 = (_29 = (_28 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _28 === void 0 ? void 0 : _28.untaxed) === null || _29 === void 0 ? void 0 : _29.intracomunity) !== null && _30 !== void 0 ? _30 : 0);
68
68
  const untaxedIntracommunityDelivery = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true));
69
69
  // TVA brute
70
- const normalRate = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), ['6'], 0, true));
70
+ const normalRate = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_33 = (_32 = (_31 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _31 === void 0 ? void 0 : _31.france) === null || _32 === void 0 ? void 0 : _32.base20) !== null && _33 !== void 0 ? _33 : 0);
71
71
  const normalRateTax = (0, _lodash.round)(normalRate * 0.2);
72
- const reducedRate5Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), ['6'], 0, true));
72
+ const reducedRate5Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_36 = (_35 = (_34 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _34 === void 0 ? void 0 : _34.france) === null || _35 === void 0 ? void 0 : _35.base5Dot5) !== null && _36 !== void 0 ? _36 : 0);
73
73
  const reducedRate5Dot5Tax = (0, _lodash.round)(reducedRate5Dot5 * 0.055);
74
- const reducedRate10 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), ['6'], 0, true));
74
+ const reducedRate10 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_39 = (_38 = (_37 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _37 === void 0 ? void 0 : _37.france) === null || _38 === void 0 ? void 0 : _38.base10) !== null && _39 !== void 0 ? _39 : 0);
75
75
  const reducedRate10Tax = (0, _lodash.round)(reducedRate10 * 0.1);
76
- const reducedRate8Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), ['6'], 0, true));
76
+ const reducedRate8Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_42 = (_41 = (_40 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _40 === void 0 ? void 0 : _40.france) === null || _41 === void 0 ? void 0 : _41.base8Dot5) !== null && _42 !== void 0 ? _42 : 0);
77
77
  const reducedRate8Dot5Tax = (0, _lodash.round)(reducedRate8Dot5 * 0.085);
78
- const reducedRate2Dot1 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), ['6'], 0, true));
78
+ const reducedRate2Dot1 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedServicesEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), servicesAccounts, 0, true) + (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), ['6'], 0, true)) + ((_45 = (_44 = (_43 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _43 === void 0 ? void 0 : _43.france) === null || _44 === void 0 ? void 0 : _44.base2Dot1) !== null && _45 !== void 0 ? _45 : 0);
79
79
  const reducedRate2Dot1Tax = (0, _lodash.round)(reducedRate2Dot1 * 0.021);
80
- const importNormalRate = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
80
+ const importNormalRate = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_48 = (_47 = (_46 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _46 === void 0 ? void 0 : _46.importations) === null || _47 === void 0 ? void 0 : _47.base20) !== null && _48 !== void 0 ? _48 : 0);
81
81
  const importNormalRateTax = (0, _lodash.round)(importNormalRate * 0.2);
82
- const importReducedRate10 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
82
+ const importReducedRate10 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_51 = (_50 = (_49 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _49 === void 0 ? void 0 : _49.importations) === null || _50 === void 0 ? void 0 : _50.base10) !== null && _51 !== void 0 ? _51 : 0);
83
83
  const importReducedRate10Tax = (0, _lodash.round)(importReducedRate10 * 0.1);
84
- const importReducedRate8Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
84
+ const importReducedRate8Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_54 = (_53 = (_52 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _52 === void 0 ? void 0 : _52.importations) === null || _53 === void 0 ? void 0 : _53.base8Dot5) !== null && _54 !== void 0 ? _54 : 0);
85
85
  const importReducedRate8Dot5Tax = (0, _lodash.round)(importReducedRate8Dot5 * 0.085);
86
- const importReducedRate5Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
86
+ const importReducedRate5Dot5 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_57 = (_56 = (_55 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _55 === void 0 ? void 0 : _55.importations) === null || _56 === void 0 ? void 0 : _56.base5Dot5) !== null && _57 !== void 0 ? _57 : 0);
87
87
  const importReducedRate5Dot5Tax = (0, _lodash.round)(importReducedRate8Dot5 * 0.055);
88
- const importReducedRate2Dot1 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
88
+ const importReducedRate2Dot1 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true)) + ((_60 = (_59 = (_58 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _58 === void 0 ? void 0 : _58.importations) === null || _59 === void 0 ? void 0 : _59.base2Dot1) !== null && _60 !== void 0 ? _60 : 0);
89
89
  const importReducedRate2Dot1Tax = (0, _lodash.round)(importReducedRate2Dot1 * 0.021);
90
90
  const importReducedRate1Dot05 = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 1.05).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true));
91
91
  const importReducedRate1Dot05Tax = (0, _lodash.round)(importReducedRate1Dot05 * 0.0105);
92
92
  const intracommunityTax = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(intracommunityServiceEntries, [...intracommunityServiceAccounts, ...intracommunityAccounts2], 0));
93
93
  // TVA Déductible
94
- const immobilizationTax = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries, ['2']));
95
- const otherGoodsAndServices = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => !v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6']));
96
- const otherDeductibles = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6']));
97
- const report = ((_c = (_b = payload.vat) === null || _b === void 0 ? void 0 : _b.deductible) === null || _c === void 0 ? void 0 : _c.toReport) && ((_e = (_d = payload.vat) === null || _d === void 0 ? void 0 : _d.deductible) === null || _e === void 0 ? void 0 : _e.toReport) > 0 ? (0, _lodash.round)((_h = (_g = (_f = payload.vat) === null || _f === void 0 ? void 0 : _f.deductible) === null || _g === void 0 ? void 0 : _g.toReport) !== null && _h !== void 0 ? _h : 0) : (_l = (_k = (_j = payload.previousVatDeclaration) === null || _j === void 0 ? void 0 : _j.credit) === null || _k === void 0 ? void 0 : _k.toReport) !== null && _l !== void 0 ? _l : 0;
98
- const coefficient = (0, _lodash.round)((_p = (_o = (_m = payload.vat) === null || _m === void 0 ? void 0 : _m.deductible) === null || _o === void 0 ? void 0 : _o.coefficient) !== null && _p !== void 0 ? _p : 100, 2);
94
+ const immobilizationTax = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries, ['2'])) + ((_63 = (_62 = (_61 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _61 === void 0 ? void 0 : _61.deducted) === null || _62 === void 0 ? void 0 : _62.immobilization) !== null && _63 !== void 0 ? _63 : 0);
95
+ const otherGoodsAndServices = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => !v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6'])) + ((_66 = (_65 = (_64 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _64 === void 0 ? void 0 : _64.deducted) === null || _65 === void 0 ? void 0 : _65.abs) !== null && _66 !== void 0 ? _66 : 0);
96
+ const otherDeductibles = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6'])) + ((_69 = (_68 = (_67 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _67 === void 0 ? void 0 : _67.deducted) === null || _68 === void 0 ? void 0 : _68.other) !== null && _69 !== void 0 ? _69 : 0);
97
+ const report = (((_71 = (_70 = payload.vat) === null || _70 === void 0 ? void 0 : _70.deductible) === null || _71 === void 0 ? void 0 : _71.toReport) && ((_73 = (_72 = payload.vat) === null || _72 === void 0 ? void 0 : _72.deductible) === null || _73 === void 0 ? void 0 : _73.toReport) > 0 ? (0, _lodash.round)((_76 = (_75 = (_74 = payload.vat) === null || _74 === void 0 ? void 0 : _74.deductible) === null || _75 === void 0 ? void 0 : _75.toReport) !== null && _76 !== void 0 ? _76 : 0) : (_79 = (_78 = (_77 = payload.previousVatDeclaration) === null || _77 === void 0 ? void 0 : _77.credit) === null || _78 === void 0 ? void 0 : _78.toReport) !== null && _79 !== void 0 ? _79 : 0) + ((_82 = (_81 = (_80 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _80 === void 0 ? void 0 : _80.deducted) === null || _81 === void 0 ? void 0 : _81.reported) !== null && _82 !== void 0 ? _82 : 0);
98
+ const coefficient = (0, _lodash.round)((_85 = (_84 = (_83 = payload.vat) === null || _83 === void 0 ? void 0 : _83.deductible) === null || _84 === void 0 ? void 0 : _84.coefficient) !== null && _85 !== void 0 ? _85 : 100, 2);
99
99
  const isNil = payload.isNil === true;
100
100
  const isHolidayDeposit = payload.isHolidayDeposit === true;
101
- const sumToAdd = (0, _utils.setZeroIfIsNegative)(isNil ? 0 : isHolidayDeposit ? (0, _lodash.round)(((_s = (_r = (_q = payload.previousVatDeclaration) === null || _q === void 0 ? void 0 : _q.toPay) === null || _r === void 0 ? void 0 : _r.total) !== null && _s !== void 0 ? _s : 0) * 0.8) : (0, _lodash.round)((_u = (_t = payload.vat) === null || _t === void 0 ? void 0 : _t.sumToAdd) !== null && _u !== void 0 ? _u : 0) + mxToAdd);
102
- const comment = isHolidayDeposit ? `ACOMPTE CONGES ${(_v = payload.comment) !== null && _v !== void 0 ? _v : ''}` : (_w = payload.comment) !== null && _w !== void 0 ? _w : null;
101
+ const sumToAdd = (0, _utils.setZeroIfIsNegative)(isNil ? 0 : isHolidayDeposit ? (0, _lodash.round)(((_88 = (_87 = (_86 = payload.previousVatDeclaration) === null || _86 === void 0 ? void 0 : _86.toPay) === null || _87 === void 0 ? void 0 : _87.total) !== null && _88 !== void 0 ? _88 : 0) * 0.8) : (0, _lodash.round)((_90 = (_89 = payload.vat) === null || _89 === void 0 ? void 0 : _89.sumToAdd) !== null && _90 !== void 0 ? _90 : 0) + mxToAdd) + ((_93 = (_92 = (_91 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _91 === void 0 ? void 0 : _91.regularisations) === null || _92 === void 0 ? void 0 : _92.case5B) !== null && _93 !== void 0 ? _93 : 0);
102
+ const comment = isHolidayDeposit ? `ACOMPTE CONGES ${(_94 = payload.comment) !== null && _94 !== void 0 ? _94 : ''}` : (_95 = payload.comment) !== null && _95 !== void 0 ? _95 : null;
103
103
  const initialPayload = {
104
104
  isNil,
105
105
  isDGE: false,
@@ -112,7 +112,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
112
112
  full: `${payload.society.address}\n${payload.society.zipCode} ${payload.society.city}`
113
113
  },
114
114
  numbers: {
115
- SIE: (_y = (_x = payload.sie) === null || _x === void 0 ? void 0 : _x.sages) !== null && _y !== void 0 ? _y : null,
115
+ SIE: (_97 = (_96 = payload.sie) === null || _96 === void 0 ? void 0 : _96.sages) !== null && _97 !== void 0 ? _97 : null,
116
116
  folder: null,
117
117
  key: null,
118
118
  period: null,
@@ -124,7 +124,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
124
124
  },
125
125
  service: {
126
126
  address: {
127
- full: (0, _classValidator.isDefined)((_0 = (_z = payload.sie) === null || _z === void 0 ? void 0 : _z.address) === null || _0 === void 0 ? void 0 : _0.address1) ? `${(_1 = payload.sie) === null || _1 === void 0 ? void 0 : _1.address.address1}\n${(_2 = payload.sie) === null || _2 === void 0 ? void 0 : _2.address.address2}\n${(_3 = payload.sie) === null || _3 === void 0 ? void 0 : _3.address.address3}\n${(_4 = payload.sie) === null || _4 === void 0 ? void 0 : _4.address.address4}\n${(_5 = payload.sie) === null || _5 === void 0 ? void 0 : _5.address.address5}` : null
127
+ full: (0, _classValidator.isDefined)((_99 = (_98 = payload.sie) === null || _98 === void 0 ? void 0 : _98.address) === null || _99 === void 0 ? void 0 : _99.address1) ? `${(_100 = payload.sie) === null || _100 === void 0 ? void 0 : _100.address.address1}\n${(_101 = payload.sie) === null || _101 === void 0 ? void 0 : _101.address.address2}\n${(_102 = payload.sie) === null || _102 === void 0 ? void 0 : _102.address.address3}\n${(_103 = payload.sie) === null || _103 === void 0 ? void 0 : _103.address.address4}\n${(_104 = payload.sie) === null || _104 === void 0 ? void 0 : _104.address.address5}` : null
128
128
  }
129
129
  },
130
130
  period: {
@@ -140,13 +140,13 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
140
140
  }
141
141
  },
142
142
  siret: {
143
- first: (0, _classValidator.isDefined)(payload.society.siret) ? (_7 = (_6 = payload.society.siret) === null || _6 === void 0 ? void 0 : _6.slice(0, 9)) !== null && _7 !== void 0 ? _7 : null : null,
144
- second: (0, _classValidator.isDefined)(payload.society.siret) ? (_9 = (_8 = payload.society.siret) === null || _8 === void 0 ? void 0 : _8.slice(-5)) !== null && _9 !== void 0 ? _9 : null : null
143
+ first: (0, _classValidator.isDefined)(payload.society.siret) ? (_106 = (_105 = payload.society.siret) === null || _105 === void 0 ? void 0 : _105.slice(0, 9)) !== null && _106 !== void 0 ? _106 : null : null,
144
+ second: (0, _classValidator.isDefined)(payload.society.siret) ? (_108 = (_107 = payload.society.siret) === null || _107 === void 0 ? void 0 : _107.slice(-5)) !== null && _108 !== void 0 ? _108 : null : null
145
145
  },
146
146
  intracommunityVat: {
147
- first: shouldHaveVatCode ? (_12 = (_11 = (_10 = payload.setting) === null || _10 === void 0 ? void 0 : _10.tvaCode) === null || _11 === void 0 ? void 0 : _11.slice(0, 2)) !== null && _12 !== void 0 ? _12 : null : null,
148
- second: shouldHaveVatCode ? (_15 = (_14 = (_13 = payload.setting) === null || _13 === void 0 ? void 0 : _13.tvaCode) === null || _14 === void 0 ? void 0 : _14.slice(2, 4)) !== null && _15 !== void 0 ? _15 : null : null,
149
- third: shouldHaveVatCode ? (_17 = (_16 = payload.society.siret) === null || _16 === void 0 ? void 0 : _16.slice(0, 9)) !== null && _17 !== void 0 ? _17 : null : null
147
+ first: shouldHaveVatCode ? (_111 = (_110 = (_109 = payload.setting) === null || _109 === void 0 ? void 0 : _109.tvaCode) === null || _110 === void 0 ? void 0 : _110.slice(0, 2)) !== null && _111 !== void 0 ? _111 : null : null,
148
+ second: shouldHaveVatCode ? (_114 = (_113 = (_112 = payload.setting) === null || _112 === void 0 ? void 0 : _112.tvaCode) === null || _113 === void 0 ? void 0 : _113.slice(2, 4)) !== null && _114 !== void 0 ? _114 : null : null,
149
+ third: shouldHaveVatCode ? (_116 = (_115 = payload.society.siret) === null || _115 === void 0 ? void 0 : _115.slice(0, 9)) !== null && _116 !== void 0 ? _116 : null : null
150
150
  },
151
151
  payment: {
152
152
  date: dayjs().format('YYYY-MM-DD'),
@@ -160,29 +160,29 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
160
160
  other: isNil || isHolidayDeposit ? 0 : taxedOther,
161
161
  purchaseOfIntracommunityServiceProvision: isNil || isHolidayDeposit ? 0 : taxedPurchaseOfIntracommunityService,
162
162
  import: isNil || isHolidayDeposit ? 0 : taxedImport,
163
- withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_19 = (_18 = payload.taxedOperations) === null || _18 === void 0 ? void 0 : _18.withdrawSuspensiveRegime) !== null && _19 !== void 0 ? _19 : 0),
164
- releaseFromConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_21 = (_20 = payload.taxedOperations) === null || _20 === void 0 ? void 0 : _20.releaseFromConsumption) !== null && _21 !== void 0 ? _21 : 0),
163
+ withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_118 = (_117 = payload.taxedOperations) === null || _117 === void 0 ? void 0 : _117.withdrawSuspensiveRegime) !== null && _118 !== void 0 ? _118 : 0),
164
+ releaseFromConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_120 = (_119 = payload.taxedOperations) === null || _119 === void 0 ? void 0 : _119.releaseFromConsumption) !== null && _120 !== void 0 ? _120 : 0),
165
165
  intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : taxedIntracommunityAcquisitions,
166
- energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_23 = (_22 = payload.taxedOperations) === null || _22 === void 0 ? void 0 : _22.energyDelivery) !== null && _23 !== void 0 ? _23 : 0),
167
- purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_25 = (_24 = payload.taxedOperations) === null || _24 === void 0 ? void 0 : _24.purchaseOfServicesNotInFrance) !== null && _25 !== void 0 ? _25 : 0),
168
- regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_27 = (_26 = payload.taxedOperations) === null || _26 === void 0 ? void 0 : _26.regularizations) !== null && _27 !== void 0 ? _27 : 0)
166
+ energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_122 = (_121 = payload.taxedOperations) === null || _121 === void 0 ? void 0 : _121.energyDelivery) !== null && _122 !== void 0 ? _122 : 0),
167
+ purchaseOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_124 = (_123 = payload.taxedOperations) === null || _123 === void 0 ? void 0 : _123.purchaseOfServicesNotInFrance) !== null && _124 !== void 0 ? _124 : 0),
168
+ regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_126 = (_125 = payload.taxedOperations) === null || _125 === void 0 ? void 0 : _125.regularizations) !== null && _126 !== void 0 ? _126 : 0) + ((_129 = (_128 = (_127 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _127 === void 0 ? void 0 : _127.regularisations) === null || _128 === void 0 ? void 0 : _128.base20) !== null && _129 !== void 0 ? _129 : 0) + ((_132 = (_131 = (_130 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _130 === void 0 ? void 0 : _130.regularisations) === null || _131 === void 0 ? void 0 : _131.base10) !== null && _132 !== void 0 ? _132 : 0) + ((_135 = (_134 = (_133 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _133 === void 0 ? void 0 : _133.regularisations) === null || _134 === void 0 ? void 0 : _134.base5Dot5) !== null && _135 !== void 0 ? _135 : 0) + ((_138 = (_137 = (_136 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _136 === void 0 ? void 0 : _136.regularisations) === null || _137 === void 0 ? void 0 : _137.base2Dot1) !== null && _138 !== void 0 ? _138 : 0)
169
169
  },
170
170
  untaxedOperations: {
171
171
  exportationNotInEurope: isNil || isHolidayDeposit ? 0 : untaxedExportationNotInEurope,
172
172
  other: isNil || isHolidayDeposit ? 0 : untaxedOther,
173
- distanceSelling: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_29 = (_28 = payload.untaxedOperations) === null || _28 === void 0 ? void 0 : _28.distanceSelling) !== null && _29 !== void 0 ? _29 : 0),
173
+ distanceSelling: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_140 = (_139 = payload.untaxedOperations) === null || _139 === void 0 ? void 0 : _139.distanceSelling) !== null && _140 !== void 0 ? _140 : 0),
174
174
  import: isNil || isHolidayDeposit ? 0 : untaxedImport,
175
- withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_31 = (_30 = payload.untaxedOperations) === null || _30 === void 0 ? void 0 : _30.withdrawSuspensiveRegime) !== null && _31 !== void 0 ? _31 : 0),
176
- importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_33 = (_32 = payload.untaxedOperations) === null || _32 === void 0 ? void 0 : _32.importInSuspensiveSystem) !== null && _33 !== void 0 ? _33 : 0),
175
+ withdrawSuspensiveRegime: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_142 = (_141 = payload.untaxedOperations) === null || _141 === void 0 ? void 0 : _141.withdrawSuspensiveRegime) !== null && _142 !== void 0 ? _142 : 0),
176
+ importInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_144 = (_143 = payload.untaxedOperations) === null || _143 === void 0 ? void 0 : _143.importInSuspensiveSystem) !== null && _144 !== void 0 ? _144 : 0),
177
177
  intracommunityAcquisitions: isNil || isHolidayDeposit ? 0 : untaxedIntracomunity,
178
178
  intracommunityDelivery: isNil || isHolidayDeposit ? 0 : untaxedIntracommunityDelivery,
179
- energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_35 = (_34 = payload.untaxedOperations) === null || _34 === void 0 ? void 0 : _34.energyDelivery) !== null && _35 !== void 0 ? _35 : 0),
180
- oilProductsConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_37 = (_36 = payload.untaxedOperations) === null || _36 === void 0 ? void 0 : _36.oilProductsConsumption) !== null && _37 !== void 0 ? _37 : 0),
181
- importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_39 = (_38 = payload.untaxedOperations) === null || _38 === void 0 ? void 0 : _38.importPetrolInSuspensiveSystem) !== null && _39 !== void 0 ? _39 : 0),
182
- purchaseInFranchise: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_41 = (_40 = payload.untaxedOperations) === null || _40 === void 0 ? void 0 : _40.purchaseInFranchise) !== null && _41 !== void 0 ? _41 : 0),
183
- saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_43 = (_42 = payload.untaxedOperations) === null || _42 === void 0 ? void 0 : _42.saleOfServicesNotInFrance) !== null && _43 !== void 0 ? _43 : 0),
184
- regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_45 = (_44 = payload.untaxedOperations) === null || _44 === void 0 ? void 0 : _44.regularizations) !== null && _45 !== void 0 ? _45 : 0),
185
- internalUniq: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_47 = (_46 = payload.untaxedOperations) === null || _46 === void 0 ? void 0 : _46.internalUniq) !== null && _47 !== void 0 ? _47 : 0)
179
+ energyDelivery: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_146 = (_145 = payload.untaxedOperations) === null || _145 === void 0 ? void 0 : _145.energyDelivery) !== null && _146 !== void 0 ? _146 : 0),
180
+ oilProductsConsumption: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_148 = (_147 = payload.untaxedOperations) === null || _147 === void 0 ? void 0 : _147.oilProductsConsumption) !== null && _148 !== void 0 ? _148 : 0),
181
+ importPetrolInSuspensiveSystem: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_150 = (_149 = payload.untaxedOperations) === null || _149 === void 0 ? void 0 : _149.importPetrolInSuspensiveSystem) !== null && _150 !== void 0 ? _150 : 0),
182
+ purchaseInFranchise: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_152 = (_151 = payload.untaxedOperations) === null || _151 === void 0 ? void 0 : _151.purchaseInFranchise) !== null && _152 !== void 0 ? _152 : 0),
183
+ saleOfServicesNotInFrance: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_154 = (_153 = payload.untaxedOperations) === null || _153 === void 0 ? void 0 : _153.saleOfServicesNotInFrance) !== null && _154 !== void 0 ? _154 : 0),
184
+ regularizations: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_156 = (_155 = payload.untaxedOperations) === null || _155 === void 0 ? void 0 : _155.regularizations) !== null && _156 !== void 0 ? _156 : 0) + ((_159 = (_158 = (_157 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _157 === void 0 ? void 0 : _157.untaxed) === null || _158 === void 0 ? void 0 : _158.regularisation) !== null && _159 !== void 0 ? _159 : 0),
185
+ internalUniq: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_161 = (_160 = payload.untaxedOperations) === null || _160 === void 0 ? void 0 : _160.internalUniq) !== null && _161 !== void 0 ? _161 : 0)
186
186
  },
187
187
  vat: {
188
188
  carrieredOutInFrance: {
@@ -211,12 +211,12 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
211
211
  },
212
212
  oilProducts: {
213
213
  normalRate20: {
214
- base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_51 = (_50 = (_49 = (_48 = payload.vat) === null || _48 === void 0 ? void 0 : _48.oilProducts) === null || _49 === void 0 ? void 0 : _49.normalRate20) === null || _50 === void 0 ? void 0 : _50.base) !== null && _51 !== void 0 ? _51 : 0),
215
- tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_55 = (_54 = (_53 = (_52 = payload.vat) === null || _52 === void 0 ? void 0 : _52.oilProducts) === null || _53 === void 0 ? void 0 : _53.normalRate20) === null || _54 === void 0 ? void 0 : _54.base) !== null && _55 !== void 0 ? _55 : 0) * 0.02
214
+ base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_165 = (_164 = (_163 = (_162 = payload.vat) === null || _162 === void 0 ? void 0 : _162.oilProducts) === null || _163 === void 0 ? void 0 : _163.normalRate20) === null || _164 === void 0 ? void 0 : _164.base) !== null && _165 !== void 0 ? _165 : 0),
215
+ tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_169 = (_168 = (_167 = (_166 = payload.vat) === null || _166 === void 0 ? void 0 : _166.oilProducts) === null || _167 === void 0 ? void 0 : _167.normalRate20) === null || _168 === void 0 ? void 0 : _168.base) !== null && _169 !== void 0 ? _169 : 0) * 0.02
216
216
  },
217
217
  reduceRate13: {
218
- base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_59 = (_58 = (_57 = (_56 = payload.vat) === null || _56 === void 0 ? void 0 : _56.oilProducts) === null || _57 === void 0 ? void 0 : _57.reduceRate13) === null || _58 === void 0 ? void 0 : _58.base) !== null && _59 !== void 0 ? _59 : 0),
219
- tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_63 = (_62 = (_61 = (_60 = payload.vat) === null || _60 === void 0 ? void 0 : _60.oilProducts) === null || _61 === void 0 ? void 0 : _61.reduceRate13) === null || _62 === void 0 ? void 0 : _62.base) !== null && _63 !== void 0 ? _63 : 0) * 0.013
218
+ base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_173 = (_172 = (_171 = (_170 = payload.vat) === null || _170 === void 0 ? void 0 : _170.oilProducts) === null || _171 === void 0 ? void 0 : _171.reduceRate13) === null || _172 === void 0 ? void 0 : _172.base) !== null && _173 !== void 0 ? _173 : 0),
219
+ tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_177 = (_176 = (_175 = (_174 = payload.vat) === null || _174 === void 0 ? void 0 : _174.oilProducts) === null || _175 === void 0 ? void 0 : _175.reduceRate13) === null || _176 === void 0 ? void 0 : _176.base) !== null && _177 !== void 0 ? _177 : 0) * 0.013
220
220
  }
221
221
  },
222
222
  importations: {
@@ -246,34 +246,34 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
246
246
  }
247
247
  },
248
248
  previouslyDeductedToBeReturned: {
249
- onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_66 = (_65 = (_64 = payload.vat) === null || _64 === void 0 ? void 0 : _64.previouslyDeductedToBeReturned) === null || _65 === void 0 ? void 0 : _65.onOilProducts) !== null && _66 !== void 0 ? _66 : 0),
250
- otherThanOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_69 = (_68 = (_67 = payload.vat) === null || _67 === void 0 ? void 0 : _67.previouslyDeductedToBeReturned) === null || _68 === void 0 ? void 0 : _68.otherThanOilProducts) !== null && _69 !== void 0 ? _69 : 0),
251
- total: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_72 = (_71 = (_70 = payload.vat) === null || _70 === void 0 ? void 0 : _70.previouslyDeductedToBeReturned) === null || _71 === void 0 ? void 0 : _71.total) !== null && _72 !== void 0 ? _72 : 0)
249
+ onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_180 = (_179 = (_178 = payload.vat) === null || _178 === void 0 ? void 0 : _178.previouslyDeductedToBeReturned) === null || _179 === void 0 ? void 0 : _179.onOilProducts) !== null && _180 !== void 0 ? _180 : 0),
250
+ otherThanOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_183 = (_182 = (_181 = payload.vat) === null || _181 === void 0 ? void 0 : _181.previouslyDeductedToBeReturned) === null || _182 === void 0 ? void 0 : _182.otherThanOilProducts) !== null && _183 !== void 0 ? _183 : 0),
251
+ total: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_186 = (_185 = (_184 = payload.vat) === null || _184 === void 0 ? void 0 : _184.previouslyDeductedToBeReturned) === null || _185 === void 0 ? void 0 : _185.total) !== null && _186 !== void 0 ? _186 : 0)
252
252
  },
253
253
  sumToAdd,
254
254
  grossDue: 0,
255
255
  onIntracommunityAcquisition: isNil || isHolidayDeposit ? 0 : intracommunityTax,
256
- toMonaco: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_74 = (_73 = payload.vat) === null || _73 === void 0 ? void 0 : _73.toMonaco) !== null && _74 !== void 0 ? _74 : 0),
256
+ toMonaco: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_188 = (_187 = payload.vat) === null || _187 === void 0 ? void 0 : _187.toMonaco) !== null && _188 !== void 0 ? _188 : 0),
257
257
  deductible: {
258
258
  immobilizations: isNil || isHolidayDeposit ? 0 : immobilizationTax !== null && immobilizationTax !== void 0 ? immobilizationTax : 0,
259
259
  otherGoodsAndServices: isNil || isHolidayDeposit ? 0 : otherGoodsAndServices !== null && otherGoodsAndServices !== void 0 ? otherGoodsAndServices : 0,
260
260
  other: {
261
- oil: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_78 = (_77 = (_76 = (_75 = payload.vat) === null || _75 === void 0 ? void 0 : _75.deductible) === null || _76 === void 0 ? void 0 : _76.other) === null || _77 === void 0 ? void 0 : _77.oil) !== null && _78 !== void 0 ? _78 : 0),
261
+ oil: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_192 = (_191 = (_190 = (_189 = payload.vat) === null || _189 === void 0 ? void 0 : _189.deductible) === null || _190 === void 0 ? void 0 : _190.other) === null || _191 === void 0 ? void 0 : _191.oil) !== null && _192 !== void 0 ? _192 : 0),
262
262
  thanOilProducts: 0,
263
263
  collected: 0,
264
264
  total: isNil || isHolidayDeposit ? 0 : otherDeductibles
265
265
  },
266
266
  report,
267
- toImpute: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_81 = (_80 = (_79 = payload.vat) === null || _79 === void 0 ? void 0 : _79.deductible) === null || _80 === void 0 ? void 0 : _80.toImpute) !== null && _81 !== void 0 ? _81 : 0) + mxToSub,
267
+ toImpute: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_195 = (_194 = (_193 = payload.vat) === null || _193 === void 0 ? void 0 : _193.deductible) === null || _194 === void 0 ? void 0 : _194.toImpute) !== null && _195 !== void 0 ? _195 : 0) + mxToSub + ((_198 = (_197 = (_196 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _196 === void 0 ? void 0 : _196.deducted) === null || _197 === void 0 ? void 0 : _197.case2C) !== null && _198 !== void 0 ? _198 : 0),
268
268
  total: 0,
269
269
  onImportOtherThanOilProducts: isNil || isHolidayDeposit ? 0 : otherDeductibles,
270
270
  coefficient: isNil || isHolidayDeposit ? 100 : coefficient,
271
- onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_84 = (_83 = (_82 = payload.vat) === null || _82 === void 0 ? void 0 : _82.deductible) === null || _83 === void 0 ? void 0 : _83.onOilProducts) !== null && _84 !== void 0 ? _84 : 0)
271
+ onOilProducts: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_201 = (_200 = (_199 = payload.vat) === null || _199 === void 0 ? void 0 : _199.deductible) === null || _200 === void 0 ? void 0 : _200.onOilProducts) !== null && _201 !== void 0 ? _201 : 0)
272
272
  },
273
273
  otherRate: {
274
274
  oldRate: {
275
- base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_88 = (_87 = (_86 = (_85 = payload.vat) === null || _85 === void 0 ? void 0 : _85.otherRate) === null || _86 === void 0 ? void 0 : _86.oldRate) === null || _87 === void 0 ? void 0 : _87.base) !== null && _88 !== void 0 ? _88 : 0),
276
- tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_92 = (_91 = (_90 = (_89 = payload.vat) === null || _89 === void 0 ? void 0 : _89.otherRate) === null || _90 === void 0 ? void 0 : _90.oldRate) === null || _91 === void 0 ? void 0 : _91.tax) !== null && _92 !== void 0 ? _92 : 0)
275
+ base: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_205 = (_204 = (_203 = (_202 = payload.vat) === null || _202 === void 0 ? void 0 : _202.otherRate) === null || _203 === void 0 ? void 0 : _203.oldRate) === null || _204 === void 0 ? void 0 : _204.base) !== null && _205 !== void 0 ? _205 : 0),
276
+ tax: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_209 = (_208 = (_207 = (_206 = payload.vat) === null || _206 === void 0 ? void 0 : _206.otherRate) === null || _207 === void 0 ? void 0 : _207.oldRate) === null || _208 === void 0 ? void 0 : _208.tax) !== null && _209 !== void 0 ? _209 : 0)
277
277
  },
278
278
  at1Dot75: {
279
279
  base: 0,
@@ -307,16 +307,16 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
307
307
  },
308
308
  credit: {
309
309
  amount: 0,
310
- refundAsked: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_94 = (_93 = payload.credit) === null || _93 === void 0 ? void 0 : _93.refundAsked) !== null && _94 !== void 0 ? _94 : 0),
311
- transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_96 = (_95 = payload.credit) === null || _95 === void 0 ? void 0 : _95.transferedToSocietyHeadOfGroup) !== null && _96 !== void 0 ? _96 : 0),
312
- assimiledTaxes: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_98 = (_97 = payload.credit) === null || _97 === void 0 ? void 0 : _97.assimiledTaxes) !== null && _98 !== void 0 ? _98 : 0),
310
+ refundAsked: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_211 = (_210 = payload.credit) === null || _210 === void 0 ? void 0 : _210.refundAsked) !== null && _211 !== void 0 ? _211 : 0) + ((_213 = (_212 = payload === null || payload === void 0 ? void 0 : payload.vatControl) === null || _212 === void 0 ? void 0 : _212.refundAsked) !== null && _213 !== void 0 ? _213 : 0),
311
+ transferedToSocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_215 = (_214 = payload.credit) === null || _214 === void 0 ? void 0 : _214.transferedToSocietyHeadOfGroup) !== null && _215 !== void 0 ? _215 : 0),
312
+ assimiledTaxes: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_217 = (_216 = payload.credit) === null || _216 === void 0 ? void 0 : _216.assimiledTaxes) !== null && _217 !== void 0 ? _217 : 0),
313
313
  toReport: 0,
314
314
  ticRefund: 0,
315
315
  ticTransfered: 0
316
316
  },
317
317
  toPay: {
318
318
  netDue: 0,
319
- acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_100 = (_99 = payload.toPay) === null || _99 === void 0 ? void 0 : _99.acquittedBySocietyHeadOfGroup) !== null && _100 !== void 0 ? _100 : 0),
319
+ acquittedBySocietyHeadOfGroup: isNil || isHolidayDeposit ? 0 : (0, _lodash.round)((_219 = (_218 = payload.toPay) === null || _218 === void 0 ? void 0 : _218.acquittedBySocietyHeadOfGroup) !== null && _219 !== void 0 ? _219 : 0),
320
320
  total: 0
321
321
  },
322
322
  tic: {
@@ -362,7 +362,7 @@ function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries
362
362
  initialPayload.credit.amount = initialPayload.vat.grossDue - initialPayload.vat.deductible.total < 0 ? Math.abs(initialPayload.vat.grossDue - initialPayload.vat.deductible.total) : 0;
363
363
  initialPayload.toPay.netDue = initialPayload.vat.grossDue - initialPayload.vat.deductible.total > 0 ? initialPayload.vat.grossDue - initialPayload.vat.deductible.total : 0;
364
364
  initialPayload.credit.toReport = initialPayload.credit.amount - initialPayload.credit.refundAsked - initialPayload.credit.transferedToSocietyHeadOfGroup;
365
- initialPayload.toPay.total = initialPayload.toPay.netDue + initialPayload.credit.assimiledTaxes + ((_103 = (_102 = (_101 = initialPayload.tic) === null || _101 === void 0 ? void 0 : _101.total) === null || _102 === void 0 ? void 0 : _102.tax) !== null && _103 !== void 0 ? _103 : 0) - initialPayload.toPay.acquittedBySocietyHeadOfGroup;
365
+ initialPayload.toPay.total = initialPayload.toPay.netDue + initialPayload.credit.assimiledTaxes + ((_222 = (_221 = (_220 = initialPayload.tic) === null || _220 === void 0 ? void 0 : _220.total) === null || _221 === void 0 ? void 0 : _221.tax) !== null && _222 !== void 0 ? _222 : 0) - initialPayload.toPay.acquittedBySocietyHeadOfGroup;
366
366
  return initialPayload;
367
367
  }
368
368
  function getCerfa3310Century23RegistrationFields(data) {