@silexpert/core 2.0.122 → 2.0.123

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.
@@ -1,5 +1,5 @@
1
1
  import { t as __name } from "../rolldown-runtime-BhWHdk3m.mjs";
2
- import { $q as ReadCommercialMailTemplate, JJ as CreateInvoiceDocument, Qq as ReadCommercialDocumentTemplate, YJ as CreateMailHeader, ZJ as CreatePreSaleDocument, gX as EstimateInvoiceType, lW as IUser } from "../index-BTRchHCY.mjs";
2
+ import { _W as IUser, aY as CreatePreSaleDocument, nY as CreateInvoiceDocument, oJ as ReadCommercialDocumentTemplate, rY as CreateMailHeader, sJ as ReadCommercialMailTemplate, wX as EstimateInvoiceType } from "../index-DY6JXj66.mjs";
3
3
  import "dayjs/locale/fr.js";
4
4
  //#region ts/utils/email.d.ts
5
5
  export declare function getHoraires(user: IUser): "Du lundi au vendredi de 9h à 18h" | "Du lundi au jeudi de 9h à 17h<br/>Le vendredi de 9h à 12h";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../ts/utils/email.ts","../../ts/utils/commercialManagement/document.ts"],"mappings":";;;;wBAmIgB,YAAY,MAAM;wBA2FlB,kBAAkB;;;wBCnLlB,2BACd,uBAAuB,qBACvB,SAAS,wBAAwB,uBACjC,+BACA,+BACC;wBAuJa,mBACd,QAAQ,kBACR,+BACA,+BACC;;;;wBAwCa,mCAAmC,SAAS,wBAAwB;EAClF;EACA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../ts/utils/email.ts","../../ts/utils/commercialManagement/document.ts"],"mappings":";;;;wBAmIgB,YAAY,MAAM;wBA2FlB,kBAAkB;;;wBCnLlB,2BACd,uBAAuB,qBACvB,SAAS,wBAAwB,uBACjC,+BACA,+BACC;wBAgNa,mBACd,QAAQ,kBACR,+BACA,+BACC;;;;wBAwCa,mCAAmC,SAAS,wBAAwB;EAClF;EACA"}
@@ -248,7 +248,7 @@ class="signatureClementine">
248
248
  Les informations contenues dans ce courrier électronique et ses pièces jointes sont confidentielles et couvertes par le secret professionnel. Si vous n'êtes pas le(s) destinataire(s) ou avez reçu ce courrier électronique par erreur, merci de bien vouloir supprimer l'email et d'en informer l'expéditeur dès que possible. Ce courrier électronique ne peut pas être divulgué, utilisé ou copié par quelqu'un d'autre que le(s) destinataire(s).
249
249
  </td>
250
250
  </tr>
251
- </table>`,{forceRole:o,isFacturation:a.roles?a.roles.some(e=>e.id===34):!1,isDataOfficer:!a.roles||a.roles.some(e=>e.id===51),brandName:d,brandPostalAddress:p,brandCity:f,idTypeBrand:n,commercialName:m,iban:h,bic:g,hostS3:u,user:a,roleSignature:j,mailSignature:M,phoneSignature:m!==`Comptalib`&&N?N.replace(/\s+/gm,`&nbsp;`):null,standardPhoneSignature:m===`Comptalib`?null:D.replace(/\s+/gm,`&nbsp;`),horaires:P,primaryColor:E,supportMail:C})}var CommercialDocumentCommonHTML=class{header=`<style>html {
251
+ </table>`,{forceRole:o,isFacturation:a.roles?a.roles.some(e=>e.id===34):!1,isDataOfficer:!a.roles||a.roles.some(e=>e.id===51),brandName:d,brandPostalAddress:p,brandCity:f,idTypeBrand:n,commercialName:m,iban:h,bic:g,hostS3:u,user:a,roleSignature:j,mailSignature:M,phoneSignature:m!==`Comptalib`&&N?N.replace(/\s+/gm,`&nbsp;`):null,standardPhoneSignature:m===`Comptalib`?null:D.replace(/\s+/gm,`&nbsp;`),horaires:P,primaryColor:E,supportMail:C},{})}var CommercialDocumentCommonHTML=class{header=`<style>html {
252
252
  -webkit-print-color-adjust: exact;
253
253
  }</style><% if (settings && settings.isEdgingDisplayed) { %>
254
254
  <span id="header-edging" style="position: absolute; top: 0; left: 0; width: 100vw; font-size: 10px !important; height: 15px; background-color: <%= settings && settings.edgingColor ? settings.edgingColor : '#333333' %>; margin-bottom: 20px;"></span>
@@ -556,7 +556,7 @@ class="signatureClementine">
556
556
  </style>
557
557
  <div style="background-color: <%= brandColors.primary50 %> !important; color: black; width: calc(100% - 48px); display: grid; border-radius: 16px; padding: 24px;">
558
558
  <div style="width: max-content; margin: auto; font-size: 16px; font-family: 'circular std', sans-serif; font-weight: 100; line-height: 140%; position: relative;">
559
- <div style="color: black;"><span style="font-weight: 500;"><%- companyName %></span> <%= languageMail.mail.common.send %>
559
+ <div style="color: black;"><span style="font-weight: 500;"><%= companyName %></span> <%= languageMail.mail.common.send %>
560
560
  <% if(idEstimateInvoiceType) { %>
561
561
  <% if ([1, 5].includes(idEstimateInvoiceType)) { %>
562
562
  <%= languageMail.mail.invoice.title %>
@@ -592,7 +592,7 @@ class="signatureClementine">
592
592
  <% } else { %>
593
593
  <%= languageMail.mail.default.subTitle %>
594
594
  <% } %>
595
- <%- reference %>
595
+ <%= reference %>
596
596
  </div>
597
597
  <div style="; color: <%= brandColors.primary500 %>; font-size: 14px;">
598
598
  <%= languageMail.mail.common.dueDate %> : <%- dueDateFormatted %>
@@ -767,5 +767,5 @@ class="signatureClementine">
767
767
  <style>
768
768
  ${w.styleWYSIWYG}
769
769
  </style>
770
- </html>`;function thirdPartyToReadThirdPartyEditing(t){return{...t,country:b(t?.idCountry)?e.find(e=>e.id===t.idCountry)?.name?.toUpperCase()??null:null,deliveryCountry:b(t?.deliveryIdCountry)?e.find(e=>e.id===t.deliveryIdCountry)?.name?.toUpperCase()??null:null}}function generateCommercialDocument(e,r,i=!1,a=void 0){let s=g(r.products.map(e=>d(e),`reorder`)),l=g(Object.values(h(s,`vatFormatted`)).map(e=>u(e),`value`)).filter(e=>e.id!==t.MARGE.id),b=thirdPartyToReadThirdPartyEditing(r.thirdParty),w;if(r.advanceProducts?.length){let e=Object.values(h(r.advanceProducts,`vatFormatted`)).map(e=>u(e),`value`).filter(e=>e.id!==t.MARGE.id);w=l.map(t=>{let n=t.base-(e.find(e=>e.id===t.id)?.base??0),r=t.toPay-(e.find(e=>e.id===t.id)?.toPay??0);return{...t,baseFormatted:m(n),amountFormatted:m(r)}})}let E=v(l,e=>_(e.amount)),D=v(s,`totalTaxExcludedRounded`),O=D+E,k=r.language??`fr`,A=f[k],j=n.find(e=>e.id===r.accountingCategory)?.label??null,M=r.recoveryCost,N={...r,thirdParty:b,paymentLink:r.paymentLink??`#`,idEstimateInvoiceType:e,title:r.title??null,cgv:r.cgv??null,name:r.name??null,number:r.number??null,street:r.street??null,zipCode:r.zipCode??null,city:r.city??null,legalForm:r.legalForm??null,capital:r.capital??null,siren:r.siren??null,rcs:r.rcs??null,vatCode:r.vatCode??null,nafCode:r.nafCode??null,penalties:r.penalties?o(k,r.penalties,`penalties`)??r.penalties:null,termsOfPayment:r.termsOfPayment?o(k,r.termsOfPayment,`termsOfPayment`)??r.termsOfPayment:null,recoveryCost:M?o(k,M,`recoveryCost`)??M:null,discount:r.discount?o(k,r.discount,`discount`)??r.discount:null,vatMention:r.vatMention?o(k,r.vatMention,`vatMention`)??r.vatMention:null,phoneContact:r.settings?.phoneContact??null,products:s,vats:l,totalTaxExcluded:D,totalTaxIncluded:_(O),totalTaxAndDiscountIncluded:_(O),generalDiscountFormatted:r.generalDiscount2?m(r.generalDiscount2):null,depositFormatted:r.deposit?m(r.deposit):null,totalTaxExcludedFormatted:m(D),totalTaxIncludedFormatted:m(O),totalTaxAndDiscountIncludedFormatted:m(O-(r.generalDiscount2??0)-(r.deposit??0)),totalVatAmountFormatted:m(E),font:{id:r.settings?.idFont??1,name:p.find(e=>e.id===r.settings?.idFont)?.name??p[0].name,url:p.find(e=>e.id===r.settings?.idFont)?.link??p[0].link},capitalFormatted:r.capital?`${r.capital}`.split(``).reduceRight((e,t,n,{length:r})=>`${t}${(r-(n+1))%3==0?` `:``}${e}`,``).trim():null,dueDateFormatted:r.dueDate?x(r.dueDate).format(`DD/MM/YYYY`):null,expirationDateFormatted:r.expirationDate?x(r.expirationDate).format(`DD/MM/YYYY`):null,emissionDateFormatted:r.emissionDate?x(r.emissionDate).format(`DD/MM/YYYY`):null,shouldDisplayDiscountColumn:!!s.find(e=>e.discount2&&e.discount2>0),marginVats:y(s.filter(e=>e.marginVatFormatted!==null).map(e=>e.marginVatFormatted)),accountingCategoryFormatted:j?o(k,j,`accountingCategory`)??null:null,brandColors:c({objectWaited:`colors`,nodeEnv:a}),brandName:`${c({objectWaited:`name`,nodeEnv:a})}`,shouldHideBrandName:i,addressComplement:r.addressComplement??null,paymentType:r.paymentType?o(k,r.paymentType,`paymentType`)??r.paymentType:null,languageTemplate:A},P=new CommercialDocumentCommonHTML,F=[2,3].includes(e)?r?.settings?.freeEstimateText:r?.settings?.freeInvoiceText;return{header:S.render(P.header,N),body:S.render(T,{...N,comment:N.comment&&typeof N.comment==`string`?C(N.comment?.replace(/\n/g,`<br/>`),{allowedTags:[`b`,`i`,`em`,`br`,`strong`]}):null,products:N.products.map(e=>({...e,comment:e.comment&&typeof e.comment==`string`?C(e.comment?.replace(/\n/g,`<br/>`),{allowedTags:[`b`,`i`,`em`,`br`,`strong`]}):null,unitFormatted:o(k,e.unitFormatted,`unit`)})),vats:w??l}),footer:S.render(P.footer,{...N,freeText:F??null}),data:N}}function generateMailHeader(e,t=!1,n=void 0){let r=e.payload.language??`fr`,i=f[r];x.locale(`fr`);let o={...e.payload,totalTaxExcludedFormatted:a(e.payload.totalTaxExcluded),totalTaxIncludedFormatted:a(e.payload.totalTaxIncluded),totalVatFormatted:a(e.payload.totalTaxIncluded-e.payload.totalTaxExcluded),dueDateFormatted:e.payload.dueDate?x(e.payload.dueDate).format(`DD MMMM YYYY`):null,hasVat:e.hasVat,hostS3:e.hostS3,logoUrl:e.logoUrl,companyName:e.companyName,fileUrl:e.fileUrl,brandColors:c({objectWaited:`colors`,nodeEnv:n}),shouldHideBrandName:t,languageMail:i},s=new CommercialDocumentMailHTML;return{header:S.render(s.header,o)}}function isMissing(e){return e==null?!0:typeof e==`string`?e.trim().length===0:Array.isArray(e)?e.length===0:!1}function checkCommercialDocumentInformation(e){let n=[],a=g(e.products.map(e=>d(e),`reorder`)),o=g(Object.values(h(a,`vatFormatted`)).map(e=>u(e),`value`)).filter(e=>e.id!==t.MARGE.id),s=v(o,e=>_(e.amount)),c=v(a,e=>_(e.totalTaxExcluded)),l=_(c+s),f=[{value:e.reference,error:`Le numéro de facture est obligatoire.`},{value:e.idEstimateInvoiceType,error:`Le type de document est obligatoire.`},{value:e.emissionDate,error:`La date d’émission est obligatoire.`},...a.flatMap((e,t)=>{let n=e.itemSaleName?.trim()?`"${e.itemSaleName}"`:`à la ligne ${t+1}`;return[{value:e.itemSaleName,error:`Le nom de l'article ${n} est obligatoire.`},{value:e.priceTaxExcluded,error:`Le prix net de l'article ${n} est obligatoire.`},{value:e.quantity,error:`La quantité de l'article ${n} est obligatoire.`},{value:e.unit,error:`Le code EN 16931 de l'article ${n} est obligatoire.`},{value:e.idVat,error:`Le type de TVA de l'article ${n} est obligatoire.`},{value:e.totalTaxExcluded,error:`Le montant net de l'article ${n} est obligatoire.`}]}),{value:e.name,error:`Le nom du vendeur est obligatoire.`},{value:e.siren,error:`Le SIREN du vendeur est obligatoire.`},{value:e.zipCode,error:`Le code postal du vendeur est obligatoire.`},{value:e.street,error:`L’adresse du vendeur est obligatoire.`},{value:e.city,error:`La ville du vendeur est obligatoire.`},{value:e.idCountry,error:`Le pays du vendeur est obligatoire.`},{value:e.thirdParty.company??e.thirdParty.fullname??`NA`,error:`Le nom de l’acheteur est obligatoire.`},{value:e.thirdParty?.idCountry,error:`Le pays de l’acheteur est obligatoire.`},...o.flatMap((e,t)=>[{value:e.amount,error:`Le montant de TVA à la ligne ${t+1} est obligatoire.`},{value:e.base,error:`La base d’imposition de la TVA à la ligne ${t+1} est obligatoire.`},{value:e.value,error:`Le type de TVA à la ligne ${t+1} est obligatoire.`}]),{value:c,error:`Le montant total hors taxe est obligatoire.`},{value:c,error:`La somme du montant net des lignes est obligatoire.`},{value:s,error:`Le montant total de TVA est obligatoire.`},{value:l,error:`Le montant total TTC est obligatoire.`}],p=r.find(t=>t.value===e.vatMention)?.taxType??`standard`;if([`margin`,`autoliquidation`,`export`,`exempt`].includes(p))for(let e of a)i(e.idVat)?.value!==0&&n.push(`L'article "${e.itemSaleName}" a une TVA non nulle alors que la mention légale de TVA est définie comme "${p}".`);return n.push(...f.filter(e=>isMissing(e.value)).map(e=>e.error)),{valid:n.length===0,errors:n.length>0?n:void 0}}export{checkCommercialDocumentInformation,generateCommercialDocument,generateMailHeader,generateSignature,getHoraires};
770
+ </html>`;function thirdPartyToReadThirdPartyEditing(t){return{...t,country:b(t?.idCountry)?e.find(e=>e.id===t.idCountry)?.name?.toUpperCase()??null:null,deliveryCountry:b(t?.deliveryIdCountry)?e.find(e=>e.id===t.deliveryIdCountry)?.name?.toUpperCase()??null:null}}function generateCommercialDocument(e,r,i=!1,a=void 0){let s=g(r.products.map(e=>d(e),`reorder`)),l=g(Object.values(h(s,`vatFormatted`)).map(e=>u(e),`value`)).filter(e=>e.id!==t.MARGE.id),b=thirdPartyToReadThirdPartyEditing(r.thirdParty),w;if(r.advanceProducts?.length){let e=Object.values(h(r.advanceProducts,`vatFormatted`)).map(e=>u(e),`value`).filter(e=>e.id!==t.MARGE.id);w=l.map(t=>{let n=t.base-(e.find(e=>e.id===t.id)?.base??0),r=t.toPay-(e.find(e=>e.id===t.id)?.toPay??0);return{...t,baseFormatted:m(n),amountFormatted:m(r)}})}let E=v(l,e=>_(e.amount)),D=v(s,`totalTaxExcludedRounded`),O=D+E,k=r.language??`fr`,A=f[k],j=n.find(e=>e.id===r.accountingCategory)?.label??null,M=r.recoveryCost,N={...r,thirdParty:b,paymentLink:r.paymentLink??`#`,idEstimateInvoiceType:e,title:r.title??null,cgv:r.cgv??null,name:r.name??null,number:r.number??null,street:r.street??null,zipCode:r.zipCode??null,city:r.city??null,legalForm:r.legalForm??null,capital:r.capital??null,siren:r.siren??null,rcs:r.rcs??null,vatCode:r.vatCode??null,nafCode:r.nafCode??null,penalties:r.penalties?o(k,r.penalties,`penalties`)??r.penalties:null,termsOfPayment:r.termsOfPayment?o(k,r.termsOfPayment,`termsOfPayment`)??r.termsOfPayment:null,recoveryCost:M?o(k,M,`recoveryCost`)??M:null,discount:r.discount?o(k,r.discount,`discount`)??r.discount:null,vatMention:r.vatMention?o(k,r.vatMention,`vatMention`)??r.vatMention:null,phoneContact:r.settings?.phoneContact??null,products:s,vats:l,totalTaxExcluded:D,totalTaxIncluded:_(O),totalTaxAndDiscountIncluded:_(O),generalDiscountFormatted:r.generalDiscount2?m(r.generalDiscount2):null,depositFormatted:r.deposit?m(r.deposit):null,totalTaxExcludedFormatted:m(D),totalTaxIncludedFormatted:m(O),totalTaxAndDiscountIncludedFormatted:m(O-(r.generalDiscount2??0)-(r.deposit??0)),totalVatAmountFormatted:m(E),font:{id:r.settings?.idFont??1,name:p.find(e=>e.id===r.settings?.idFont)?.name??p[0].name,url:p.find(e=>e.id===r.settings?.idFont)?.link??p[0].link},capitalFormatted:r.capital?`${r.capital}`.split(``).reduceRight((e,t,n,{length:r})=>`${t}${(r-(n+1))%3==0?` `:``}${e}`,``).trim():null,dueDateFormatted:r.dueDate?x(r.dueDate).format(`DD/MM/YYYY`):null,expirationDateFormatted:r.expirationDate?x(r.expirationDate).format(`DD/MM/YYYY`):null,emissionDateFormatted:r.emissionDate?x(r.emissionDate).format(`DD/MM/YYYY`):null,shouldDisplayDiscountColumn:!!s.find(e=>e.discount2&&e.discount2>0),marginVats:y(s.filter(e=>e.marginVatFormatted!==null).map(e=>e.marginVatFormatted)),accountingCategoryFormatted:j?o(k,j,`accountingCategory`)??null:null,brandColors:c({objectWaited:`colors`,nodeEnv:a}),brandName:`${c({objectWaited:`name`,nodeEnv:a})}`,shouldHideBrandName:i,addressComplement:r.addressComplement??null,paymentType:r.paymentType?o(k,r.paymentType,`paymentType`)??r.paymentType:null,languageTemplate:A},P=new CommercialDocumentCommonHTML,F=[2,3].includes(e)?r?.settings?.freeEstimateText:r?.settings?.freeInvoiceText;return{header:S.render(P.header,N,{}),body:S.render(T,{...N,cgv:N.cgv&&typeof N.cgv==`string`?C(N.cgv,{allowedTags:[`b`,`i`,`em`,`br`,`strong`,`p`,`span`,`li`,`ul`,`ol`,`h1`,`h2`,`h3`,`u`,`s`,`a`,`blockquote`],allowedAttributes:{a:[`href`,`name`,`target`,`data-list`],li:[`data-list`],"*":[`class`,`style`,`dir`]},allowedClasses:{"*":[/^ql-/]},allowedStyles:{"*":{color:[/^[a-z]+$/i,/^#(?:[0-9a-f]{3}){1,2}$/i,/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/i],"background-color":[/^[a-z]+$/i,/^#(?:[0-9a-f]{3}){1,2}$/i,/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/i],"text-align":[/^left$/i,/^right$/i,/^center$/i,/^justify$/i],"white-space":[/^pre-wrap$/i]}}}):null,comment:N.comment&&typeof N.comment==`string`?C(N.comment?.replace(/\n/g,`<br/>`),{allowedTags:[`b`,`i`,`em`,`br`,`strong`]}):null,products:N.products.map(e=>({...e,comment:e.comment&&typeof e.comment==`string`?C(e.comment?.replace(/\n/g,`<br/>`),{allowedTags:[`b`,`i`,`em`,`br`,`strong`]}):null,unitFormatted:o(k,e.unitFormatted,`unit`)})),vats:w??l},{}),footer:S.render(P.footer,{...N,freeText:F&&typeof F==`string`?C(F?.replace(/\n/g,`<br/>`),{allowedTags:[`b`,`i`,`em`,`br`,`strong`,`p`]}):null},{}),data:N}}function generateMailHeader(e,t=!1,n=void 0){let r=e.payload.language??`fr`,i=f[r];x.locale(`fr`);let o={...e.payload,totalTaxExcludedFormatted:a(e.payload.totalTaxExcluded),totalTaxIncludedFormatted:a(e.payload.totalTaxIncluded),totalVatFormatted:a(e.payload.totalTaxIncluded-e.payload.totalTaxExcluded),dueDateFormatted:e.payload.dueDate?x(e.payload.dueDate).format(`DD MMMM YYYY`):null,hasVat:e.hasVat,hostS3:e.hostS3,logoUrl:e.logoUrl,companyName:e.companyName,fileUrl:e.fileUrl,brandColors:c({objectWaited:`colors`,nodeEnv:n}),shouldHideBrandName:t,languageMail:i},s=new CommercialDocumentMailHTML;return{header:S.render(s.header,o,{})}}function isMissing(e){return e==null?!0:typeof e==`string`?e.trim().length===0:Array.isArray(e)?e.length===0:!1}function checkCommercialDocumentInformation(e){let n=[],a=g(e.products.map(e=>d(e),`reorder`)),o=g(Object.values(h(a,`vatFormatted`)).map(e=>u(e),`value`)).filter(e=>e.id!==t.MARGE.id),s=v(o,e=>_(e.amount)),c=v(a,e=>_(e.totalTaxExcluded)),l=_(c+s),f=[{value:e.reference,error:`Le numéro de facture est obligatoire.`},{value:e.idEstimateInvoiceType,error:`Le type de document est obligatoire.`},{value:e.emissionDate,error:`La date d’émission est obligatoire.`},...a.flatMap((e,t)=>{let n=e.itemSaleName?.trim()?`"${e.itemSaleName}"`:`à la ligne ${t+1}`;return[{value:e.itemSaleName,error:`Le nom de l'article ${n} est obligatoire.`},{value:e.priceTaxExcluded,error:`Le prix net de l'article ${n} est obligatoire.`},{value:e.quantity,error:`La quantité de l'article ${n} est obligatoire.`},{value:e.unit,error:`Le code EN 16931 de l'article ${n} est obligatoire.`},{value:e.idVat,error:`Le type de TVA de l'article ${n} est obligatoire.`},{value:e.totalTaxExcluded,error:`Le montant net de l'article ${n} est obligatoire.`}]}),{value:e.name,error:`Le nom du vendeur est obligatoire.`},{value:e.siren,error:`Le SIREN du vendeur est obligatoire.`},{value:e.zipCode,error:`Le code postal du vendeur est obligatoire.`},{value:e.street,error:`L’adresse du vendeur est obligatoire.`},{value:e.city,error:`La ville du vendeur est obligatoire.`},{value:e.idCountry,error:`Le pays du vendeur est obligatoire.`},{value:e.thirdParty.company??e.thirdParty.fullname??`NA`,error:`Le nom de l’acheteur est obligatoire.`},{value:e.thirdParty?.idCountry,error:`Le pays de l’acheteur est obligatoire.`},...o.flatMap((e,t)=>[{value:e.amount,error:`Le montant de TVA à la ligne ${t+1} est obligatoire.`},{value:e.base,error:`La base d’imposition de la TVA à la ligne ${t+1} est obligatoire.`},{value:e.value,error:`Le type de TVA à la ligne ${t+1} est obligatoire.`}]),{value:c,error:`Le montant total hors taxe est obligatoire.`},{value:c,error:`La somme du montant net des lignes est obligatoire.`},{value:s,error:`Le montant total de TVA est obligatoire.`},{value:l,error:`Le montant total TTC est obligatoire.`}],p=r.find(t=>t.value===e.vatMention)?.taxType??`standard`;if([`margin`,`autoliquidation`,`export`,`exempt`].includes(p))for(let e of a)i(e.idVat)?.value!==0&&n.push(`L'article "${e.itemSaleName}" a une TVA non nulle alors que la mention légale de TVA est définie comme "${p}".`);return n.push(...f.filter(e=>isMissing(e.value)).map(e=>e.error)),{valid:n.length===0,errors:n.length>0?n:void 0}}export{checkCommercialDocumentInformation,generateCommercialDocument,generateMailHeader,generateSignature,getHoraires};
771
771
  //# sourceMappingURL=index.mjs.map