@silexpert/core 1.2.67 → 1.2.69

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 (22) hide show
  1. package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
  2. package/dist/cjs/utils/commercialManagement/document.js +21 -11
  3. package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
  4. package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts +4 -0
  5. package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
  6. package/dist/cjs/utils/commercialManagement/internationalization/choices.js +112 -2
  7. package/dist/cjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
  8. package/dist/cjs/utils/vat/3517/century23.js +1 -1
  9. package/dist/cjs/utils/vat/3517/century23.js.map +1 -1
  10. package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
  11. package/dist/mjs/utils/commercialManagement/document.js +17 -6
  12. package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
  13. package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts +4 -0
  14. package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
  15. package/dist/mjs/utils/commercialManagement/internationalization/choices.js +110 -2
  16. package/dist/mjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
  17. package/dist/mjs/utils/vat/3517/century23.js +1 -1
  18. package/dist/mjs/utils/vat/3517/century23.js.map +1 -1
  19. package/package.json +1 -1
  20. package/ts/utils/commercialManagement/document.ts +17 -6
  21. package/ts/utils/commercialManagement/internationalization/choices.ts +124 -2
  22. package/ts/utils/vat/3517/century23.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,8BAA8B,EAG/B,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAkBrB,wBAAgB,0BAA0B,CACxC,qBAAqB,EAAE,mBAAmB,EAC1C,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EACtD,mBAAmB,UAAQ,EAC3B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,8BAA8B,CAwGhC;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,mBAAmB,UAAQ,EAC3B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,0BAA0B,CA4B5B"}
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,8BAA8B,EAG/B,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAkBrB,wBAAgB,0BAA0B,CACxC,qBAAqB,EAAE,mBAAmB,EAC1C,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EACtD,mBAAmB,UAAQ,EAC3B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,8BAA8B,CAmHhC;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,mBAAmB,UAAQ,EAC3B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,0BAA0B,CA4B5B"}
@@ -19,7 +19,7 @@ const ejs = require("ejs");
19
19
  // eslint-disable-next-line @typescript-eslint/no-require-imports
20
20
  require('dayjs/locale/fr');
21
21
  function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBrandName = false, nodeEnv = undefined) {
22
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
22
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
23
23
  const products = (0, lodash_1.orderBy)(payload.products.map((product) => (0, product_1.productToReadProductEditing)(product), 'reorder'));
24
24
  const vats = (0, lodash_1.orderBy)(Object.values((0, lodash_1.groupBy)(products, 'vatFormatted')).map((v) => (0, vat_1.vatToReadVatEditing)(v), 'value')).filter((v) => v.id !== Vat_1.Vat.MARGE.id);
25
25
  const thirdParty = (0, thirdParty_1.thirdPartyToReadThirdPartyEditing)(payload.thirdParty);
@@ -38,13 +38,21 @@ function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBr
38
38
  const totalTaxIncluded = (0, lodash_1.sumBy)(products, 'totalTaxExcluded') + (0, lodash_1.sumBy)(vats, 'amount');
39
39
  const locale = (_b = payload.language) !== null && _b !== void 0 ? _b : CommercialManagement_1.InvoiceLanguage.FR;
40
40
  const languageOption = choices_1.internationalizationChoices[locale];
41
- const data = Object.assign(Object.assign({}, payload), { thirdParty, paymentLink: (_c = payload.paymentLink) !== null && _c !== void 0 ? _c : '#', idEstimateInvoiceType, title: (_d = payload.title) !== null && _d !== void 0 ? _d : null, penalties: (_e = payload.penalties) !== null && _e !== void 0 ? _e : null, compensation: (_f = payload.compensation) !== null && _f !== void 0 ? _f : null, discount: (_g = payload.discount) !== null && _g !== void 0 ? _g : null, vatMention: (_h = payload.vatMention) !== null && _h !== void 0 ? _h : null, phoneContact: (_k = (_j = payload.settings) === null || _j === void 0 ? void 0 : _j.phoneContact) !== null && _k !== void 0 ? _k : null, products,
41
+ const data = Object.assign(Object.assign({}, payload), { thirdParty, paymentLink: (_c = payload.paymentLink) !== null && _c !== void 0 ? _c : '#', idEstimateInvoiceType, title: (_d = payload.title) !== null && _d !== void 0 ? _d : null, penalties: payload.penalties
42
+ ? ((_e = (0, choices_1.internationalizationConsistency)(locale, payload.penalties, 'penalties')) !== null && _e !== void 0 ? _e : null)
43
+ : null, termsOfPayment: payload.termsOfPayment
44
+ ? ((_f = (0, choices_1.internationalizationConsistency)(locale, payload.termsOfPayment, 'termsOfPayment')) !== null && _f !== void 0 ? _f : null)
45
+ : null, compensation: payload.compensation
46
+ ? ((_g = (0, choices_1.internationalizationConsistency)(locale, payload.compensation, 'recoveryCost')) !== null && _g !== void 0 ? _g : null)
47
+ : null, discount: payload.discount ? ((_h = (0, choices_1.internationalizationConsistency)(locale, payload.discount, 'discount')) !== null && _h !== void 0 ? _h : null) : null, vatMention: payload.vatMention
48
+ ? ((_j = (0, choices_1.internationalizationConsistency)(locale, payload.vatMention, 'vatMention')) !== null && _j !== void 0 ? _j : null)
49
+ : null, phoneContact: (_l = (_k = payload.settings) === null || _k === void 0 ? void 0 : _k.phoneContact) !== null && _l !== void 0 ? _l : null, products,
42
50
  vats, totalTaxExcluded: (0, lodash_1.sumBy)(products, 'totalTaxExcluded'), totalTaxIncluded: (0, lodash_1.round)(totalTaxIncluded), totalTaxAndDiscountIncluded: (0, lodash_1.round)(totalTaxIncluded), generalDiscountFormatted: payload.generalDiscount2
43
51
  ? (0, amount_1.integerToFormattedAmountString)(payload.generalDiscount2)
44
- : null, depositFormatted: payload.deposit ? (0, amount_1.integerToFormattedAmountString)(payload.deposit) : null, totalTaxExcludedFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, 'totalTaxExcluded')), totalTaxIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded), totalTaxAndDiscountIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded - ((_l = payload.generalDiscount2) !== null && _l !== void 0 ? _l : 0) - ((_m = payload.deposit) !== null && _m !== void 0 ? _m : 0)), totalVatAmountFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(vats, 'amount')), font: {
45
- id: (_p = (_o = payload.settings) === null || _o === void 0 ? void 0 : _o.idFont) !== null && _p !== void 0 ? _p : CommercialManagement_1.FontIds.CIRCULAR_STD,
46
- name: (_r = (_q = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _q === void 0 ? void 0 : _q.name) !== null && _r !== void 0 ? _r : CommercialManagement_1.fontList[0].name,
47
- url: (_t = (_s = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _s === void 0 ? void 0 : _s.link) !== null && _t !== void 0 ? _t : CommercialManagement_1.fontList[0].link,
52
+ : null, depositFormatted: payload.deposit ? (0, amount_1.integerToFormattedAmountString)(payload.deposit) : null, totalTaxExcludedFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, 'totalTaxExcluded')), totalTaxIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded), totalTaxAndDiscountIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded - ((_m = payload.generalDiscount2) !== null && _m !== void 0 ? _m : 0) - ((_o = payload.deposit) !== null && _o !== void 0 ? _o : 0)), totalVatAmountFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(vats, 'amount')), font: {
53
+ id: (_q = (_p = payload.settings) === null || _p === void 0 ? void 0 : _p.idFont) !== null && _q !== void 0 ? _q : CommercialManagement_1.FontIds.CIRCULAR_STD,
54
+ name: (_s = (_r = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _r === void 0 ? void 0 : _r.name) !== null && _s !== void 0 ? _s : CommercialManagement_1.fontList[0].name,
55
+ url: (_u = (_t = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _t === void 0 ? void 0 : _t.link) !== null && _u !== void 0 ? _u : CommercialManagement_1.fontList[0].link,
48
56
  }, capitalFormatted: payload.capital
49
57
  ? `${payload.capital}`
50
58
  .split('')
@@ -52,16 +60,18 @@ function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBr
52
60
  .trim()
53
61
  : null, dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null, expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null, emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null, shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),
54
62
  // @ts-ignore
55
- marginVats: (0, lodash_1.uniq)(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (_v = (_u = CommercialManagement_1.AccountingCategoryList.find((a) => a.id === payload.accountingCategory)) === null || _u === void 0 ? void 0 : _u.label) !== null && _v !== void 0 ? _v : null,
63
+ marginVats: (0, lodash_1.uniq)(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (_w = (_v = CommercialManagement_1.AccountingCategoryList.find((a) => a.id === payload.accountingCategory)) === null || _v === void 0 ? void 0 : _v.label) !== null && _w !== void 0 ? _w : null,
56
64
  // @ts-ignore
57
- brandColors: (0, brands_1.getBrandConfig)({ objectWaited: 'colors', nodeEnv }), brandName: `${(0, brands_1.getBrandConfig)({ objectWaited: 'name', nodeEnv })}`, shouldHideBrandName, paymentType: payload.paymentType, languageTemplate: languageOption });
65
+ brandColors: (0, brands_1.getBrandConfig)({ objectWaited: 'colors', nodeEnv }), brandName: `${(0, brands_1.getBrandConfig)({ objectWaited: 'name', nodeEnv })}`, shouldHideBrandName, paymentType: payload.paymentType
66
+ ? (0, choices_1.internationalizationConsistency)(locale, payload.paymentType, 'paymentType')
67
+ : null, languageTemplate: languageOption });
58
68
  const commonTemplate = new common_1.CommercialDocumentCommonHTML();
59
69
  const documentFreeText = [EstimateInvoice_1.EstimateInvoiceType.DEVIS, EstimateInvoice_1.EstimateInvoiceType.BON].includes(idEstimateInvoiceType)
60
- ? (_w = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _w === void 0 ? void 0 : _w.freeEstimateText
61
- : (_x = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _x === void 0 ? void 0 : _x.freeInvoiceText;
70
+ ? (_x = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _x === void 0 ? void 0 : _x.freeEstimateText
71
+ : (_y = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _y === void 0 ? void 0 : _y.freeInvoiceText;
62
72
  return {
63
73
  header: ejs.render(commonTemplate.header, data),
64
- body: ejs.render(body_1.bodyTemplate, Object.assign(Object.assign({}, data), { comment: data.comment && typeof data.comment === 'string' ? (_y = data.comment) === null || _y === void 0 ? void 0 : _y.replace(/\n/g, '<br/>') : null, products: data.products.map((p) => {
74
+ body: ejs.render(body_1.bodyTemplate, Object.assign(Object.assign({}, data), { comment: data.comment && typeof data.comment === 'string' ? (_z = data.comment) === null || _z === void 0 ? void 0 : _z.replace(/\n/g, '<br/>') : null, products: data.products.map((p) => {
65
75
  var _a;
66
76
  return (Object.assign(Object.assign({}, p), { comment: p.comment && typeof p.comment === 'string' ? (_a = p.comment) === null || _a === void 0 ? void 0 : _a.replace(/\n/g, '<br/>') : null }));
67
77
  }), vats: forcedVats !== null && forcedVats !== void 0 ? forcedVats : vats })),
@@ -1 +1 @@
1
- {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":";;AAsCA,gEA6GC;AAED,gDAgCC;AArLD,mCAAmH;AACnH,+BAA+B;AAM/B,gFAAmH;AACnH,sEAAuE;AACvE,8CAA2C;AAC3C,sCAA2F;AAC3F,+CAA8F;AAC9F,2CAAgD;AAChD,uCAAwD;AACxD,+BAA4C;AAO5C,6CAAiE;AACjE,sCAA2C;AAC3C,4DAA6E;AAE7E,2BAA2B;AAC3B,iEAAiE;AACjE,OAAO,CAAC,iBAAiB,CAA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B,CAAC,EAC1F,iBAAiB,EAAE,IAAA,uCAA8B,EAC/C,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAClE,EACD,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EACtG,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,IAAA,uBAAc,EAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB,EAClF,mBAAmB,EACnB,YAAY,EAAE,cAAc,GAC7B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,mCAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import { orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, round as _round } from 'lodash';\nimport * as dayjs from 'dayjs';\nimport {\n ReadCommercialDocumentTemplate,\n ReadDocumentEditing,\n ReadVatEditing,\n} from '../../types/Interface/api/commercialManagement/Read';\nimport { AccountingCategoryList, FontIds, fontList, InvoiceLanguage } from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';\nimport { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport {\n CreateInvoiceDocument,\n CreateMailHeader,\n CreatePreSaleDocument,\n ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\nimport { internationalizationChoices } from './internationalization/choices';\n\nimport * as ejs from 'ejs';\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nrequire('dayjs/locale/fr');\n\ntype brandColorType = {\n primary: string;\n primary50: string;\n primary100: string;\n primary300: string;\n primary500: string;\n primary700: string;\n};\n\nexport function generateCommercialDocument(\n idEstimateInvoiceType: EstimateInvoiceType,\n payload: CreateInvoiceDocument | CreatePreSaleDocument,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(\n Object.values(_groupBy(products, 'vatFormatted')).map((v) => vatToReadVatEditing(v), 'value'),\n ).filter((v) => v.id !== Vat.MARGE.id);\n const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);\n\n let forcedVats: ReadVatEditing[] | undefined = undefined;\n\n if (payload.advanceProducts?.length) {\n const advanceVats = Object.values(_groupBy(payload.advanceProducts, 'vatFormatted'))\n .map((v) => vatToReadVatEditing(v), 'value')\n .filter((v) => v.id !== Vat.MARGE.id);\n\n forcedVats = vats.map((v) => {\n const base = v.base - (advanceVats.find((a) => a.id === v.id)?.base ?? 0);\n const toPay = v.toPay - (advanceVats.find((a) => a.id === v.id)?.toPay ?? 0);\n return {\n ...v,\n baseFormatted: integerToFormattedAmountString(base),\n amountFormatted: integerToFormattedAmountString(toPay),\n };\n });\n }\n\n const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');\n\n const locale = payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n\n const data: ReadDocumentEditing & { brandColors: brandColorType; brandName: string; shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties ?? null,\n compensation: payload.compensation ?? null,\n discount: payload.discount ?? null,\n vatMention: payload.vatMention ?? null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _round(totalTaxIncluded),\n totalTaxAndDiscountIncluded: _round(totalTaxIncluded),\n generalDiscountFormatted: payload.generalDiscount2\n ? integerToFormattedAmountString(payload.generalDiscount2)\n : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(\n totalTaxIncluded - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0),\n ),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`\n .split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),\n // @ts-ignore\n marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)),\n accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv }) as unknown as string}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n languageTemplate: languageOption,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment: data.comment && typeof data.comment === 'string' ? data.comment?.replace(/\\n/g, '<br/>') : null,\n products: data.products.map((p) => ({\n ...p,\n comment: p.comment && typeof p.comment === 'string' ? p.comment?.replace(/\\n/g, '<br/>') : null,\n })),\n vats: forcedVats ?? vats,\n }),\n footer: ejs.render(commonTemplate.footer, {\n ...data,\n freeText: documentFreeText ?? null,\n }),\n data,\n };\n}\n\nexport function generateMailHeader(\n params: CreateMailHeader,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialMailTemplate {\n const locale = params.payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(\n params.payload.totalTaxIncluded - params.payload.totalTaxExcluded,\n ),\n dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,\n hasVat: params.hasVat,\n hostS3: params.hostS3,\n logoUrl: params.logoUrl,\n companyName: params.companyName,\n fileUrl: params.fileUrl,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n shouldHideBrandName,\n languageMail: languageOption,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}\n"]}
1
+ {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":";;AAsCA,gEAwHC;AAED,gDAgCC;AAhMD,mCAAmH;AACnH,+BAA+B;AAM/B,gFAAmH;AACnH,sEAAuE;AACvE,8CAA2C;AAC3C,sCAA2F;AAC3F,+CAA8F;AAC9F,2CAAgD;AAChD,uCAAwD;AACxD,+BAA4C;AAO5C,6CAAiE;AACjE,sCAA2C;AAC3C,4DAA8G;AAE9G,2BAA2B;AAC3B,iEAAiE;AACjE,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAW3B,SAAgB,0BAA0B,CACxC,qBAA0C,EAC1C,OAAsD,EACtD,mBAAmB,GAAG,KAAK,EAC3B,UAA8B,SAAS;;IAEvC,MAAM,QAAQ,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,qCAA2B,EAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IAC9G,MAAM,IAAI,GAAG,IAAA,gBAAQ,EACnB,MAAM,CAAC,MAAM,CAAC,IAAA,gBAAQ,EAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,yBAAmB,EAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAC9F,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,UAAU,GAAG,IAAA,8CAA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8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,yBAAyB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,iBAAiB,EAAE,IAAA,uCAA8B,EAC/C,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAClE,EACD,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EACtG,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,IAAA,uBAAc,EAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB,EAClF,mBAAmB,EACnB,YAAY,EAAE,cAAc,GAC7B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,mCAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import { orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, round as _round } from 'lodash';\nimport * as dayjs from 'dayjs';\nimport {\n ReadCommercialDocumentTemplate,\n ReadDocumentEditing,\n ReadVatEditing,\n} from '../../types/Interface/api/commercialManagement/Read';\nimport { AccountingCategoryList, FontIds, fontList, InvoiceLanguage } from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';\nimport { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport {\n CreateInvoiceDocument,\n CreateMailHeader,\n CreatePreSaleDocument,\n ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\nimport { internationalizationChoices, internationalizationConsistency } from './internationalization/choices';\n\nimport * as ejs from 'ejs';\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nrequire('dayjs/locale/fr');\n\ntype brandColorType = {\n primary: string;\n primary50: string;\n primary100: string;\n primary300: string;\n primary500: string;\n primary700: string;\n};\n\nexport function generateCommercialDocument(\n idEstimateInvoiceType: EstimateInvoiceType,\n payload: CreateInvoiceDocument | CreatePreSaleDocument,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(\n Object.values(_groupBy(products, 'vatFormatted')).map((v) => vatToReadVatEditing(v), 'value'),\n ).filter((v) => v.id !== Vat.MARGE.id);\n const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);\n\n let forcedVats: ReadVatEditing[] | undefined = undefined;\n\n if (payload.advanceProducts?.length) {\n const advanceVats = Object.values(_groupBy(payload.advanceProducts, 'vatFormatted'))\n .map((v) => vatToReadVatEditing(v), 'value')\n .filter((v) => v.id !== Vat.MARGE.id);\n\n forcedVats = vats.map((v) => {\n const base = v.base - (advanceVats.find((a) => a.id === v.id)?.base ?? 0);\n const toPay = v.toPay - (advanceVats.find((a) => a.id === v.id)?.toPay ?? 0);\n return {\n ...v,\n baseFormatted: integerToFormattedAmountString(base),\n amountFormatted: integerToFormattedAmountString(toPay),\n };\n });\n }\n\n const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');\n\n const locale = payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n\n const data: ReadDocumentEditing & { brandColors: brandColorType; brandName: string; shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties\n ? (internationalizationConsistency(locale, payload.penalties, 'penalties') ?? null)\n : null,\n termsOfPayment: payload.termsOfPayment\n ? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ?? null)\n : null,\n compensation: payload.compensation\n ? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ?? null)\n : null,\n discount: payload.discount ? (internationalizationConsistency(locale, payload.discount, 'discount') ?? null) : null,\n vatMention: payload.vatMention\n ? (internationalizationConsistency(locale, payload.vatMention, 'vatMention') ?? null)\n : null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _round(totalTaxIncluded),\n totalTaxAndDiscountIncluded: _round(totalTaxIncluded),\n generalDiscountFormatted: payload.generalDiscount2\n ? integerToFormattedAmountString(payload.generalDiscount2)\n : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(\n totalTaxIncluded - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0),\n ),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`\n .split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),\n // @ts-ignore\n marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)),\n accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv }) as unknown as string}`,\n shouldHideBrandName,\n paymentType: payload.paymentType\n ? internationalizationConsistency(locale, payload.paymentType, 'paymentType')\n : null,\n languageTemplate: languageOption,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment: data.comment && typeof data.comment === 'string' ? data.comment?.replace(/\\n/g, '<br/>') : null,\n products: data.products.map((p) => ({\n ...p,\n comment: p.comment && typeof p.comment === 'string' ? p.comment?.replace(/\\n/g, '<br/>') : null,\n })),\n vats: forcedVats ?? vats,\n }),\n footer: ejs.render(commonTemplate.footer, {\n ...data,\n freeText: documentFreeText ?? null,\n }),\n data,\n };\n}\n\nexport function generateMailHeader(\n params: CreateMailHeader,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialMailTemplate {\n const locale = params.payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(\n params.payload.totalTaxIncluded - params.payload.totalTaxExcluded,\n ),\n dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,\n hasVat: params.hasVat,\n hostS3: params.hostS3,\n logoUrl: params.logoUrl,\n companyName: params.companyName,\n fileUrl: params.fileUrl,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n shouldHideBrandName,\n languageMail: languageOption,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}\n"]}
@@ -1,3 +1,7 @@
1
+ import { InvoiceLanguage } from '../../../types/Enum/CommercialManagement';
1
2
  import { InternationalizationChoicesType } from './type';
3
+ type InternationalizationConsistencyKey = 'penalties' | 'discount' | 'vatMention' | 'recoveryCost' | 'paymentType' | 'termsOfPayment';
2
4
  export declare const internationalizationChoices: InternationalizationChoicesType;
5
+ export declare const internationalizationConsistency: (language: InvoiceLanguage, value: string, key: InternationalizationConsistencyKey) => string | undefined;
6
+ export {};
3
7
  //# sourceMappingURL=choices.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AAEzD,eAAO,MAAM,2BAA2B,EAAE,+BA6XzC,CAAC"}
1
+ {"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,eAAe,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AAEzD,KAAK,kCAAkC,GACnC,WAAW,GACX,UAAU,GACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,gBAAgB,CAAC;AAErB,eAAO,MAAM,2BAA2B,EAAE,+BA6XzC,CAAC;AAyGF,eAAO,MAAM,+BAA+B,aAChC,eAAe,SAClB,MAAM,OACR,kCAAkC,KACtC,MAAM,GAAG,SAKX,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.internationalizationChoices = void 0;
3
+ exports.internationalizationConsistency = exports.internationalizationChoices = void 0;
4
4
  const CommercialManagement_1 = require("../../../types/Enum/CommercialManagement");
5
5
  exports.internationalizationChoices = {
6
6
  fr: {
@@ -229,7 +229,7 @@ exports.internationalizationChoices = {
229
229
  'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
230
230
  'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
231
231
  'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
232
- ' Invoice subject to VAT reverse charge system',
232
+ 'Invoice subject to VAT reverse charge system',
233
233
  ],
234
234
  recoveryCost: ['Not applicable', '40€'],
235
235
  paymentType: ['Credit card', 'Check', 'Cash', 'Direct debit', 'Bank transfer'],
@@ -384,4 +384,114 @@ exports.internationalizationChoices = {
384
384
  },
385
385
  },
386
386
  };
387
+ const internationalizationMatching = {
388
+ penalties: [
389
+ { fr: 'Non applicable', en: 'Not applicable' },
390
+ { fr: '3 fois le taux légal', en: '3 times the legal rate' },
391
+ { fr: 'Taux directeur de la BCE + 10 points', en: 'ECB key rate + 10 points' },
392
+ ],
393
+ discount: [
394
+ { fr: 'Non applicable', en: 'Not applicable' },
395
+ { fr: 'Aucun escompte en cas de paiement anticipé', en: 'No discount for early payment' },
396
+ ],
397
+ recoveryCost: [
398
+ { fr: 'Non applicable', en: 'Not applicable' },
399
+ { fr: '40€', en: '40€' },
400
+ ],
401
+ paymentType: [
402
+ { fr: 'Carte bancaire', en: 'Credit card' },
403
+ { fr: 'Chèque', en: 'Check' },
404
+ { fr: 'Espèces', en: 'Cash' },
405
+ { fr: 'Prélèvement', en: 'Direct debit' },
406
+ { fr: 'Virement bancaire', en: 'Bank transfer' },
407
+ ],
408
+ vatMention: [
409
+ { fr: 'Non concerné', en: 'Not affected' },
410
+ { fr: 'Non applicable', en: 'Not applicable' },
411
+ {
412
+ fr: 'TVA non applicable, art. 293 B du CGI',
413
+ en: 'VAT not applicable, art. 293 B of the French General Tax Code (FGTC)',
414
+ },
415
+ {
416
+ fr: 'TVA non applicable - Exportation hors UE - Art. 259-1 du CGI',
417
+ en: 'VAT not applicable - Exports outside the EU - Art. 259-1 of the French General Tax Code (FGTC)',
418
+ },
419
+ {
420
+ fr: "Non soumis à TVA selon l'article 261C du CGI",
421
+ en: 'Not subject to VAT according to article 261C of the French General Tax Code (FGTC)',
422
+ },
423
+ { fr: 'Article 261 D du code général des impôts (CGI)', en: 'Article 261D of the French General Tax Code (FGTC)' },
424
+ {
425
+ fr: 'Exonération de TVA, article 283-2 du Code général des impôts',
426
+ en: 'VAT exemption, article 283-2 of the French General Tax Code (FGTC)',
427
+ },
428
+ {
429
+ fr: 'Exonération de la TVA : Article 262 ter I du CGI',
430
+ en: 'VAT exemption: Article 262 ter I of the French General Tax Code (FGTC)',
431
+ },
432
+ { fr: 'Mention de TVA 261.4.4 1 du CGI', en: 'VAT notice 261.4.4 1 of the French General Tax Code (FGTC)' },
433
+ {
434
+ fr: "Régime particulier – Biens d'occasion - article 297 A du CGI et directive communautaire 2006/112/CE",
435
+ en: 'Specific regime - Second-hand goods - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
436
+ },
437
+ {
438
+ fr: "Régime particulier – Objets d'art - article 297 A du CGI et directive communautaire 2006/112/CE",
439
+ en: 'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
440
+ },
441
+ {
442
+ fr: "Régime particulier – Objets de collection ou d'antiquité - article 297 A du CGI et directive communautaire 2006/112/CE",
443
+ en: 'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
444
+ },
445
+ {
446
+ fr: 'Régime particulier – Agences de voyage - article 297 A du CGI et directive communautaire 2006/112/CE',
447
+ en: 'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
448
+ },
449
+ {
450
+ fr: 'Facture soumise au régime de l’auto-liquidation de la TVA',
451
+ en: 'Invoice subject to VAT reverse charge system',
452
+ },
453
+ ],
454
+ termsOfPayment: [
455
+ {
456
+ fr: 'À la livraison',
457
+ en: 'On delivery',
458
+ },
459
+ {
460
+ fr: 'À la command',
461
+ en: 'On order',
462
+ },
463
+ {
464
+ fr: 'À réception de la facture',
465
+ en: 'Upon receipt of invoice',
466
+ },
467
+ {
468
+ fr: 'Exigible sous 14 jours',
469
+ en: 'Due within 14 days',
470
+ },
471
+ {
472
+ fr: 'Exigible sous 30 jours',
473
+ en: 'Due within 30 days',
474
+ },
475
+ {
476
+ fr: '30 jours à réception de la facture',
477
+ en: '30 days upon receipt of invoice',
478
+ },
479
+ {
480
+ fr: '45 jours à réception de la facture',
481
+ en: '45 days upon receipt of invoice',
482
+ },
483
+ {
484
+ fr: '60 jours à réception de la facture',
485
+ en: '60 days upon receipt of invoice',
486
+ },
487
+ ],
488
+ };
489
+ const internationalizationConsistency = (language, value, key) => {
490
+ var _a, _b;
491
+ const keyObjectToMacht = internationalizationMatching[key];
492
+ return language === CommercialManagement_1.InvoiceLanguage.FR
493
+ ? (_a = keyObjectToMacht.find((obj) => obj.fr === value)) === null || _a === void 0 ? void 0 : _a.fr
494
+ : (_b = keyObjectToMacht.find((obj) => obj.fr === value)) === null || _b === void 0 ? void 0 : _b.en;
495
+ };
496
+ exports.internationalizationConsistency = internationalizationConsistency;
387
497
  //# sourceMappingURL=choices.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"choices.js","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":";;;AAAA,mFAAgF;AAGnE,QAAA,2BAA2B,GAAoC;IAC1E,EAAE,EAAE;QACF,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,cAAc,EAAE;oBACd,gBAAgB;oBAChB,eAAe;oBACf,2BAA2B;oBAC3B,wBAAwB;oBACxB,wBAAwB;oBACxB,oCAAoC;oBACpC,oCAAoC;oBACpC,oCAAoC;iBACrC;gBACD,oBAAoB,EAAE;oBACpB,EAAE,EAAE,EAAE,2CAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE;oBAC1E,EAAE,EAAE,EAAE,2CAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,wBAAwB,EAAE;oBAC9E,EAAE,EAAE,EAAE,2CAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,8CAA8C,EAAE;iBACrG;aACF;YACD,OAAO,EAAE;gBACP,SAAS,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,sCAAsC,CAAC;gBAC7F,QAAQ,EAAE,CAAC,gBAAgB,EAAE,4CAA4C,CAAC;gBAC1E,UAAU,EAAE;oBACV,cAAc;oBACd,gBAAgB;oBAChB,uCAAuC;oBACvC,8DAA8D;oBAC9D,8CAA8C;oBAC9C,gDAAgD;oBAChD,8DAA8D;oBAC9D,kDAAkD;oBAClD,iCAAiC;oBACjC,qGAAqG;oBACrG,iGAAiG;oBACjG,wHAAwH;oBACxH,sGAAsG;oBACtG,2DAA2D;iBAC5D;gBACD,YAAY,EAAE,CAAC,gBAAgB,EAAE,KAAK,CAAC;gBACvC,WAAW,EAAE,CAAC,gBAAgB,EAAE,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,KAAK,EAAE,aAAa;oBACpB,OAAO,EAAE,UAAU;oBACnB,cAAc,EAAE,sBAAsB;iBACvC;aACF;YACD,SAAS,EAAE;gBACT,OAAO,EAAE;oBACP,KAAK,EAAE,iBAAiB;oBACxB,OAAO,EAAE,UAAU;oBACnB,cAAc,EAAE,sBAAsB;iBACvC;aACF;YACD,KAAK,EAAE;gBACL,OAAO,EAAE;oBACP,KAAK,EAAE,OAAO;oBACd,OAAO,EAAE,UAAU;oBACnB,cAAc,EAAE,sBAAsB;iBACvC;aACF;SACF;QACD,IAAI,EAAE;YACJ,MAAM,EAAE;gBACN,OAAO,EAAE,UAAU;gBACnB,QAAQ,EAAE,YAAY;gBACtB,eAAe,EAAE,kBAAkB;gBACnC,OAAO,EAAE,iBAAiB;gBAC1B,QAAQ,EAAE,WAAW;gBACrB,QAAQ,EAAE,iBAAiB;gBAC3B,IAAI,EAAE,UAAU;aACjB;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,cAAc;gBACrB,QAAQ,EAAE,SAAS;aACpB;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,eAAe;gBACtB,QAAQ,EAAE,UAAU;aACrB;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,iBAAiB;gBACxB,QAAQ,EAAE,YAAY;aACvB;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,cAAc;gBACrB,QAAQ,EAAE,SAAS;aACpB;YACD,KAAK,EAAE;gBACL,KAAK,EAAE,YAAY;gBACnB,QAAQ,EAAE,OAAO;aAClB;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,cAAc;gBACrB,QAAQ,EAAE,SAAS;aACpB;YACD,OAAO,EAAE;gBACP,KAAK,EAAE,eAAe;gBACtB,QAAQ,EAAE,UAAU;aACrB;SACF;KACF;CACF,CAAC","sourcesContent":["import { AccountingCategoryId } from '../../../types/Enum/CommercialManagement';\nimport { InternationalizationChoicesType } from './type';\n\nexport const internationalizationChoices: InternationalizationChoicesType = {\n fr: {\n inputLists: {\n headers: {\n termsOfPayment: [\n 'À la livraison',\n 'À la commande',\n 'À réception de la facture',\n 'Exigible sous 14 jours',\n 'Exigible sous 30 jours',\n '30 jours à réception de la facture',\n '45 jours à réception de la facture',\n '60 jours à réception de la facture',\n ],\n accountingCategories: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Livraison de biens' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Prestation de services' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Prestation de services et livraison de biens' },\n ],\n },\n options: {\n penalties: ['Non applicable', '3 fois le taux légal', 'Taux directeur de la BCE + 10 points'],\n discount: ['Non applicable', 'Aucun escompte en cas de paiement anticipé'],\n vatMention: [\n 'Non concerné',\n 'Non applicable',\n 'TVA non applicable, art. 293 B du CGI',\n 'TVA non applicable - Exportation hors UE - Art. 259-1 du CGI',\n \"Non soumis à TVA selon l'article 261C du CGI\",\n 'Article 261 D du code général des impôts (CGI)',\n 'Exonération de TVA, article 283-2 du Code général des impôts',\n 'Exonération de la TVA : Article 262 ter I du CGI',\n 'Mention de TVA 261.4.4 1 du CGI',\n \"Régime particulier – Biens d'occasion - article 297 A du CGI et directive communautaire 2006/112/CE\",\n \"Régime particulier – Objets d'art - article 297 A du CGI et directive communautaire 2006/112/CE\",\n \"Régime particulier – Objets de collection ou d'antiquité - article 297 A du CGI et directive communautaire 2006/112/CE\",\n 'Régime particulier – Agences de voyage - article 297 A du CGI et directive communautaire 2006/112/CE',\n 'Facture soumise au régime de l’auto-liquidation de la TVA',\n ],\n recoveryCost: ['Non applicable', '40€'],\n paymentType: ['Carte bancaire', 'Chèque', 'Espèces', 'Prélèvement', 'Virement bancaire'],\n },\n },\n template: {\n common: {\n headers: {\n emissionDate: \"Date d'émission\",\n accountingCategory: {\n title: \"Catégorie de l'opération\",\n choices: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Livraison de biens' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Prestation de services' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Prestation de services et livraison de biens' },\n ],\n },\n },\n footer: {\n capital: 'au capital de',\n siren: 'immatriculée sous le SIREN',\n vatCode: 'N° TVA',\n marginVat: 'Régime TVA sur marge',\n legalVatMention: 'ART 297-A du CGI ou directive 2006-212 CE',\n shouldPayTaxAfterDebit: \"Option pour le paiement de la taxe d'après les débits\",\n penalties: 'Pénalités en cas de retard',\n discount: 'Escompte',\n recoveryCosts: 'Indemnités forfaitaire en cas de retard',\n generate: 'Généré par',\n },\n options: {\n vatMention: 'Mention TVA',\n paymentType: 'Mode de paiement',\n bank: 'BANQUE',\n approval: 'Bon pour accord',\n comment: 'Commentaire',\n },\n table: {\n headers: {\n product: 'Article',\n quantity: 'Quantité',\n unitPrice: 'P.U HT',\n unitPriceWithoutVat: 'P.U',\n discount: 'Remise',\n vat: 'TVA',\n amount: 'Montant HT',\n amountWithoutVat: 'Montant',\n base: 'Base',\n rate: 'Taux',\n vatAmount: 'Montant TVA',\n recap: 'Récapitulatif',\n },\n lines: {\n totalHt: 'Total HT',\n vat: 'TVA',\n totalTTC: 'Total TTC',\n totalWhitoutVat: 'Total',\n deposit: 'Acompte',\n remainderToPay: 'Reste à payer',\n netToPay: 'Net à payer',\n },\n },\n },\n invoice: {\n headers: {\n title: 'Facture',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n estimate: {\n headers: {\n title: 'Devis',\n dueDate: \"Valide jusqu'au\",\n termsOfPayment: 'Conditions de règlement',\n },\n },\n orderForm: {\n headers: {\n title: 'Bon de commande',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Conditions de règlement',\n },\n },\n deposit: {\n headers: {\n title: \"Facture d'acompte\",\n expirationDate: \"Date d'expiration\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n asset: {\n headers: {\n title: 'Avoir',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n remainder: {\n headers: {\n title: 'Facture de solde',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n draft: {\n headers: {\n title: 'Brouillon',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n },\n mail: {\n common: {\n dueDate: 'Échéance',\n generate: 'Généré par',\n displayDocument: 'Afficher le document',\n totalHt: 'Total HT',\n totalVat: 'Total TVA',\n totalTtc: 'Total TTC',\n send: 'vous adresse',\n },\n invoice: {\n title: 'cette facture',\n subTitle: 'Facture',\n },\n estimate: {\n title: 'ce devis',\n subTitle: 'Devis',\n },\n orderForm: {\n title: 'ce bon de commande',\n subTitle: 'Bon de commande',\n },\n deposit: {\n title: 'cet acompte',\n subTitle: 'Acompte',\n },\n asset: {\n title: 'cet avoir',\n subTitle: 'Avoir',\n },\n remainder: {\n title: 'cette facture',\n subTitle: 'Facture',\n },\n default: {\n title: 'ce document',\n subTitle: 'Document',\n },\n },\n },\n en: {\n inputLists: {\n headers: {\n termsOfPayment: [\n 'On delivery',\n 'On order',\n 'Upon receipt of invoice',\n 'Due within 14 days',\n 'Due within 30 days',\n '30 days upon receipt of invoice',\n '45 days upon receipt of invoice',\n '60 days upon receipt of invoice',\n ],\n accountingCategories: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Delivery of goods' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Services delivery' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Services and goods delivery' },\n ],\n },\n options: {\n penalties: ['Not applicable', '3 times the legal rate', 'ECB key rate + 10 points'],\n discount: ['Not applicable', 'No discount for early payment'],\n vatMention: [\n 'Not affected',\n 'Not applicable',\n 'VAT not applicable, art. 293 B of the French General Tax Code (FGTC)',\n 'VAT not applicable - Exports outside the EU - Art. 259-1 of the French General Tax Code (FGTC)',\n 'Not subject to VAT according to article 261C of the French General Tax Code (FGTC)',\n 'Article 261D of the French General Tax Code (FGTC)',\n 'VAT exemption, article 283-2 of the French General Tax Code (FGTC)',\n 'VAT exemption: Article 262 ter I of the French General Tax Code (FGTC)',\n 'VAT notice 261.4.4 1 of the French General Tax Code (FGTC)',\n 'Specific regime - Second-hand goods - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n 'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n 'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n 'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n ' Invoice subject to VAT reverse charge system',\n ],\n recoveryCost: ['Not applicable', '40€'],\n paymentType: ['Credit card', 'Check', 'Cash', 'Direct debit', 'Bank transfer'],\n },\n },\n template: {\n common: {\n headers: {\n emissionDate: 'Invoice date',\n accountingCategory: {\n title: 'Transaction type',\n choices: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'supply of goods' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Services provision' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Services provision and supply of goods' },\n ],\n },\n },\n footer: {\n capital: 'with capital of',\n siren: 'registered under SIREN',\n vatCode: 'VAT number',\n marginVat: 'VAT margin scheme',\n legalVatMention: 'ART 297-A of the FGTC or directive 2006-212 EC',\n shouldPayTaxAfterDebit: 'Option to pay tax on debits',\n penalties: 'Late fees',\n discount: 'discount',\n recoveryCosts: 'flat-rate delay compensation',\n generate: 'Created by',\n },\n options: {\n vatMention: 'VAT mention',\n paymentType: 'payment type',\n bank: 'BANK',\n approval: 'Agreed and signed',\n comment: 'Comment',\n },\n table: {\n headers: {\n product: 'Product',\n quantity: 'Quantity',\n unitPrice: 'Excl. tax unit price',\n unitPriceWithoutVat: 'Unit price',\n discount: 'Discount',\n vat: 'VAT',\n amount: 'Amount excl. tax',\n amountWithoutVat: 'Amount',\n base: 'Base',\n rate: 'Rate',\n vatAmount: 'VAT amount',\n recap: 'Summary',\n },\n lines: {\n totalHt: 'Amount excl. tax',\n vat: 'VAT',\n totalTTC: 'Amount incl. tax',\n totalWhitoutVat: 'Amount',\n deposit: 'Deposit',\n remainderToPay: 'Remainder to pay',\n netToPay: 'Net to pay',\n },\n },\n },\n invoice: {\n headers: {\n title: 'Invoice',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n estimate: {\n headers: {\n title: 'Quotation',\n dueDate: 'Valid until',\n termsOfPayment: 'Term of payment',\n },\n },\n orderForm: {\n headers: {\n title: 'Order form',\n dueDate: 'Valid until',\n termsOfPayment: 'Term of payment',\n },\n },\n deposit: {\n headers: {\n title: 'Deposit invoice',\n expirationDate: 'expiry date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n asset: {\n headers: {\n title: 'Credit note',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n remainder: {\n headers: {\n title: 'Balance invoice',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n draft: {\n headers: {\n title: 'Draft',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n },\n mail: {\n common: {\n dueDate: 'Due date',\n generate: 'Created by',\n displayDocument: 'Display document',\n totalHt: 'Total excl. tax',\n totalVat: 'Total VAT',\n totalTtc: 'Total incl. tax',\n send: 'send you',\n },\n invoice: {\n title: 'this invoice',\n subTitle: 'Invoice',\n },\n estimate: {\n title: 'this estimate',\n subTitle: 'Estimate',\n },\n orderForm: {\n title: 'this order form',\n subTitle: 'Order form',\n },\n deposit: {\n title: 'this deposit',\n subTitle: 'Deposit',\n },\n asset: {\n title: 'this asset',\n subTitle: 'Asset',\n },\n remainder: {\n title: 'this invoice',\n subTitle: 'Invoice',\n },\n default: {\n title: 'this document',\n subTitle: 'Document',\n },\n },\n },\n};\n"]}
1
+ {"version":3,"file":"choices.js","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":";;;AAAA,mFAAiG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{ AccountingCategoryId, InvoiceLanguage } from '../../../types/Enum/CommercialManagement';\nimport { InternationalizationChoicesType } from './type';\n\ntype InternationalizationConsistencyKey =\n | 'penalties'\n | 'discount'\n | 'vatMention'\n | 'recoveryCost'\n | 'paymentType'\n | 'termsOfPayment';\n\nexport const internationalizationChoices: InternationalizationChoicesType = {\n fr: {\n inputLists: {\n headers: {\n termsOfPayment: [\n 'À la livraison',\n 'À la commande',\n 'À réception de la facture',\n 'Exigible sous 14 jours',\n 'Exigible sous 30 jours',\n '30 jours à réception de la facture',\n '45 jours à réception de la facture',\n '60 jours à réception de la facture',\n ],\n accountingCategories: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Livraison de biens' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Prestation de services' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Prestation de services et livraison de biens' },\n ],\n },\n options: {\n penalties: ['Non applicable', '3 fois le taux légal', 'Taux directeur de la BCE + 10 points'],\n discount: ['Non applicable', 'Aucun escompte en cas de paiement anticipé'],\n vatMention: [\n 'Non concerné',\n 'Non applicable',\n 'TVA non applicable, art. 293 B du CGI',\n 'TVA non applicable - Exportation hors UE - Art. 259-1 du CGI',\n \"Non soumis à TVA selon l'article 261C du CGI\",\n 'Article 261 D du code général des impôts (CGI)',\n 'Exonération de TVA, article 283-2 du Code général des impôts',\n 'Exonération de la TVA : Article 262 ter I du CGI',\n 'Mention de TVA 261.4.4 1 du CGI',\n \"Régime particulier – Biens d'occasion - article 297 A du CGI et directive communautaire 2006/112/CE\",\n \"Régime particulier – Objets d'art - article 297 A du CGI et directive communautaire 2006/112/CE\",\n \"Régime particulier – Objets de collection ou d'antiquité - article 297 A du CGI et directive communautaire 2006/112/CE\",\n 'Régime particulier – Agences de voyage - article 297 A du CGI et directive communautaire 2006/112/CE',\n 'Facture soumise au régime de l’auto-liquidation de la TVA',\n ],\n recoveryCost: ['Non applicable', '40€'],\n paymentType: ['Carte bancaire', 'Chèque', 'Espèces', 'Prélèvement', 'Virement bancaire'],\n },\n },\n template: {\n common: {\n headers: {\n emissionDate: \"Date d'émission\",\n accountingCategory: {\n title: \"Catégorie de l'opération\",\n choices: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Livraison de biens' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Prestation de services' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Prestation de services et livraison de biens' },\n ],\n },\n },\n footer: {\n capital: 'au capital de',\n siren: 'immatriculée sous le SIREN',\n vatCode: 'N° TVA',\n marginVat: 'Régime TVA sur marge',\n legalVatMention: 'ART 297-A du CGI ou directive 2006-212 CE',\n shouldPayTaxAfterDebit: \"Option pour le paiement de la taxe d'après les débits\",\n penalties: 'Pénalités en cas de retard',\n discount: 'Escompte',\n recoveryCosts: 'Indemnités forfaitaire en cas de retard',\n generate: 'Généré par',\n },\n options: {\n vatMention: 'Mention TVA',\n paymentType: 'Mode de paiement',\n bank: 'BANQUE',\n approval: 'Bon pour accord',\n comment: 'Commentaire',\n },\n table: {\n headers: {\n product: 'Article',\n quantity: 'Quantité',\n unitPrice: 'P.U HT',\n unitPriceWithoutVat: 'P.U',\n discount: 'Remise',\n vat: 'TVA',\n amount: 'Montant HT',\n amountWithoutVat: 'Montant',\n base: 'Base',\n rate: 'Taux',\n vatAmount: 'Montant TVA',\n recap: 'Récapitulatif',\n },\n lines: {\n totalHt: 'Total HT',\n vat: 'TVA',\n totalTTC: 'Total TTC',\n totalWhitoutVat: 'Total',\n deposit: 'Acompte',\n remainderToPay: 'Reste à payer',\n netToPay: 'Net à payer',\n },\n },\n },\n invoice: {\n headers: {\n title: 'Facture',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n estimate: {\n headers: {\n title: 'Devis',\n dueDate: \"Valide jusqu'au\",\n termsOfPayment: 'Conditions de règlement',\n },\n },\n orderForm: {\n headers: {\n title: 'Bon de commande',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Conditions de règlement',\n },\n },\n deposit: {\n headers: {\n title: \"Facture d'acompte\",\n expirationDate: \"Date d'expiration\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n asset: {\n headers: {\n title: 'Avoir',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n remainder: {\n headers: {\n title: 'Facture de solde',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n draft: {\n headers: {\n title: 'Brouillon',\n dueDate: \"Date d'échéance\",\n termsOfPayment: 'Date limite de règlement',\n },\n },\n },\n mail: {\n common: {\n dueDate: 'Échéance',\n generate: 'Généré par',\n displayDocument: 'Afficher le document',\n totalHt: 'Total HT',\n totalVat: 'Total TVA',\n totalTtc: 'Total TTC',\n send: 'vous adresse',\n },\n invoice: {\n title: 'cette facture',\n subTitle: 'Facture',\n },\n estimate: {\n title: 'ce devis',\n subTitle: 'Devis',\n },\n orderForm: {\n title: 'ce bon de commande',\n subTitle: 'Bon de commande',\n },\n deposit: {\n title: 'cet acompte',\n subTitle: 'Acompte',\n },\n asset: {\n title: 'cet avoir',\n subTitle: 'Avoir',\n },\n remainder: {\n title: 'cette facture',\n subTitle: 'Facture',\n },\n default: {\n title: 'ce document',\n subTitle: 'Document',\n },\n },\n },\n en: {\n inputLists: {\n headers: {\n termsOfPayment: [\n 'On delivery',\n 'On order',\n 'Upon receipt of invoice',\n 'Due within 14 days',\n 'Due within 30 days',\n '30 days upon receipt of invoice',\n '45 days upon receipt of invoice',\n '60 days upon receipt of invoice',\n ],\n accountingCategories: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Delivery of goods' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Services delivery' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Services and goods delivery' },\n ],\n },\n options: {\n penalties: ['Not applicable', '3 times the legal rate', 'ECB key rate + 10 points'],\n discount: ['Not applicable', 'No discount for early payment'],\n vatMention: [\n 'Not affected',\n 'Not applicable',\n 'VAT not applicable, art. 293 B of the French General Tax Code (FGTC)',\n 'VAT not applicable - Exports outside the EU - Art. 259-1 of the French General Tax Code (FGTC)',\n 'Not subject to VAT according to article 261C of the French General Tax Code (FGTC)',\n 'Article 261D of the French General Tax Code (FGTC)',\n 'VAT exemption, article 283-2 of the French General Tax Code (FGTC)',\n 'VAT exemption: Article 262 ter I of the French General Tax Code (FGTC)',\n 'VAT notice 261.4.4 1 of the French General Tax Code (FGTC)',\n 'Specific regime - Second-hand goods - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n 'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n 'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n 'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n 'Invoice subject to VAT reverse charge system',\n ],\n recoveryCost: ['Not applicable', '40€'],\n paymentType: ['Credit card', 'Check', 'Cash', 'Direct debit', 'Bank transfer'],\n },\n },\n template: {\n common: {\n headers: {\n emissionDate: 'Invoice date',\n accountingCategory: {\n title: 'Transaction type',\n choices: [\n { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'supply of goods' },\n { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Services provision' },\n { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Services provision and supply of goods' },\n ],\n },\n },\n footer: {\n capital: 'with capital of',\n siren: 'registered under SIREN',\n vatCode: 'VAT number',\n marginVat: 'VAT margin scheme',\n legalVatMention: 'ART 297-A of the FGTC or directive 2006-212 EC',\n shouldPayTaxAfterDebit: 'Option to pay tax on debits',\n penalties: 'Late fees',\n discount: 'discount',\n recoveryCosts: 'flat-rate delay compensation',\n generate: 'Created by',\n },\n options: {\n vatMention: 'VAT mention',\n paymentType: 'payment type',\n bank: 'BANK',\n approval: 'Agreed and signed',\n comment: 'Comment',\n },\n table: {\n headers: {\n product: 'Product',\n quantity: 'Quantity',\n unitPrice: 'Excl. tax unit price',\n unitPriceWithoutVat: 'Unit price',\n discount: 'Discount',\n vat: 'VAT',\n amount: 'Amount excl. tax',\n amountWithoutVat: 'Amount',\n base: 'Base',\n rate: 'Rate',\n vatAmount: 'VAT amount',\n recap: 'Summary',\n },\n lines: {\n totalHt: 'Amount excl. tax',\n vat: 'VAT',\n totalTTC: 'Amount incl. tax',\n totalWhitoutVat: 'Amount',\n deposit: 'Deposit',\n remainderToPay: 'Remainder to pay',\n netToPay: 'Net to pay',\n },\n },\n },\n invoice: {\n headers: {\n title: 'Invoice',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n estimate: {\n headers: {\n title: 'Quotation',\n dueDate: 'Valid until',\n termsOfPayment: 'Term of payment',\n },\n },\n orderForm: {\n headers: {\n title: 'Order form',\n dueDate: 'Valid until',\n termsOfPayment: 'Term of payment',\n },\n },\n deposit: {\n headers: {\n title: 'Deposit invoice',\n expirationDate: 'expiry date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n asset: {\n headers: {\n title: 'Credit note',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n remainder: {\n headers: {\n title: 'Balance invoice',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n draft: {\n headers: {\n title: 'Draft',\n dueDate: 'Due date',\n termsOfPayment: 'Deadline for payment',\n },\n },\n },\n mail: {\n common: {\n dueDate: 'Due date',\n generate: 'Created by',\n displayDocument: 'Display document',\n totalHt: 'Total excl. tax',\n totalVat: 'Total VAT',\n totalTtc: 'Total incl. tax',\n send: 'send you',\n },\n invoice: {\n title: 'this invoice',\n subTitle: 'Invoice',\n },\n estimate: {\n title: 'this estimate',\n subTitle: 'Estimate',\n },\n orderForm: {\n title: 'this order form',\n subTitle: 'Order form',\n },\n deposit: {\n title: 'this deposit',\n subTitle: 'Deposit',\n },\n asset: {\n title: 'this asset',\n subTitle: 'Asset',\n },\n remainder: {\n title: 'this invoice',\n subTitle: 'Invoice',\n },\n default: {\n title: 'this document',\n subTitle: 'Document',\n },\n },\n },\n};\n\nconst internationalizationMatching: { [key: string]: { fr: string; en: string }[] } = {\n penalties: [\n { fr: 'Non applicable', en: 'Not applicable' },\n { fr: '3 fois le taux légal', en: '3 times the legal rate' },\n { fr: 'Taux directeur de la BCE + 10 points', en: 'ECB key rate + 10 points' },\n ],\n discount: [\n { fr: 'Non applicable', en: 'Not applicable' },\n { fr: 'Aucun escompte en cas de paiement anticipé', en: 'No discount for early payment' },\n ],\n recoveryCost: [\n { fr: 'Non applicable', en: 'Not applicable' },\n { fr: '40€', en: '40€' },\n ],\n paymentType: [\n { fr: 'Carte bancaire', en: 'Credit card' },\n { fr: 'Chèque', en: 'Check' },\n { fr: 'Espèces', en: 'Cash' },\n { fr: 'Prélèvement', en: 'Direct debit' },\n { fr: 'Virement bancaire', en: 'Bank transfer' },\n ],\n vatMention: [\n { fr: 'Non concerné', en: 'Not affected' },\n { fr: 'Non applicable', en: 'Not applicable' },\n {\n fr: 'TVA non applicable, art. 293 B du CGI',\n en: 'VAT not applicable, art. 293 B of the French General Tax Code (FGTC)',\n },\n {\n fr: 'TVA non applicable - Exportation hors UE - Art. 259-1 du CGI',\n en: 'VAT not applicable - Exports outside the EU - Art. 259-1 of the French General Tax Code (FGTC)',\n },\n {\n fr: \"Non soumis à TVA selon l'article 261C du CGI\",\n en: 'Not subject to VAT according to article 261C of the French General Tax Code (FGTC)',\n },\n { fr: 'Article 261 D du code général des impôts (CGI)', en: 'Article 261D of the French General Tax Code (FGTC)' },\n {\n fr: 'Exonération de TVA, article 283-2 du Code général des impôts',\n en: 'VAT exemption, article 283-2 of the French General Tax Code (FGTC)',\n },\n {\n fr: 'Exonération de la TVA : Article 262 ter I du CGI',\n en: 'VAT exemption: Article 262 ter I of the French General Tax Code (FGTC)',\n },\n { fr: 'Mention de TVA 261.4.4 1 du CGI', en: 'VAT notice 261.4.4 1 of the French General Tax Code (FGTC)' },\n {\n fr: \"Régime particulier – Biens d'occasion - article 297 A du CGI et directive communautaire 2006/112/CE\",\n en: 'Specific regime - Second-hand goods - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n },\n {\n fr: \"Régime particulier – Objets d'art - article 297 A du CGI et directive communautaire 2006/112/CE\",\n en: 'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n },\n {\n fr: \"Régime particulier – Objets de collection ou d'antiquité - article 297 A du CGI et directive communautaire 2006/112/CE\",\n en: 'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n },\n {\n fr: 'Régime particulier – Agences de voyage - article 297 A du CGI et directive communautaire 2006/112/CE',\n en: 'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',\n },\n {\n fr: 'Facture soumise au régime de l’auto-liquidation de la TVA',\n en: 'Invoice subject to VAT reverse charge system',\n },\n ],\n termsOfPayment: [\n {\n fr: 'À la livraison',\n en: 'On delivery',\n },\n {\n fr: 'À la command',\n en: 'On order',\n },\n {\n fr: 'À réception de la facture',\n en: 'Upon receipt of invoice',\n },\n {\n fr: 'Exigible sous 14 jours',\n en: 'Due within 14 days',\n },\n {\n fr: 'Exigible sous 30 jours',\n en: 'Due within 30 days',\n },\n {\n fr: '30 jours à réception de la facture',\n en: '30 days upon receipt of invoice',\n },\n {\n fr: '45 jours à réception de la facture',\n en: '45 days upon receipt of invoice',\n },\n {\n fr: '60 jours à réception de la facture',\n en: '60 days upon receipt of invoice',\n },\n ],\n};\n\nexport const internationalizationConsistency = (\n language: InvoiceLanguage,\n value: string,\n key: InternationalizationConsistencyKey,\n): string | undefined => {\n const keyObjectToMacht = internationalizationMatching[key];\n return language === InvoiceLanguage.FR\n ? keyObjectToMacht.find((obj) => obj.fr === value)?.fr\n : keyObjectToMacht.find((obj) => obj.fr === value)?.en;\n};\n"]}
@@ -35,7 +35,7 @@ function getCerfa3517Century23Payload(accountingEntries, payload) {
35
35
  const vatReducedRate8Dot5 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => ae.idVat === Vat_1.Vat.TX_8_5.id), taxedOperationsAccounts, 0, true));
36
36
  const vatReducedRate2Dot1 = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => ae.idVat === Vat_1.Vat.TX_2_1.id), taxedOperationsAccounts, 0, true));
37
37
  const prestation2Entries = vatEntries.filter((ae) => intracomVat.includes(ae.idVat));
38
- const presta2Accounts = ['604', '61', '62', '607', '651', '601', '602']; // Ajout suite à la demande de Ben x Angelo
38
+ const presta2Accounts = ['604', '61', '62', '607', '651', '601', '602', '606']; // Ajout suite à la demande de Ben x Angelo, 606 Angelo
39
39
  const prestation2Base = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(prestation2Entries, presta2Accounts, 0, true));
40
40
  const prestation2AmountOfVat = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getTaxAmountByAccountNumber)(prestation2Entries, presta2Accounts, 0, false, true));
41
41
  const saleOfImmobilization = (0, utils_1.setZeroIfIsNegative)((0, utils_1.getAmountByAccountNumber)(vatEntries.filter((ae) => !withoutTaxVat.includes(ae.idVat) && frenchVat.includes(ae.idVat)), ['775'], 0, true));