@silexpert/core 1.1.34 → 1.1.36

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 (256) hide show
  1. package/es/api/resources/AccountingFiles.d.ts +2 -1
  2. package/es/api/resources/AccountingFiles.d.ts.map +1 -1
  3. package/es/api/resources/AccountingFiles.js +3 -0
  4. package/es/api/resources/AccountingFiles.js.map +1 -1
  5. package/es/api/resources/Rule.d.ts +1 -0
  6. package/es/api/resources/Rule.d.ts.map +1 -1
  7. package/es/api/resources/Rule.js +3 -0
  8. package/es/api/resources/Rule.js.map +1 -1
  9. package/es/types/Enum/BrandLegalstart.js +20 -20
  10. package/es/types/Enum/BrandLegalstart.js.map +1 -1
  11. package/es/types/Enum/ConnectorType.d.ts +0 -1
  12. package/es/types/Enum/ConnectorType.d.ts.map +1 -1
  13. package/es/types/Enum/ConnectorType.js +1 -1
  14. package/es/types/Enum/ConnectorType.js.map +1 -1
  15. package/es/types/Enum/Unit.d.ts +2 -1
  16. package/es/types/Enum/Unit.d.ts.map +1 -1
  17. package/es/types/Enum/Unit.js +11 -0
  18. package/es/types/Enum/Unit.js.map +1 -1
  19. package/es/types/Interface/api/accountingFiles/Read.d.ts +6 -0
  20. package/es/types/Interface/api/accountingFiles/Read.d.ts.map +1 -0
  21. package/es/types/Interface/api/accountingFiles/Read.js +2 -0
  22. package/es/types/Interface/api/accountingFiles/Read.js.map +1 -0
  23. package/es/types/Interface/api/archive/ImportSocietyArchive.d.ts +1 -1
  24. package/es/types/Interface/api/archive/ImportSocietyArchive.d.ts.map +1 -1
  25. package/es/types/Interface/api/archive/ImportSocietyArchive.js +1 -1
  26. package/es/types/Interface/api/archive/ImportSocietyArchive.js.map +1 -1
  27. package/es/types/Interface/api/exercice/CreateExercice.d.ts +1 -0
  28. package/es/types/Interface/api/exercice/CreateExercice.d.ts.map +1 -1
  29. package/es/types/Interface/api/exercice/CreateExercice.js +7 -0
  30. package/es/types/Interface/api/exercice/CreateExercice.js.map +1 -1
  31. package/es/types/Interface/api/exercice/UpdateExercice.d.ts +1 -0
  32. package/es/types/Interface/api/exercice/UpdateExercice.d.ts.map +1 -1
  33. package/es/types/Interface/api/exercice/UpdateExercice.js +7 -0
  34. package/es/types/Interface/api/exercice/UpdateExercice.js.map +1 -1
  35. package/es/types/Interface/api/registration/ReadRegistration.d.ts +2 -2
  36. package/es/types/Interface/api/registration/ReadRegistration.d.ts.map +1 -1
  37. package/es/types/Interface/api/registration/ReadRegistration.js +2 -1
  38. package/es/types/Interface/api/registration/ReadRegistration.js.map +1 -1
  39. package/es/types/Interface/models/IAccountingEntry.d.ts +0 -2
  40. package/es/types/Interface/models/IAccountingEntry.d.ts.map +1 -1
  41. package/es/types/Interface/models/IAccountingEntry.js.map +1 -1
  42. package/es/types/Interface/models/IApiError.d.ts +1 -0
  43. package/es/types/Interface/models/IApiError.d.ts.map +1 -1
  44. package/es/types/Interface/models/IApiError.js +1 -0
  45. package/es/types/Interface/models/IApiError.js.map +1 -1
  46. package/es/types/Interface/models/ISociety.d.ts +0 -2
  47. package/es/types/Interface/models/ISociety.d.ts.map +1 -1
  48. package/es/types/Interface/models/ISociety.js.map +1 -1
  49. package/es/types/Interface/models/ISupervision.d.ts +0 -4
  50. package/es/types/Interface/models/ISupervision.d.ts.map +1 -1
  51. package/es/types/Interface/models/ISupervision.js.map +1 -1
  52. package/es/types/index.d.ts +1 -20
  53. package/es/types/index.d.ts.map +1 -1
  54. package/es/types/index.js +1 -20
  55. package/es/types/index.js.map +1 -1
  56. package/es/utils/vat/3310/century23.d.ts.map +1 -1
  57. package/es/utils/vat/3310/century23.js +31 -31
  58. package/es/utils/vat/3310/century23.js.map +1 -1
  59. package/es/utils/vat/3517/century23.d.ts.map +1 -1
  60. package/es/utils/vat/3517/century23.js +11 -11
  61. package/es/utils/vat/3517/century23.js.map +1 -1
  62. package/es/utils/vat/utils.d.ts +1 -0
  63. package/es/utils/vat/utils.d.ts.map +1 -1
  64. package/es/utils/vat/utils.js +3 -0
  65. package/es/utils/vat/utils.js.map +1 -1
  66. package/js/api/resources/AccountingFiles.js +3 -0
  67. package/js/api/resources/AccountingFiles.js.map +1 -1
  68. package/js/api/resources/Rule.js +3 -0
  69. package/js/api/resources/Rule.js.map +1 -1
  70. package/js/types/Enum/BrandLegalstart.js +20 -20
  71. package/js/types/Enum/BrandLegalstart.js.map +1 -1
  72. package/js/types/Enum/ConnectorType.js +1 -1
  73. package/js/types/Enum/ConnectorType.js.map +1 -1
  74. package/js/types/Enum/Unit.js +10 -0
  75. package/js/types/Enum/Unit.js.map +1 -1
  76. package/js/types/Interface/{models/IFaq.js → api/accountingFiles/Read.js} +1 -1
  77. package/js/types/Interface/api/accountingFiles/Read.js.map +1 -0
  78. package/js/types/Interface/api/archive/ImportSocietyArchive.js +1 -1
  79. package/js/types/Interface/api/archive/ImportSocietyArchive.js.map +1 -1
  80. package/js/types/Interface/api/exercice/CreateExercice.js +1 -0
  81. package/js/types/Interface/api/exercice/CreateExercice.js.map +1 -1
  82. package/js/types/Interface/api/exercice/UpdateExercice.js +1 -0
  83. package/js/types/Interface/api/exercice/UpdateExercice.js.map +1 -1
  84. package/js/types/Interface/api/registration/ReadRegistration.js +2 -0
  85. package/js/types/Interface/api/registration/ReadRegistration.js.map +1 -1
  86. package/js/types/Interface/models/IAccountingEntry.js.map +1 -1
  87. package/js/types/Interface/models/IApiError.js +1 -0
  88. package/js/types/Interface/models/IApiError.js.map +1 -1
  89. package/js/types/Interface/models/ISociety.js.map +1 -1
  90. package/js/types/Interface/models/ISupervision.js.map +1 -1
  91. package/js/types/index.js +34 -224
  92. package/js/types/index.js.map +1 -1
  93. package/js/utils/vat/3310/century23.js +25 -25
  94. package/js/utils/vat/3310/century23.js.map +1 -1
  95. package/js/utils/vat/3517/century23.js +10 -10
  96. package/js/utils/vat/3517/century23.js.map +1 -1
  97. package/js/utils/vat/utils.js +4 -0
  98. package/js/utils/vat/utils.js.map +1 -1
  99. package/package.json +1 -1
  100. package/ts/api/resources/AccountingFiles.ts +5 -1
  101. package/ts/api/resources/Rule.ts +4 -0
  102. package/ts/types/Enum/BrandLegalstart.ts +20 -20
  103. package/ts/types/Enum/ConnectorType.ts +1 -1
  104. package/ts/types/Enum/Unit.ts +11 -0
  105. package/ts/types/Interface/api/accountingFiles/Read.ts +6 -0
  106. package/ts/types/Interface/api/archive/ImportSocietyArchive.ts +1 -1
  107. package/ts/types/Interface/api/exercice/CreateExercice.ts +6 -0
  108. package/ts/types/Interface/api/exercice/UpdateExercice.ts +6 -0
  109. package/ts/types/Interface/api/registration/ReadRegistration.ts +4 -1
  110. package/ts/types/Interface/models/IAccountingEntry.ts +0 -2
  111. package/ts/types/Interface/models/IApiError.ts +1 -0
  112. package/ts/types/Interface/models/ISociety.ts +0 -2
  113. package/ts/types/Interface/models/ISupervision.ts +0 -4
  114. package/ts/types/index.ts +1 -20
  115. package/ts/utils/vat/3310/century23.ts +34 -32
  116. package/ts/utils/vat/3517/century23.ts +13 -11
  117. package/ts/utils/vat/utils.ts +4 -0
  118. package/es/types/Interface/models/IAccountingTransaction_new.d.ts +0 -18
  119. package/es/types/Interface/models/IAccountingTransaction_new.d.ts.map +0 -1
  120. package/es/types/Interface/models/IAccountingTransaction_new.js +0 -2
  121. package/es/types/Interface/models/IAccountingTransaction_new.js.map +0 -1
  122. package/es/types/Interface/models/IAutoLoginToken.d.ts +0 -10
  123. package/es/types/Interface/models/IAutoLoginToken.d.ts.map +0 -1
  124. package/es/types/Interface/models/IAutoLoginToken.js +0 -2
  125. package/es/types/Interface/models/IAutoLoginToken.js.map +0 -1
  126. package/es/types/Interface/models/IBankTransaction.d.ts +0 -34
  127. package/es/types/Interface/models/IBankTransaction.d.ts.map +0 -1
  128. package/es/types/Interface/models/IBankTransaction.js +0 -2
  129. package/es/types/Interface/models/IBankTransaction.js.map +0 -1
  130. package/es/types/Interface/models/ICallDirectly.d.ts +0 -26
  131. package/es/types/Interface/models/ICallDirectly.d.ts.map +0 -1
  132. package/es/types/Interface/models/ICallDirectly.js +0 -2
  133. package/es/types/Interface/models/ICallDirectly.js.map +0 -1
  134. package/es/types/Interface/models/IFaq.d.ts +0 -15
  135. package/es/types/Interface/models/IFaq.d.ts.map +0 -1
  136. package/es/types/Interface/models/IFaq.js +0 -2
  137. package/es/types/Interface/models/IFaq.js.map +0 -1
  138. package/es/types/Interface/models/IFaqCategory.d.ts +0 -5
  139. package/es/types/Interface/models/IFaqCategory.d.ts.map +0 -1
  140. package/es/types/Interface/models/IFaqCategory.js +0 -2
  141. package/es/types/Interface/models/IFaqCategory.js.map +0 -1
  142. package/es/types/Interface/models/IFollowedQualityMail.d.ts +0 -13
  143. package/es/types/Interface/models/IFollowedQualityMail.d.ts.map +0 -1
  144. package/es/types/Interface/models/IFollowedQualityMail.js +0 -2
  145. package/es/types/Interface/models/IFollowedQualityMail.js.map +0 -1
  146. package/es/types/Interface/models/IFollowedQualityMailType.d.ts +0 -7
  147. package/es/types/Interface/models/IFollowedQualityMailType.d.ts.map +0 -1
  148. package/es/types/Interface/models/IFollowedQualityMailType.js +0 -2
  149. package/es/types/Interface/models/IFollowedQualityMailType.js.map +0 -1
  150. package/es/types/Interface/models/IIdentification.d.ts +0 -18
  151. package/es/types/Interface/models/IIdentification.d.ts.map +0 -1
  152. package/es/types/Interface/models/IIdentification.js +0 -2
  153. package/es/types/Interface/models/IIdentification.js.map +0 -1
  154. package/es/types/Interface/models/IJob.d.ts +0 -12
  155. package/es/types/Interface/models/IJob.d.ts.map +0 -1
  156. package/es/types/Interface/models/IJob.js +0 -2
  157. package/es/types/Interface/models/IJob.js.map +0 -1
  158. package/es/types/Interface/models/IJobCategory.d.ts +0 -9
  159. package/es/types/Interface/models/IJobCategory.d.ts.map +0 -1
  160. package/es/types/Interface/models/IJobCategory.js +0 -2
  161. package/es/types/Interface/models/IJobCategory.js.map +0 -1
  162. package/es/types/Interface/models/IPenalty.d.ts +0 -27
  163. package/es/types/Interface/models/IPenalty.d.ts.map +0 -1
  164. package/es/types/Interface/models/IPenalty.js +0 -2
  165. package/es/types/Interface/models/IPenalty.js.map +0 -1
  166. package/es/types/Interface/models/IPenaltyType.d.ts +0 -7
  167. package/es/types/Interface/models/IPenaltyType.d.ts.map +0 -1
  168. package/es/types/Interface/models/IPenaltyType.js +0 -2
  169. package/es/types/Interface/models/IPenaltyType.js.map +0 -1
  170. package/es/types/Interface/models/ISuggestion.d.ts +0 -14
  171. package/es/types/Interface/models/ISuggestion.d.ts.map +0 -1
  172. package/es/types/Interface/models/ISuggestion.js +0 -2
  173. package/es/types/Interface/models/ISuggestion.js.map +0 -1
  174. package/es/types/Interface/models/ISupervisionJob.d.ts +0 -8
  175. package/es/types/Interface/models/ISupervisionJob.d.ts.map +0 -1
  176. package/es/types/Interface/models/ISupervisionJob.js +0 -2
  177. package/es/types/Interface/models/ISupervisionJob.js.map +0 -1
  178. package/es/types/Interface/models/ITmpValidationToken.d.ts +0 -11
  179. package/es/types/Interface/models/ITmpValidationToken.d.ts.map +0 -1
  180. package/es/types/Interface/models/ITmpValidationToken.js +0 -2
  181. package/es/types/Interface/models/ITmpValidationToken.js.map +0 -1
  182. package/es/types/Interface/models/IUserSocietyTicketSupport.d.ts +0 -9
  183. package/es/types/Interface/models/IUserSocietyTicketSupport.d.ts.map +0 -1
  184. package/es/types/Interface/models/IUserSocietyTicketSupport.js +0 -2
  185. package/es/types/Interface/models/IUserSocietyTicketSupport.js.map +0 -1
  186. package/es/types/Interface/models/IVatMargin.d.ts +0 -7
  187. package/es/types/Interface/models/IVatMargin.d.ts.map +0 -1
  188. package/es/types/Interface/models/IVatMargin.js +0 -2
  189. package/es/types/Interface/models/IVatMargin.js.map +0 -1
  190. package/es/types/Interface/models/IWebMailSpam.d.ts +0 -8
  191. package/es/types/Interface/models/IWebMailSpam.d.ts.map +0 -1
  192. package/es/types/Interface/models/IWebMailSpam.js +0 -2
  193. package/es/types/Interface/models/IWebMailSpam.js.map +0 -1
  194. package/es/types/Interface/models/IWebMailSpamType.d.ts +0 -7
  195. package/es/types/Interface/models/IWebMailSpamType.d.ts.map +0 -1
  196. package/es/types/Interface/models/IWebMailSpamType.js +0 -2
  197. package/es/types/Interface/models/IWebMailSpamType.js.map +0 -1
  198. package/js/types/Interface/models/IAccountingTransaction_new.js +0 -6
  199. package/js/types/Interface/models/IAccountingTransaction_new.js.map +0 -1
  200. package/js/types/Interface/models/IAutoLoginToken.js +0 -6
  201. package/js/types/Interface/models/IAutoLoginToken.js.map +0 -1
  202. package/js/types/Interface/models/IBankTransaction.js +0 -6
  203. package/js/types/Interface/models/IBankTransaction.js.map +0 -1
  204. package/js/types/Interface/models/ICallDirectly.js +0 -6
  205. package/js/types/Interface/models/ICallDirectly.js.map +0 -1
  206. package/js/types/Interface/models/IFaq.js.map +0 -1
  207. package/js/types/Interface/models/IFaqCategory.js +0 -6
  208. package/js/types/Interface/models/IFaqCategory.js.map +0 -1
  209. package/js/types/Interface/models/IFollowedQualityMail.js +0 -6
  210. package/js/types/Interface/models/IFollowedQualityMail.js.map +0 -1
  211. package/js/types/Interface/models/IFollowedQualityMailType.js +0 -6
  212. package/js/types/Interface/models/IFollowedQualityMailType.js.map +0 -1
  213. package/js/types/Interface/models/IIdentification.js +0 -6
  214. package/js/types/Interface/models/IIdentification.js.map +0 -1
  215. package/js/types/Interface/models/IJob.js +0 -6
  216. package/js/types/Interface/models/IJob.js.map +0 -1
  217. package/js/types/Interface/models/IJobCategory.js +0 -6
  218. package/js/types/Interface/models/IJobCategory.js.map +0 -1
  219. package/js/types/Interface/models/IPenalty.js +0 -6
  220. package/js/types/Interface/models/IPenalty.js.map +0 -1
  221. package/js/types/Interface/models/IPenaltyType.js +0 -6
  222. package/js/types/Interface/models/IPenaltyType.js.map +0 -1
  223. package/js/types/Interface/models/ISuggestion.js +0 -6
  224. package/js/types/Interface/models/ISuggestion.js.map +0 -1
  225. package/js/types/Interface/models/ISupervisionJob.js +0 -6
  226. package/js/types/Interface/models/ISupervisionJob.js.map +0 -1
  227. package/js/types/Interface/models/ITmpValidationToken.js +0 -6
  228. package/js/types/Interface/models/ITmpValidationToken.js.map +0 -1
  229. package/js/types/Interface/models/IUserSocietyTicketSupport.js +0 -6
  230. package/js/types/Interface/models/IUserSocietyTicketSupport.js.map +0 -1
  231. package/js/types/Interface/models/IVatMargin.js +0 -6
  232. package/js/types/Interface/models/IVatMargin.js.map +0 -1
  233. package/js/types/Interface/models/IWebMailSpam.js +0 -6
  234. package/js/types/Interface/models/IWebMailSpam.js.map +0 -1
  235. package/js/types/Interface/models/IWebMailSpamType.js +0 -6
  236. package/js/types/Interface/models/IWebMailSpamType.js.map +0 -1
  237. package/ts/types/Interface/models/IAccountingTransaction_new.ts +0 -20
  238. package/ts/types/Interface/models/IAutoLoginToken.ts +0 -10
  239. package/ts/types/Interface/models/IBankTransaction.ts +0 -37
  240. package/ts/types/Interface/models/ICallDirectly.ts +0 -29
  241. package/ts/types/Interface/models/IFaq.ts +0 -18
  242. package/ts/types/Interface/models/IFaqCategory.ts +0 -5
  243. package/ts/types/Interface/models/IFollowedQualityMail.ts +0 -16
  244. package/ts/types/Interface/models/IFollowedQualityMailType.ts +0 -7
  245. package/ts/types/Interface/models/IIdentification.ts +0 -21
  246. package/ts/types/Interface/models/IJob.ts +0 -15
  247. package/ts/types/Interface/models/IJobCategory.ts +0 -12
  248. package/ts/types/Interface/models/IPenalty.ts +0 -30
  249. package/ts/types/Interface/models/IPenaltyType.ts +0 -7
  250. package/ts/types/Interface/models/ISuggestion.ts +0 -17
  251. package/ts/types/Interface/models/ISupervisionJob.ts +0 -8
  252. package/ts/types/Interface/models/ITmpValidationToken.ts +0 -14
  253. package/ts/types/Interface/models/IUserSocietyTicketSupport.ts +0 -9
  254. package/ts/types/Interface/models/IVatMargin.ts +0 -7
  255. package/ts/types/Interface/models/IWebMailSpam.ts +0 -8
  256. package/ts/types/Interface/models/IWebMailSpamType.ts +0 -7
@@ -49,49 +49,49 @@ 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.getAmountByAccountNumber)(taxedServicesEntries, servicesAccounts, 0, true);
53
- const taxedOther = (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));
53
+ const taxedOther = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withTaxVat.includes(ae.idVat)), ['775'], 0, true));
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
- const taxedPurchaseOfIntracommunityService = (0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true);
56
+ const taxedPurchaseOfIntracommunityService = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(intracommunityServiceEntries, intracommunityServiceAccounts, 0, true));
57
57
  const taxedImportEntries = vatEntries.filter(ae => importationVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat));
58
58
  const taxedImportAccounts = ['6'];
59
- const taxedImport = (0, _utils.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts, 0, true);
60
- const taxedIntracommunityAcquisitions = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
59
+ const taxedImport = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(taxedImportEntries, taxedImportAccounts, 0, true));
60
+ const taxedIntracommunityAcquisitions = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true));
61
61
  // Opérations non taxées
62
- const untaxedExportationNotInEurope = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true);
63
- const untaxedOther = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7'], 0, true);
64
- const untaxedImport = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true);
65
- const untaxedIntracomunity = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true);
66
- const untaxedIntracommunityDelivery = (0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true);
62
+ const untaxedExportationNotInEurope = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), servicesAccounts, 0, true));
63
+ const untaxedOther = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => frenchVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['7'], 0, true));
64
+ const untaxedImport = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => importationVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['6'], 0, true));
65
+ const untaxedIntracomunity = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => intracomVat.includes(ae.idVat) && withoutTaxVat.includes(ae.idVat)), ['601', '602', '603', '605', '606', '607'], 0, true));
66
+ const untaxedIntracommunityDelivery = (0, _utils.setZeroIfIsNegative)((0, _utils.getAmountByAccountNumber)(vatEntries.filter(ae => withoutTaxVat.includes(ae.idVat) && intracomVat.includes(ae.idVat)), ['701', '707'], 0, true));
67
67
  // TVA brute
68
- const normalRate = (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);
68
+ 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));
69
69
  const normalRateTax = (0, _lodash.round)(normalRate * 0.2);
70
- const reducedRate5Dot5 = (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);
70
+ 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));
71
71
  const reducedRate5Dot5Tax = (0, _lodash.round)(reducedRate5Dot5 * 0.055);
72
- const reducedRate10 = (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);
72
+ 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));
73
73
  const reducedRate10Tax = (0, _lodash.round)(reducedRate10 * 0.1);
74
- const reducedRate8Dot5 = (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);
74
+ 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));
75
75
  const reducedRate8Dot5Tax = (0, _lodash.round)(reducedRate8Dot5 * 0.085);
76
- const reducedRate2Dot1 = (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);
76
+ 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));
77
77
  const reducedRate2Dot1Tax = (0, _lodash.round)(reducedRate2Dot1 * 0.021);
78
- const importNormalRate = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 20).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
78
+ 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));
79
79
  const importNormalRateTax = (0, _lodash.round)(importNormalRate * 0.2);
80
- const importReducedRate10 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 10).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
80
+ 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));
81
81
  const importReducedRate10Tax = (0, _lodash.round)(importReducedRate10 * 0.1);
82
- const importReducedRate8Dot5 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 8.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
82
+ 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));
83
83
  const importReducedRate8Dot5Tax = (0, _lodash.round)(importReducedRate8Dot5 * 0.085);
84
- const importReducedRate5Dot5 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 5.5).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
84
+ 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));
85
85
  const importReducedRate5Dot5Tax = (0, _lodash.round)(importReducedRate8Dot5 * 0.055);
86
- const importReducedRate2Dot1 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 2.1).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
86
+ 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));
87
87
  const importReducedRate2Dot1Tax = (0, _lodash.round)(importReducedRate2Dot1 * 0.021);
88
- const importReducedRate1Dot05 = (0, _utils.getAmountByAccountNumber)(taxedImportEntries.filter(e => vats.filter(v => v.value === 1.05).map(v => v.id).includes(e.idVat)), taxedImportAccounts, 0, true);
88
+ 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));
89
89
  const importReducedRate1Dot05Tax = (0, _lodash.round)(importReducedRate1Dot05 * 0.0105);
90
- const intracommunityTax = (0, _utils.getTaxAmountByAccountNumber)(intracommunityServiceEntries, intracommunityServiceAccounts);
90
+ const intracommunityTax = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(intracommunityServiceEntries, intracommunityServiceAccounts));
91
91
  // TVA Déductible
92
- const immobilizationTax = (0, _utils.getTaxAmountByAccountNumber)(vatEntries, ['2']);
93
- const otherGoodsAndServices = (0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => !v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6']);
94
- const otherDeductibles = (0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6']);
92
+ const immobilizationTax = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries, ['2']));
93
+ const otherGoodsAndServices = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => !v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6']));
94
+ const otherDeductibles = (0, _utils.setZeroIfIsNegative)((0, _utils.getTaxAmountByAccountNumber)(vatEntries.filter(e => vats.filter(v => v.isVatImportation).map(v => v.id).includes(e.idVat)), ['6']));
95
95
  const report = (_d = (_c = (_b = payload.previousVatDeclaration) === null || _b === void 0 ? void 0 : _b.credit) === null || _c === void 0 ? void 0 : _c.toReport) !== null && _d !== void 0 ? _d : 0;
96
96
  const coefficient = (0, _lodash.round)((_g = (_f = (_e = payload.vat) === null || _e === void 0 ? void 0 : _e.deductible) === null || _f === void 0 ? void 0 : _f.coefficient) !== null && _g !== void 0 ? _g : 100, 2);
97
97
  const isNil = payload.isNil === true;