@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.
- package/es/types/Enum/BrandClementine.js +1 -1
- package/es/types/Enum/BrandClementine.js.map +1 -1
- package/es/types/Enum/BrandPourcentage.js +1 -1
- package/es/types/Enum/BrandPourcentage.js.map +1 -1
- package/es/types/Enum/Country.d.ts +238 -2
- package/es/types/Enum/Country.d.ts.map +1 -1
- package/es/types/Enum/Country.js +487 -13
- package/es/types/Enum/Country.js.map +1 -1
- package/es/types/Enum/PrestationOption.d.ts +41 -0
- package/es/types/Enum/PrestationOption.d.ts.map +1 -1
- package/es/types/Enum/PrestationOption.js +41 -0
- package/es/types/Enum/PrestationOption.js.map +1 -1
- package/es/types/Enum/PrestationType.d.ts +1 -1
- package/es/types/Enum/PrestationType.js +1 -1
- package/es/types/Enum/PrestationType.js.map +1 -1
- package/es/types/Enum/TimeCounterType.js +2 -2
- package/es/types/Enum/TimeCounterType.js.map +1 -1
- package/es/types/Interface/api/commercialManagement/Read.d.ts +5 -0
- package/es/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/es/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.d.ts +2 -2
- package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.d.ts.map +1 -1
- package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js +2 -2
- package/es/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js.map +1 -1
- package/es/types/Interface/api/pdf/ReadPdfizer.d.ts +35 -0
- package/es/types/Interface/api/pdf/ReadPdfizer.d.ts.map +1 -0
- package/es/types/Interface/api/pdf/ReadPdfizer.js +2 -0
- package/es/types/Interface/api/pdf/ReadPdfizer.js.map +1 -0
- package/es/types/Interface/api/statistic/QueryInternal.d.ts +5 -0
- package/es/types/Interface/api/statistic/QueryInternal.d.ts.map +1 -0
- package/es/types/Interface/api/statistic/QueryInternal.js +26 -0
- package/es/types/Interface/api/statistic/QueryInternal.js.map +1 -0
- package/es/types/Interface/models/ISociety.d.ts +2 -2
- package/es/types/Interface/models/ISociety.d.ts.map +1 -1
- package/es/types/Interface/models/ISociety.js.map +1 -1
- package/es/types/Interface/models/IThirdParty.d.ts +1 -0
- package/es/types/Interface/models/IThirdParty.d.ts.map +1 -1
- package/es/types/Interface/models/IThirdParty.js.map +1 -1
- package/es/types/index.d.ts +2 -0
- package/es/types/index.d.ts.map +1 -1
- package/es/types/index.js +2 -0
- package/es/types/index.js.map +1 -1
- package/es/utils/commercialManagement/document.d.ts.map +1 -1
- package/es/utils/commercialManagement/document.js +3 -1
- package/es/utils/commercialManagement/document.js.map +1 -1
- package/es/utils/commercialManagement/templates/body.d.ts.map +1 -1
- package/es/utils/commercialManagement/templates/body.js +4 -3
- package/es/utils/commercialManagement/templates/body.js.map +1 -1
- package/es/utils/commercialManagement/templates/common.js +1 -1
- package/es/utils/commercialManagement/templates/common.js.map +1 -1
- package/es/utils/commercialManagement/thirdParty.d.ts +3 -0
- package/es/utils/commercialManagement/thirdParty.d.ts.map +1 -0
- package/es/utils/commercialManagement/thirdParty.js +7 -0
- package/es/utils/commercialManagement/thirdParty.js.map +1 -0
- package/js/types/Enum/BrandClementine.js +1 -1
- package/js/types/Enum/BrandClementine.js.map +1 -1
- package/js/types/Enum/BrandPourcentage.js +1 -1
- package/js/types/Enum/BrandPourcentage.js.map +1 -1
- package/js/types/Enum/Country.js +1210 -13
- package/js/types/Enum/Country.js.map +1 -1
- package/js/types/Enum/PrestationOption.js +48 -4
- package/js/types/Enum/PrestationOption.js.map +1 -1
- package/js/types/Enum/PrestationType.js +1 -1
- package/js/types/Enum/PrestationType.js.map +1 -1
- package/js/types/Enum/TimeCounterType.js +2 -2
- package/js/types/Enum/TimeCounterType.js.map +1 -1
- package/js/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js +1 -1
- package/js/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.js.map +1 -1
- package/js/types/Interface/api/pdf/ReadPdfizer.js +6 -0
- package/js/types/Interface/api/pdf/ReadPdfizer.js.map +1 -0
- package/js/types/Interface/api/statistic/QueryInternal.js +31 -0
- package/js/types/Interface/api/statistic/QueryInternal.js.map +1 -0
- package/js/types/index.js +24 -0
- package/js/types/index.js.map +1 -1
- package/js/utils/commercialManagement/document.js +4 -0
- package/js/utils/commercialManagement/document.js.map +1 -1
- package/js/utils/commercialManagement/templates/body.js +4 -3
- package/js/utils/commercialManagement/templates/body.js.map +1 -1
- package/js/utils/commercialManagement/templates/common.js +1 -1
- package/js/utils/commercialManagement/templates/common.js.map +1 -1
- package/js/utils/commercialManagement/thirdParty.js +20 -0
- package/js/utils/commercialManagement/thirdParty.js.map +1 -0
- package/package.json +1 -1
- package/ts/types/Enum/BrandClementine.ts +1 -1
- package/ts/types/Enum/BrandPourcentage.ts +1 -1
- package/ts/types/Enum/Country.ts +478 -3
- package/ts/types/Enum/PrestationOption.ts +42 -0
- package/ts/types/Enum/PrestationType.ts +1 -1
- package/ts/types/Enum/TimeCounterType.ts +2 -2
- package/ts/types/Interface/api/commercialManagement/Read.ts +6 -0
- package/ts/types/Interface/api/partneredAccountant/CreatePartneredAccountantSociety.ts +3 -3
- package/ts/types/Interface/api/pdf/ReadPdfizer.ts +10 -0
- package/ts/types/Interface/api/statistic/QueryInternal.ts +16 -0
- package/ts/types/Interface/models/ISociety.ts +2 -2
- package/ts/types/Interface/models/IThirdParty.ts +1 -0
- package/ts/types/index.ts +2 -0
- package/ts/utils/commercialManagement/document.ts +4 -0
- package/ts/utils/commercialManagement/templates/body.ts +4 -3
- package/ts/utils/commercialManagement/templates/common.ts +1 -1
- package/ts/utils/commercialManagement/thirdParty.ts +11 -0
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
|
|
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
|
+
}
|