@silexpert/core 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/Enum/BrandPourcentage.d.ts.map +1 -1
- package/dist/types/Enum/BrandPourcentage.js +24 -32
- package/dist/types/Enum/BrandPourcentage.js.map +1 -1
- package/dist/types/Enum/SocietyApproval.d.ts +11 -0
- package/dist/types/Enum/SocietyApproval.d.ts.map +1 -1
- package/dist/types/Enum/SocietyApproval.js +43 -20
- package/dist/types/Enum/SocietyApproval.js.map +1 -1
- package/dist/types/Enum/StatutsSection.d.ts +2 -3
- package/dist/types/Enum/StatutsSection.d.ts.map +1 -1
- package/dist/types/Enum/StatutsSection.js +1 -2
- package/dist/types/Enum/StatutsSection.js.map +1 -1
- package/dist/types/Interface/api/SocietyApproval.d.ts +1 -0
- package/dist/types/Interface/api/SocietyApproval.d.ts.map +1 -1
- package/dist/types/Interface/api/SocietyApproval.js +8 -0
- package/dist/types/Interface/api/SocietyApproval.js.map +1 -1
- package/dist/types/Interface/api/user/CreateCoworker.d.ts +1 -0
- package/dist/types/Interface/api/user/CreateCoworker.d.ts.map +1 -1
- package/dist/types/Interface/api/user/CreateCoworker.js +7 -0
- package/dist/types/Interface/api/user/CreateCoworker.js.map +1 -1
- package/dist/types/Interface/api/user/UpdateCoworker.d.ts +1 -0
- package/dist/types/Interface/api/user/UpdateCoworker.d.ts.map +1 -1
- package/dist/types/Interface/api/user/UpdateCoworker.js +7 -0
- package/dist/types/Interface/api/user/UpdateCoworker.js.map +1 -1
- package/dist/types/Interface/models/IUser.d.ts +1 -0
- package/dist/types/Interface/models/IUser.d.ts.map +1 -1
- package/dist/types/Interface/models/IUser.js +1 -0
- package/dist/types/Interface/models/IUser.js.map +1 -1
- package/dist/utils/brands.d.ts +10 -0
- package/dist/utils/brands.d.ts.map +1 -1
- package/dist/utils/brands.js.map +1 -1
- package/dist/utils/societyApproval.d.ts.map +1 -1
- package/dist/utils/societyApproval.js +20 -1
- package/dist/utils/societyApproval.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/BrandPourcentage.ts +24 -32
- package/ts/types/Enum/SocietyApproval.ts +50 -20
- package/ts/types/Enum/StatutsSection.ts +1 -2
- package/ts/types/Interface/api/SocietyApproval.ts +6 -0
- package/ts/types/Interface/api/user/CreateCoworker.ts +6 -0
- package/ts/types/Interface/api/user/UpdateCoworker.ts +6 -0
- package/ts/types/Interface/models/IUser.ts +1 -0
- package/ts/utils/brands.ts +10 -0
- package/ts/utils/societyApproval.ts +22 -0
package/dist/utils/brands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../ts/utils/brands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AA4IhF,6DAA6D;AAC7D,MAAM,SAAS,GAAG;IAChB,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,aAAa;IACb,gBAAgB;IAChB,SAAS;IACT,mBAAmB;CACX,CAAC;AAGX,MAAM,WAAW,GAQb;IACF,eAAe;IACf,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,mBAAmB;IACnB,YAAY;IACZ,sBAAsB;CACvB,CAAC;AAaF,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAAa,EAAE;IAC5D,MAAM,GAAG,GAAG,OA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AE,OAAO,mBAAmB,CAAC;IAC3E,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,mBAAmB,CAAC;IACrE,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAgB,EAAgB,EAAE;IACzD,MAAM,WAAW,GAAG,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;IACpD,MAAM,cAAc,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IAE1D,aAAa;IACb,MAAM,iBAAiB,GAAY,WAAW,CAAC,QAAQ,cAAc,EAAE,CAAC,CAAC;IAEzE,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,OAAO,EACL,cAAc,EACd,WAAW,EACX,oBAAoB,EACpB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,QAAQ,GACT,CAAC","sourcesContent":["import { get } from 'lodash-es';\nimport { BrandClementine } from '../types/Enum/BrandClementine.js';\nimport { BrandLegalstart } from '../types/Enum/BrandLegalstart.js';\nimport { BrandComptalib } from '../types/Enum/BrandComptalib.js';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage.js';\nimport { BrandStatutsExpress } from '../types/Enum/BrandStatutsExpress.js';\nimport { BrandAnytime } from '../types/Enum/BrandAnytime.js';\nimport { SaleContract } from '../types/index.js';\nimport { BrandTeamsystemFacture } from '../types/Enum/BrandTeamsytemFacture.js';\n\nexport type Brand = {\n idTypeBrand: number;\n name: string;\n commercialName?: string;\n urlS3?: string;\n logoS3?: string;\n lightLogoS3?: string;\n privacyPolicy?: string;\n urlApi1?: string;\n urlClient?: string;\n urlApp?: string;\n colors: {\n primary: string;\n primary50?: string;\n primary100?: string;\n primary300?: string;\n primary500?: string;\n primary700?: string;\n footerColor?: string;\n sendContract?: string;\n };\n listMails?: {\n administratif?: string;\n app?: string;\n bonjour?: string;\n contact: string;\n facturation?: string;\n feedback?: string;\n gestion?: string;\n juridique?: string;\n informatique?: string;\n msd?: string;\n noreply?: string;\n qualite?: string;\n paiement?: string;\n resiliation?: string;\n rh?: string;\n satisfaction?: string;\n social?: string;\n support?: string;\n tva?: string;\n wb?: string;\n recovery?: string;\n };\n listPhones?: {\n contact: string;\n qualite: string;\n social?: string;\n juridique: string;\n };\n companyInformation?: {\n ape: string;\n bp: string;\n city: string;\n montantCapital: string;\n nomRaisonSociale: string;\n ECName?: string;\n ECOrderCity: string;\n ECDepartment?: string;\n ECPosition?: string;\n phone: string;\n postalAddress: string;\n rcs: string;\n statut: string;\n zipCode: string;\n };\n idPrestationsListHidden?: number[];\n idPrestationsListAuthorized?: number[];\n logoUrl?: string;\n miniLogoUrl?: string;\n hiddenPages?: [];\n urlApi2?: string;\n urlExpert?: string;\n bank?: {\n IBAN: string;\n BIC: string;\n Name: string;\n Id: string;\n codeEtablissement?: string;\n codeGuichet?: string;\n numeroCompte?: string;\n cleRib?: string;\n ribIdFile?: number;\n };\n internalInvoicing?: {\n lastUsedNumber?: number;\n statut: string;\n name: string;\n address: string;\n zipCode: string;\n city: string;\n country: string;\n montantCapital: string;\n siret: string;\n ape: string;\n rcs: string;\n phone: string;\n vatIntracom: string;\n email: string;\n };\n webmail?: {\n domains: string[];\n };\n offices?: {\n LAXOU?: {\n id: number;\n name: string;\n };\n PARIS?: {\n id: number;\n name: string;\n };\n MARSEILLE?: {\n id: number;\n name: string;\n };\n EPINAL?: {\n id: number;\n name: string;\n };\n HOME_OFFICE?: {\n id: number;\n name: string;\n };\n NICE?: {\n id: number;\n name: string;\n };\n };\n salesContractConfig?: SaleContract[];\n caarl?: {\n subscriptionNumber?: {\n sandbox?: string;\n production?: string;\n };\n };\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst allBrands = [\n 'Legalstart',\n 'Comptalib',\n 'Clementine',\n 'Pourcentage',\n 'StatutsExpress',\n 'Anytime',\n 'TeamsystemFacture',\n] as const;\ntype BrandList = (typeof allBrands)[number];\n\nconst listEnvEnum: {\n BrandClementine: Brand[];\n BrandLegalstart: Brand[];\n BrandComptalib: Brand[];\n BrandPourcentage: Brand[];\n BrandStatutsExpress: Brand[];\n BrandAnytime: Brand[];\n BrandTeamsystemFacture: Brand[];\n} = {\n BrandClementine,\n BrandLegalstart,\n BrandComptalib,\n BrandPourcentage,\n BrandStatutsExpress,\n BrandAnytime,\n BrandTeamsystemFacture,\n};\n\ntype GetBrandConfigParam = {\n idTypeBrand?: number;\n objectWaited?: string;\n nodeEnv?: string;\n};\n\ntype GetBrandParam = {\n idTypeBrand?: number;\n nodeEnv?: string;\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): BrandList => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n if (env && env !== 'dev') {\n if (\n env.indexOf('legalstart') > -1 ||\n env.indexOf('Legalstart') > -1 ||\n env.indexOf('ComptaStart') > -1 ||\n env.indexOf('comptaStart') > -1 ||\n env.indexOf('Comptastart') > -1 ||\n env.indexOf('comptastart') > -1\n ) {\n return 'Legalstart';\n }\n if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {\n return 'Comptalib';\n }\n if (env.indexOf('pourcentage') > -1 || env.indexOf('Pourcentage') > -1) {\n return 'Pourcentage';\n }\n if (env.indexOf('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n if (env.indexOf('anytime') > -1 || env.indexOf('Anytime') > -1) {\n return 'Anytime';\n }\n if (env.indexOf('teamsystemfacture') > -1 || env.indexOf('TeamSystemFacture') > -1) {\n return 'TeamsystemFacture';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (brandList: BrandList, nodeEnv?: string): boolean => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n return getBrandNameByNodeEnv(env) === brandList;\n};\n\nconst getAllBrandByNodeEnv = (nodeEnv?: string): Array<Brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n const brand = currentConfigFile;\n\n return brand;\n};\n\nfunction getBrand(params?: GetBrandParam): Brand {\n let brand: Brand | undefined;\n\n const { nodeEnv, idTypeBrand } = params ?? {};\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n brand = currentConfigFile.find((b: Brand) => b.idTypeBrand === idTypeBrand);\n }\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: Brand, b: Brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n return brand;\n}\n/**\n * @deprecated use getBrand()\n */\nconst getBrandConfig = (params: GetBrandConfigParam): Brand => {\n const { idTypeBrand = null, objectWaited = null, nodeEnv } = params;\n let brand;\n\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n // Récupération de la brand via idTypeBrand\n brand = currentConfigFile.find((b: Brand) => b.idTypeBrand === idTypeBrand);\n }\n // else if (idSociety) {\n // Récupération de la brand via l'idSociety -> impossible directement depuis le core (pas d'accès au resources, ni au token pour l'appel via fetch)\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: Brand, b: Brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n if (objectWaited) {\n // Si on attend un attribut particulier de la brand, on le parcourt\n let objectToReturn = get(brand, objectWaited);\n // Si aucun attribut trouvé, on renvoit celui de Clementine par défaut\n if (!objectToReturn) {\n const brandDefault = currentConfigFile.find((b: Brand) => b.name === currentEnvName);\n objectToReturn = get(brandDefault, objectWaited);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return objectToReturn;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return brand;\n};\n\nconst getBrandByEmail = (\n email: string,\n):\n | 'Legalstart'\n | 'Comptalib'\n | 'Clementine'\n | 'Pourcentage'\n | 'Lecomptablefrancais'\n | 'Statuts'\n | 'TeamsystemFacture'\n | 'Teamsystem'\n | null => {\n if (email.indexOf('legalstart.fr') > -1 || email.indexOf('comptastartbyclementine.fr') > -1) return 'Legalstart';\n if (email.indexOf('statuts-express.fr') > -1) return 'Statuts';\n if (email.indexOf('comptalib.com') > -1) return 'Comptalib';\n if (email.indexOf('pourcentage.fr') > -1) return 'Pourcentage';\n if (email.indexOf('compta-clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('lecomptablefrancais.fr') > -1) return 'Lecomptablefrancais';\n if (email.indexOf('teamsystemfacture.fr') > -1) return 'TeamsystemFacture';\n if (email.indexOf('teamsystem.com') > -1) return 'TeamsystemFacture';\n return null;\n};\n\nconst getSubBrandList = (nodeEnv?: string): Array<Brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n // @ts-ignore\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig,\n isItThisEnv,\n getAllBrandByNodeEnv,\n getBrandNameByNodeEnv,\n getBrandByEmail,\n getSubBrandList,\n getBrand,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"brands.js","sourceRoot":"","sources":["../../ts/utils/brands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,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ine } from '../types/Enum/BrandClementine.js';\nimport { BrandLegalstart } from '../types/Enum/BrandLegalstart.js';\nimport { BrandComptalib } from '../types/Enum/BrandComptalib.js';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage.js';\nimport { BrandStatutsExpress } from '../types/Enum/BrandStatutsExpress.js';\nimport { BrandAnytime } from '../types/Enum/BrandAnytime.js';\nimport { SaleContract } from '../types/index.js';\nimport { BrandTeamsystemFacture } from '../types/Enum/BrandTeamsytemFacture.js';\n\nexport type Brand = {\n idTypeBrand: number;\n name: string;\n commercialName?: string;\n urlS3?: string;\n logoS3?: string;\n lightLogoS3?: string;\n privacyPolicy?: string;\n urlApi1?: string;\n urlClient?: string;\n urlApp?: string;\n colors: {\n primary: string;\n primary50?: string;\n primary100?: string;\n primary300?: string;\n primary500?: string;\n primary700?: string;\n footerColor?: string;\n sendContract?: string;\n };\n listMails?: {\n administratif?: string;\n app?: string;\n bonjour?: string;\n contact: string;\n facturation?: string;\n feedback?: string;\n gestion?: string;\n juridique?: string;\n informatique?: string;\n msd?: string;\n noreply?: string;\n qualite?: string;\n paiement?: string;\n resiliation?: string;\n rh?: string;\n satisfaction?: string;\n social?: string;\n support?: string;\n tva?: string;\n wb?: string;\n recovery?: string;\n };\n listPhones?: {\n contact: string;\n qualite: string;\n social?: string;\n juridique: string;\n };\n companyInformation?: {\n ape: string;\n bp: string;\n city: string;\n montantCapital: string;\n nomRaisonSociale: string;\n ECName?: string;\n ECOrderCity: string;\n ECDepartment?: string;\n ECPosition?: string;\n phone: string;\n postalAddress: string;\n rcs: string;\n statut: string;\n zipCode: string;\n };\n idPrestationsListHidden?: number[];\n idPrestationsListAuthorized?: number[];\n logoUrl?: string;\n miniLogoUrl?: string;\n hiddenPages?: [];\n urlApi2?: string;\n urlExpert?: string;\n bank?: {\n IBAN: string;\n BIC: string;\n Name: string;\n Id: string;\n codeEtablissement?: string;\n codeGuichet?: string;\n numeroCompte?: string;\n cleRib?: string;\n ribIdFile?: number;\n };\n internalInvoicing?: {\n lastUsedNumber?: number;\n invoicePrefix?: string;\n /**\n * Configuration des réinitialisations de numérotation.\n * À partir de la date `resetFrom`, la numérotation redémarre à `resetStartNumber` (+ 1 à l'usage).\n * Exemple: resetFrom: \"2026-01-01\", resetStartNumber: 0 → factures générées >= 01/01/2026 seront numérotées 1, 2, 3...\n */\n resetNumbering?: Array<{\n resetFrom: string;\n resetStartNumber: number;\n }>;\n statut: string;\n name: string;\n address: string;\n zipCode: string;\n city: string;\n country: string;\n montantCapital: string;\n siret: string;\n ape: string;\n rcs: string;\n phone: string;\n vatIntracom: string;\n email: string;\n };\n webmail?: {\n domains: string[];\n };\n offices?: {\n LAXOU?: {\n id: number;\n name: string;\n };\n PARIS?: {\n id: number;\n name: string;\n };\n MARSEILLE?: {\n id: number;\n name: string;\n };\n EPINAL?: {\n id: number;\n name: string;\n };\n HOME_OFFICE?: {\n id: number;\n name: string;\n };\n NICE?: {\n id: number;\n name: string;\n };\n };\n salesContractConfig?: SaleContract[];\n caarl?: {\n subscriptionNumber?: {\n sandbox?: string;\n production?: string;\n };\n };\n};\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst allBrands = [\n 'Legalstart',\n 'Comptalib',\n 'Clementine',\n 'Pourcentage',\n 'StatutsExpress',\n 'Anytime',\n 'TeamsystemFacture',\n] as const;\ntype BrandList = (typeof allBrands)[number];\n\nconst listEnvEnum: {\n BrandClementine: Brand[];\n BrandLegalstart: Brand[];\n BrandComptalib: Brand[];\n BrandPourcentage: Brand[];\n BrandStatutsExpress: Brand[];\n BrandAnytime: Brand[];\n BrandTeamsystemFacture: Brand[];\n} = {\n BrandClementine,\n BrandLegalstart,\n BrandComptalib,\n BrandPourcentage,\n BrandStatutsExpress,\n BrandAnytime,\n BrandTeamsystemFacture,\n};\n\ntype GetBrandConfigParam = {\n idTypeBrand?: number;\n objectWaited?: string;\n nodeEnv?: string;\n};\n\ntype GetBrandParam = {\n idTypeBrand?: number;\n nodeEnv?: string;\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): BrandList => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n if (env && env !== 'dev') {\n if (\n env.indexOf('legalstart') > -1 ||\n env.indexOf('Legalstart') > -1 ||\n env.indexOf('ComptaStart') > -1 ||\n env.indexOf('comptaStart') > -1 ||\n env.indexOf('Comptastart') > -1 ||\n env.indexOf('comptastart') > -1\n ) {\n return 'Legalstart';\n }\n if (env.indexOf('comptalib') > -1 || env.indexOf('Comptalib') > -1) {\n return 'Comptalib';\n }\n if (env.indexOf('pourcentage') > -1 || env.indexOf('Pourcentage') > -1) {\n return 'Pourcentage';\n }\n if (env.indexOf('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n if (env.indexOf('anytime') > -1 || env.indexOf('Anytime') > -1) {\n return 'Anytime';\n }\n if (env.indexOf('teamsystemfacture') > -1 || env.indexOf('TeamSystemFacture') > -1) {\n return 'TeamsystemFacture';\n }\n }\n return 'Clementine';\n};\n\nconst isItThisEnv = (brandList: BrandList, nodeEnv?: string): boolean => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n return getBrandNameByNodeEnv(env) === brandList;\n};\n\nconst getAllBrandByNodeEnv = (nodeEnv?: string): Array<Brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n const brand = currentConfigFile;\n\n return brand;\n};\n\nfunction getBrand(params?: GetBrandParam): Brand {\n let brand: Brand | undefined;\n\n const { nodeEnv, idTypeBrand } = params ?? {};\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n brand = currentConfigFile.find((b: Brand) => b.idTypeBrand === idTypeBrand);\n }\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: Brand, b: Brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n return brand;\n}\n/**\n * @deprecated use getBrand()\n */\nconst getBrandConfig = (params: GetBrandConfigParam): Brand => {\n const { idTypeBrand = null, objectWaited = null, nodeEnv } = params;\n let brand;\n\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n if (idTypeBrand) {\n // Récupération de la brand via idTypeBrand\n brand = currentConfigFile.find((b: Brand) => b.idTypeBrand === idTypeBrand);\n }\n // else if (idSociety) {\n // Récupération de la brand via l'idSociety -> impossible directement depuis le core (pas d'accès au resources, ni au token pour l'appel via fetch)\n\n if (!brand) {\n // Si aucune brand trouvée, on passe par défaut la première brand de la liste\n [brand] = currentConfigFile.sort((a: Brand, b: Brand) => a.idTypeBrand - b.idTypeBrand);\n }\n\n if (objectWaited) {\n // Si on attend un attribut particulier de la brand, on le parcourt\n let objectToReturn = get(brand, objectWaited);\n // Si aucun attribut trouvé, on renvoit celui de Clementine par défaut\n if (!objectToReturn) {\n const brandDefault = currentConfigFile.find((b: Brand) => b.name === currentEnvName);\n objectToReturn = get(brandDefault, objectWaited);\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return objectToReturn;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return brand;\n};\n\nconst getBrandByEmail = (\n email: string,\n):\n | 'Legalstart'\n | 'Comptalib'\n | 'Clementine'\n | 'Pourcentage'\n | 'Lecomptablefrancais'\n | 'Statuts'\n | 'TeamsystemFacture'\n | 'Teamsystem'\n | null => {\n if (email.indexOf('legalstart.fr') > -1 || email.indexOf('comptastartbyclementine.fr') > -1) return 'Legalstart';\n if (email.indexOf('statuts-express.fr') > -1) return 'Statuts';\n if (email.indexOf('comptalib.com') > -1) return 'Comptalib';\n if (email.indexOf('pourcentage.fr') > -1) return 'Pourcentage';\n if (email.indexOf('compta-clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('clementine.fr') > -1) return 'Clementine';\n if (email.indexOf('lecomptablefrancais.fr') > -1) return 'Lecomptablefrancais';\n if (email.indexOf('teamsystemfacture.fr') > -1) return 'TeamsystemFacture';\n if (email.indexOf('teamsystem.com') > -1) return 'TeamsystemFacture';\n return null;\n};\n\nconst getSubBrandList = (nodeEnv?: string): Array<Brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n\n // @ts-ignore\n const currentConfigFile: Brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n return currentConfigFile;\n};\n\nexport {\n getBrandConfig,\n isItThisEnv,\n getAllBrandByNodeEnv,\n getBrandNameByNodeEnv,\n getBrandByEmail,\n getSubBrandList,\n getBrand,\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"societyApproval.d.ts","sourceRoot":"","sources":["../../ts/utils/societyApproval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,
|
|
1
|
+
{"version":3,"file":"societyApproval.d.ts","sourceRoot":"","sources":["../../ts/utils/societyApproval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAEL,2BAA2B,EAC3B,6BAA6B,EAE7B,+BAA+B,EAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAC;AAQjF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,EAAE,QAAQ,GAAE,MAAW,GAAG,MAAM,CAE9F;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,iBAAiB,GAC7B,6BAA6B,GAAG,SAAS,CAE3C;AAED;;;;;GAKG;AAEH,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,iBAAiB,EAC9B,cAAc,EAAE,2BAA2B,GAC1C,MAAM,GAAG,SAAS,CAIpB;AAYD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,iBAAiB,EAC9B,cAAc,EAAE,2BAA2B,GAC1C,+BAA+B,GAAG,SAAS,CAG7C;AAYD;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAoFhH"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LegalForm } from '../types/Enum/LegalForm.js';
|
|
2
|
-
import { SocietyApprovalDocumentsByLegalForm, } from '../types/Enum/SocietyApproval.js';
|
|
2
|
+
import { AdditionalMentionType, SocietyApprovalDocumentsByLegalForm, } from '../types/Enum/SocietyApproval.js';
|
|
3
3
|
import { QualityList } from '../types/Enum/Quality.js';
|
|
4
4
|
import { getBrand } from './brands.js';
|
|
5
5
|
import { convertNumberToLetter } from './amount.js';
|
|
@@ -55,6 +55,14 @@ export function getApprovalDocumentInfos(idLegalForm, idDocumentType) {
|
|
|
55
55
|
const config = getApprovalDocumentsByLegalForm(idLegalForm);
|
|
56
56
|
return config?.documents.find((doc) => doc.idDocumentType === idDocumentType);
|
|
57
57
|
}
|
|
58
|
+
function createApprovalDecisionTitleGenerator() {
|
|
59
|
+
const decisionOrdinals = ['PREMIERE', 'DEUXIEME', 'TROISIEME', 'QUATRIEME', 'CINQUIEME', 'SIXIEME'];
|
|
60
|
+
let decisionNumber = 0;
|
|
61
|
+
return () => {
|
|
62
|
+
decisionNumber += 1;
|
|
63
|
+
return `${decisionOrdinals[decisionNumber - 1] ?? `${decisionNumber}EME`} DECISION`;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
58
66
|
/**
|
|
59
67
|
* Construit les données formatées pour le template d'approbation
|
|
60
68
|
* @param existingApproval - Les données d'approbation de la société
|
|
@@ -70,6 +78,8 @@ export function buildApprovalTemplateData(existingApproval, style) {
|
|
|
70
78
|
const brand = getBrand();
|
|
71
79
|
return {
|
|
72
80
|
// Variables globales
|
|
81
|
+
AdditionalMentionType,
|
|
82
|
+
nextDecisionTitle: createApprovalDecisionTitleGenerator(),
|
|
73
83
|
rates: {
|
|
74
84
|
flatTax: 0.314,
|
|
75
85
|
flatLevy: 0.128, //prelevement forfaitaire
|
|
@@ -107,6 +117,15 @@ export function buildApprovalTemplateData(existingApproval, style) {
|
|
|
107
117
|
.toUpperCase(),
|
|
108
118
|
}
|
|
109
119
|
: {}),
|
|
120
|
+
...(existingApproval?.generatingDatas?.approvalDate
|
|
121
|
+
? {
|
|
122
|
+
approvalDateMore4Months: dayjs(existingApproval?.generatingDatas?.approvalDate)
|
|
123
|
+
.add(4, 'month')
|
|
124
|
+
.locale('fr')
|
|
125
|
+
.format('DD MMMM YYYY')
|
|
126
|
+
.toUpperCase(),
|
|
127
|
+
}
|
|
128
|
+
: {}),
|
|
110
129
|
...(existingApproval?.generatingDatas?.approvalDividendsPaymentDate
|
|
111
130
|
? {
|
|
112
131
|
approvalDividendsPaymentDate: dayjs(existingApproval?.generatingDatas?.approvalDividendsPaymentDate)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"societyApproval.js","sourceRoot":"","sources":["../../ts/utils/societyApproval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAGL,mCAAmC,GAEpC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAA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BAAgB,EAAE,eAAe,EAAE,4BAA4B;gBACjE,CAAC,CAAC;oBACE,4BAA4B,EAAE,KAAK,CAAC,gBAAgB,EAAE,eAAe,EAAE,4BAA4B,CAAC;yBACjG,MAAM,CAAC,IAAI,CAAC;yBACZ,MAAM,CAAC,cAAc,CAAC;iBAC1B;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;QACD,QAAQ,EAAE;YACR,GAAG,gBAAgB,EAAE,QAAQ;YAC7B,OAAO,EAAE;gBACP,GAAG,gBAAgB,EAAE,QAAQ,EAAE,OAAO;gBACtC,YAAY,EAAE,mBAAmB,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,WAAW,EAAE;gBACpG,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK;oBAC/C,CAAC,CAAC,CAAC,YAAY,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC,uBAAuB,EAAE,UAAU,CAAC;wBACpG,IAAI,CAAC;oBACP,CAAC,CAAC,IAAI;aACT;YACD,OAAO,EAAE,KAAK,CAAC,gBAAgB,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE;SACtG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { LegalForm, LegalFormTypeEnum } from '../types/Enum/LegalForm.js';\nimport {\n SocietyApprovalDocumentType,\n SocietyApprovalDocumentConfig,\n SocietyApprovalDocumentsByLegalForm,\n SocietyApprovalDocumentTemplate,\n} from '../types/Enum/SocietyApproval.js';\nimport { ISocietyApproval } from '../types/Interface/models/ISocietyApproval.js';\nimport { QualityList } from '../types/Enum/Quality.js';\nimport { getBrand } from './brands.js';\nimport { convertNumberToLetter } from './amount.js';\nimport dayjs from 'dayjs';\nimport { CityOfGreffeDetail } from '../types/Enum/CityOfGreffe.js';\nimport { siretToSiren } from './siretValidation.js';\n\n/**\n * Récupère le nom de la forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param fallback - Valeur par défaut si non trouvée\n * @returns Le nom de la forme juridique\n */\nexport function getLegalFormName(idLegalForm: LegalFormTypeEnum, fallback: string = ''): string {\n return Object.values(LegalForm).find((lf) => lf.id === idLegalForm)?.name ?? fallback;\n}\n\n/**\n * Récupère la configuration des documents d'approbation pour une forme juridique donnée\n * @param idLegalForm - L'identifiant de la forme juridique\n * @returns La configuration des documents ou undefined si non trouvée\n */\nexport function getApprovalDocumentsByLegalForm(\n idLegalForm: LegalFormTypeEnum,\n): SocietyApprovalDocumentConfig | undefined {\n return SocietyApprovalDocumentsByLegalForm.find((config) => config.idLegalForm === idLegalForm);\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\n//@deprecated use getApprovalDocumentInfos instead\nexport function getApprovalDocumentTemplateName(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): string | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n const document = config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n return document?.templateName;\n}\n\n/**\n * Récupère le texte de la ville du greffe\n * @param idCityOfGreffe - L'identifiant de la ville du greffe\n * @returns Le texte de la ville ou une chaîne vide\n */\nfunction getCityOfGreffeName(idCityOfGreffe: number | null | undefined): string {\n if (!idCityOfGreffe) return '';\n return CityOfGreffeDetail.find((c) => c.id === idCityOfGreffe)?.text ?? '';\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\nexport function getApprovalDocumentInfos(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): SocietyApprovalDocumentTemplate | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n return config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n}\n\n/**\n * Construit les données formatées pour le template d'approbation\n * @param existingApproval - Les données d'approbation de la société\n * @param style - Le style HTML pour le document\n * @returns L'objet de données formaté pour le template\n */\nexport function buildApprovalTemplateData(existingApproval: ISocietyApproval, style: string): Record<string, any> {\n const yearInText = convertNumberToLetter(\n +dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('YYYY'),\n ).toLowerCase();\n const dayAndMonthInText = `${convertNumberToLetter(+dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('D'))} ${dayjs(\n existingApproval?.generatingDatas?.approvalDate || null,\n )\n .locale('fr')\n .format('MMMM')\n .toLowerCase()}`;\n const brand = getBrand();\n return {\n // Variables globales\n rates: {\n flatTax: 0.314,\n flatLevy: 0.128, //prelevement forfaitaire\n csg: 0.106,\n solidarity: 0.075,\n crds: 0.005,\n socialSecurityContributions: 0.186, //= csg + solidarity + crds\n },\n style,\n yearInText,\n dayAndMonthInText,\n date: dayjs().locale('fr').format('DD MMMM YYYY'),\n companyInformation: {\n rcs: brand?.companyInformation?.rcs,\n nomRaisonSociale: brand?.companyInformation?.nomRaisonSociale,\n city: brand?.companyInformation?.city,\n postalAddress: brand?.companyInformation?.postalAddress,\n montantCapital: brand?.companyInformation?.montantCapital,\n statut: brand?.companyInformation?.statut,\n ECOrderCity: brand?.companyInformation?.ECOrderCity,\n },\n owner: {\n identity: `${existingApproval?.exercice?.society?.users?.[0]?.idCivility === 1 ? 'Monsieur' : 'Madame'} ${existingApproval?.exercice?.society?.users?.[0]?.firstname} ${existingApproval?.exercice?.society?.users?.[0]?.lastname} `,\n quality: QualityList.find(\n (ql) => ql.id === existingApproval?.exercice?.society?.users?.[0]?.businessPartners?.[0]?.idQuality,\n )?.label,\n },\n // Variables stockées en base\n ...existingApproval,\n generatingDatas: {\n ...existingApproval?.generatingDatas,\n ...(existingApproval?.generatingDatas?.approvalDate\n ? {\n approvalDate: dayjs(existingApproval?.generatingDatas?.approvalDate)\n .locale('fr')\n .format('DD MMMM YYYY')\n .toUpperCase(),\n }\n : {}),\n ...(existingApproval?.generatingDatas?.approvalDividendsPaymentDate\n ? {\n approvalDividendsPaymentDate: dayjs(existingApproval?.generatingDatas?.approvalDividendsPaymentDate)\n .locale('fr')\n .format('DD MMMM YYYY'),\n }\n : {}),\n },\n exercice: {\n ...existingApproval?.exercice,\n society: {\n ...existingApproval?.exercice?.society,\n cityOfGreffe: getCityOfGreffeName(existingApproval?.exercice?.society?.idCityOfGreffe).toUpperCase(),\n siren: existingApproval?.exercice?.society?.siret\n ? (siretToSiren(existingApproval.exercice.society.siret)?.replace(/(\\d{3})(\\d{3})(\\d{3})/, '$1 $2 $3') ??\n null)\n : null,\n },\n endDate: dayjs(existingApproval?.exercice?.endDate).locale('fr').format('DD MMMM YYYY').toLowerCase(),\n },\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"societyApproval.js","sourceRoot":"","sources":["../../ts/utils/societyApproval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EACL,qBAAqB,EAGrB,mCAAmC,GAEpC,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,WAA8B,EAAE,WAAmB,EAAE;IACpF,OAAO,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC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,CAAC,cAAc,CAAC,CAAC,WAAW,EAAE;SACtG;KACF,CAAC;AACJ,CAAC","sourcesContent":["import { LegalForm, LegalFormTypeEnum } from '../types/Enum/LegalForm.js';\nimport {\n AdditionalMentionType,\n SocietyApprovalDocumentType,\n SocietyApprovalDocumentConfig,\n SocietyApprovalDocumentsByLegalForm,\n SocietyApprovalDocumentTemplate,\n} from '../types/Enum/SocietyApproval.js';\nimport { ISocietyApproval } from '../types/Interface/models/ISocietyApproval.js';\nimport { QualityList } from '../types/Enum/Quality.js';\nimport { getBrand } from './brands.js';\nimport { convertNumberToLetter } from './amount.js';\nimport dayjs from 'dayjs';\nimport { CityOfGreffeDetail } from '../types/Enum/CityOfGreffe.js';\nimport { siretToSiren } from './siretValidation.js';\n\n/**\n * Récupère le nom de la forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param fallback - Valeur par défaut si non trouvée\n * @returns Le nom de la forme juridique\n */\nexport function getLegalFormName(idLegalForm: LegalFormTypeEnum, fallback: string = ''): string {\n return Object.values(LegalForm).find((lf) => lf.id === idLegalForm)?.name ?? fallback;\n}\n\n/**\n * Récupère la configuration des documents d'approbation pour une forme juridique donnée\n * @param idLegalForm - L'identifiant de la forme juridique\n * @returns La configuration des documents ou undefined si non trouvée\n */\nexport function getApprovalDocumentsByLegalForm(\n idLegalForm: LegalFormTypeEnum,\n): SocietyApprovalDocumentConfig | undefined {\n return SocietyApprovalDocumentsByLegalForm.find((config) => config.idLegalForm === idLegalForm);\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\n//@deprecated use getApprovalDocumentInfos instead\nexport function getApprovalDocumentTemplateName(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): string | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n const document = config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n return document?.templateName;\n}\n\n/**\n * Récupère le texte de la ville du greffe\n * @param idCityOfGreffe - L'identifiant de la ville du greffe\n * @returns Le texte de la ville ou une chaîne vide\n */\nfunction getCityOfGreffeName(idCityOfGreffe: number | null | undefined): string {\n if (!idCityOfGreffe) return '';\n return CityOfGreffeDetail.find((c) => c.id === idCityOfGreffe)?.text ?? '';\n}\n\n/**\n * Récupère le nom du template pour un document spécifique et une forme juridique\n * @param idLegalForm - L'identifiant de la forme juridique\n * @param idDocumentType - Le type de document d'approbation\n * @returns Le nom du template ou undefined si non trouvé\n */\nexport function getApprovalDocumentInfos(\n idLegalForm: LegalFormTypeEnum,\n idDocumentType: SocietyApprovalDocumentType,\n): SocietyApprovalDocumentTemplate | undefined {\n const config = getApprovalDocumentsByLegalForm(idLegalForm);\n return config?.documents.find((doc) => doc.idDocumentType === idDocumentType);\n}\n\nfunction createApprovalDecisionTitleGenerator(): () => string {\n const decisionOrdinals = ['PREMIERE', 'DEUXIEME', 'TROISIEME', 'QUATRIEME', 'CINQUIEME', 'SIXIEME'];\n let decisionNumber = 0;\n\n return () => {\n decisionNumber += 1;\n return `${decisionOrdinals[decisionNumber - 1] ?? `${decisionNumber}EME`} DECISION`;\n };\n}\n\n/**\n * Construit les données formatées pour le template d'approbation\n * @param existingApproval - Les données d'approbation de la société\n * @param style - Le style HTML pour le document\n * @returns L'objet de données formaté pour le template\n */\nexport function buildApprovalTemplateData(existingApproval: ISocietyApproval, style: string): Record<string, any> {\n const yearInText = convertNumberToLetter(\n +dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('YYYY'),\n ).toLowerCase();\n const dayAndMonthInText = `${convertNumberToLetter(+dayjs(existingApproval?.generatingDatas?.approvalDate || null).format('D'))} ${dayjs(\n existingApproval?.generatingDatas?.approvalDate || null,\n )\n .locale('fr')\n .format('MMMM')\n .toLowerCase()}`;\n const brand = getBrand();\n return {\n // Variables globales\n AdditionalMentionType,\n nextDecisionTitle: createApprovalDecisionTitleGenerator(),\n rates: {\n flatTax: 0.314,\n flatLevy: 0.128, //prelevement forfaitaire\n csg: 0.106,\n solidarity: 0.075,\n crds: 0.005,\n socialSecurityContributions: 0.186, //= csg + solidarity + crds\n },\n style,\n yearInText,\n dayAndMonthInText,\n date: dayjs().locale('fr').format('DD MMMM YYYY'),\n companyInformation: {\n rcs: brand?.companyInformation?.rcs,\n nomRaisonSociale: brand?.companyInformation?.nomRaisonSociale,\n city: brand?.companyInformation?.city,\n postalAddress: brand?.companyInformation?.postalAddress,\n montantCapital: brand?.companyInformation?.montantCapital,\n statut: brand?.companyInformation?.statut,\n ECOrderCity: brand?.companyInformation?.ECOrderCity,\n },\n owner: {\n identity: `${existingApproval?.exercice?.society?.users?.[0]?.idCivility === 1 ? 'Monsieur' : 'Madame'} ${existingApproval?.exercice?.society?.users?.[0]?.firstname} ${existingApproval?.exercice?.society?.users?.[0]?.lastname} `,\n quality: QualityList.find(\n (ql) => ql.id === existingApproval?.exercice?.society?.users?.[0]?.businessPartners?.[0]?.idQuality,\n )?.label,\n },\n // Variables stockées en base\n ...existingApproval,\n generatingDatas: {\n ...existingApproval?.generatingDatas,\n ...(existingApproval?.generatingDatas?.approvalDate\n ? {\n approvalDate: dayjs(existingApproval?.generatingDatas?.approvalDate)\n .locale('fr')\n .format('DD MMMM YYYY')\n .toUpperCase(),\n }\n : {}),\n ...(existingApproval?.generatingDatas?.approvalDate\n ? {\n approvalDateMore4Months: dayjs(existingApproval?.generatingDatas?.approvalDate)\n .add(4, 'month')\n .locale('fr')\n .format('DD MMMM YYYY')\n .toUpperCase(),\n }\n : {}),\n ...(existingApproval?.generatingDatas?.approvalDividendsPaymentDate\n ? {\n approvalDividendsPaymentDate: dayjs(existingApproval?.generatingDatas?.approvalDividendsPaymentDate)\n .locale('fr')\n .format('DD MMMM YYYY'),\n }\n : {}),\n },\n exercice: {\n ...existingApproval?.exercice,\n society: {\n ...existingApproval?.exercice?.society,\n cityOfGreffe: getCityOfGreffeName(existingApproval?.exercice?.society?.idCityOfGreffe).toUpperCase(),\n siren: existingApproval?.exercice?.society?.siret\n ? (siretToSiren(existingApproval.exercice.society.siret)?.replace(/(\\d{3})(\\d{3})(\\d{3})/, '$1 $2 $3') ??\n null)\n : null,\n },\n endDate: dayjs(existingApproval?.exercice?.endDate).locale('fr').format('DD MMMM YYYY').toLowerCase(),\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
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
|
"type": "module",
|
|
@@ -51,19 +51,19 @@ export const BrandPourcentage: Brand[] = [
|
|
|
51
51
|
},
|
|
52
52
|
companyInformation: {
|
|
53
53
|
ape: '6920Z',
|
|
54
|
-
bp: '
|
|
55
|
-
city: '
|
|
56
|
-
montantCapital: '
|
|
57
|
-
nomRaisonSociale: 'EXPERTISE CHOIX
|
|
54
|
+
bp: 'CS 31029',
|
|
55
|
+
city: 'LAXOU CEDEX',
|
|
56
|
+
montantCapital: '500 000',
|
|
57
|
+
nomRaisonSociale: 'EXPERTISE CHOIX B',
|
|
58
58
|
ECName: 'M. Maximilien SAINTDIZIER',
|
|
59
59
|
ECOrderCity: 'Nancy',
|
|
60
60
|
ECDepartment: 'Lorraine',
|
|
61
61
|
ECPosition: 'Président',
|
|
62
|
-
phone: '
|
|
63
|
-
postalAddress: '9
|
|
64
|
-
rcs: '
|
|
62
|
+
phone: '03 83 93 14 14',
|
|
63
|
+
postalAddress: '9 AVENUE DU RHIN',
|
|
64
|
+
rcs: '752 566 687',
|
|
65
65
|
statut: 'SAS',
|
|
66
|
-
zipCode: '54
|
|
66
|
+
zipCode: '54 521',
|
|
67
67
|
},
|
|
68
68
|
idPrestationsListAuthorized: [197, 205, 12, 207, 208, 189, 44],
|
|
69
69
|
logoUrl: 'logo-pourcentage.svg',
|
|
@@ -75,35 +75,27 @@ export const BrandPourcentage: Brand[] = [
|
|
|
75
75
|
urlExpert: 'https://pro.pourcentage.fr',
|
|
76
76
|
urlClient: 'https://www.pourcentage.fr',
|
|
77
77
|
bank: {
|
|
78
|
-
|
|
79
|
-
IBAN: 'FR7616106010019601826952765',
|
|
78
|
+
IBAN: 'FR7616106840138646838239863',
|
|
80
79
|
BIC: 'AGRIFRPP861',
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
Id: 'FR57ZZZ878E61',
|
|
84
|
-
codeEtablissement: '16106',
|
|
85
|
-
codeGuichet: '01001',
|
|
86
|
-
numeroCompte: '96018269527',
|
|
87
|
-
cleRib: '65',
|
|
88
|
-
// codeEtablissement: '11899',
|
|
89
|
-
// codeGuichet: '00203',
|
|
90
|
-
// numeroCompte: '00020056145',
|
|
91
|
-
// cleRib: '80',
|
|
80
|
+
Name: 'Expertise Choix B',
|
|
81
|
+
Id: 'FR91ZZZ617135',
|
|
92
82
|
},
|
|
93
83
|
internalInvoicing: {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
invoicePrefix: 'PO',
|
|
85
|
+
resetNumbering: [{ resetFrom: '2026-03-26', resetStartNumber: 0 }],
|
|
86
|
+
statut: 'SAS',
|
|
87
|
+
name: 'EXPERTISE CHOIX B',
|
|
88
|
+
address: '9 AVENUE DU RHIN',
|
|
89
|
+
zipCode: '54521',
|
|
90
|
+
city: 'LAXOU CEDEX',
|
|
99
91
|
country: 'FRANCE',
|
|
100
|
-
montantCapital: '
|
|
101
|
-
siret: '
|
|
92
|
+
montantCapital: '500 000',
|
|
93
|
+
siret: '75256668700063',
|
|
102
94
|
ape: '6920Z',
|
|
103
|
-
rcs: '
|
|
104
|
-
phone: '
|
|
105
|
-
vatIntracom: '
|
|
106
|
-
email: 'facturation@
|
|
95
|
+
rcs: '752 566 687',
|
|
96
|
+
phone: '03 83 93 14 14',
|
|
97
|
+
vatIntracom: 'FR47752566687',
|
|
98
|
+
email: 'facturation@clementine.fr',
|
|
107
99
|
},
|
|
108
100
|
webmail: {
|
|
109
101
|
domains: ['@pourcentage.fr', '@rlexpertise.fr', '@cabinetamex.com'],
|
|
@@ -32,6 +32,36 @@ export type RegulatedConvention = {
|
|
|
32
32
|
applicableTo: LegalFormTypeEnum[];
|
|
33
33
|
};
|
|
34
34
|
|
|
35
|
+
export enum AdditionalMentionType {
|
|
36
|
+
EXECUTIVE_REMUNERATION = 1,
|
|
37
|
+
TAKEOVER_OF_COMMITMENTS = 2,
|
|
38
|
+
LOSS_OF_EQUITY = 3,
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type AdditionalMention = {
|
|
42
|
+
id: AdditionalMentionType;
|
|
43
|
+
label: string;
|
|
44
|
+
applicableTo: LegalFormTypeEnum[];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const AdditionalMentions: AdditionalMention[] = [
|
|
48
|
+
{
|
|
49
|
+
id: AdditionalMentionType.EXECUTIVE_REMUNERATION,
|
|
50
|
+
label: 'Rémunération de la gérance',
|
|
51
|
+
applicableTo: [LegalFormTypeEnum.EURL],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: AdditionalMentionType.TAKEOVER_OF_COMMITMENTS,
|
|
55
|
+
label: 'Reprise des engagements',
|
|
56
|
+
applicableTo: [LegalFormTypeEnum.EURL, LegalFormTypeEnum.SASU, LegalFormTypeEnum.SAS, LegalFormTypeEnum.SCI],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: AdditionalMentionType.LOSS_OF_EQUITY,
|
|
60
|
+
label: 'Perte des capitaux propres',
|
|
61
|
+
applicableTo: [LegalFormTypeEnum.EURL, LegalFormTypeEnum.SASU, LegalFormTypeEnum.SAS, LegalFormTypeEnum.SCI],
|
|
62
|
+
},
|
|
63
|
+
];
|
|
64
|
+
|
|
35
65
|
export const RegulatedConventions: RegulatedConvention[] = [
|
|
36
66
|
{
|
|
37
67
|
id: RegulatedConventionType.SOCIAL_CONTRIBUTIONS_COVERAGE,
|
|
@@ -124,7 +154,7 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
124
154
|
},
|
|
125
155
|
{
|
|
126
156
|
idDocumentType: SocietyApprovalDocumentType.POWER_MANDATE,
|
|
127
|
-
docName: '
|
|
157
|
+
docName: 'Pouvoir',
|
|
128
158
|
templateName: 'POWER_MANDATE_EURL',
|
|
129
159
|
documentSectionType: DocumentSectionType.POWER_MANDATE,
|
|
130
160
|
},
|
|
@@ -132,23 +162,23 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
132
162
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO,
|
|
133
163
|
docName: 'Déclaration de confidentialité pour les comptes annuels (Micro)',
|
|
134
164
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO_EURL',
|
|
135
|
-
documentSectionType: DocumentSectionType.
|
|
165
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
136
166
|
},
|
|
137
167
|
{
|
|
138
168
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME,
|
|
139
169
|
docName: 'Déclaration de confidentialité pour les comptes annuels (PME)',
|
|
140
170
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME_EURL',
|
|
141
|
-
documentSectionType: DocumentSectionType.
|
|
171
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
142
172
|
},
|
|
143
173
|
{
|
|
144
174
|
idDocumentType: SocietyApprovalDocumentType.INCOME_APPROPRIATION,
|
|
145
|
-
docName: '
|
|
175
|
+
docName: 'Résolution d’affectation du résultat',
|
|
146
176
|
templateName: 'INCOME_APPROPRIATION_EURL',
|
|
147
177
|
documentSectionType: DocumentSectionType.INCOME_APPROPRIATION,
|
|
148
178
|
},
|
|
149
179
|
{
|
|
150
180
|
idDocumentType: SocietyApprovalDocumentType.LIST_OF_CONVENTIONS,
|
|
151
|
-
docName: '
|
|
181
|
+
docName: 'Rapport spécial des conventions réglementées',
|
|
152
182
|
templateName: 'LIST_OF_CONVENTIONS_EURL',
|
|
153
183
|
documentSectionType: DocumentSectionType.LIST_OF_CONVENTIONS,
|
|
154
184
|
},
|
|
@@ -166,7 +196,7 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
166
196
|
// },
|
|
167
197
|
// {
|
|
168
198
|
// idDocumentType: SocietyApprovalDocumentType.POWER_MANDATE,
|
|
169
|
-
// docName: '
|
|
199
|
+
// docName: 'Pouvoir',
|
|
170
200
|
// templateName: 'POWER_MANDATE_SARL',
|
|
171
201
|
// documentSectionType: DocumentSectionType.POWER_MANDATE,
|
|
172
202
|
// },
|
|
@@ -178,7 +208,7 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
178
208
|
// },
|
|
179
209
|
// {
|
|
180
210
|
// idDocumentType: SocietyApprovalDocumentType.INCOME_APPROPRIATION,
|
|
181
|
-
// docName: '
|
|
211
|
+
// docName: 'Résolution d’affectation du résultat',
|
|
182
212
|
// templateName: 'INCOME_APPROPRIATION_SARL',
|
|
183
213
|
// documentSectionType: DocumentSectionType.INCOME_APPROPRIATION,
|
|
184
214
|
// },
|
|
@@ -196,7 +226,7 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
196
226
|
},
|
|
197
227
|
{
|
|
198
228
|
idDocumentType: SocietyApprovalDocumentType.POWER_MANDATE,
|
|
199
|
-
docName: '
|
|
229
|
+
docName: 'Pouvoir',
|
|
200
230
|
templateName: 'POWER_MANDATE_SASU',
|
|
201
231
|
documentSectionType: DocumentSectionType.POWER_MANDATE,
|
|
202
232
|
},
|
|
@@ -204,23 +234,23 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
204
234
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO,
|
|
205
235
|
docName: 'Déclaration de confidentialité pour les comptes annuels (Micro)',
|
|
206
236
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO_SASU',
|
|
207
|
-
documentSectionType: DocumentSectionType.
|
|
237
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
208
238
|
},
|
|
209
239
|
{
|
|
210
240
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME,
|
|
211
241
|
docName: 'Déclaration de confidentialité pour les comptes annuels (PME)',
|
|
212
242
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME_SASU',
|
|
213
|
-
documentSectionType: DocumentSectionType.
|
|
243
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
214
244
|
},
|
|
215
245
|
{
|
|
216
246
|
idDocumentType: SocietyApprovalDocumentType.INCOME_APPROPRIATION,
|
|
217
|
-
docName: '
|
|
247
|
+
docName: 'Résolution d’affectation du résultat',
|
|
218
248
|
templateName: 'INCOME_APPROPRIATION_SASU',
|
|
219
249
|
documentSectionType: DocumentSectionType.INCOME_APPROPRIATION,
|
|
220
250
|
},
|
|
221
251
|
{
|
|
222
252
|
idDocumentType: SocietyApprovalDocumentType.LIST_OF_DIVIDENDS,
|
|
223
|
-
docName: 'Liste
|
|
253
|
+
docName: 'Liste des dividendes',
|
|
224
254
|
templateName: 'LIST_OF_DIVIDENDS_SASU',
|
|
225
255
|
documentSectionType: DocumentSectionType.LIST_OF_DIVIDENDS,
|
|
226
256
|
},
|
|
@@ -238,7 +268,7 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
238
268
|
},
|
|
239
269
|
{
|
|
240
270
|
idDocumentType: SocietyApprovalDocumentType.POWER_MANDATE,
|
|
241
|
-
docName: '
|
|
271
|
+
docName: 'Pouvoir',
|
|
242
272
|
templateName: 'POWER_MANDATE_SAS',
|
|
243
273
|
documentSectionType: DocumentSectionType.POWER_MANDATE,
|
|
244
274
|
},
|
|
@@ -246,17 +276,17 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
246
276
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO,
|
|
247
277
|
docName: 'Déclaration de confidentialité pour les comptes annuels (Micro)',
|
|
248
278
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO_SAS',
|
|
249
|
-
documentSectionType: DocumentSectionType.
|
|
279
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
250
280
|
},
|
|
251
281
|
{
|
|
252
282
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME,
|
|
253
283
|
docName: 'Déclaration de confidentialité pour les comptes annuels (PME)',
|
|
254
284
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME_SAS',
|
|
255
|
-
documentSectionType: DocumentSectionType.
|
|
285
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
256
286
|
},
|
|
257
287
|
{
|
|
258
288
|
idDocumentType: SocietyApprovalDocumentType.INCOME_APPROPRIATION,
|
|
259
|
-
docName: '
|
|
289
|
+
docName: 'Résolution d’affectation du résultat',
|
|
260
290
|
templateName: 'INCOME_APPROPRIATION_SAS',
|
|
261
291
|
documentSectionType: DocumentSectionType.INCOME_APPROPRIATION,
|
|
262
292
|
},
|
|
@@ -274,7 +304,7 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
274
304
|
},
|
|
275
305
|
{
|
|
276
306
|
idDocumentType: SocietyApprovalDocumentType.POWER_MANDATE,
|
|
277
|
-
docName: '
|
|
307
|
+
docName: 'Pouvoir',
|
|
278
308
|
templateName: 'POWER_MANDATE_SCI',
|
|
279
309
|
documentSectionType: DocumentSectionType.POWER_MANDATE,
|
|
280
310
|
},
|
|
@@ -282,17 +312,17 @@ export const SocietyApprovalDocumentsByLegalForm: SocietyApprovalDocumentConfig[
|
|
|
282
312
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO,
|
|
283
313
|
docName: 'Déclaration de confidentialité pour les comptes annuels (Micro)',
|
|
284
314
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_MICRO_SCI',
|
|
285
|
-
documentSectionType: DocumentSectionType.
|
|
315
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
286
316
|
},
|
|
287
317
|
{
|
|
288
318
|
idDocumentType: SocietyApprovalDocumentType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME,
|
|
289
319
|
docName: 'Déclaration de confidentialité pour les comptes annuels',
|
|
290
320
|
templateName: 'DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME_SCI',
|
|
291
|
-
documentSectionType: DocumentSectionType.
|
|
321
|
+
documentSectionType: DocumentSectionType.DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS,
|
|
292
322
|
},
|
|
293
323
|
{
|
|
294
324
|
idDocumentType: SocietyApprovalDocumentType.INCOME_APPROPRIATION,
|
|
295
|
-
docName: '
|
|
325
|
+
docName: 'Résolution d’affectation du résultat',
|
|
296
326
|
templateName: 'INCOME_APPROPRIATION_SCI',
|
|
297
327
|
documentSectionType: DocumentSectionType.INCOME_APPROPRIATION,
|
|
298
328
|
},
|
|
@@ -9,11 +9,10 @@ export enum DocumentSectionType {
|
|
|
9
9
|
// Utilisés pour la génération de documents juridiques (approbation) depuis clientApp
|
|
10
10
|
APPROVAL_PV = 5,
|
|
11
11
|
POWER_MANDATE = 6,
|
|
12
|
-
|
|
12
|
+
DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS = 7,
|
|
13
13
|
INCOME_APPROPRIATION = 8,
|
|
14
14
|
LIST_OF_CONVENTIONS = 9,
|
|
15
15
|
LIST_OF_DIVIDENDS = 10,
|
|
16
|
-
DECLARATION_OF_CONFIDENTIALITY_FOR_ANNUAL_ACCOUNTS_PME = 11,
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
export const DocumentSectionTypeDetail = [
|
|
@@ -26,6 +26,12 @@ export class SocietyApprovalJsonDatas {
|
|
|
26
26
|
@ToBoolean()
|
|
27
27
|
lossOfEquity?: boolean; //Perte des capitaux propres
|
|
28
28
|
|
|
29
|
+
@ApiPropertyOptional()
|
|
30
|
+
@IsOptional()
|
|
31
|
+
@IsBoolean()
|
|
32
|
+
@ToBoolean()
|
|
33
|
+
takeoverOfCommitments?: boolean; //Reprise des engagements
|
|
34
|
+
|
|
29
35
|
@ApiPropertyOptional()
|
|
30
36
|
@IsOptional()
|
|
31
37
|
@IsNumber()
|
package/ts/utils/brands.ts
CHANGED
|
@@ -94,6 +94,16 @@ export type Brand = {
|
|
|
94
94
|
};
|
|
95
95
|
internalInvoicing?: {
|
|
96
96
|
lastUsedNumber?: number;
|
|
97
|
+
invoicePrefix?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Configuration des réinitialisations de numérotation.
|
|
100
|
+
* À partir de la date `resetFrom`, la numérotation redémarre à `resetStartNumber` (+ 1 à l'usage).
|
|
101
|
+
* Exemple: resetFrom: "2026-01-01", resetStartNumber: 0 → factures générées >= 01/01/2026 seront numérotées 1, 2, 3...
|
|
102
|
+
*/
|
|
103
|
+
resetNumbering?: Array<{
|
|
104
|
+
resetFrom: string;
|
|
105
|
+
resetStartNumber: number;
|
|
106
|
+
}>;
|
|
97
107
|
statut: string;
|
|
98
108
|
name: string;
|
|
99
109
|
address: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LegalForm, LegalFormTypeEnum } from '../types/Enum/LegalForm.js';
|
|
2
2
|
import {
|
|
3
|
+
AdditionalMentionType,
|
|
3
4
|
SocietyApprovalDocumentType,
|
|
4
5
|
SocietyApprovalDocumentConfig,
|
|
5
6
|
SocietyApprovalDocumentsByLegalForm,
|
|
@@ -74,6 +75,16 @@ export function getApprovalDocumentInfos(
|
|
|
74
75
|
return config?.documents.find((doc) => doc.idDocumentType === idDocumentType);
|
|
75
76
|
}
|
|
76
77
|
|
|
78
|
+
function createApprovalDecisionTitleGenerator(): () => string {
|
|
79
|
+
const decisionOrdinals = ['PREMIERE', 'DEUXIEME', 'TROISIEME', 'QUATRIEME', 'CINQUIEME', 'SIXIEME'];
|
|
80
|
+
let decisionNumber = 0;
|
|
81
|
+
|
|
82
|
+
return () => {
|
|
83
|
+
decisionNumber += 1;
|
|
84
|
+
return `${decisionOrdinals[decisionNumber - 1] ?? `${decisionNumber}EME`} DECISION`;
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
77
88
|
/**
|
|
78
89
|
* Construit les données formatées pour le template d'approbation
|
|
79
90
|
* @param existingApproval - Les données d'approbation de la société
|
|
@@ -93,6 +104,8 @@ export function buildApprovalTemplateData(existingApproval: ISocietyApproval, st
|
|
|
93
104
|
const brand = getBrand();
|
|
94
105
|
return {
|
|
95
106
|
// Variables globales
|
|
107
|
+
AdditionalMentionType,
|
|
108
|
+
nextDecisionTitle: createApprovalDecisionTitleGenerator(),
|
|
96
109
|
rates: {
|
|
97
110
|
flatTax: 0.314,
|
|
98
111
|
flatLevy: 0.128, //prelevement forfaitaire
|
|
@@ -132,6 +145,15 @@ export function buildApprovalTemplateData(existingApproval: ISocietyApproval, st
|
|
|
132
145
|
.toUpperCase(),
|
|
133
146
|
}
|
|
134
147
|
: {}),
|
|
148
|
+
...(existingApproval?.generatingDatas?.approvalDate
|
|
149
|
+
? {
|
|
150
|
+
approvalDateMore4Months: dayjs(existingApproval?.generatingDatas?.approvalDate)
|
|
151
|
+
.add(4, 'month')
|
|
152
|
+
.locale('fr')
|
|
153
|
+
.format('DD MMMM YYYY')
|
|
154
|
+
.toUpperCase(),
|
|
155
|
+
}
|
|
156
|
+
: {}),
|
|
135
157
|
...(existingApproval?.generatingDatas?.approvalDividendsPaymentDate
|
|
136
158
|
? {
|
|
137
159
|
approvalDividendsPaymentDate: dayjs(existingApproval?.generatingDatas?.approvalDividendsPaymentDate)
|