@silexpert/core 1.1.381 → 1.1.383

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 (99) hide show
  1. package/dist/cjs/api/resources/AccountingFiles.d.ts +2 -2
  2. package/dist/cjs/api/resources/AccountingFiles.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/AccountingFiles.js.map +1 -1
  4. package/dist/cjs/api/resources/BankAccount.d.ts +2 -1
  5. package/dist/cjs/api/resources/BankAccount.d.ts.map +1 -1
  6. package/dist/cjs/api/resources/BankAccount.js +3 -0
  7. package/dist/cjs/api/resources/BankAccount.js.map +1 -1
  8. package/dist/cjs/types/Enum/ConstitutionState.d.ts +2 -1
  9. package/dist/cjs/types/Enum/ConstitutionState.d.ts.map +1 -1
  10. package/dist/cjs/types/Enum/ConstitutionState.js +7 -0
  11. package/dist/cjs/types/Enum/ConstitutionState.js.map +1 -1
  12. package/dist/cjs/types/Enum/EstimateInvoice.d.ts +14 -0
  13. package/dist/cjs/types/Enum/EstimateInvoice.d.ts.map +1 -1
  14. package/dist/cjs/types/Enum/EstimateInvoice.js +22 -1
  15. package/dist/cjs/types/Enum/EstimateInvoice.js.map +1 -1
  16. package/dist/cjs/types/Enum/TaskResponseType.d.ts.map +1 -1
  17. package/dist/cjs/types/Enum/TaskResponseType.js +11 -0
  18. package/dist/cjs/types/Enum/TaskResponseType.js.map +1 -1
  19. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +10 -0
  20. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
  21. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.js +49 -1
  22. package/dist/cjs/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
  23. package/dist/cjs/types/Interface/api/revision/Query.d.ts.map +1 -1
  24. package/dist/cjs/types/Interface/api/revision/Query.js.map +1 -1
  25. package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.d.ts +1 -0
  26. package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.d.ts.map +1 -1
  27. package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.js +7 -0
  28. package/dist/cjs/types/Interface/api/terminationList/CreateTerminationList.js.map +1 -1
  29. package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts +2 -1
  30. package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts.map +1 -1
  31. package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js +5 -0
  32. package/dist/cjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js.map +1 -1
  33. package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts +2 -1
  34. package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts.map +1 -1
  35. package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js +5 -0
  36. package/dist/cjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js.map +1 -1
  37. package/dist/cjs/types/Interface/models/IThirdParty.d.ts +2 -0
  38. package/dist/cjs/types/Interface/models/IThirdParty.d.ts.map +1 -1
  39. package/dist/cjs/types/Interface/models/IThirdParty.js.map +1 -1
  40. package/dist/cjs/utils/prestation.d.ts +7 -0
  41. package/dist/cjs/utils/prestation.d.ts.map +1 -1
  42. package/dist/cjs/utils/prestation.js +11 -1
  43. package/dist/cjs/utils/prestation.js.map +1 -1
  44. package/dist/mjs/api/resources/AccountingFiles.d.ts +2 -2
  45. package/dist/mjs/api/resources/AccountingFiles.d.ts.map +1 -1
  46. package/dist/mjs/api/resources/AccountingFiles.js.map +1 -1
  47. package/dist/mjs/api/resources/BankAccount.d.ts +2 -1
  48. package/dist/mjs/api/resources/BankAccount.d.ts.map +1 -1
  49. package/dist/mjs/api/resources/BankAccount.js +3 -0
  50. package/dist/mjs/api/resources/BankAccount.js.map +1 -1
  51. package/dist/mjs/types/Enum/ConstitutionState.d.ts +2 -1
  52. package/dist/mjs/types/Enum/ConstitutionState.d.ts.map +1 -1
  53. package/dist/mjs/types/Enum/ConstitutionState.js +7 -0
  54. package/dist/mjs/types/Enum/ConstitutionState.js.map +1 -1
  55. package/dist/mjs/types/Enum/EstimateInvoice.d.ts +14 -0
  56. package/dist/mjs/types/Enum/EstimateInvoice.d.ts.map +1 -1
  57. package/dist/mjs/types/Enum/EstimateInvoice.js +21 -0
  58. package/dist/mjs/types/Enum/EstimateInvoice.js.map +1 -1
  59. package/dist/mjs/types/Enum/TaskResponseType.d.ts.map +1 -1
  60. package/dist/mjs/types/Enum/TaskResponseType.js +11 -0
  61. package/dist/mjs/types/Enum/TaskResponseType.js.map +1 -1
  62. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts +10 -0
  63. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.d.ts.map +1 -1
  64. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.js +56 -1
  65. package/dist/mjs/types/Interface/api/accountingFiles/queryAccountingFiles.js.map +1 -1
  66. package/dist/mjs/types/Interface/api/revision/Query.d.ts.map +1 -1
  67. package/dist/mjs/types/Interface/api/revision/Query.js.map +1 -1
  68. package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.d.ts +1 -0
  69. package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.d.ts.map +1 -1
  70. package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.js +8 -0
  71. package/dist/mjs/types/Interface/api/terminationList/CreateTerminationList.js.map +1 -1
  72. package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts +2 -1
  73. package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.d.ts.map +1 -1
  74. package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js +6 -0
  75. package/dist/mjs/types/Interface/api/thirdParty/CreateThirdPartyForm.js.map +1 -1
  76. package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts +2 -1
  77. package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.d.ts.map +1 -1
  78. package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js +6 -0
  79. package/dist/mjs/types/Interface/api/thirdParty/UpdateThirdPartyForm.js.map +1 -1
  80. package/dist/mjs/types/Interface/models/IThirdParty.d.ts +2 -0
  81. package/dist/mjs/types/Interface/models/IThirdParty.d.ts.map +1 -1
  82. package/dist/mjs/types/Interface/models/IThirdParty.js.map +1 -1
  83. package/dist/mjs/utils/prestation.d.ts +7 -0
  84. package/dist/mjs/utils/prestation.d.ts.map +1 -1
  85. package/dist/mjs/utils/prestation.js +9 -0
  86. package/dist/mjs/utils/prestation.js.map +1 -1
  87. package/package.json +1 -1
  88. package/ts/api/resources/AccountingFiles.ts +2 -2
  89. package/ts/api/resources/BankAccount.ts +5 -1
  90. package/ts/types/Enum/ConstitutionState.ts +7 -1
  91. package/ts/types/Enum/EstimateInvoice.ts +22 -0
  92. package/ts/types/Enum/TaskResponseType.ts +11 -0
  93. package/ts/types/Interface/api/accountingFiles/queryAccountingFiles.ts +42 -0
  94. package/ts/types/Interface/api/revision/Query.ts +113 -113
  95. package/ts/types/Interface/api/terminationList/CreateTerminationList.ts +6 -0
  96. package/ts/types/Interface/api/thirdParty/CreateThirdPartyForm.ts +5 -1
  97. package/ts/types/Interface/api/thirdParty/UpdateThirdPartyForm.ts +5 -1
  98. package/ts/types/Interface/models/IThirdParty.ts +2 -0
  99. package/ts/utils/prestation.ts +11 -0
@@ -1,4 +1,5 @@
1
1
  import { IExercice, IPrestation, IPrestationList } from '../types';
2
+ import { Vat } from '../types/Enum/Vat';
2
3
  import { getTaxesIncludedAmount } from './vat/utils';
3
4
  import { intersection } from './noLodash';
4
5
  import { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';
@@ -139,6 +140,16 @@ const calculateScoringOfPrestation = (idPrestationType: PrestationType, prestati
139
140
  return numberPoint;
140
141
  };
141
142
 
143
+ export const calculateMonthlyAmount = (params: { monthlyPrice: number, monthNumber: number, monthOffer: number, idVatForInternalInvoicing?: number | null, returnTaxesIncludedValue?: boolean }): number =>{
144
+ const { monthlyPrice, monthNumber, monthOffer, idVatForInternalInvoicing, returnTaxesIncludedValue = true } = params;
145
+
146
+ if (!idVatForInternalInvoicing && returnTaxesIncludedValue) throw new Error('Taux de TVA manquant pour calculer le montant TTC');
147
+
148
+ if (!idVatForInternalInvoicing || !returnTaxesIncludedValue) return monthlyPrice * (monthNumber - monthOffer);
149
+
150
+ return monthlyPrice * (monthNumber - monthOffer) * (1 + (Object.values(Vat).find(el => el.id === idVatForInternalInvoicing).value / 100));
151
+ };
152
+
142
153
  export const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {
143
154
  let currentBrandPriceGrid: priceGridBrand | undefined;
144
155
  let currentPriceGrid: priceGrid | undefined;