@silexpert/core 1.0.73 → 1.0.75

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 (122) hide show
  1. package/es/api/resources/Facturation.d.ts +10 -0
  2. package/es/api/resources/Facturation.d.ts.map +1 -0
  3. package/es/api/resources/Facturation.js +13 -0
  4. package/es/api/resources/Facturation.js.map +1 -0
  5. package/es/api/resources.d.ts +2 -0
  6. package/es/api/resources.d.ts.map +1 -1
  7. package/es/api/resources.js +2 -0
  8. package/es/api/resources.js.map +1 -1
  9. package/es/types/Enum/Country.d.ts +238 -2
  10. package/es/types/Enum/Country.d.ts.map +1 -1
  11. package/es/types/Enum/Country.js +487 -13
  12. package/es/types/Enum/Country.js.map +1 -1
  13. package/es/types/Enum/TimeCounterType.js +7 -7
  14. package/es/types/Enum/TimeCounterType.js.map +1 -1
  15. package/es/types/Interface/api/billingHistory/QueryPaginatedBillingHistory.d.ts +5 -0
  16. package/es/types/Interface/api/billingHistory/QueryPaginatedBillingHistory.d.ts.map +1 -0
  17. package/es/types/Interface/api/billingHistory/QueryPaginatedBillingHistory.js +26 -0
  18. package/es/types/Interface/api/billingHistory/QueryPaginatedBillingHistory.js.map +1 -0
  19. package/es/types/Interface/api/commercialManagement/Read.d.ts +5 -0
  20. package/es/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
  21. package/es/types/Interface/api/commercialManagement/Read.js.map +1 -1
  22. package/es/types/Interface/api/facturation/CreateRebilling.d.ts +11 -0
  23. package/es/types/Interface/api/facturation/CreateRebilling.d.ts.map +1 -0
  24. package/es/types/Interface/api/facturation/CreateRebilling.js +58 -0
  25. package/es/types/Interface/api/facturation/CreateRebilling.js.map +1 -0
  26. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.d.ts +2 -2
  27. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.d.ts.map +1 -1
  28. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js +2 -2
  29. package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js.map +1 -1
  30. package/es/types/Interface/api/pdf/ReadPdfizer.d.ts +35 -0
  31. package/es/types/Interface/api/pdf/ReadPdfizer.d.ts.map +1 -0
  32. package/es/types/Interface/api/pdf/ReadPdfizer.js +2 -0
  33. package/es/types/Interface/api/pdf/ReadPdfizer.js.map +1 -0
  34. package/es/types/Interface/api/society/QueryPaginatedSocietyWithFacturation.d.ts +11 -0
  35. package/es/types/Interface/api/society/QueryPaginatedSocietyWithFacturation.d.ts.map +1 -0
  36. package/es/types/Interface/api/society/QueryPaginatedSocietyWithFacturation.js +62 -0
  37. package/es/types/Interface/api/society/QueryPaginatedSocietyWithFacturation.js.map +1 -0
  38. package/es/types/Interface/api/society/QuerySociety.d.ts.map +1 -1
  39. package/es/types/Interface/api/society/QuerySociety.js +3 -1
  40. package/es/types/Interface/api/society/QuerySociety.js.map +1 -1
  41. package/es/types/Interface/models/IBillingHistory.d.ts +18 -0
  42. package/es/types/Interface/models/IBillingHistory.d.ts.map +1 -0
  43. package/es/types/Interface/models/IBillingHistory.js +2 -0
  44. package/es/types/Interface/models/IBillingHistory.js.map +1 -0
  45. package/es/types/Interface/models/IExercice.d.ts +1 -0
  46. package/es/types/Interface/models/IExercice.d.ts.map +1 -1
  47. package/es/types/Interface/models/IExercice.js.map +1 -1
  48. package/es/types/Interface/models/ISociety.d.ts +3 -2
  49. package/es/types/Interface/models/ISociety.d.ts.map +1 -1
  50. package/es/types/Interface/models/ISociety.js.map +1 -1
  51. package/es/types/Interface/models/IThirdParty.d.ts +1 -0
  52. package/es/types/Interface/models/IThirdParty.d.ts.map +1 -1
  53. package/es/types/Interface/models/IThirdParty.js.map +1 -1
  54. package/es/types/index.d.ts +5 -0
  55. package/es/types/index.d.ts.map +1 -1
  56. package/es/types/index.js +5 -0
  57. package/es/types/index.js.map +1 -1
  58. package/es/utils/commercialManagement/document.d.ts.map +1 -1
  59. package/es/utils/commercialManagement/document.js +3 -1
  60. package/es/utils/commercialManagement/document.js.map +1 -1
  61. package/es/utils/commercialManagement/templates/body.d.ts.map +1 -1
  62. package/es/utils/commercialManagement/templates/body.js +4 -3
  63. package/es/utils/commercialManagement/templates/body.js.map +1 -1
  64. package/es/utils/commercialManagement/templates/common.js +1 -1
  65. package/es/utils/commercialManagement/templates/common.js.map +1 -1
  66. package/es/utils/commercialManagement/thirdParty.d.ts +3 -0
  67. package/es/utils/commercialManagement/thirdParty.d.ts.map +1 -0
  68. package/es/utils/commercialManagement/thirdParty.js +7 -0
  69. package/es/utils/commercialManagement/thirdParty.js.map +1 -0
  70. package/js/api/resources/Facturation.js +34 -0
  71. package/js/api/resources/Facturation.js.map +1 -0
  72. package/js/api/resources.js +3 -0
  73. package/js/api/resources.js.map +1 -1
  74. package/js/types/Enum/Country.js +1210 -13
  75. package/js/types/Enum/Country.js.map +1 -1
  76. package/js/types/Enum/TimeCounterType.js +7 -7
  77. package/js/types/Enum/TimeCounterType.js.map +1 -1
  78. package/js/types/Interface/api/billingHistory/QueryPaginatedBillingHistory.js +35 -0
  79. package/js/types/Interface/api/billingHistory/QueryPaginatedBillingHistory.js.map +1 -0
  80. package/js/types/Interface/api/facturation/CreateRebilling.js +45 -0
  81. package/js/types/Interface/api/facturation/CreateRebilling.js.map +1 -0
  82. package/js/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js +1 -1
  83. package/js/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js.map +1 -1
  84. package/js/types/Interface/api/pdf/ReadPdfizer.js +6 -0
  85. package/js/types/Interface/api/pdf/ReadPdfizer.js.map +1 -0
  86. package/js/types/Interface/api/society/QueryPaginatedSocietyWithFacturation.js +47 -0
  87. package/js/types/Interface/api/society/QueryPaginatedSocietyWithFacturation.js.map +1 -0
  88. package/js/types/Interface/api/society/QuerySociety.js +2 -2
  89. package/js/types/Interface/api/society/QuerySociety.js.map +1 -1
  90. package/js/types/Interface/models/IBillingHistory.js +6 -0
  91. package/js/types/Interface/models/IBillingHistory.js.map +1 -0
  92. package/js/types/index.js +60 -0
  93. package/js/types/index.js.map +1 -1
  94. package/js/utils/commercialManagement/document.js +4 -0
  95. package/js/utils/commercialManagement/document.js.map +1 -1
  96. package/js/utils/commercialManagement/templates/body.js +4 -3
  97. package/js/utils/commercialManagement/templates/body.js.map +1 -1
  98. package/js/utils/commercialManagement/templates/common.js +1 -1
  99. package/js/utils/commercialManagement/templates/common.js.map +1 -1
  100. package/js/utils/commercialManagement/thirdParty.js +20 -0
  101. package/js/utils/commercialManagement/thirdParty.js.map +1 -0
  102. package/package.json +1 -1
  103. package/ts/api/resources/Facturation.ts +18 -0
  104. package/ts/api/resources.ts +2 -0
  105. package/ts/types/Enum/Country.ts +478 -3
  106. package/ts/types/Enum/TimeCounterType.ts +7 -7
  107. package/ts/types/Interface/api/billingHistory/QueryPaginatedBillingHistory.ts +16 -0
  108. package/ts/types/Interface/api/commercialManagement/Read.ts +6 -0
  109. package/ts/types/Interface/api/facturation/CreateRebilling.ts +42 -0
  110. package/ts/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.ts +3 -3
  111. package/ts/types/Interface/api/pdf/ReadPdfizer.ts +10 -0
  112. package/ts/types/Interface/api/society/QueryPaginatedSocietyWithFacturation.ts +46 -0
  113. package/ts/types/Interface/api/society/QuerySociety.ts +3 -1
  114. package/ts/types/Interface/models/IBillingHistory.ts +21 -0
  115. package/ts/types/Interface/models/IExercice.ts +1 -0
  116. package/ts/types/Interface/models/ISociety.ts +3 -2
  117. package/ts/types/Interface/models/IThirdParty.ts +1 -0
  118. package/ts/types/index.ts +5 -0
  119. package/ts/utils/commercialManagement/document.ts +4 -0
  120. package/ts/utils/commercialManagement/templates/body.ts +4 -3
  121. package/ts/utils/commercialManagement/templates/common.ts +1 -1
  122. package/ts/utils/commercialManagement/thirdParty.ts +11 -0
@@ -0,0 +1,46 @@
1
+ import {
2
+ IsInt, IsOptional, IsString,
3
+ } from 'class-validator';
4
+ import { ApiPropertyOptional } from '../../../../utils';
5
+
6
+ export class QueryPaginatedSocietyWithFacturation {
7
+ @ApiPropertyOptional()
8
+ @IsOptional()
9
+ @IsString()
10
+ search?: string;
11
+
12
+ @ApiPropertyOptional()
13
+ @IsOptional()
14
+ @IsInt()
15
+ day?: number;
16
+
17
+ @ApiPropertyOptional()
18
+ @IsOptional()
19
+ @IsInt()
20
+ month?: number;
21
+
22
+ @ApiPropertyOptional()
23
+ @IsOptional()
24
+ @IsInt()
25
+ year?: number;
26
+
27
+ @ApiPropertyOptional()
28
+ @IsOptional()
29
+ @IsInt()
30
+ idUser?: number;
31
+
32
+ @ApiPropertyOptional()
33
+ @IsOptional()
34
+ @IsInt()
35
+ idBillingState?: number;
36
+
37
+ @ApiPropertyOptional({ default: 20 })
38
+ @IsOptional()
39
+ @IsInt()
40
+ limit?: number;
41
+
42
+ @ApiPropertyOptional({ default: 1 })
43
+ @IsOptional()
44
+ @IsInt()
45
+ page?: number;
46
+ }
@@ -1,4 +1,4 @@
1
- import { IsIn } from 'class-validator';
1
+ import { IsIn, IsOptional } from 'class-validator';
2
2
  import { ApiPropertyOptional } from '../../../../utils/decorators';
3
3
 
4
4
  export class QuerySociety {
@@ -6,9 +6,11 @@ export class QuerySociety {
6
6
  id?: number;
7
7
 
8
8
  @ApiPropertyOptional()
9
+ @IsOptional()
9
10
  attributes?: string[];
10
11
 
11
12
  @ApiPropertyOptional()
13
+ @IsOptional()
12
14
  @IsIn(['brandType', 'societyGescom', 'societyBank', 'societyDetails', 'oldExpertInfo', 'activity', 'follows', 'compta', 'subscriptionType', 'nafCode', 'connector', 'societyCgv', 'societyConfig', 'exercices', 'businessPartners'], { each: true })
13
15
  include?: string[];
14
16
  }
@@ -0,0 +1,21 @@
1
+ import { IUser } from './IUser';
2
+ import { IExercice, ISociety } from '../..';
3
+
4
+ // comments
5
+ export interface IBillingHistory {
6
+ id?: number;
7
+ totalAmount: number;
8
+ numberOfMonths: number;
9
+ comment: string;
10
+ hasToBeAccruals?: boolean;
11
+ idUser?: number | null;
12
+ idSociety?: number | null;
13
+ idExercice?: number | null;
14
+ createdAt?: Date | null;
15
+ updatedAt?: Date | null;
16
+
17
+ // Associations
18
+ user?: IUser;
19
+ society?: ISociety;
20
+ exercice?: IExercice;
21
+ }
@@ -33,6 +33,7 @@ export interface IExercice {
33
33
  receiptJeDeclare: boolean;
34
34
  annualFolderEdition: boolean;
35
35
  turnoverDone: string;
36
+ turnoverMax?: string;
36
37
  processClossingExercice: boolean;
37
38
  idFilePaymentSchedule?: number | null;
38
39
  isDefault: boolean;
@@ -48,7 +48,7 @@ import { ISms } from './ISms';
48
48
  import { IUser } from './IUser';
49
49
  import { ISocietyEvent } from './ISocietyEvent';
50
50
  import {
51
- ComptaType, Country, INafCode, IPartneredAccountantCompanyService, Sector, UnpaidDetail, IPartneredAccountantToSociety, IMail, IAccountingTransaction, IFecFile, IGedFile, IBusinessPartner,
51
+ ComptaType, CountryId, INafCode, IPartneredAccountantCompanyService, Sector, UnpaidDetail, IPartneredAccountantToSociety, IMail, IAccountingTransaction, IFecFile, IGedFile, IBusinessPartner, IPaymentSchedule,
52
52
  } from '../..';
53
53
  import { IBrandType } from './IBrandType';
54
54
 
@@ -112,7 +112,7 @@ export interface ISociety {
112
112
  idComptaType: ComptaType | null;
113
113
  idTypeBrand: number | null;
114
114
  idSubscriptionType: number | null;
115
- idCountry: Country | null;
115
+ idCountry: CountryId | null;
116
116
  idSector: Sector | null;
117
117
  idSocietyNotes: number | null;
118
118
  folderNote: string | null;
@@ -158,6 +158,7 @@ export interface ISociety {
158
158
  societiesFollowedQualityMail?: IFollowedQualityMail[];
159
159
  societyFollow?: IFollow[];
160
160
  paymentsExpectations?: IPaymentExpectation[];
161
+ paymentSchedules?: IPaymentSchedule[];
161
162
  legalForm?: ILegalForm;
162
163
  oldExpertInfo?: IOldExpertInfo;
163
164
  prestationsSocieties?: IPrestation[];
@@ -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
@@ -49,6 +49,7 @@ export * from './Interface/models/ICivility';
49
49
  export * from './Interface/models/IErrorCode';
50
50
  export * from './Interface/models/IColor';
51
51
  export * from './Interface/models/IComment';
52
+ export * from './Interface/models/IBillingHistory';
52
53
  export * from './Interface/models/IConnector';
53
54
  export * from './Interface/models/ICotation';
54
55
  export * from './Interface/models/ICountry';
@@ -518,6 +519,9 @@ export * from './Interface/api/society/SocietyWithStatsCaParams';
518
519
  export * from './Interface/api/society/QuerySociety';
519
520
  export * from './Interface/api/society/QueryPaginatedSociety';
520
521
  export * from './Interface/api/society/QueryPaginatedSocietyWithStatsCa';
522
+ export * from './Interface/api/society/QueryPaginatedSocietyWithFacturation';
523
+ export * from './Interface/api/billingHistory/QueryPaginatedBillingHistory';
524
+ export * from './Interface/api/facturation/CreateRebilling';
521
525
  export * from './Interface/api/commercial/QueryGetStats';
522
526
  export * from './Interface/api/commercial/QueryFetchDialogDatasInfosOk';
523
527
  export * from './Interface/api/commercial/QueryMovePrestationsToNextMonth';
@@ -824,6 +828,7 @@ export * from './Interface/api/legalNotice/UpdateLegalNotice';
824
828
  export * from './Interface/api/wallet/QueryWallet';
825
829
  export * from './Interface/api/terminationList/QueryTerminationList';
826
830
  export * from './Interface/api/terminationList/DestroyTerminationList';
831
+ export * from './Interface/api/pdf/ReadPdfizer';
827
832
 
828
833
  // Enums types
829
834
  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
+ }