@silexpert/core 1.1.68 → 1.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/types/Enum/Country.d.ts +4 -2
- package/es/types/Enum/Country.d.ts.map +1 -1
- package/es/types/Enum/Country.js +9 -5
- package/es/types/Enum/Country.js.map +1 -1
- package/es/types/Interface/api/paymentExpectationCustomer/QueryPaymentExpectationCustomer.d.ts.map +1 -1
- package/es/types/Interface/api/paymentExpectationCustomer/QueryPaymentExpectationCustomer.js +14 -0
- package/es/types/Interface/api/paymentExpectationCustomer/QueryPaymentExpectationCustomer.js.map +1 -1
- package/es/types/Interface/api/stripe/QueryStripe.d.ts +2 -2
- package/es/types/Interface/api/stripe/QueryStripe.d.ts.map +1 -1
- package/es/types/Interface/api/stripe/QueryStripe.js +20 -1
- package/es/types/Interface/api/stripe/QueryStripe.js.map +1 -1
- package/es/utils/brands.js +1 -1
- package/es/utils/brands.js.map +1 -1
- package/es/utils/vat/3310/century23.d.ts.map +1 -1
- package/es/utils/vat/3310/century23.js +23 -2
- package/es/utils/vat/3310/century23.js.map +1 -1
- package/es/utils/vat/3517/century23.js +22 -22
- package/es/utils/vat/3517/century23.js.map +1 -1
- package/js/types/Enum/Country.js +14 -5
- package/js/types/Enum/Country.js.map +1 -1
- package/js/types/Interface/api/paymentExpectationCustomer/QueryPaymentExpectationCustomer.js +13 -0
- package/js/types/Interface/api/paymentExpectationCustomer/QueryPaymentExpectationCustomer.js.map +1 -1
- package/js/types/Interface/api/stripe/QueryStripe.js +16 -0
- package/js/types/Interface/api/stripe/QueryStripe.js.map +1 -1
- package/js/utils/brands.js +2 -1
- package/js/utils/brands.js.map +1 -1
- package/js/utils/vat/3310/century23.js +33 -1
- package/js/utils/vat/3310/century23.js.map +1 -1
- package/js/utils/vat/3517/century23.js +22 -22
- package/js/utils/vat/3517/century23.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/Country.ts +9 -5
- package/ts/types/Interface/api/paymentExpectationCustomer/QueryPaymentExpectationCustomer.ts +2 -1
- package/ts/types/Interface/api/stripe/QueryStripe.ts +7 -2
- package/ts/utils/brands.ts +1 -1
- package/ts/utils/vat/3310/century23.ts +29 -2
- package/ts/utils/vat/3517/century23.ts +22 -22
package/es/utils/brands.js
CHANGED
|
@@ -44,7 +44,7 @@ const getBrandConfig = (params) => {
|
|
|
44
44
|
const nodeEnvUsed = nodeEnv !== null && nodeEnv !== void 0 ? nodeEnv : process.env.NODE_ENV;
|
|
45
45
|
const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);
|
|
46
46
|
const listEnvEnum = {
|
|
47
|
-
BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandClems,
|
|
47
|
+
BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandClems, BrandStatutsExpress,
|
|
48
48
|
};
|
|
49
49
|
// @ts-ignore
|
|
50
50
|
const currentConfigFile = listEnvEnum[`Brand${currentEnvName}`];
|
package/es/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,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAiCxE,MAAM,qBAAqB,GAAG,CAAC,OAAgB,EAA0F,EAAE;;IACzI,MAAM,GAAG,GAAG,MAAA,OAAO,aAAP,OAAO,cAAP,OAAO,GAA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YACnB,MAAM,YAAY,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,cAAc,CAAC,CAAC;YACrF,cAAc,GAAG,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;SACxD;QACD,OAAO,cAAc,CAAC;KACvB;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAa,EAA4F,EAAE;IAClI,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,WAAW,CAAC;IAC5D,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,aAAa,CAAC;IAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IACpE,IAAI,KAAK,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,YAAY,CAAC;IAC7D,IAAI,KAAK,CAAC,OAAO,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC;QAAE,OAAO,qBAAqB,CAAC;IAC/E,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF,OAAO,EACL,cAAc,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,eAAe,GAC7E,CAAC","sourcesContent":["import { get as getLodash } from 'lodash';\nimport { BrandClementine } from '../types/Enum/BrandClementine';\nimport { BrandLegalstart } from '../types/Enum/BrandLegalstart';\nimport { BrandComptalib } from '../types/Enum/BrandComptalib';\nimport { BrandPourcentage } from '../types/Enum/BrandPourcentage';\nimport { BrandClems } from '../types/Enum/BrandClems';\nimport { BrandStatutsExpress } from '../types/Enum/BrandStatutsExpress';\n\ntype brand = {\n idTypeBrand: number,\n colors: {\n primary: string,\n },\n listMails: {\n bonjour: string,\n },\n listPhones: {\n contact: string,\n },\n name: string,\n urlApi1?: string,\n urlClient?: string,\n urlApp?: string,\n offices?: {\n LAXOU: {\n id : number,\n },\n HOME_OFFICE: {\n id : number,\n }\n },\n};\n\ntype getBrandConfigParams = {\n idTypeBrand?: number,\n objectWaited?: string,\n nodeEnv?: string\n};\n\nconst getBrandNameByNodeEnv = (nodeEnv?: string): 'Legalstart' | 'Comptalib' | 'Clementine' | 'Pourcentage' | 'Clems' | 'StatutsExpress' => {\n const env = nodeEnv ?? process.env.NODE_ENV ?? process.env.API_HOST;\n if (env) {\n if (env.indexOf('legalstart') > -1 || env.indexOf('Legalstart') > -1) {\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('clems') > -1 || env.indexOf('Clems') > -1) {\n return 'Clems';\n }\n if (env.indexOf('statuts') > -1 || env.indexOf('Statuts') > -1) {\n return 'StatutsExpress';\n }\n }\n return 'Clementine';\n};\n\nconst getAllBrandByNodeEnv = (nodeEnv?: string): Array<brand> => {\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandClems, BrandStatutsExpress,\n };\n // @ts-ignore\n const currentConfigFile:brand[] = listEnvEnum[`Brand${currentEnvName}`];\n\n const brand = currentConfigFile;\n\n return brand;\n};\n\nconst getBrandConfig = (params: getBrandConfigParams): brand => {\n const {\n idTypeBrand = null, objectWaited = null, nodeEnv,\n } = params;\n let brand;\n const nodeEnvUsed = nodeEnv ?? process.env.NODE_ENV;\n const currentEnvName = getBrandNameByNodeEnv(nodeEnvUsed);\n const listEnvEnum = {\n BrandClementine, BrandLegalstart, BrandComptalib, BrandPourcentage, BrandClems, BrandStatutsExpress,\n };\n // @ts-ignore\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 = getLodash(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 = getLodash(brandDefault, objectWaited);\n }\n return objectToReturn;\n }\n\n return brand;\n};\n\nconst getBrandByEmail = (email: string): 'Legalstart' | 'Comptalib' | 'Clementine' | 'Pourcentage' | 'Lecomptablefrancais' | null => {\n if (email.indexOf('legalstart.fr') > -1) return 'Legalstart';\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 return null;\n};\n\nexport {\n getBrandConfig, getAllBrandByNodeEnv, getBrandNameByNodeEnv, getBrandByEmail,\n};"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"century23.d.ts","sourceRoot":"","sources":["../../../../ts/utils/vat/3310/century23.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"century23.d.ts","sourceRoot":"","sources":["../../../../ts/utils/vat/3310/century23.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAKhG,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAClG,OAAO,EAAE,iBAAiB,EAAE,MAAM,4DAA4D,CAAC;AAG/F,wBAAgB,4BAA4B,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE,cAAc,GAAE,iBAAsB,GAAG,cAAc,CA6W1K;AAED,wBAAgB,uCAAuC,CAAC,IAAI,EAAE,cAAc,GAAG,gBAAgB,CAi7B9F;AAED,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,EAyLrD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as dayjs from 'dayjs';
|
|
2
2
|
import { isDefined } from 'class-validator';
|
|
3
|
-
import { round as _round, flatten, uniqBy } from 'lodash';
|
|
3
|
+
import { round as _round, flatten, uniqBy, maxBy, } from 'lodash';
|
|
4
4
|
import { Vat } from '../../../types/Enum/Vat';
|
|
5
5
|
import { getAmountByAccountNumber, getTaxAmountByAccountNumber, setZeroIfIsNegative, textFormatting, } from '../utils';
|
|
6
6
|
export function getCerfa3310Century23Payload(accountingEntries, payload, updatedEntries = []) {
|
|
@@ -135,7 +135,7 @@ export function getCerfa3310Century23Payload(accountingEntries, payload, updated
|
|
|
135
135
|
},
|
|
136
136
|
siret: {
|
|
137
137
|
first: isDefined(payload.society.siret) ? ((_7 = (_6 = payload.society.siret) === null || _6 === void 0 ? void 0 : _6.slice(0, 9)) !== null && _7 !== void 0 ? _7 : null) : null,
|
|
138
|
-
second: isDefined(payload.society.siret) ? ((_9 = (_8 = payload.society.siret) === null || _8 === void 0 ? void 0 : _8.slice(
|
|
138
|
+
second: isDefined(payload.society.siret) ? ((_9 = (_8 = payload.society.siret) === null || _8 === void 0 ? void 0 : _8.slice(-4)) !== null && _9 !== void 0 ? _9 : null) : null,
|
|
139
139
|
},
|
|
140
140
|
intracommunityVat: {
|
|
141
141
|
first: shouldHaveVatCode ? ((_12 = (_11 = (_10 = payload.setting) === null || _10 === void 0 ? void 0 : _10.tvaCode) === null || _11 === void 0 ? void 0 : _11.slice(0, 2)) !== null && _12 !== void 0 ? _12 : null) : null,
|
|
@@ -319,6 +319,27 @@ export function getCerfa3310Century23Payload(accountingEntries, payload, updated
|
|
|
319
319
|
},
|
|
320
320
|
},
|
|
321
321
|
};
|
|
322
|
+
const totalCadreA = initialPayload.taxedOperations.services + initialPayload.taxedOperations.other + initialPayload.taxedOperations.purchaseOfIntracommunityServiceProvision + initialPayload.taxedOperations.intracommunityAcquisitions + initialPayload.taxedOperations.energyDelivery + initialPayload.taxedOperations.purchaseOfServicesNotInFrance;
|
|
323
|
+
const totalCadreB = initialPayload.vat.carrieredOutInFrance.normalRate20.base + initialPayload.vat.carrieredOutInFrance.reduceRate5Dot5.base + initialPayload.vat.carrieredOutInFrance.reduceRate10.base + initialPayload.vat.overseasDepartment.reduceRate8Dot5.base + initialPayload.vat.overseasDepartment.reduceRate2Dot1.base + initialPayload.vat.otherRate.at1Dot75.base + initialPayload.vat.otherRate.at1Dot05.base + initialPayload.vat.otherRate.at10.base + initialPayload.vat.otherRate.atCorse2Dot1.base + initialPayload.vat.otherRate.atCorse0Dot9.base + initialPayload.vat.otherRate.at2Dot1.base + initialPayload.vat.otherRate.author.base + initialPayload.vat.otherRate.oldRate.base;
|
|
324
|
+
// On tolère une différence de 3, dans ce cas on force le champ
|
|
325
|
+
if (totalCadreA !== totalCadreB) {
|
|
326
|
+
const difference = totalCadreB - totalCadreA;
|
|
327
|
+
if (difference >= -3 && difference <= 3) {
|
|
328
|
+
const cadreAFields = [
|
|
329
|
+
{ key: 'services', value: initialPayload.taxedOperations.services },
|
|
330
|
+
{ key: 'other', value: initialPayload.taxedOperations.other },
|
|
331
|
+
{ key: 'purchaseOfIntracommunityServiceProvision', value: initialPayload.taxedOperations.purchaseOfIntracommunityServiceProvision },
|
|
332
|
+
{ key: 'intracommunityAcquisitions', value: initialPayload.taxedOperations.intracommunityAcquisitions },
|
|
333
|
+
{ key: 'energyDelivery', value: initialPayload.taxedOperations.energyDelivery },
|
|
334
|
+
{ key: 'purchaseOfServicesNotInFrance;', value: initialPayload.taxedOperations.purchaseOfServicesNotInFrance },
|
|
335
|
+
];
|
|
336
|
+
const biggestValue = maxBy(cadreAFields, 'value');
|
|
337
|
+
if (biggestValue) {
|
|
338
|
+
// @ts-ignore
|
|
339
|
+
initialPayload.taxedOperations[biggestValue.key] += difference;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
322
343
|
initialPayload.vat.grossDue = initialPayload.vat.carrieredOutInFrance.normalRate20.tax + initialPayload.vat.carrieredOutInFrance.reduceRate5Dot5.tax + initialPayload.vat.carrieredOutInFrance.reduceRate10.tax + initialPayload.vat.overseasDepartment.reduceRate8Dot5.tax + initialPayload.vat.overseasDepartment.reduceRate2Dot1.tax + initialPayload.vat.otherRate.at1Dot75.tax + initialPayload.vat.otherRate.at1Dot05.tax + initialPayload.vat.otherRate.at10.tax + initialPayload.vat.otherRate.atCorse2Dot1.tax + initialPayload.vat.otherRate.atCorse0Dot9.tax + initialPayload.vat.otherRate.at2Dot1.tax + initialPayload.vat.otherRate.author.tax + initialPayload.vat.otherRate.oldRate.tax + initialPayload.vat.oilProducts.normalRate20.tax + initialPayload.vat.oilProducts.reduceRate13.tax + initialPayload.vat.importations.normalRate20.tax + initialPayload.vat.importations.reduceRate10.tax + initialPayload.vat.importations.reduceRate8Dot5.tax + initialPayload.vat.importations.reduceRate5Dot5.tax + initialPayload.vat.importations.reduceRate2Dot1.tax + initialPayload.vat.importations.reduceRate1Dot05.tax + initialPayload.vat.previouslyDeductedToBeReturned.total + initialPayload.vat.sumToAdd;
|
|
323
344
|
initialPayload.vat.deductible.total = initialPayload.vat.deductible.immobilizations + initialPayload.vat.deductible.otherGoodsAndServices + initialPayload.vat.deductible.other.total + initialPayload.vat.deductible.report + initialPayload.vat.deductible.toImpute;
|
|
324
345
|
initialPayload.credit.amount = initialPayload.vat.grossDue - initialPayload.vat.deductible.total < 0 ? Math.abs(initialPayload.vat.grossDue - initialPayload.vat.deductible.total) : 0;
|