@silexpert/core 1.0.41 → 1.0.44

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 (70) hide show
  1. package/es/api/resources/Loan.js +1 -1
  2. package/es/api/resources/Loan.js.map +1 -1
  3. package/es/api/resources/SocietyConfig.d.ts +7 -0
  4. package/es/api/resources/SocietyConfig.d.ts.map +1 -0
  5. package/es/api/resources/SocietyConfig.js +10 -0
  6. package/es/api/resources/SocietyConfig.js.map +1 -0
  7. package/es/api/resources.d.ts +2 -0
  8. package/es/api/resources.d.ts.map +1 -1
  9. package/es/api/resources.js +2 -0
  10. package/es/api/resources.js.map +1 -1
  11. package/es/types/Enum/ProductType.d.ts +10 -0
  12. package/es/types/Enum/ProductType.d.ts.map +1 -1
  13. package/es/types/Enum/ProductType.js +23 -3
  14. package/es/types/Enum/ProductType.js.map +1 -1
  15. package/es/types/Enum/Unit.d.ts +31 -0
  16. package/es/types/Enum/Unit.d.ts.map +1 -1
  17. package/es/types/Enum/Unit.js +141 -22
  18. package/es/types/Enum/Unit.js.map +1 -1
  19. package/es/types/Interface/api/commercialManagement/Create.d.ts +1 -1
  20. package/es/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  21. package/es/types/Interface/api/commercialManagement/Create.js +1 -2
  22. package/es/types/Interface/api/commercialManagement/Create.js.map +1 -1
  23. package/es/types/Interface/api/commercialManagement/Read.d.ts +1 -1
  24. package/es/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
  25. package/es/types/Interface/api/commercialManagement/Read.js.map +1 -1
  26. package/es/types/Interface/api/societyConfig/update.d.ts +21 -0
  27. package/es/types/Interface/api/societyConfig/update.d.ts.map +1 -0
  28. package/es/types/Interface/api/societyConfig/update.js +131 -0
  29. package/es/types/Interface/api/societyConfig/update.js.map +1 -0
  30. package/es/types/index.d.ts +1 -0
  31. package/es/types/index.d.ts.map +1 -1
  32. package/es/types/index.js +1 -0
  33. package/es/types/index.js.map +1 -1
  34. package/es/utils/commercialManagement/document.d.ts.map +1 -1
  35. package/es/utils/commercialManagement/document.js +13 -13
  36. package/es/utils/commercialManagement/document.js.map +1 -1
  37. package/es/utils/commercialManagement/templates/common.js +2 -2
  38. package/es/utils/commercialManagement/templates/common.js.map +1 -1
  39. package/js/api/resources/Loan.js +1 -1
  40. package/js/api/resources/Loan.js.map +1 -1
  41. package/js/api/resources/SocietyConfig.js +22 -0
  42. package/js/api/resources/SocietyConfig.js.map +1 -0
  43. package/js/api/resources.js +4 -1
  44. package/js/api/resources.js.map +1 -1
  45. package/js/types/Enum/ProductType.js +21 -3
  46. package/js/types/Enum/ProductType.js.map +1 -1
  47. package/js/types/Enum/Unit.js +123 -22
  48. package/js/types/Enum/Unit.js.map +1 -1
  49. package/js/types/Interface/api/commercialManagement/Create.js +1 -1
  50. package/js/types/Interface/api/commercialManagement/Create.js.map +1 -1
  51. package/js/types/Interface/api/societyConfig/update.js +65 -0
  52. package/js/types/Interface/api/societyConfig/update.js.map +1 -0
  53. package/js/types/index.js +12 -0
  54. package/js/types/index.js.map +1 -1
  55. package/js/utils/commercialManagement/document.js +30 -24
  56. package/js/utils/commercialManagement/document.js.map +1 -1
  57. package/js/utils/commercialManagement/templates/common.js +2 -2
  58. package/js/utils/commercialManagement/templates/common.js.map +1 -1
  59. package/package.json +1 -1
  60. package/ts/api/resources/Loan.ts +1 -1
  61. package/ts/api/resources/SocietyConfig.ts +12 -0
  62. package/ts/api/resources.ts +2 -0
  63. package/ts/types/Enum/ProductType.ts +26 -3
  64. package/ts/types/Enum/Unit.ts +145 -23
  65. package/ts/types/Interface/api/commercialManagement/Create.ts +1 -2
  66. package/ts/types/Interface/api/commercialManagement/Read.ts +1 -1
  67. package/ts/types/Interface/api/societyConfig/update.ts +103 -0
  68. package/ts/types/index.ts +1 -0
  69. package/ts/utils/commercialManagement/document.ts +6 -0
  70. package/ts/utils/commercialManagement/templates/common.ts +2 -2
@@ -6,100 +6,222 @@ export interface IUnit {
6
6
  }
7
7
  }
8
8
 
9
+ export enum UnitId {
10
+ ITEM = 1,
11
+ HOUR = 2,
12
+ DAY = 3,
13
+ KILOGRAM = 4,
14
+ LITER = 5,
15
+ KILOMETER = 6,
16
+ HALF_DAY = 7,
17
+ YEAR = 8,
18
+ WEEK = 9,
19
+ MONTH = 10,
20
+ QUARTER = 11,
21
+ PIECE = 12,
22
+ FIXED = 13,
23
+ SQUARE_METER = 14,
24
+ CUBIC_METER = 15,
25
+ METER = 16,
26
+ SUBSCRIPTION = 17,
27
+ NIGHT = 18,
28
+ TON = 19,
29
+ }
30
+
31
+ export type IUnitList = Array<{ name: string; id: number; shortName: string; }>;
32
+
9
33
  export const Unit: IUnit = {
10
34
  ITEM: {
11
- id: 1,
35
+ id: UnitId.ITEM,
12
36
  name: 'Article',
13
- shortName: 'Art',
37
+ shortName: 'art',
14
38
  },
15
39
  HOUR: {
16
- id: 2,
40
+ id: UnitId.HOUR,
17
41
  name: 'Heure',
18
42
  shortName: 'h',
19
43
  },
20
44
  DAY: {
21
- id: 3,
45
+ id: UnitId.DAY,
22
46
  name: 'Jour',
23
47
  shortName: 'j',
24
48
  },
25
49
  KILOGRAM: {
26
- id: 4,
50
+ id: UnitId.KILOGRAM,
27
51
  name: 'Kilogramme',
28
52
  shortName: 'kg',
29
53
  },
30
54
  LITER: {
31
- id: 5,
55
+ id: UnitId.LITER,
32
56
  name: 'Litre',
33
57
  shortName: 'l',
34
58
  },
35
59
  KILOMETER: {
36
- id: 6,
60
+ id: UnitId.KILOMETER,
37
61
  name: 'Kilomètres',
38
62
  shortName: 'km',
39
63
  },
40
64
  HALF_DAY: {
41
- id: 7,
65
+ id: UnitId.HALF_DAY,
42
66
  name: 'Demi journée',
43
67
  shortName: 'demi j',
44
68
  },
45
69
  YEAR: {
46
- id: 8,
70
+ id: UnitId.YEAR,
47
71
  name: 'Année',
48
72
  shortName: 'an',
49
73
  },
50
74
  WEEK: {
51
- id: 9,
75
+ id: UnitId.WEEK,
52
76
  name: 'Semaine',
53
77
  shortName: 'sem',
54
78
  },
55
79
  MONTH: {
56
- id: 10,
80
+ id: UnitId.MONTH,
57
81
  name: 'Mois',
58
82
  shortName: 'mois',
59
83
  },
60
84
  QUARTER: {
61
- id: 11,
85
+ id: UnitId.QUARTER,
62
86
  name: 'Trimestre',
63
- shortName: 'trst,',
87
+ shortName: 'trim',
64
88
  },
65
89
  PIECE: {
66
- id: 12,
90
+ id: UnitId.PIECE,
67
91
  name: 'Pièce',
68
92
  shortName: 'p',
69
93
  },
70
94
  FIXED: {
71
- id: 13,
95
+ id: UnitId.FIXED,
72
96
  name: 'Forfaitaire',
73
97
  shortName: 'f',
74
98
  },
75
99
  SQUARE_METER: {
76
- id: 14,
100
+ id: UnitId.SQUARE_METER,
77
101
  name: 'Mètre carré',
78
102
  shortName: 'm2',
79
103
  },
80
104
  CUBIC_METER: {
81
- id: 15,
105
+ id: UnitId.CUBIC_METER,
82
106
  name: 'Mètre cube',
83
107
  shortName: 'm3',
84
108
  },
85
109
  METER: {
86
- id: 16,
110
+ id: UnitId.METER,
87
111
  name: 'Mètre',
88
112
  shortName: 'm',
89
113
  },
90
- SUBSCROPTION: {
91
- id: 17,
114
+ SUBSCRIPTION: {
115
+ id: UnitId.SUBSCRIPTION,
92
116
  name: 'Abonnement',
93
117
  shortName: 'abo',
94
118
  },
95
119
  NIGHT: {
96
- id: 18,
120
+ id: UnitId.NIGHT,
97
121
  name: 'Nuitée',
98
122
  shortName: 'nuit',
99
123
  },
100
124
  TON: {
101
- id: 19,
125
+ id: UnitId.TON,
126
+ name: 'Tonne',
127
+ shortName: 't',
128
+ },
129
+ };
130
+
131
+ export const UnitList = [
132
+ {
133
+ id: UnitId.ITEM,
134
+ name: 'Article',
135
+ shortName: 'art',
136
+ },
137
+ {
138
+ id: UnitId.HOUR,
139
+ name: 'Heure',
140
+ shortName: 'h',
141
+ },
142
+ {
143
+ id: UnitId.DAY,
144
+ name: 'Jour',
145
+ shortName: 'j',
146
+ },
147
+ {
148
+ id: UnitId.KILOGRAM,
149
+ name: 'Kilogramme',
150
+ shortName: 'kg',
151
+ },
152
+ {
153
+ id: UnitId.LITER,
154
+ name: 'Litre',
155
+ shortName: 'l',
156
+ },
157
+ {
158
+ id: UnitId.KILOMETER,
159
+ name: 'Kilomètres',
160
+ shortName: 'km',
161
+ },
162
+ {
163
+ id: UnitId.HALF_DAY,
164
+ name: 'Demi journée',
165
+ shortName: 'demi j',
166
+ },
167
+ {
168
+ id: UnitId.YEAR,
169
+ name: 'Année',
170
+ shortName: 'an',
171
+ },
172
+ {
173
+ id: UnitId.WEEK,
174
+ name: 'Semaine',
175
+ shortName: 'sem',
176
+ },
177
+ {
178
+ id: UnitId.MONTH,
179
+ name: 'Mois',
180
+ shortName: 'mois',
181
+ },
182
+ {
183
+ id: UnitId.QUARTER,
184
+ name: 'Trimestre',
185
+ shortName: 'trim',
186
+ },
187
+ {
188
+ id: UnitId.PIECE,
189
+ name: 'Pièce',
190
+ shortName: 'p',
191
+ },
192
+ {
193
+ id: UnitId.FIXED,
194
+ name: 'Forfaitaire',
195
+ shortName: 'f',
196
+ },
197
+ {
198
+ id: UnitId.SQUARE_METER,
199
+ name: 'Mètre carré',
200
+ shortName: 'm2',
201
+ },
202
+ {
203
+ id: UnitId.CUBIC_METER,
204
+ name: 'Mètre cube',
205
+ shortName: 'm3',
206
+ },
207
+ {
208
+ id: UnitId.METER,
209
+ name: 'Mètre',
210
+ shortName: 'm',
211
+ },
212
+ {
213
+ id: UnitId.SUBSCRIPTION,
214
+ name: 'Abonnement',
215
+ shortName: 'abo',
216
+ },
217
+ {
218
+ id: UnitId.NIGHT,
219
+ name: 'Nuitée',
220
+ shortName: 'nuit',
221
+ },
222
+ {
223
+ id: UnitId.TON,
102
224
  name: 'Tonne',
103
225
  shortName: 't',
104
226
  },
105
- };
227
+ ];
@@ -282,8 +282,7 @@ export class CommercialDocumentInputs {
282
282
  products: Array<IProductInvoiceToCreate>;
283
283
 
284
284
  @ApiProperty({ description: 'Escompte' })
285
- @IsString()
286
- discount: string;
285
+ discount: string | null;
287
286
 
288
287
  @ApiProperty()
289
288
  comment: string | null;
@@ -33,7 +33,7 @@ export type ReadVatEditing = {
33
33
  };
34
34
 
35
35
  export type ReadDocumentEditing = CommercialDocumentInputs & {
36
- title?: string;
36
+ title?: string | null;
37
37
  idEstimateInvoiceType: EstimateInvoiceType;
38
38
  phoneContact: string | null;
39
39
  dueDateFormatted: string | null;
@@ -0,0 +1,103 @@
1
+ import { IsBoolean, IsOptional } from 'class-validator';
2
+ import { ApiPropertyOptional } from '../../../../utils';
3
+ import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
4
+
5
+ export class UpdateSocietyConfig {
6
+ @ApiPropertyOptional()
7
+ @IsBoolean()
8
+ @ToBoolean()
9
+ @IsOptional()
10
+ disableExport?: boolean;
11
+
12
+ @ApiPropertyOptional()
13
+ @IsBoolean()
14
+ @ToBoolean()
15
+ @IsOptional()
16
+ noVat?: boolean;
17
+
18
+ @ApiPropertyOptional()
19
+ @IsOptional()
20
+ dateActiveVat?: Date | null;
21
+
22
+ @ApiPropertyOptional()
23
+ @IsOptional()
24
+ logo?: string | null;
25
+
26
+ @ApiPropertyOptional()
27
+ @IsBoolean()
28
+ @ToBoolean()
29
+ @IsOptional()
30
+ adjournment?: boolean;
31
+
32
+ @ApiPropertyOptional()
33
+ @IsBoolean()
34
+ @ToBoolean()
35
+ @IsOptional()
36
+ acceptCgv?: boolean;
37
+
38
+ @ApiPropertyOptional()
39
+ @IsBoolean()
40
+ @ToBoolean()
41
+ @IsOptional()
42
+ showWelcomeModal?: boolean;
43
+
44
+ @ApiPropertyOptional()
45
+ @IsBoolean()
46
+ @ToBoolean()
47
+ @IsOptional()
48
+ modalNews?: boolean;
49
+
50
+ @ApiPropertyOptional()
51
+ @IsOptional()
52
+ typeMicroentreprise?: number | null;
53
+
54
+ @ApiPropertyOptional()
55
+ @IsBoolean()
56
+ @ToBoolean()
57
+ @IsOptional()
58
+ showTipSchedule?: boolean;
59
+
60
+ @ApiPropertyOptional()
61
+ @IsOptional()
62
+ defaultBa?: number | null;
63
+
64
+ @ApiPropertyOptional()
65
+ @IsOptional()
66
+ salesType?: number | null;
67
+
68
+ @ApiPropertyOptional()
69
+ @IsBoolean()
70
+ @ToBoolean()
71
+ @IsOptional()
72
+ noShowModalAnnotation?: boolean;
73
+
74
+ @ApiPropertyOptional()
75
+ @IsBoolean()
76
+ @ToBoolean()
77
+ @IsOptional()
78
+ emailAgreement?: boolean;
79
+
80
+ @ApiPropertyOptional()
81
+ @IsBoolean()
82
+ @ToBoolean()
83
+ @IsOptional()
84
+ clicPaiement?: boolean;
85
+
86
+ @ApiPropertyOptional()
87
+ @IsBoolean()
88
+ @ToBoolean()
89
+ @IsOptional()
90
+ mailIdepotStatus?: boolean;
91
+
92
+ @ApiPropertyOptional()
93
+ @IsBoolean()
94
+ @ToBoolean()
95
+ @IsOptional()
96
+ mobileRegister?: boolean;
97
+
98
+ @ApiPropertyOptional()
99
+ @IsBoolean()
100
+ @ToBoolean()
101
+ @IsOptional()
102
+ registeredFromWebsite?: boolean;
103
+ }
package/ts/types/index.ts CHANGED
@@ -787,6 +787,7 @@ export * from './Interface/api/qonto/ProcessBankAccount';
787
787
  export * from './Interface/api/qonto/ReadCreateConnection';
788
788
  export * from './Interface/api/file/Create';
789
789
  export * from './Interface/api/file/Read';
790
+ export * from './Interface/api/societyConfig/update';
790
791
 
791
792
  // Enums types
792
793
  export * from './Interface/enum/Util';
@@ -23,6 +23,11 @@ export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoic
23
23
  ...payload,
24
24
  paymentLink: payload.paymentLink ?? '#',
25
25
  idEstimateInvoiceType,
26
+ title: payload.title ?? null,
27
+ penalties: payload.penalties ?? null,
28
+ compensation: payload.compensation ?? null,
29
+ discount: payload.discount ?? null,
30
+ vatMention: payload.vatMention ?? null,
26
31
  phoneContact: payload.settings?.phoneContact ?? null,
27
32
  products,
28
33
  vats,
@@ -65,6 +70,7 @@ export function generateAdvanceDocument(payload: CreateInvoiceDocument): ReadCom
65
70
 
66
71
  const data: ReadDocumentEditing = {
67
72
  ...payload,
73
+ title: payload.title ?? null,
68
74
  paymentLink: payload.paymentLink ?? '#',
69
75
  idEstimateInvoiceType: EstimateInvoiceType.ACOMPTE,
70
76
  phoneContact: payload.settings?.phoneContact ?? null,
@@ -73,7 +73,7 @@ export class CommercialDocumentCommonHTML {
73
73
  <% if(product.itemSaleName) { %><p class="product-name"><%= product.itemSaleName %></p><% } %>
74
74
  <% if(product.comment) { %><p class="product-description"><%= product.comment %></p><% } %>
75
75
  </td>
76
- <td class="product-quantity"><%= product.quantity ? product.quantity : '' %><%= product.unitFormatted ? product.unitFormatted : '' %></td>
76
+ <td class="product-quantity"><%= product.quantity ? product.quantity : '' %> <%= product.unitFormatted ? product.unitFormatted : '' %></td>
77
77
  <td class="product-price-without-vat"><% if(product.priceTaxExcludedFormatted) { %><%= product.priceTaxExcludedFormatted + '€' %><% } %></td>
78
78
  <% if (shouldDisplayDiscountColumn) { %>
79
79
  <td class="product-discount">
@@ -188,7 +188,7 @@ export class CommercialDocumentCommonHTML {
188
188
  .pdf-content .logo-placeholder { width: 300px; max-height: 150px;text-align: <%= settings && settings.logoAlignment === 'left' ? 'left' : 'right' %>; margin-bottom: <%= settings && settings.logoAlignment === 'left' ? '10px;' : '0px' %>}
189
189
  .pdf-content .logo-placeholder > svg, .pdf-content .logo-placeholder > img { max-width: 100%; max-height: 150px; }
190
190
  .pdf-content .document-reference { font-size: 20px; }
191
- ..pdf-content customer-border { border: 2px solid #EAEAEA; border-radius: 6px; padding: 7px; }
191
+ .pdf-content .customer-border { border: 2px solid #EAEAEA; border-radius: 6px; padding: 7px; }
192
192
 
193
193
  /* Body */
194
194
  .pdf-content table.commercial-table-preview { border-spacing: 1px; border-collapse: collapse; }