@silexpert/core 1.2.80 → 1.2.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/dist/cjs/api/resources/Reminder.d.ts +17 -2
  2. package/dist/cjs/api/resources/Reminder.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/Reminder.js +31 -2
  4. package/dist/cjs/api/resources/Reminder.js.map +1 -1
  5. package/dist/cjs/types/Enum/AppointmentState.d.ts +6 -1
  6. package/dist/cjs/types/Enum/AppointmentState.d.ts.map +1 -1
  7. package/dist/cjs/types/Enum/AppointmentState.js +5 -0
  8. package/dist/cjs/types/Enum/AppointmentState.js.map +1 -1
  9. package/dist/cjs/types/Enum/CommercialManagement.d.ts.map +1 -1
  10. package/dist/cjs/types/Enum/CommercialManagement.js +5 -36
  11. package/dist/cjs/types/Enum/CommercialManagement.js.map +1 -1
  12. package/dist/cjs/types/Enum/IncomeStatement.js +1 -1
  13. package/dist/cjs/types/Enum/IncomeStatement.js.map +1 -1
  14. package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +17 -7
  15. package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  16. package/dist/cjs/types/Interface/api/commercialManagement/Create.js +66 -11
  17. package/dist/cjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
  18. package/dist/cjs/types/Interface/api/commercialManagement/Update.d.ts +7 -0
  19. package/dist/cjs/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
  20. package/dist/cjs/types/Interface/api/commercialManagement/Update.js +36 -1
  21. package/dist/cjs/types/Interface/api/commercialManagement/Update.js.map +1 -1
  22. package/dist/cjs/types/Interface/models/IEstimateInvoice.d.ts +3 -0
  23. package/dist/cjs/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
  24. package/dist/cjs/types/Interface/models/IEstimateInvoice.js.map +1 -1
  25. package/dist/cjs/types/Interface/models/IInvoiceReminder.d.ts +3 -0
  26. package/dist/cjs/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
  27. package/dist/cjs/types/Interface/models/IInvoiceReminder.js.map +1 -1
  28. package/dist/cjs/types/Interface/models/IReminder.d.ts +18 -0
  29. package/dist/cjs/types/Interface/models/IReminder.d.ts.map +1 -0
  30. package/dist/cjs/types/Interface/models/IReminder.js +3 -0
  31. package/dist/cjs/types/Interface/models/IReminder.js.map +1 -0
  32. package/dist/cjs/types/Interface/models/IReminderAttachment.d.ts +12 -0
  33. package/dist/cjs/types/Interface/models/IReminderAttachment.d.ts.map +1 -0
  34. package/dist/cjs/types/Interface/models/IReminderAttachment.js +3 -0
  35. package/dist/cjs/types/Interface/models/IReminderAttachment.js.map +1 -0
  36. package/dist/cjs/types/Interface/models/IScheduledReminder.d.ts +8 -0
  37. package/dist/cjs/types/Interface/models/IScheduledReminder.d.ts.map +1 -0
  38. package/dist/cjs/types/Interface/models/IScheduledReminder.js +3 -0
  39. package/dist/cjs/types/Interface/models/IScheduledReminder.js.map +1 -0
  40. package/dist/cjs/types/Interface/models/ISocietyGescom.d.ts +3 -3
  41. package/dist/cjs/types/Interface/models/ISocietyGescom.d.ts.map +1 -1
  42. package/dist/cjs/types/Interface/models/ISocietyGescom.js.map +1 -1
  43. package/dist/cjs/types/index.d.ts +3 -0
  44. package/dist/cjs/types/index.d.ts.map +1 -1
  45. package/dist/cjs/types/index.js +3 -0
  46. package/dist/cjs/types/index.js.map +1 -1
  47. package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
  48. package/dist/cjs/utils/commercialManagement/document.js +21 -16
  49. package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
  50. package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts +1 -1
  51. package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
  52. package/dist/cjs/utils/commercialManagement/internationalization/choices.js +15 -1
  53. package/dist/cjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
  54. package/dist/mjs/api/resources/Reminder.d.ts +17 -2
  55. package/dist/mjs/api/resources/Reminder.d.ts.map +1 -1
  56. package/dist/mjs/api/resources/Reminder.js +31 -2
  57. package/dist/mjs/api/resources/Reminder.js.map +1 -1
  58. package/dist/mjs/types/Enum/AppointmentState.d.ts +6 -1
  59. package/dist/mjs/types/Enum/AppointmentState.d.ts.map +1 -1
  60. package/dist/mjs/types/Enum/AppointmentState.js +5 -0
  61. package/dist/mjs/types/Enum/AppointmentState.js.map +1 -1
  62. package/dist/mjs/types/Enum/CommercialManagement.d.ts.map +1 -1
  63. package/dist/mjs/types/Enum/CommercialManagement.js +5 -36
  64. package/dist/mjs/types/Enum/CommercialManagement.js.map +1 -1
  65. package/dist/mjs/types/Enum/IncomeStatement.js +1 -1
  66. package/dist/mjs/types/Enum/IncomeStatement.js.map +1 -1
  67. package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +17 -7
  68. package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
  69. package/dist/mjs/types/Interface/api/commercialManagement/Create.js +73 -14
  70. package/dist/mjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
  71. package/dist/mjs/types/Interface/api/commercialManagement/Update.d.ts +7 -0
  72. package/dist/mjs/types/Interface/api/commercialManagement/Update.d.ts.map +1 -1
  73. package/dist/mjs/types/Interface/api/commercialManagement/Update.js +40 -1
  74. package/dist/mjs/types/Interface/api/commercialManagement/Update.js.map +1 -1
  75. package/dist/mjs/types/Interface/models/IEstimateInvoice.d.ts +3 -0
  76. package/dist/mjs/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
  77. package/dist/mjs/types/Interface/models/IEstimateInvoice.js.map +1 -1
  78. package/dist/mjs/types/Interface/models/IInvoiceReminder.d.ts +3 -0
  79. package/dist/mjs/types/Interface/models/IInvoiceReminder.d.ts.map +1 -1
  80. package/dist/mjs/types/Interface/models/IInvoiceReminder.js.map +1 -1
  81. package/dist/mjs/types/Interface/models/IReminder.d.ts +18 -0
  82. package/dist/mjs/types/Interface/models/IReminder.d.ts.map +1 -0
  83. package/dist/mjs/types/Interface/models/IReminder.js +2 -0
  84. package/dist/mjs/types/Interface/models/IReminder.js.map +1 -0
  85. package/dist/mjs/types/Interface/models/IReminderAttachment.d.ts +12 -0
  86. package/dist/mjs/types/Interface/models/IReminderAttachment.d.ts.map +1 -0
  87. package/dist/mjs/types/Interface/models/IReminderAttachment.js +2 -0
  88. package/dist/mjs/types/Interface/models/IReminderAttachment.js.map +1 -0
  89. package/dist/mjs/types/Interface/models/IScheduledReminder.d.ts +8 -0
  90. package/dist/mjs/types/Interface/models/IScheduledReminder.d.ts.map +1 -0
  91. package/dist/mjs/types/Interface/models/IScheduledReminder.js +2 -0
  92. package/dist/mjs/types/Interface/models/IScheduledReminder.js.map +1 -0
  93. package/dist/mjs/types/Interface/models/ISocietyGescom.d.ts +3 -3
  94. package/dist/mjs/types/Interface/models/ISocietyGescom.d.ts.map +1 -1
  95. package/dist/mjs/types/Interface/models/ISocietyGescom.js.map +1 -1
  96. package/dist/mjs/types/index.d.ts +3 -0
  97. package/dist/mjs/types/index.d.ts.map +1 -1
  98. package/dist/mjs/types/index.js +3 -0
  99. package/dist/mjs/types/index.js.map +1 -1
  100. package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
  101. package/dist/mjs/utils/commercialManagement/document.js +10 -5
  102. package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
  103. package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts +1 -1
  104. package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
  105. package/dist/mjs/utils/commercialManagement/internationalization/choices.js +15 -1
  106. package/dist/mjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
  107. package/package.json +1 -1
  108. package/ts/api/resources/Reminder.ts +51 -5
  109. package/ts/types/Enum/AppointmentState.ts +5 -0
  110. package/ts/types/Enum/CommercialManagement.ts +10 -36
  111. package/ts/types/Enum/IncomeStatement.ts +1 -1
  112. package/ts/types/Interface/api/commercialManagement/Create.ts +55 -12
  113. package/ts/types/Interface/api/commercialManagement/Update.ts +30 -0
  114. package/ts/types/Interface/models/IEstimateInvoice.ts +3 -0
  115. package/ts/types/Interface/models/IInvoiceReminder.ts +3 -0
  116. package/ts/types/Interface/models/IReminder.ts +20 -0
  117. package/ts/types/Interface/models/IReminderAttachment.ts +14 -0
  118. package/ts/types/Interface/models/IScheduledReminder.ts +7 -0
  119. package/ts/types/Interface/models/ISocietyGescom.ts +3 -3
  120. package/ts/types/index.ts +3 -0
  121. package/ts/utils/commercialManagement/document.ts +11 -5
  122. package/ts/utils/commercialManagement/internationalization/choices.ts +17 -2
@@ -36,6 +36,7 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
36
36
  const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');
37
37
  const locale = payload.language ?? InvoiceLanguage.FR;
38
38
  const languageOption = internationalizationChoices[locale];
39
+ const accountingCategory = AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null;
39
40
  const data = {
40
41
  ...payload,
41
42
  thirdParty,
@@ -43,15 +44,17 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
43
44
  idEstimateInvoiceType,
44
45
  title: payload.title ?? null,
45
46
  penalties: payload.penalties
46
- ? (internationalizationConsistency(locale, payload.penalties, 'penalties') ?? null)
47
+ ? (internationalizationConsistency(locale, payload.penalties, 'penalties') ?? payload.penalties)
47
48
  : null,
48
49
  termsOfPayment: payload.termsOfPayment
49
- ? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ?? null)
50
+ ? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ?? payload.termsOfPayment)
50
51
  : null,
51
52
  compensation: payload.compensation
52
- ? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ?? null)
53
+ ? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ?? payload.compensation)
54
+ : null,
55
+ discount: payload.discount
56
+ ? (internationalizationConsistency(locale, payload.discount, 'discount') ?? payload.discount)
53
57
  : null,
54
- discount: payload.discount ? (internationalizationConsistency(locale, payload.discount, 'discount') ?? null) : null,
55
58
  vatMention: payload.vatMention
56
59
  ? (internationalizationConsistency(locale, payload.vatMention, 'vatMention') ?? null)
57
60
  : null,
@@ -86,7 +89,9 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
86
89
  shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),
87
90
  // @ts-ignore
88
91
  marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)),
89
- accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,
92
+ accountingCategoryFormatted: accountingCategory
93
+ ? (internationalizationConsistency(locale, accountingCategory, 'accountingCategory') ?? null)
94
+ : null,
90
95
  // @ts-ignore
91
96
  brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }),
92
97
  brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,
@@ -1 +1 @@
1
- {"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,IAAI,IAAI,KAAK,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AACnH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACnH,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,0BAA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AAQ,EAAE,OAAO,EAAE,CAAmB;QAClF,mBAAmB;QACnB,YAAY,EAAE,cAAc;KAC7B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,0BAA0B,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
+ {"version":3,"file":"document.js","sourceRoot":"","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AC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnB,MAAM,IAAI,GAAG;QACX,GAAG,MAAM,CAAC,OAAO;QACjB,yBAAyB,EAAE,8BAA8B,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAC1F,yBAAyB,EAAE,8BAA8B,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAC1F,iBAAiB,EAAE,8BAA8B,CAC/C,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAClE;QACD,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;QACtG,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,cAAc,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB;QAClF,mBAAmB;QACnB,YAAY,EAAE,cAAc;KAC7B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,0BAA0B,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 accountingCategory = AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null;\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') ?? payload.penalties)\n : null,\n termsOfPayment: payload.termsOfPayment\n ? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ?? payload.termsOfPayment)\n : null,\n compensation: payload.compensation\n ? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ?? payload.compensation)\n : null,\n discount: payload.discount\n ? (internationalizationConsistency(locale, payload.discount, 'discount') ?? payload.discount)\n : 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: accountingCategory\n ? (internationalizationConsistency(locale, accountingCategory, 'accountingCategory') ?? null)\n : 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,6 +1,6 @@
1
1
  import { InvoiceLanguage } from '../../../types/Enum/CommercialManagement';
2
2
  import { InternationalizationChoicesType } from './type';
3
- type InternationalizationConsistencyKey = 'penalties' | 'discount' | 'vatMention' | 'recoveryCost' | 'paymentType' | 'termsOfPayment';
3
+ type InternationalizationConsistencyKey = 'penalties' | 'discount' | 'vatMention' | 'recoveryCost' | 'paymentType' | 'termsOfPayment' | 'accountingCategory';
4
4
  export declare const internationalizationChoices: InternationalizationChoicesType;
5
5
  export declare const internationalizationConsistency: (language: InvoiceLanguage, value: string, key: InternationalizationConsistencyKey) => string | undefined;
6
6
  export {};
@@ -1 +1 @@
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
+ {"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,GAChB,oBAAoB,CAAC;AAEzB,eAAO,MAAM,2BAA2B,EAAE,+BA6XzC,CAAC;AAuHF,eAAO,MAAM,+BAA+B,aAChC,eAAe,SAClB,MAAM,OACR,kCAAkC,KACtC,MAAM,GAAG,SAKX,CAAC"}
@@ -239,7 +239,7 @@ export const internationalizationChoices = {
239
239
  accountingCategory: {
240
240
  title: 'Transaction type',
241
241
  choices: [
242
- { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'supply of goods' },
242
+ { id: AccountingCategoryId.DELIVERY_OF_GOOD, label: 'Supply of goods' },
243
243
  { id: AccountingCategoryId.SERVICE_DELIVERY, label: 'Services provision' },
244
244
  { id: AccountingCategoryId.GOOD_AND_SERVICE, label: 'Services provision and supply of goods' },
245
245
  ],
@@ -482,6 +482,20 @@ const internationalizationMatching = {
482
482
  en: '60 days upon receipt of invoice',
483
483
  },
484
484
  ],
485
+ accountingCategory: [
486
+ {
487
+ fr: 'Livraison de biens',
488
+ en: 'Supply of goods',
489
+ },
490
+ {
491
+ fr: 'Prestation de services',
492
+ en: 'Services provision',
493
+ },
494
+ {
495
+ fr: 'Prestation de services et livraison de biens',
496
+ en: 'Services provision and supply of goods',
497
+ },
498
+ ],
485
499
  };
486
500
  export const internationalizationConsistency = (language, value, key) => {
487
501
  const keyObjectToMacht = internationalizationMatching[key];
@@ -1 +1 @@
1
- {"version":3,"file":"choices.js","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAWjG,MAAM,CAAC,MAAM,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,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE;oBAC1E,EAAE,EAAE,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,wBAAwB,EAAE;oBAC9E,EAAE,EAAE,EAAE,oBAAoB,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;oBAC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,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,QAAyB,EACzB,KAAa,EACb,GAAuC,EACnB,EAAE;IACtB,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,GAAG,CAAC,CAAC;IAC3D,OAAO,QAAQ,KAAK,eAAe,CAAC,EAAE;QACpC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAE;QACtD,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAE,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["import { 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"]}
1
+ {"version":3,"file":"choices.js","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAYjG,MAAM,CAAC,MAAM,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,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,oBAAoB,EAAE;oBAC1E,EAAE,EAAE,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,wBAAwB,EAAE;oBAC9E,EAAE,EAAE,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,KAAK,EAAE,8CAA8C,EAAE;iBACrG;aACF;YACD,OAAO,EAAE;gBACP,SAAS,EAAE,CAAC,gBAAgB,EAAE,sBAAsB,EAAE,sCAAsC,CAAC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YACE,EAAE,EAAE,oCAAoC;YACxC,EAAE,EAAE,iCAAiC;SACtC;QACD;YACE,EAAE,EAAE,oCAAoC;YACxC,EAAE,EAAE,iCAAiC;SACtC;KACF;IACD,kBAAkB,EAAE;QAClB;YACE,EAAE,EAAE,oBAAoB;YACxB,EAAE,EAAE,iBAAiB;SACtB;QACD;YACE,EAAE,EAAE,wBAAwB;YAC5B,EAAE,EAAE,oBAAoB;SACzB;QACD;YACE,EAAE,EAAE,8CAA8C;YAClD,EAAE,EAAE,wCAAwC;SAC7C;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAC7C,QAAyB,EACzB,KAAa,EACb,GAAuC,EACnB,EAAE;IACtB,MAAM,gBAAgB,GAAG,4BAA4B,CAAC,GAAG,CAAC,CAAC;IAC3D,OAAO,QAAQ,KAAK,eAAe,CAAC,EAAE;QACpC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAE;QACtD,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,KAAK,CAAC,EAAE,EAAE,CAAC;AAC3D,CAAC,CAAC","sourcesContent":["import { 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 | 'accountingCategory';\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 accountingCategory: [\n {\n fr: 'Livraison de biens',\n en: 'Supply of goods',\n },\n {\n fr: 'Prestation de services',\n en: 'Services provision',\n },\n {\n fr: 'Prestation de services et livraison de biens',\n en: 'Services provision and supply of goods',\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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.2.80",
3
+ "version": "1.2.82",
4
4
  "description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
5
5
  "homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
6
6
  "main": "dist/cjs/index.js",
@@ -1,22 +1,68 @@
1
1
  import { Resource } from '../Resource';
2
- import { CreateReminder, IInvoiceReminder, UpdateReminder } from '../../types';
2
+ import {
3
+ CreateReminder,
4
+ CreateReminder2,
5
+ CreateReminderAttachment,
6
+ CreateScheduleReminder,
7
+ IInvoiceReminder,
8
+ IReminder,
9
+ IReminderAttachment,
10
+ IScheduledReminder,
11
+ UpdateReminder,
12
+ UpdateReminder2,
13
+ } from '../../types';
3
14
 
4
15
  export class Reminder extends Resource {
16
+ /**
17
+ * @deprecated
18
+ */
5
19
  create(idEstimateInvoice: number, payload: CreateReminder): Promise<IInvoiceReminder> {
6
20
  return this.axios.$post(`/commercial-management/documents/${idEstimateInvoice}/reminders`, payload);
7
21
  }
8
22
 
23
+ /**
24
+ * @deprecated
25
+ */
9
26
  update(id: number, idEstimateInvoice: number, payload: UpdateReminder): Promise<IInvoiceReminder> {
10
27
  return this.axios.$put(`/commercial-management/documents/${idEstimateInvoice}/reminders/${id}`, payload);
11
28
  }
12
29
 
30
+ /**
31
+ * @deprecated
32
+ */
13
33
  delete(id: number, idEstimateInvoice: number): Promise<true> {
14
34
  return this.axios.$delete(`/commercial-management/documents/${idEstimateInvoice}/reminders/${id}`);
15
35
  }
16
36
 
17
- deleteAttachment(id: number, idEstimateInvoice: number, idReminder: number): Promise<true> {
18
- return this.axios.$delete(
19
- `/commercial-management/documents/${idEstimateInvoice}/reminders/${idReminder}/attachments/${id}`,
20
- );
37
+ createReminder(payload: CreateReminder2): Promise<IReminder> {
38
+ return this.axios.$post('/commercial-management/reminders', payload);
39
+ }
40
+
41
+ updateReminder(id: number, payload: UpdateReminder2): Promise<IReminder> {
42
+ return this.axios.$put(`/commercial-management/reminders/${id}`, payload);
43
+ }
44
+
45
+ deleteReminder(id: number): Promise<true> {
46
+ return this.axios.$delete(`/commercial-management/reminders/${id}`);
47
+ }
48
+
49
+ // ATTACHMENTS
50
+
51
+ createAttachment(idReminder: number, payload: CreateReminderAttachment): Promise<IReminderAttachment> {
52
+ return this.axios.$post(`/commercial-management/reminders/${idReminder}/attachments`, payload);
53
+ }
54
+
55
+ deleteAttachment(id: number, idReminder: number): Promise<true> {
56
+ return this.axios.$delete(`/commercial-management/reminders/${idReminder}/attachments/${id}`);
57
+ }
58
+
59
+ // SCHEDULES
60
+
61
+ createSchedule(idReminder: number, payload: CreateScheduleReminder): Promise<IScheduledReminder> {
62
+ return this.axios.$post(`/commercial-management/reminders/${idReminder}/schedules`, payload);
63
+ }
64
+
65
+ deleteSchedule(id: number, idReminder: number): Promise<true> {
66
+ return this.axios.$delete(`/commercial-management/reminders/${idReminder}/schedules/${id}`);
21
67
  }
22
68
  }
@@ -4,6 +4,7 @@ export enum StateAppointment {
4
4
  SOCIETY_CANCELLED = 3,
5
5
  MISSING_FILE = 4,
6
6
  BUSINESS_CONTRIBUTOR = 5,
7
+ MANY_COMPANIES = 6,
7
8
  }
8
9
 
9
10
  export const StateAppointmentDetail = {
@@ -27,4 +28,8 @@ export const StateAppointmentDetail = {
27
28
  id: StateAppointment.BUSINESS_CONTRIBUTOR,
28
29
  name: "Apporteur d'affaires",
29
30
  },
31
+ MANY_COMPANIES: {
32
+ id: StateAppointment.MANY_COMPANIES,
33
+ name: 'Multiples sociétés',
34
+ },
30
35
  };
@@ -183,66 +183,40 @@ export const DefaultEmailTemplateList: Array<Omit<ISaleEmail, 'idSociety'>> = [
183
183
  {
184
184
  name: 'modèle devis par défaut',
185
185
  subject: 'Votre devis',
186
- content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
187
- <p>Vous trouverez ci-joint votre devis N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p>
188
- <p>Vous en souhaitant bonne réception.</p>
189
- <p>Cordialement,
190
- <span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
191
- </p>`,
186
+ content:
187
+ '<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p> <p>Vous trouverez ci-joint votre devis N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p> <p>Vous en souhaitant bonne réception. </p> <p>Cordialement,</p><p><span style="color: rgb(131, 131, 132);">[raison_sociale]</span></p>',
192
188
  type: EmailType.ESTIMATE,
193
189
  isDefault: false,
194
190
  },
195
191
  {
196
192
  name: 'modèle facture par défaut',
197
193
  subject: 'Votre facture',
198
- content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
199
- <p>Vous trouverez ci-joint votre facture N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>.</p> <p>Vous en souhaitant bonne réception.</p>
200
- <p>Cordialement,
201
- <span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
202
- </p>`,
194
+ content:
195
+ '<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p> <p>Vous trouverez ci-joint votre facture N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>.</p> <p>Vous en souhaitant bonne réception.</p> <p>Cordialement,</p><p><span style="color: rgb(131, 131, 132);">[raison_sociale]</span></p>',
203
196
  type: EmailType.INVOICE,
204
197
  isDefault: false,
205
198
  },
206
199
  {
207
200
  name: 'modèle bon de commande par défaut',
208
201
  subject: 'Votre bon de commande',
209
- content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span></p>
210
- <p>Vous trouverez ci-joint votre bon de commande N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p>
211
- <p>Vous en souhaitant bonne réception.</p>
212
- <p>Cordialement,
213
- <span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
214
- </p>`,
202
+ content:
203
+ '<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span></p> <p>Vous trouverez ci-joint votre bon de commande N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p> <p>Vous en souhaitant bonne réception.</p> <p>Cordialement,</p><p><span style="color: rgb(131, 131, 132);">[raison_sociale]</span></p>',
215
204
  type: EmailType.ORDER_FORM,
216
205
  isDefault: false,
217
206
  },
218
207
  {
219
208
  name: 'modèle avoir par défaut',
220
209
  subject: 'Votre avoir',
221
- content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
222
- <p>Vous trouverez ci-joint votre facture.</p>
223
- <p>Vous trouverez ci-joint votre bon de commande N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p>
224
- <p>Vous en souhaitant bonne réception.</p>
225
- <p>Cordialement,
226
- <span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
227
- </p>`,
210
+ content:
211
+ '<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p> <p>Vous trouverez ci-joint votre facture.</p> <p>Vous trouverez ci-joint votre bon de commande N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span>. </p> <p>Vous en souhaitant bonne réception.</p> <p>Cordialement,</p><p><span style="color: rgb(131, 131, 132);">[raison_sociale]</span></p>',
228
212
  type: EmailType.ASSET,
229
213
  isDefault: false,
230
214
  },
231
215
  {
232
216
  name: 'modèle relance par défaut',
233
217
  subject: 'Votre facture',
234
- content: `<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p>
235
- <p>
236
- Je me permets de revenir vers vous concernant la facture N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span> pour laquelle le paiement est toujours en attente.
237
- </p>
238
- <p>
239
- Je vous joins à nouveau le document en pièce jointe en cas de besoin.
240
- </p>
241
- <p>Vous en souhaitant bonne réception.</p>
242
- <p>
243
- Cordialement,
244
- <span style="color: rgb(131, 131, 132);">[raison_sociale]</span>
245
- </p>`,
218
+ content:
219
+ '<p>Bonjour, <span style="color: rgb(131, 131, 132);">[nom_client]</span> </p> <p>Je me permets de revenir vers vous concernant la facture N°<span style="color: rgb(131, 131, 132);">[reference_document]</span> d’un montant de <span style="color: rgb(131, 131, 132);">[montant_ttc_document]</span> pour laquelle le paiement est toujours en attente. </p> <p>Je vous joins à nouveau le document en pièce jointe en cas de besoin.</p> <p>Vous en souhaitant bonne réception.</p> <p>Cordialement,</p><p><span style="color: rgb(131, 131, 132);">[raison_sociale]</span></p>',
246
220
  type: EmailType.CUSTOMER_REMINDER,
247
221
  isDefault: false,
248
222
  },
@@ -322,7 +322,7 @@ export const INCOME_STATEMENT_LIST: IncomeStatement[] = [
322
322
  name: 'Impôt sur les bénéfices',
323
323
  total: 0,
324
324
  key: 'incomeTax',
325
- accounts: ['695'],
325
+ accounts: ['69'],
326
326
  },
327
327
  {
328
328
  name: "Résultat de l'exercice",
@@ -10,6 +10,7 @@ import {
10
10
  IsObject,
11
11
  IsOptional,
12
12
  IsString,
13
+ Length,
13
14
  Min,
14
15
  } from 'class-validator';
15
16
  import { BorderLineType, IFile, ReadProductEditing } from '../../..';
@@ -308,11 +309,6 @@ export class CreateCommercialSetting {
308
309
  @IsString()
309
310
  externalBorderColor?: string;
310
311
 
311
- @ApiPropertyOptional()
312
- @IsOptional()
313
- @IsNumber()
314
- reminderCustomizedDayDiff?: number | null;
315
-
316
312
  @ApiPropertyOptional()
317
313
  @IsOptional()
318
314
  @IsInt()
@@ -331,7 +327,7 @@ export class CreateCommercialSetting {
331
327
  @ApiPropertyOptional()
332
328
  @IsOptional()
333
329
  @IsInt()
334
- idReminderSaleEmail?: number | null;
330
+ idReminder?: number | null;
335
331
 
336
332
  @ApiPropertyOptional()
337
333
  @IsOptional()
@@ -535,7 +531,7 @@ export class CreateInvoiceDocument extends CommercialDocumentInputs {
535
531
  assetMarginVatIds?: number[]; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes
536
532
  advanceProducts?: ReadProductEditing[]; // Laisser vide côté front, utilisé pour l'affichage des bases TVA sur les acomptes
537
533
  language?: InvoiceLanguage;
538
- reminder?: CreateReminderForTemplate | null;
534
+ reminder?: CreateReminder2 | null;
539
535
  recurrence?: CreateRecurrence | null;
540
536
  }
541
537
 
@@ -596,11 +592,6 @@ export class CreateReminder {
596
592
  idFiles?: number[];
597
593
  }
598
594
 
599
- export class CreateReminderForTemplate extends CreateReminder {
600
- idSaleEmail?: number | null;
601
- customizedDayDiff?: number | null;
602
- }
603
-
604
595
  export class CreateRecurrence {
605
596
  @ApiProperty()
606
597
  @IsEnum(RecurrenceType)
@@ -796,3 +787,55 @@ export class UpdateSaleDocumentTemplate {
796
787
  @ToBoolean()
797
788
  isDefault?: boolean;
798
789
  }
790
+
791
+ export class CreateReminder2 {
792
+ @ApiPropertyOptional()
793
+ @IsString()
794
+ @Length(0, 255)
795
+ @IsOptional()
796
+ email: string | null;
797
+
798
+ @ApiPropertyOptional()
799
+ @IsString()
800
+ @IsOptional()
801
+ content: string | null;
802
+
803
+ @ApiPropertyOptional()
804
+ @IsString()
805
+ @Length(0, 255)
806
+ @IsOptional()
807
+ subject: string | null;
808
+
809
+ @ApiPropertyOptional({ comment: 'ids of file to attach' })
810
+ @IsArray()
811
+ @IsInt({ each: true })
812
+ @IsOptional()
813
+ attachments: number[];
814
+
815
+ @ApiProperty({ comment: 'days between due date and remind' })
816
+ @IsArray()
817
+ @IsInt({ each: true })
818
+ schedules: number[];
819
+
820
+ @ApiPropertyOptional()
821
+ @IsInt()
822
+ @IsOptional()
823
+ idEstimateInvoice: number | null;
824
+
825
+ @ApiPropertyOptional()
826
+ @IsInt()
827
+ @IsOptional()
828
+ idSaleEmail: number | null;
829
+ }
830
+
831
+ export class CreateReminderAttachment {
832
+ @ApiProperty()
833
+ @IsInt()
834
+ idFile: number;
835
+ }
836
+
837
+ export class CreateScheduleReminder {
838
+ @ApiProperty()
839
+ @IsInt()
840
+ day: number;
841
+ }