@silexpert/core 1.0.74 → 1.0.76

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 (100) hide show
  1. package/es/types/Enum/BrandClementine.js +1 -1
  2. package/es/types/Enum/BrandClementine.js.map +1 -1
  3. package/es/types/Enum/BrandPourcentage.js +1 -1
  4. package/es/types/Enum/BrandPourcentage.js.map +1 -1
  5. package/es/types/Enum/Country.d.ts +238 -2
  6. package/es/types/Enum/Country.d.ts.map +1 -1
  7. package/es/types/Enum/Country.js +487 -13
  8. package/es/types/Enum/Country.js.map +1 -1
  9. package/es/types/Enum/PrestationOption.d.ts +41 -0
  10. package/es/types/Enum/PrestationOption.d.ts.map +1 -1
  11. package/es/types/Enum/PrestationOption.js +41 -0
  12. package/es/types/Enum/PrestationOption.js.map +1 -1
  13. package/es/types/Enum/PrestationType.d.ts +1 -1
  14. package/es/types/Enum/PrestationType.js +1 -1
  15. package/es/types/Enum/PrestationType.js.map +1 -1
  16. package/es/types/Enum/TimeCounterType.js +2 -2
  17. package/es/types/Enum/TimeCounterType.js.map +1 -1
  18. package/es/types/Interface/api/commercialManagement/Read.d.ts +5 -0
  19. package/es/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
  20. package/es/types/Interface/api/commercialManagement/Read.js.map +1 -1
  21. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.d.ts +2 -2
  22. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.d.ts.map +1 -1
  23. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js +2 -2
  24. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js.map +1 -1
  25. package/es/types/Interface/api/pdf/ReadPdfizer.d.ts +35 -0
  26. package/es/types/Interface/api/pdf/ReadPdfizer.d.ts.map +1 -0
  27. package/es/types/Interface/api/pdf/ReadPdfizer.js +2 -0
  28. package/es/types/Interface/api/pdf/ReadPdfizer.js.map +1 -0
  29. package/es/types/Interface/api/statistic/QueryInternal.d.ts +5 -0
  30. package/es/types/Interface/api/statistic/QueryInternal.d.ts.map +1 -0
  31. package/es/types/Interface/api/statistic/QueryInternal.js +26 -0
  32. package/es/types/Interface/api/statistic/QueryInternal.js.map +1 -0
  33. package/es/types/Interface/models/ISociety.d.ts +2 -2
  34. package/es/types/Interface/models/ISociety.d.ts.map +1 -1
  35. package/es/types/Interface/models/ISociety.js.map +1 -1
  36. package/es/types/Interface/models/IThirdParty.d.ts +1 -0
  37. package/es/types/Interface/models/IThirdParty.d.ts.map +1 -1
  38. package/es/types/Interface/models/IThirdParty.js.map +1 -1
  39. package/es/types/index.d.ts +2 -0
  40. package/es/types/index.d.ts.map +1 -1
  41. package/es/types/index.js +2 -0
  42. package/es/types/index.js.map +1 -1
  43. package/es/utils/commercialManagement/document.d.ts.map +1 -1
  44. package/es/utils/commercialManagement/document.js +3 -1
  45. package/es/utils/commercialManagement/document.js.map +1 -1
  46. package/es/utils/commercialManagement/templates/body.d.ts.map +1 -1
  47. package/es/utils/commercialManagement/templates/body.js +4 -3
  48. package/es/utils/commercialManagement/templates/body.js.map +1 -1
  49. package/es/utils/commercialManagement/templates/common.js +1 -1
  50. package/es/utils/commercialManagement/templates/common.js.map +1 -1
  51. package/es/utils/commercialManagement/thirdParty.d.ts +3 -0
  52. package/es/utils/commercialManagement/thirdParty.d.ts.map +1 -0
  53. package/es/utils/commercialManagement/thirdParty.js +7 -0
  54. package/es/utils/commercialManagement/thirdParty.js.map +1 -0
  55. package/js/types/Enum/BrandClementine.js +1 -1
  56. package/js/types/Enum/BrandClementine.js.map +1 -1
  57. package/js/types/Enum/BrandPourcentage.js +1 -1
  58. package/js/types/Enum/BrandPourcentage.js.map +1 -1
  59. package/js/types/Enum/Country.js +1210 -13
  60. package/js/types/Enum/Country.js.map +1 -1
  61. package/js/types/Enum/PrestationOption.js +48 -4
  62. package/js/types/Enum/PrestationOption.js.map +1 -1
  63. package/js/types/Enum/PrestationType.js +1 -1
  64. package/js/types/Enum/PrestationType.js.map +1 -1
  65. package/js/types/Enum/TimeCounterType.js +2 -2
  66. package/js/types/Enum/TimeCounterType.js.map +1 -1
  67. package/js/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js +1 -1
  68. package/js/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js.map +1 -1
  69. package/js/types/Interface/api/pdf/ReadPdfizer.js +6 -0
  70. package/js/types/Interface/api/pdf/ReadPdfizer.js.map +1 -0
  71. package/js/types/Interface/api/statistic/QueryInternal.js +31 -0
  72. package/js/types/Interface/api/statistic/QueryInternal.js.map +1 -0
  73. package/js/types/index.js +24 -0
  74. package/js/types/index.js.map +1 -1
  75. package/js/utils/commercialManagement/document.js +4 -0
  76. package/js/utils/commercialManagement/document.js.map +1 -1
  77. package/js/utils/commercialManagement/templates/body.js +4 -3
  78. package/js/utils/commercialManagement/templates/body.js.map +1 -1
  79. package/js/utils/commercialManagement/templates/common.js +1 -1
  80. package/js/utils/commercialManagement/templates/common.js.map +1 -1
  81. package/js/utils/commercialManagement/thirdParty.js +20 -0
  82. package/js/utils/commercialManagement/thirdParty.js.map +1 -0
  83. package/package.json +1 -1
  84. package/ts/types/Enum/BrandClementine.ts +1 -1
  85. package/ts/types/Enum/BrandPourcentage.ts +1 -1
  86. package/ts/types/Enum/Country.ts +478 -3
  87. package/ts/types/Enum/PrestationOption.ts +42 -0
  88. package/ts/types/Enum/PrestationType.ts +1 -1
  89. package/ts/types/Enum/TimeCounterType.ts +2 -2
  90. package/ts/types/Interface/api/commercialManagement/Read.ts +6 -0
  91. package/ts/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.ts +3 -3
  92. package/ts/types/Interface/api/pdf/ReadPdfizer.ts +10 -0
  93. package/ts/types/Interface/api/statistic/QueryInternal.ts +16 -0
  94. package/ts/types/Interface/models/ISociety.ts +2 -2
  95. package/ts/types/Interface/models/IThirdParty.ts +1 -0
  96. package/ts/types/index.ts +2 -0
  97. package/ts/utils/commercialManagement/document.ts +4 -0
  98. package/ts/utils/commercialManagement/templates/body.ts +4 -3
  99. package/ts/utils/commercialManagement/templates/common.ts +1 -1
  100. package/ts/utils/commercialManagement/thirdParty.ts +11 -0
@@ -30,6 +30,7 @@ export interface IThirdParty {
30
30
  deliveryAddress?: string | null;
31
31
  deliveryZipCode?: string | null;
32
32
  deliveryCity?: string | null;
33
+ deliveryIdCountry?: number | null;
33
34
  createdAt?: Date;
34
35
  updatedAt?: Date;
35
36
  deletedAt?: Date | null;
package/ts/types/index.ts CHANGED
@@ -649,6 +649,7 @@ export * from './Interface/api/statistic/QueryGetExpertAccountant';
649
649
  export * from './Interface/api/statistic/QueryAccountant';
650
650
  export * from './Interface/api/statistic/QueryGetAccountant';
651
651
  export * from './Interface/api/statistic/QueryDirection';
652
+ export * from './Interface/api/statistic/QueryInternal';
652
653
  export * from './Interface/api/statistic/QueryGetDirection';
653
654
  export * from './Interface/api/pappers/CreatePappers';
654
655
  export * from './Interface/api/bankAccount/DeleteTransaction';
@@ -828,6 +829,7 @@ export * from './Interface/api/legalNotice/UpdateLegalNotice';
828
829
  export * from './Interface/api/wallet/QueryWallet';
829
830
  export * from './Interface/api/terminationList/QueryTerminationList';
830
831
  export * from './Interface/api/terminationList/DestroyTerminationList';
832
+ export * from './Interface/api/pdf/ReadPdfizer';
831
833
 
832
834
  // Enums types
833
835
  export * from './Interface/enum/Util';
@@ -14,14 +14,18 @@ import { bodyTemplate } from './templates/body';
14
14
  import { productToReadProductEditing } from './product';
15
15
  import { vatToReadVatEditing } from './vat';
16
16
  import { CreateInvoiceDocument, CreatePreSaleDocument } from '../../types';
17
+ import { thirdPartyToReadThirdPartyEditing } from './thirdParty';
17
18
 
18
19
  const ejs = require('ejs');
19
20
 
20
21
  export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument): ReadCommercialDocumentTemplate {
21
22
  const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));
22
23
  const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);
24
+ const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);
25
+
23
26
  const data: ReadDocumentEditing = {
24
27
  ...payload,
28
+ thirdParty,
25
29
  paymentLink: payload.paymentLink ?? '#',
26
30
  idEstimateInvoiceType,
27
31
  title: payload.title ?? null,
@@ -56,9 +56,10 @@ const headOfDocument = `<div class="row space-between">
56
56
  <% if(thirdParty.fullname) {%><b><%= thirdParty.fullname %></b><br/><% } %>
57
57
  <% if(thirdParty.company) {%><%= thirdParty.company %><br/><% } %>
58
58
  <% if(thirdParty.address) {%><%= thirdParty.address %><br/><% } %>
59
- <% if(thirdParty.zipCode) {%><%= thirdParty.zipCode + ' ' %><% } %><%= thirdParty.city %><br/>
60
- <% if(thirdParty.deliveryAddress && thirdParty.deliveryCity && thirdParty.deliveryZipCode) {%>Adresse de livraison : <%= thirdParty.deliveryAddress %> <%= thirdParty.deliveryZipCode %> <%= thirdParty.deliveryCity %><br/><% } %>
61
- <% if(thirdParty.nSiret) {%>SIRET : <%= thirdParty.nSiret %><% } %>
59
+ <% if(thirdParty.zipCode) {%><%= thirdParty.zipCode + ' ' %><% } %><%= thirdParty.city %> <%= thirdParty.country %><br/>
60
+ <% if(thirdParty.deliveryAddress && thirdParty.deliveryCity && thirdParty.deliveryZipCode) {%>Adresse de livraison : <%= thirdParty.deliveryAddress %> <%= thirdParty.deliveryZipCode %> <%= thirdParty.deliveryCity %> <%= thirdParty.deliveryCountry %><br/><% } %>
61
+ <% if(thirdParty.nSiret) {%>SIRET : <%= thirdParty.nSiret %><br/><% } %>
62
+ <% if(thirdParty.nTva) {%>N° TVA : <%= thirdParty.nTva %><% } %>
62
63
  </div>
63
64
  <% } %>
64
65
  </div>
@@ -129,7 +129,7 @@ export class CommercialDocumentCommonHTML {
129
129
  <% } %>
130
130
  <% if ([${EstimateInvoiceType.FACTURE}, ${EstimateInvoiceType.RESTE}, ${EstimateInvoiceType.ACOMPTE}].includes(idEstimateInvoiceType)) { %>
131
131
  <tr>
132
- <td><b>Net à payer</b></td>
132
+ <td><b><%= depositFormatted ? 'Reste à payer' : 'Net à payer' %></b></td>
133
133
  <td><%= totalTaxAndDiscountIncludedFormatted %>€</td>
134
134
  </tr>
135
135
  <% } %>
@@ -0,0 +1,11 @@
1
+ import { isDefined } from 'class-validator';
2
+ import { IThirdParty, ReadThirdPartyEditing } from '../../types';
3
+ import { CountryList } from '../../types/Enum/Country';
4
+
5
+ export function thirdPartyToReadThirdPartyEditing(payload: IThirdParty): ReadThirdPartyEditing {
6
+ return {
7
+ ...payload,
8
+ country: isDefined(payload.idCountry) ? CountryList.find((c) => c.id === payload.idCountry)?.name?.toUpperCase() ?? null : null,
9
+ deliveryCountry: isDefined(payload.deliveryIdCountry) ? CountryList.find((c) => c.id === payload.deliveryIdCountry)?.name?.toUpperCase() ?? null : null,
10
+ };
11
+ }