@silexpert/core 1.1.348 → 1.1.349

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 (33) hide show
  1. package/dist/cjs/api/resources/AccountType.d.ts +3 -2
  2. package/dist/cjs/api/resources/AccountType.d.ts.map +1 -1
  3. package/dist/cjs/api/resources/AccountType.js +4 -1
  4. package/dist/cjs/api/resources/AccountType.js.map +1 -1
  5. package/dist/cjs/api/resources/Stripe.d.ts +2 -2
  6. package/dist/cjs/api/resources/Stripe.d.ts.map +1 -1
  7. package/dist/cjs/api/resources/Stripe.js +2 -2
  8. package/dist/cjs/api/resources/Stripe.js.map +1 -1
  9. package/dist/cjs/types/Interface/api/stripe/Create.d.ts +4 -0
  10. package/dist/cjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
  11. package/dist/cjs/types/Interface/api/stripe/Create.js +16 -1
  12. package/dist/cjs/types/Interface/api/stripe/Create.js.map +1 -1
  13. package/dist/cjs/utils/prestation.js +1 -1
  14. package/dist/cjs/utils/prestation.js.map +1 -1
  15. package/dist/mjs/api/resources/AccountType.d.ts +3 -2
  16. package/dist/mjs/api/resources/AccountType.d.ts.map +1 -1
  17. package/dist/mjs/api/resources/AccountType.js +4 -1
  18. package/dist/mjs/api/resources/AccountType.js.map +1 -1
  19. package/dist/mjs/api/resources/Stripe.d.ts +2 -2
  20. package/dist/mjs/api/resources/Stripe.d.ts.map +1 -1
  21. package/dist/mjs/api/resources/Stripe.js +2 -2
  22. package/dist/mjs/api/resources/Stripe.js.map +1 -1
  23. package/dist/mjs/types/Interface/api/stripe/Create.d.ts +4 -0
  24. package/dist/mjs/types/Interface/api/stripe/Create.d.ts.map +1 -1
  25. package/dist/mjs/types/Interface/api/stripe/Create.js +17 -1
  26. package/dist/mjs/types/Interface/api/stripe/Create.js.map +1 -1
  27. package/dist/mjs/utils/prestation.js +1 -1
  28. package/dist/mjs/utils/prestation.js.map +1 -1
  29. package/package.json +1 -1
  30. package/ts/api/resources/AccountType.ts +6 -2
  31. package/ts/api/resources/Stripe.ts +3 -3
  32. package/ts/types/Interface/api/stripe/Create.ts +13 -1
  33. package/ts/utils/prestation.ts +1 -1
@@ -1,8 +1,9 @@
1
1
  import { Resource } from '../Resource';
2
- import { ReadAccountType } from '../../types';
2
+ import { IAccountType, ReadAccountType } from '../../types';
3
3
  export declare class AccountType extends Resource {
4
- getAll(params: {
4
+ getAllForSimulation(params: {
5
5
  idSimulation: number;
6
6
  }): Promise<ReadAccountType>;
7
+ getAll(): Promise<IAccountType[]>;
7
8
  }
8
9
  //# sourceMappingURL=AccountType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountType.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,WAAY,SAAQ,QAAQ;IACvC,MAAM,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;CAGnE"}
1
+ {"version":3,"file":"AccountType.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,WAAY,SAAQ,QAAQ;IACvC,mBAAmB,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAI/E,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;CAGlC"}
@@ -3,9 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AccountType = void 0;
4
4
  const Resource_1 = require("../Resource");
5
5
  class AccountType extends Resource_1.Resource {
6
- getAll(params) {
6
+ getAllForSimulation(params) {
7
7
  return this.axios.$get(`/simulation/${params.idSimulation}/accountTypes`);
8
8
  }
9
+ getAll() {
10
+ return this.axios.$get('accounts/types');
11
+ }
9
12
  }
10
13
  exports.AccountType = AccountType;
11
14
  //# sourceMappingURL=AccountType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountType.js","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAGvC,MAAa,WAAY,SAAQ,mBAAQ;IACvC,MAAM,CAAC,MAAgC;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,YAAY,eAAe,CAAC,CAAC;IAC5E,CAAC;CACF;AAJD,kCAIC","sourcesContent":["import { Resource } from '../Resource';\nimport { ReadAccountType } from '../../types';\n\nexport class AccountType extends Resource {\n getAll(params: { idSimulation: number }): Promise<ReadAccountType> {\n return this.axios.$get(`/simulation/${params.idSimulation}/accountTypes`);\n }\n}\n"]}
1
+ {"version":3,"file":"AccountType.js","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAGvC,MAAa,WAAY,SAAQ,mBAAQ;IACvC,mBAAmB,CAAC,MAAgC;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,YAAY,eAAe,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC;CACF;AARD,kCAQC","sourcesContent":["import { Resource } from '../Resource';\nimport { IAccountType, ReadAccountType } from '../../types';\n\nexport class AccountType extends Resource {\n getAllForSimulation(params: { idSimulation: number }): Promise<ReadAccountType> {\n return this.axios.$get(`/simulation/${params.idSimulation}/accountTypes`);\n }\n\n getAll(): Promise<IAccountType[]> {\n return this.axios.$get('accounts/types');\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { Resource } from '../Resource';
2
- import { IConnector } from '../../types';
2
+ import { CreateImportTransactionForSociety, IConnector } from '../../types';
3
3
  export declare class Stripe extends Resource {
4
4
  connect(code: string, idSociety: number): Promise<IConnector>;
5
5
  connectBank(code: string, idSociety: number): Promise<number>;
6
- importForSociety(idSociety: number): Promise<number>;
6
+ importForSociety(idSociety: number, payload: CreateImportTransactionForSociety): Promise<number>;
7
7
  }
8
8
  //# sourceMappingURL=Stripe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stripe.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,qBAAa,MAAO,SAAQ,QAAQ;IAClC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7D,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7D,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGrD"}
1
+ {"version":3,"file":"Stripe.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iCAAiC,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5E,qBAAa,MAAO,SAAQ,QAAQ;IAClC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7D,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7D,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,MAAM,CAAC;CAGjG"}
@@ -9,8 +9,8 @@ class Stripe extends Resource_1.Resource {
9
9
  connectBank(code, idSociety) {
10
10
  return this.axios.$post(`/stripe/${idSociety}/banks`, { code });
11
11
  }
12
- importForSociety(idSociety) {
13
- return this.axios.$post(`/stripe/${idSociety}/importation`);
12
+ importForSociety(idSociety, payload) {
13
+ return this.axios.$post(`/stripe/${idSociety}/importation`, payload);
14
14
  }
15
15
  }
16
16
  exports.Stripe = Stripe;
@@ -1 +1 @@
1
- {"version":3,"file":"Stripe.js","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAGvC,MAAa,MAAO,SAAQ,mBAAQ;IAClC,OAAO,CAAC,IAAY,EAAE,SAAiB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,WAAW,CAAC,IAAY,EAAE,SAAiB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,gBAAgB,CAAC,SAAiB;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF;AAZD,wBAYC","sourcesContent":["import { Resource } from '../Resource';\nimport { IConnector } from '../../types';\n\nexport class Stripe extends Resource {\n connect(code: string, idSociety: number): Promise<IConnector> {\n return this.axios.$post(`/stripe/${idSociety}/connect`, { code });\n }\n\n connectBank(code: string, idSociety: number): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/banks`, { code });\n }\n\n importForSociety(idSociety: number): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/importation`);\n }\n}"]}
1
+ {"version":3,"file":"Stripe.js","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":";;;AAAA,0CAAuC;AAGvC,MAAa,MAAO,SAAQ,mBAAQ;IAClC,OAAO,CAAC,IAAY,EAAE,SAAiB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,WAAW,CAAC,IAAY,EAAE,SAAiB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,gBAAgB,CAAC,SAAiB,EAAE,OAA0C;QAC5E,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,cAAc,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACF;AAZD,wBAYC","sourcesContent":["import { Resource } from '../Resource';\nimport { CreateImportTransactionForSociety, IConnector } from '../../types';\n\nexport class Stripe extends Resource {\n connect(code: string, idSociety: number): Promise<IConnector> {\n return this.axios.$post(`/stripe/${idSociety}/connect`, { code });\n }\n\n connectBank(code: string, idSociety: number): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/banks`, { code });\n }\n\n importForSociety(idSociety: number, payload: CreateImportTransactionForSociety): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/importation`, payload);\n }\n}"]}
@@ -4,4 +4,8 @@ export declare class CreateStripeConnection {
4
4
  export declare class CreateStripePortals {
5
5
  stripeCustomerId?: string;
6
6
  }
7
+ export declare class CreateImportTransactionForSociety {
8
+ startDate?: Date;
9
+ endDate?: Date;
10
+ }
7
11
  //# sourceMappingURL=Create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Create.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IAG/B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,mBAAmB;IAI5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAE7B"}
1
+ {"version":3,"file":"Create.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IAG/B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,mBAAmB;IAI5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAE7B;AAED,qBAAa,iCAAiC;IAI1C,SAAS,CAAC,EAAE,IAAI,CAAC;IAKjB,OAAO,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -9,7 +9,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.CreateStripePortals = exports.CreateStripeConnection = void 0;
12
+ exports.CreateImportTransactionForSociety = exports.CreateStripePortals = exports.CreateStripeConnection = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
14
  const utils_1 = require("../../../../utils");
15
15
  class CreateStripeConnection {
@@ -29,4 +29,19 @@ __decorate([
29
29
  (0, class_validator_1.IsOptional)(),
30
30
  __metadata("design:type", String)
31
31
  ], CreateStripePortals.prototype, "stripeCustomerId", void 0);
32
+ class CreateImportTransactionForSociety {
33
+ }
34
+ exports.CreateImportTransactionForSociety = CreateImportTransactionForSociety;
35
+ __decorate([
36
+ (0, utils_1.ApiPropertyOptional)(),
37
+ (0, class_validator_1.IsDate)(),
38
+ (0, class_validator_1.IsOptional)(),
39
+ __metadata("design:type", Date)
40
+ ], CreateImportTransactionForSociety.prototype, "startDate", void 0);
41
+ __decorate([
42
+ (0, utils_1.ApiPropertyOptional)(),
43
+ (0, class_validator_1.IsDate)(),
44
+ (0, class_validator_1.IsOptional)(),
45
+ __metadata("design:type", Date)
46
+ ], CreateImportTransactionForSociety.prototype, "endDate", void 0);
32
47
  //# sourceMappingURL=Create.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AACvD,6CAAqE;AAErE,MAAa,sBAAsB;CAIlC;AAJD,wDAIC;AADG;IAFD,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;oDACI;AAGjB,MAAa,mBAAmB;CAM/B;AAND,kDAMC;AAFG;IAHD,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACe","sourcesContent":["import { IsOptional, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\n\nexport class CreateStripeConnection {\n @ApiProperty()\n @IsString()\n code: string;\n}\n\nexport class CreateStripePortals {\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n stripeCustomerId?: string;\n\n}"]}
1
+ {"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAC/D,6CAAqE;AAErE,MAAa,sBAAsB;CAIlC;AAJD,wDAIC;AADG;IAFD,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;oDACI;AAGjB,MAAa,mBAAmB;CAM/B;AAND,kDAMC;AAFG;IAHD,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACe;AAI9B,MAAa,iCAAiC;CAU7C;AAVD,8EAUC;AANG;IAHD,IAAA,2BAAmB,GAAE;IACrB,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACC,IAAI;oEAAC;AAKjB;IAHD,IAAA,2BAAmB,GAAE;IACrB,IAAA,wBAAM,GAAE;IACR,IAAA,4BAAU,GAAE;8BACD,IAAI;kEAAC","sourcesContent":["import { IsDate, IsOptional, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\n\nexport class CreateStripeConnection {\n @ApiProperty()\n @IsString()\n code: string;\n}\n\nexport class CreateStripePortals {\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n stripeCustomerId?: string;\n\n}\n\nexport class CreateImportTransactionForSociety {\n @ApiPropertyOptional()\n @IsDate()\n @IsOptional()\n startDate?: Date;\n\n @ApiPropertyOptional()\n @IsDate()\n @IsOptional()\n endDate?: Date;\n}"]}
@@ -47,7 +47,7 @@ const isExpress = (idPrestationList) => {
47
47
  };
48
48
  exports.isExpress = isExpress;
49
49
  const calculateScoringOfPrestation = (idPrestationType, prestations) => {
50
- const prestationsSignedPaid = prestations.filter((prestation) => prestation.terminationList === null);
50
+ const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);
51
51
  // Get the list of prestations that are half price
52
52
  const prestationHalfPriceList = Object.values(PrestationType_1.PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);
53
53
  const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);
@@ -1 +1 @@
1
- {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":";;;AACA,uCAAqD;AACrD,yCAA0C;AAC1C,iEAAgF;AAChF,uDAA4D;AAC5D,qEAAwF;AACxF,2EAAwE;AACxE,6EAA0E;AAC1E,2EAAwE;AACxE,mFAAgF;AAChF,2DAAwD;AACxD,qCAAiD;AACjD,+BAA+B;AAC/B,yCAA4C;AA4E5C,MAAM,yBAAyB,GAAG,CAAC,gBAAwB,EAAW,EAAE,CAAC;IACvE,+BAAc,CAAC,YAAY;IAC3B,+BAAc,CAAC,mBAAmB;IAClC,+BAAc,CAAC,wCAAwC;IACvD,+BAAc,CAAC,uBAAuB;IACtC,+BAAc,CAAC,GAAG;IAClB,+BAAc,C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AAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QACpR,aAAa;aACR,IAAI,CAAC,+BAAc,CAAC,kBAAkB,EAAE,+BAAc,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC,eAAe,CAAC,gBAAgB,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC1O,aAAa;aACR,IAAI,CAAC,+BAAc,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC5N,aAAa;aACR,IAAI,CAAC,+BAAc,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;;YAChN,OAAO,KAAK,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AAEf,CAAC,CAAC;AAGoQ,kDAAmB","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { getTaxesIncludedAmount } from './vat/utils';\nimport { intersection } from './noLodash';\nimport { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';\nimport { LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport { PrestationOptionType, PrestationOption } from '../types/Enum/PrestationOption';\nimport { PriceGridClementine } from '../types/Enum/PriceGridClementine';\nimport { PriceGridPourcentage } from '../types/Enum/PriceGridPourcentage';\nimport { PriceGridLegalstart } from '../types/Enum/PriceGridLegalstart';\nimport { PriceGridStatutsExpress } from '../types/Enum/PriceGridStatutsExpress';\nimport { ClosingType } from '../types/Enum/ClosingType';\nimport { getBrandNameByNodeEnv } from './brands';\nimport * as dayjs from 'dayjs';\nimport { exerciceNumber } from './exercice';\n\ntype priceGridBrand = {\n idTypeBrand: number,\n price: priceGrid[]\n};\n\ntype priceGrid = {\n idPrestationList: number[],\n priceWithTaxesIncluded: boolean,\n applicationCost: number,\n monthlyNbr?: monthlyNbr[],\n exerciceNbr?: exerciceNbr[],\n turnoverCreatedYear?: turnover[],\n turnoverPastYear?: turnover[],\n turnoverMonthly?: turnover[],\n turnoverYearly?: turnover[],\n employee?: employee[],\n partner?: employee[],\n properties?: propertie[],\n vatRegimeMonthly?: vatRegime[],\n vatRegimeYearly?: vatRegime[],\n taxSystem?: taxSystem[],\n legalForm?: legalForm[],\n employeeByLegalForm?: employeeByLegalForm[],\n};\n\ntype monthlyNbr = {\n minimum: number,\n maximum: number,\n value: number,\n closingType: number[],\n};\n\ntype exerciceNbr = {\n minimum: number,\n maximum: number,\n price: number,\n};\n\ntype turnover = {\n turnoverValue: number,\n price: number,\n};\n\ntype legalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype employee = {\n amountMinimum: number,\n amountMaximum: number,\n price: number,\n};\n\ntype employeeByLegalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype propertie = {\n amount: number,\n price: number,\n};\n\ntype vatRegime = {\n type: number,\n price: number,\n};\n\ntype taxSystem = {\n id: number,\n price: number,\n};\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean => [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => !!intersection(idPrestationList, [PrestationType.CREATION_SOCIETE, PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE].includes(idPL)).length;\n\nconst isExpress = (idPrestationList: number):boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr:any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nconst calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {\n const prestationsSignedPaid = prestations.filter((prestation) => prestation.terminationList === null);\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);\n const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);\n\n // Get the number of points for the new prestation\n const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);\n const numberPoint = prestaDetails?.point || 0;\n\n // Get list of prestations that are already done and check if one of them is in the list of prestations that are half price\n const prestationsExistIds = prestationsSignedPaid.map((prestation) => prestation.idPrestationList);\n const prestationHalfPriceAlreadyDoneIds = prestationsExistIds.filter((id) => prestationHalfPriceIds.includes(id));\n\n // If one of the prestations already done is in the list of prestations that are half price and if the idPrestationType is in prestationHalfPriceIds, return 50% of points\n if (prestationHalfPriceAlreadyDoneIds.length && prestationHalfPriceIds.includes(idPrestationType)) return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\n};\n\nexport const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {\n let currentBrandPriceGrid: priceGridBrand | undefined;\n let currentPriceGrid: priceGrid | undefined;\n\n const currentEnvName = getBrandNameByNodeEnv(process.env.NODE_ENV);\n const listEnvEnum = {\n PriceGridClementine, PriceGridPourcentage, PriceGridLegalstart, PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile) currentBrandPriceGrid = currentPriceGridFile.find((priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand);\n if (currentBrandPriceGrid) currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) => price.idPrestationList.includes(idPrestationList));\n return currentPriceGrid;\n};\n\nconst calculatePrestationPriceWithPriceGrid = (\n idPrestationList: number, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n isYearly: boolean, /* Prestation annuel ou mensuel */\n totalMonth: number, /* Nbr de moiis offer */\n idTaxSystem: number, \n idLegalForm: number, \n exerciceNbr: number,\n balanceSheetOffered: number = 0, /* montant du bilan offer */\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n monthNbr: number, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let monthNbr: number = NbrMonth;\n let yearlyPrice: number | undefined;\n let finalMonthlyPrice: number | undefined;\n let canBeCreated: boolean = true;\n let recalculateMonthly: boolean = false;\n\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n \n if (currentPriceGrid) {\n let monthlyPrice: number | undefined;\n let vatRegimePrice: number | undefined;\n let taxSystemPrice: number | undefined;\n\n /* Gestion du régime de TVA */\n if (currentPriceGrid.vatRegimeMonthly && !isYearly) vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find(regime => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly) vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find(regime => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem) taxSystemPrice = currentPriceGrid.taxSystem?.find(tax => tax.id === idTaxSystem)?.price;\n\n /* Gestion des montants */\n /* Récupératioin des prix mensuels */\n if (currentPriceGrid.turnoverMonthly && !isYearly) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(emp => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n } else if (currentPriceGrid.employeeByLegalForm) {\n monthlyPrice = currentPriceGrid.employeeByLegalForm?.find(emp => emp.idLegalForm === idLegalForm)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n /* Récupération des prix annuels */\n } else if (currentPriceGrid.turnoverYearly && isYearly) yearlyPrice = currentPriceGrid.turnoverYearly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;\n else if (currentPriceGrid.legalForm) yearlyPrice = currentPriceGrid.legalForm?.find(form => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr) yearlyPrice = currentPriceGrid.exerciceNbr?.find(el => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum )?.price;\n /* Calcul du prix mensuel final */\n finalMonthlyPrice = (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);\n\n /* Gestion des mois */\n let cloturedPast: boolean = false;\n if (dayjs(endDate, 'YYYY-MM-DD').subtract(15, 'day').isBefore(dayjs())) cloturedPast = true;\n let monthlyNbrList: monthlyNbr[] | undefined;\n let monthlyNbr: monthlyNbr | undefined;\n if (currentPriceGrid.monthlyNbr) {\n monthlyNbrList = currentPriceGrid.monthlyNbr?.filter(el => el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS));\n if (monthlyNbrList) {\n monthlyNbr = monthlyNbrList.find(el => (el.minimum <= monthNbr) && (monthNbr <= el.maximum));\n if (monthlyNbr) {\n monthNbr = monthlyNbr.value;\n }\n }\n }\n /* Gestion des offres, mois offer */\n if (totalMonth > 0) {\n if (monthlyNbr && ((monthNbr - totalMonth) < monthlyNbr?.minimum)) canBeCreated = false; \n monthNbr = monthNbr - totalMonth;\n recalculateMonthly = true;\n }\n\n /* Calcul du nombre de mois soustraient */\n reduceMonth = (monthNbr === NbrMonth - totalMonth ? totalMonth : 0);\n\n /* Gestion des offres, bilan offer */\n if (balanceSheetOffered > 0) {\n yearlyPrice = undefined;\n recalculateMonthly = false;\n finalMonthlyPrice = balanceSheetOffered / monthNbr;\n }\n \n /* Prix Final */\n totalPrestation = (yearlyPrice ? yearlyPrice : finalMonthlyPrice * monthNbr);\n }\n return { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / monthNbr) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };\n};\n\nconst calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {\n let totalPrestation: number = 0;\n\n totalPrestation = prestationList?.price || 0;\n\n return totalPrestation;\n};\n\n/**\n * From idLegalForm, get application fees amount (without taxes included if no idVat passed, or with taxes included calculated by given idVat)\n * @param idLegalForm \n * @param idVat \n * @returns amount of application fees, without taxes included\n */\nconst getApplicationFeesAmount = (idLegalForm: number, idVat?: number) =>{\n let applicationFeesAmount = 50;\n if (idLegalForm === LegalFormTypeEnum.SCI) applicationFeesAmount = 150;\n\n //Sans tva, on envoie le montant HT\n if (!idVat) return applicationFeesAmount;\n\n //Avec tva, on envoie le montant TTC\n return getTaxesIncludedAmount(applicationFeesAmount, idVat);\n};\n\nconst calculatePrestationPrice = (\n idPrestationList: number, \n prestationList: IPrestationList, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n optionsList: number[], \n totalPercentage: number, /* total pourcentage offer (%) */\n totalAmount: number, /* total montant offer (€) */\n totalMonth: number, /* total mois offer (mois) */\n isWithApplicationFees: boolean, /* frais de dossier */\n idTaxSystem: number, \n idLegalForm: number, \n isYearly: boolean = false, /* prestation annuel ou mensuel */\n isSubPrestation: boolean = false,\n balanceSheetOffered: number = 0,\n exerciceList: IExercice[] = [],\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n calculDetail: string, \n monthlyPrice: string, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let canBeCreated: boolean = true;\n let monthNbr: number = 0;\n let price: number = 0;\n let totalWithReduce: { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } = { totalPrestation: 0, reduceMonth: 0, canBeCreated: true, monthNbr: 0, price: 0 };\n\n /* Gestion du prix en fonction de la prestation */\n if (\n [\n PrestationType.COMPTA_PRO,\n PrestationType.COMPTA_PRO_EXPRESS,\n PrestationType.COMPTA_ENTREPRISE,\n PrestationType.COMPTA_ENTREPRISE_EXPRESS,\n PrestationType.COMPTA_SCI,\n PrestationType.COMPTA_SCI_EXPRESS,\n PrestationType.BILAN_PREVISIONNEL,\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n PrestationType.COMPTA_POURCENTAGE,\n PrestationType.COMPTA_POURCENTAGE_EXPRESS,\n PrestationType.SOCIAL,\n PrestationType.GESTION_JURIDIQUE,\n PrestationType.COMPTA_PRO_COMPTASTART,\n PrestationType.COMPTA_PRO_COMPTASTART_EXPRESS,\n PrestationType.COMPTA_EI_KLEMS,\n PrestationType.COMPTA_EI_KLEMS_EXPRESS,\n PrestationType.COMPTA_MICRO_KLEMS,\n PrestationType.COMPTA_MICRO_KLEMS_EXPRESS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS_EXPRESS,\n PrestationType.STATUTS_OPTION_2,\n ].includes(idPrestationList)\n ) {\n let exerciceNbr: number = 0;\n if (exerciceList.length) exerciceNbr = exerciceNumber(dayjs(endDate, 'YYYY-MM-DD').toDate(), exerciceList);\n totalWithReduce = calculatePrestationPriceWithPriceGrid(\n idPrestationList, \n endDate, \n NbrMonth, \n turnover, \n rentsNumber, \n employeesNumber, \n associatesNumber, \n idTypeBrand, \n idVatRegime, \n pastBalanceSheet, \n isYearly, \n totalMonth, \n idTaxSystem, \n idLegalForm, \n exerciceNbr,\n balanceSheetOffered,\n );\n totalPrestation = totalWithReduce.totalPrestation;\n reduceMonth = totalWithReduce.reduceMonth;\n canBeCreated = totalWithReduce.canBeCreated;\n monthNbr = totalWithReduce.monthNbr;\n price = totalWithReduce.price;\n } else {\n totalPrestation = calculatePrestationPriceWithPrestationList(prestationList);\n if ([PrestationType.CREATION_SOCIETE].includes(idPrestationList) && !isSubPrestation) totalPrestation += 50;\n }\n /* Gestion des offres */\n /* Offre montant offer */\n if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;\n /* Offre pourcentage offer */\n if (totalPercentage > 0) totalPrestation = totalPrestation - (totalPrestation * (totalPercentage / 100));\n /* Gesstioin du prix minimum acceptable pour la prestation */\n if (prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice) totalPrestation = prestationList.minimumPrice;\n /* Gestion des options */\n let OptionTotalPrice: number = 0;\n if (optionsList.length) {\n optionsList.forEach((optionId) => {\n const optionPrice: number | undefined = Object.values(PrestationOption).find((option) => option.id === optionId)?.price;\n if (optionPrice) OptionTotalPrice += optionPrice;\n });\n }\n totalPrestation += (OptionTotalPrice ? OptionTotalPrice : 0);\n /* Gestion des frais de dossier */\n if (isWithApplicationFees) {\n const applicationFeesAmount = getApplicationFeesAmount(idLegalForm);\n totalPrestation += applicationFeesAmount;\n }\n\n const calculDetail = `${monthNbr > 0 ? monthNbr + ' mois x ' + (Math.round(price * 100) / 100) + '€' : (Math.round(price * 100) / 100) + '€'} ${totalAmount > 0 ? '- ' + totalAmount + '€' : ''} ${totalPercentage > 0 ? '- ' + totalPercentage + '%' : ''} ${isWithApplicationFees ? '+ 50€' : ''}`;\n\n return { totalPrestation, reduceMonth, canBeCreated, calculDetail, monthlyPrice: monthNbr > 0 ? (Math.round(price * 100) / 100) + '€/mois' : (Math.round(price * 100) / 100) + '€', price };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter(option => option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)));\n return PrestationOptionList.filter(option => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (idTypeBrand: number, idPrestationList: number, turnover: number, pastBalanceSheet: boolean): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n // @ts-ignore\n if ([PrestationType.COMPTA_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && !pastBalanceSheet && currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && pastBalanceSheet && currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover) return true;\n else return false;\n }\n return false;\n\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid, getApplicationFeesAmount,\n};"]}
1
+ {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":";;;AACA,uCAAqD;AACrD,yCAA0C;AAC1C,iEAAgF;AAChF,uDAA4D;AAC5D,qEAAwF;AACxF,2EAAwE;AACxE,6EAA0E;AAC1E,2EAAwE;AACxE,mFAAgF;AAChF,2DAAwD;AACxD,qCAAiD;AACjD,+BAA+B;AAC/B,yCAA4C;AA4E5C,MAAM,yBAAyB,GAAG,CAAC,gBAAwB,EAAW,EAAE,CAAC;IACvE,+BAAc,CAAC,YAAY;IAC3B,+BAAc,CAAC,mBAAmB;IAClC,+BAAc,CAAC,wCAAwC;IACvD,+BAAc,CAAC,uBAAuB;IACtC,+BAAc,CAAC,GAAG;IAClB,+BAAc,CAAC,aAAa;IAC5B,+BAAc,CAAC,kBAAkB;CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AA+U9D,8DAAyB;AA7U3B,MAAM,wBAAwB,GAAG,CAAC,WAAmB,EAAE,SAAiB,EAAE,gBAAwB,EAAW,EAAE,CAAC,gBAAgB,KAAK,+BAAc,CAAC,iBAAiB,IAAI,SAAS,IAAI,WAAW,CAAC;AA6UrK,4DAAwB;AA3UrD,MAAM,oBAAoB,GAAG,CAAC,gBAAwB,EAAW,EAAE,CAAC,gBAAgB,KAAK,+BAAc,CAAC,+BAA+B,CAAC;AA2U7D,oDAAoB;AAzU/F,MAAM,kBAAkB,GAAG,CAAC,MAAc,EAAE,SAAiB,EAAW,EAAE,CAAC,CAAC,MAAM,IAAI,SAAS,CAAC;AAyUzC,gDAAkB;AAvUzE,MAAM,WAAW,GAAG,CAAC,gBAA0B,EAAU,EAAE,CAAC,CAAC,gBAAgB,CAAC,M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,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC5N,aAAa;aACR,IAAI,CAAC,+BAAc,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;;YAChN,OAAO,KAAK,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AAEf,CAAC,CAAC;AAGoQ,kDAAmB","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { getTaxesIncludedAmount } from './vat/utils';\nimport { intersection } from './noLodash';\nimport { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';\nimport { LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport { PrestationOptionType, PrestationOption } from '../types/Enum/PrestationOption';\nimport { PriceGridClementine } from '../types/Enum/PriceGridClementine';\nimport { PriceGridPourcentage } from '../types/Enum/PriceGridPourcentage';\nimport { PriceGridLegalstart } from '../types/Enum/PriceGridLegalstart';\nimport { PriceGridStatutsExpress } from '../types/Enum/PriceGridStatutsExpress';\nimport { ClosingType } from '../types/Enum/ClosingType';\nimport { getBrandNameByNodeEnv } from './brands';\nimport * as dayjs from 'dayjs';\nimport { exerciceNumber } from './exercice';\n\ntype priceGridBrand = {\n idTypeBrand: number,\n price: priceGrid[]\n};\n\ntype priceGrid = {\n idPrestationList: number[],\n priceWithTaxesIncluded: boolean,\n applicationCost: number,\n monthlyNbr?: monthlyNbr[],\n exerciceNbr?: exerciceNbr[],\n turnoverCreatedYear?: turnover[],\n turnoverPastYear?: turnover[],\n turnoverMonthly?: turnover[],\n turnoverYearly?: turnover[],\n employee?: employee[],\n partner?: employee[],\n properties?: propertie[],\n vatRegimeMonthly?: vatRegime[],\n vatRegimeYearly?: vatRegime[],\n taxSystem?: taxSystem[],\n legalForm?: legalForm[],\n employeeByLegalForm?: employeeByLegalForm[],\n};\n\ntype monthlyNbr = {\n minimum: number,\n maximum: number,\n value: number,\n closingType: number[],\n};\n\ntype exerciceNbr = {\n minimum: number,\n maximum: number,\n price: number,\n};\n\ntype turnover = {\n turnoverValue: number,\n price: number,\n};\n\ntype legalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype employee = {\n amountMinimum: number,\n amountMaximum: number,\n price: number,\n};\n\ntype employeeByLegalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype propertie = {\n amount: number,\n price: number,\n};\n\ntype vatRegime = {\n type: number,\n price: number,\n};\n\ntype taxSystem = {\n id: number,\n price: number,\n};\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean => [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => !!intersection(idPrestationList, [PrestationType.CREATION_SOCIETE, PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE].includes(idPL)).length;\n\nconst isExpress = (idPrestationList: number):boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr:any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nconst calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {\n const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);\n const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);\n\n // Get the number of points for the new prestation\n const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);\n const numberPoint = prestaDetails?.point || 0;\n\n // Get list of prestations that are already done and check if one of them is in the list of prestations that are half price\n const prestationsExistIds = prestationsSignedPaid.map((prestation) => prestation.idPrestationList);\n const prestationHalfPriceAlreadyDoneIds = prestationsExistIds.filter((id) => prestationHalfPriceIds.includes(id));\n\n // If one of the prestations already done is in the list of prestations that are half price and if the idPrestationType is in prestationHalfPriceIds, return 50% of points\n if (prestationHalfPriceAlreadyDoneIds.length && prestationHalfPriceIds.includes(idPrestationType)) return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\n};\n\nexport const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {\n let currentBrandPriceGrid: priceGridBrand | undefined;\n let currentPriceGrid: priceGrid | undefined;\n\n const currentEnvName = getBrandNameByNodeEnv(process.env.NODE_ENV);\n const listEnvEnum = {\n PriceGridClementine, PriceGridPourcentage, PriceGridLegalstart, PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile) currentBrandPriceGrid = currentPriceGridFile.find((priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand);\n if (currentBrandPriceGrid) currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) => price.idPrestationList.includes(idPrestationList));\n return currentPriceGrid;\n};\n\nconst calculatePrestationPriceWithPriceGrid = (\n idPrestationList: number, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n isYearly: boolean, /* Prestation annuel ou mensuel */\n totalMonth: number, /* Nbr de moiis offer */\n idTaxSystem: number, \n idLegalForm: number, \n exerciceNbr: number,\n balanceSheetOffered: number = 0, /* montant du bilan offer */\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n monthNbr: number, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let monthNbr: number = NbrMonth;\n let yearlyPrice: number | undefined;\n let finalMonthlyPrice: number | undefined;\n let canBeCreated: boolean = true;\n let recalculateMonthly: boolean = false;\n\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n \n if (currentPriceGrid) {\n let monthlyPrice: number | undefined;\n let vatRegimePrice: number | undefined;\n let taxSystemPrice: number | undefined;\n\n /* Gestion du régime de TVA */\n if (currentPriceGrid.vatRegimeMonthly && !isYearly) vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find(regime => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly) vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find(regime => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem) taxSystemPrice = currentPriceGrid.taxSystem?.find(tax => tax.id === idTaxSystem)?.price;\n\n /* Gestion des montants */\n /* Récupératioin des prix mensuels */\n if (currentPriceGrid.turnoverMonthly && !isYearly) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(emp => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n } else if (currentPriceGrid.employeeByLegalForm) {\n monthlyPrice = currentPriceGrid.employeeByLegalForm?.find(emp => emp.idLegalForm === idLegalForm)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n /* Récupération des prix annuels */\n } else if (currentPriceGrid.turnoverYearly && isYearly) yearlyPrice = currentPriceGrid.turnoverYearly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;\n else if (currentPriceGrid.legalForm) yearlyPrice = currentPriceGrid.legalForm?.find(form => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr) yearlyPrice = currentPriceGrid.exerciceNbr?.find(el => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum )?.price;\n /* Calcul du prix mensuel final */\n finalMonthlyPrice = (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);\n\n /* Gestion des mois */\n let cloturedPast: boolean = false;\n if (dayjs(endDate, 'YYYY-MM-DD').subtract(15, 'day').isBefore(dayjs())) cloturedPast = true;\n let monthlyNbrList: monthlyNbr[] | undefined;\n let monthlyNbr: monthlyNbr | undefined;\n if (currentPriceGrid.monthlyNbr) {\n monthlyNbrList = currentPriceGrid.monthlyNbr?.filter(el => el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS));\n if (monthlyNbrList) {\n monthlyNbr = monthlyNbrList.find(el => (el.minimum <= monthNbr) && (monthNbr <= el.maximum));\n if (monthlyNbr) {\n monthNbr = monthlyNbr.value;\n }\n }\n }\n /* Gestion des offres, mois offer */\n if (totalMonth > 0) {\n if (monthlyNbr && ((monthNbr - totalMonth) < monthlyNbr?.minimum)) canBeCreated = false; \n monthNbr = monthNbr - totalMonth;\n recalculateMonthly = true;\n }\n\n /* Calcul du nombre de mois soustraient */\n reduceMonth = (monthNbr === NbrMonth - totalMonth ? totalMonth : 0);\n\n /* Gestion des offres, bilan offer */\n if (balanceSheetOffered > 0) {\n yearlyPrice = undefined;\n recalculateMonthly = false;\n finalMonthlyPrice = balanceSheetOffered / monthNbr;\n }\n \n /* Prix Final */\n totalPrestation = (yearlyPrice ? yearlyPrice : finalMonthlyPrice * monthNbr);\n }\n return { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / monthNbr) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };\n};\n\nconst calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {\n let totalPrestation: number = 0;\n\n totalPrestation = prestationList?.price || 0;\n\n return totalPrestation;\n};\n\n/**\n * From idLegalForm, get application fees amount (without taxes included if no idVat passed, or with taxes included calculated by given idVat)\n * @param idLegalForm \n * @param idVat \n * @returns amount of application fees, without taxes included\n */\nconst getApplicationFeesAmount = (idLegalForm: number, idVat?: number) =>{\n let applicationFeesAmount = 50;\n if (idLegalForm === LegalFormTypeEnum.SCI) applicationFeesAmount = 150;\n\n //Sans tva, on envoie le montant HT\n if (!idVat) return applicationFeesAmount;\n\n //Avec tva, on envoie le montant TTC\n return getTaxesIncludedAmount(applicationFeesAmount, idVat);\n};\n\nconst calculatePrestationPrice = (\n idPrestationList: number, \n prestationList: IPrestationList, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n optionsList: number[], \n totalPercentage: number, /* total pourcentage offer (%) */\n totalAmount: number, /* total montant offer (€) */\n totalMonth: number, /* total mois offer (mois) */\n isWithApplicationFees: boolean, /* frais de dossier */\n idTaxSystem: number, \n idLegalForm: number, \n isYearly: boolean = false, /* prestation annuel ou mensuel */\n isSubPrestation: boolean = false,\n balanceSheetOffered: number = 0,\n exerciceList: IExercice[] = [],\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n calculDetail: string, \n monthlyPrice: string, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let canBeCreated: boolean = true;\n let monthNbr: number = 0;\n let price: number = 0;\n let totalWithReduce: { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } = { totalPrestation: 0, reduceMonth: 0, canBeCreated: true, monthNbr: 0, price: 0 };\n\n /* Gestion du prix en fonction de la prestation */\n if (\n [\n PrestationType.COMPTA_PRO,\n PrestationType.COMPTA_PRO_EXPRESS,\n PrestationType.COMPTA_ENTREPRISE,\n PrestationType.COMPTA_ENTREPRISE_EXPRESS,\n PrestationType.COMPTA_SCI,\n PrestationType.COMPTA_SCI_EXPRESS,\n PrestationType.BILAN_PREVISIONNEL,\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n PrestationType.COMPTA_POURCENTAGE,\n PrestationType.COMPTA_POURCENTAGE_EXPRESS,\n PrestationType.SOCIAL,\n PrestationType.GESTION_JURIDIQUE,\n PrestationType.COMPTA_PRO_COMPTASTART,\n PrestationType.COMPTA_PRO_COMPTASTART_EXPRESS,\n PrestationType.COMPTA_EI_KLEMS,\n PrestationType.COMPTA_EI_KLEMS_EXPRESS,\n PrestationType.COMPTA_MICRO_KLEMS,\n PrestationType.COMPTA_MICRO_KLEMS_EXPRESS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS_EXPRESS,\n PrestationType.STATUTS_OPTION_2,\n ].includes(idPrestationList)\n ) {\n let exerciceNbr: number = 0;\n if (exerciceList.length) exerciceNbr = exerciceNumber(dayjs(endDate, 'YYYY-MM-DD').toDate(), exerciceList);\n totalWithReduce = calculatePrestationPriceWithPriceGrid(\n idPrestationList, \n endDate, \n NbrMonth, \n turnover, \n rentsNumber, \n employeesNumber, \n associatesNumber, \n idTypeBrand, \n idVatRegime, \n pastBalanceSheet, \n isYearly, \n totalMonth, \n idTaxSystem, \n idLegalForm, \n exerciceNbr,\n balanceSheetOffered,\n );\n totalPrestation = totalWithReduce.totalPrestation;\n reduceMonth = totalWithReduce.reduceMonth;\n canBeCreated = totalWithReduce.canBeCreated;\n monthNbr = totalWithReduce.monthNbr;\n price = totalWithReduce.price;\n } else {\n totalPrestation = calculatePrestationPriceWithPrestationList(prestationList);\n if ([PrestationType.CREATION_SOCIETE].includes(idPrestationList) && !isSubPrestation) totalPrestation += 50;\n }\n /* Gestion des offres */\n /* Offre montant offer */\n if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;\n /* Offre pourcentage offer */\n if (totalPercentage > 0) totalPrestation = totalPrestation - (totalPrestation * (totalPercentage / 100));\n /* Gesstioin du prix minimum acceptable pour la prestation */\n if (prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice) totalPrestation = prestationList.minimumPrice;\n /* Gestion des options */\n let OptionTotalPrice: number = 0;\n if (optionsList.length) {\n optionsList.forEach((optionId) => {\n const optionPrice: number | undefined = Object.values(PrestationOption).find((option) => option.id === optionId)?.price;\n if (optionPrice) OptionTotalPrice += optionPrice;\n });\n }\n totalPrestation += (OptionTotalPrice ? OptionTotalPrice : 0);\n /* Gestion des frais de dossier */\n if (isWithApplicationFees) {\n const applicationFeesAmount = getApplicationFeesAmount(idLegalForm);\n totalPrestation += applicationFeesAmount;\n }\n\n const calculDetail = `${monthNbr > 0 ? monthNbr + ' mois x ' + (Math.round(price * 100) / 100) + '€' : (Math.round(price * 100) / 100) + '€'} ${totalAmount > 0 ? '- ' + totalAmount + '€' : ''} ${totalPercentage > 0 ? '- ' + totalPercentage + '%' : ''} ${isWithApplicationFees ? '+ 50€' : ''}`;\n\n return { totalPrestation, reduceMonth, canBeCreated, calculDetail, monthlyPrice: monthNbr > 0 ? (Math.round(price * 100) / 100) + '€/mois' : (Math.round(price * 100) / 100) + '€', price };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter(option => option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)));\n return PrestationOptionList.filter(option => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (idTypeBrand: number, idPrestationList: number, turnover: number, pastBalanceSheet: boolean): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n // @ts-ignore\n if ([PrestationType.COMPTA_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && !pastBalanceSheet && currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && pastBalanceSheet && currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover) return true;\n else return false;\n }\n return false;\n\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid, getApplicationFeesAmount,\n};"]}
@@ -1,8 +1,9 @@
1
1
  import { Resource } from '../Resource';
2
- import { ReadAccountType } from '../../types';
2
+ import { IAccountType, ReadAccountType } from '../../types';
3
3
  export declare class AccountType extends Resource {
4
- getAll(params: {
4
+ getAllForSimulation(params: {
5
5
  idSimulation: number;
6
6
  }): Promise<ReadAccountType>;
7
+ getAll(): Promise<IAccountType[]>;
7
8
  }
8
9
  //# sourceMappingURL=AccountType.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountType.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,WAAY,SAAQ,QAAQ;IACvC,MAAM,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;CAGnE"}
1
+ {"version":3,"file":"AccountType.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,WAAY,SAAQ,QAAQ;IACvC,mBAAmB,CAAC,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAI/E,MAAM,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;CAGlC"}
@@ -1,7 +1,10 @@
1
1
  import { Resource } from '../Resource';
2
2
  export class AccountType extends Resource {
3
- getAll(params) {
3
+ getAllForSimulation(params) {
4
4
  return this.axios.$get(`/simulation/${params.idSimulation}/accountTypes`);
5
5
  }
6
+ getAll() {
7
+ return this.axios.$get('accounts/types');
8
+ }
6
9
  }
7
10
  //# sourceMappingURL=AccountType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AccountType.js","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACvC,MAAM,CAAC,MAAgC;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,YAAY,eAAe,CAAC,CAAC;IAC5E,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport { ReadAccountType } from '../../types';\n\nexport class AccountType extends Resource {\n getAll(params: { idSimulation: number }): Promise<ReadAccountType> {\n return this.axios.$get(`/simulation/${params.idSimulation}/accountTypes`);\n }\n}\n"]}
1
+ {"version":3,"file":"AccountType.js","sourceRoot":"","sources":["../../../../ts/api/resources/AccountType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,OAAO,WAAY,SAAQ,QAAQ;IACvC,mBAAmB,CAAC,MAAgC;QAClD,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,MAAM,CAAC,YAAY,eAAe,CAAC,CAAC;IAC5E,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3C,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport { IAccountType, ReadAccountType } from '../../types';\n\nexport class AccountType extends Resource {\n getAllForSimulation(params: { idSimulation: number }): Promise<ReadAccountType> {\n return this.axios.$get(`/simulation/${params.idSimulation}/accountTypes`);\n }\n\n getAll(): Promise<IAccountType[]> {\n return this.axios.$get('accounts/types');\n }\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { Resource } from '../Resource';
2
- import { IConnector } from '../../types';
2
+ import { CreateImportTransactionForSociety, IConnector } from '../../types';
3
3
  export declare class Stripe extends Resource {
4
4
  connect(code: string, idSociety: number): Promise<IConnector>;
5
5
  connectBank(code: string, idSociety: number): Promise<number>;
6
- importForSociety(idSociety: number): Promise<number>;
6
+ importForSociety(idSociety: number, payload: CreateImportTransactionForSociety): Promise<number>;
7
7
  }
8
8
  //# sourceMappingURL=Stripe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stripe.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,qBAAa,MAAO,SAAQ,QAAQ;IAClC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7D,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7D,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAGrD"}
1
+ {"version":3,"file":"Stripe.d.ts","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,iCAAiC,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE5E,qBAAa,MAAO,SAAQ,QAAQ;IAClC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAI7D,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAI7D,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,iCAAiC,GAAG,OAAO,CAAC,MAAM,CAAC;CAGjG"}
@@ -6,8 +6,8 @@ export class Stripe extends Resource {
6
6
  connectBank(code, idSociety) {
7
7
  return this.axios.$post(`/stripe/${idSociety}/banks`, { code });
8
8
  }
9
- importForSociety(idSociety) {
10
- return this.axios.$post(`/stripe/${idSociety}/importation`);
9
+ importForSociety(idSociety, payload) {
10
+ return this.axios.$post(`/stripe/${idSociety}/importation`, payload);
11
11
  }
12
12
  }
13
13
  //# sourceMappingURL=Stripe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Stripe.js","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,OAAO,MAAO,SAAQ,QAAQ;IAClC,OAAO,CAAC,IAAY,EAAE,SAAiB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,WAAW,CAAC,IAAY,EAAE,SAAiB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,gBAAgB,CAAC,SAAiB;QAChC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,cAAc,CAAC,CAAC;IAC9D,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport { IConnector } from '../../types';\n\nexport class Stripe extends Resource {\n connect(code: string, idSociety: number): Promise<IConnector> {\n return this.axios.$post(`/stripe/${idSociety}/connect`, { code });\n }\n\n connectBank(code: string, idSociety: number): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/banks`, { code });\n }\n\n importForSociety(idSociety: number): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/importation`);\n }\n}"]}
1
+ {"version":3,"file":"Stripe.js","sourceRoot":"","sources":["../../../../ts/api/resources/Stripe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,MAAM,OAAO,MAAO,SAAQ,QAAQ;IAClC,OAAO,CAAC,IAAY,EAAE,SAAiB;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;IAED,WAAW,CAAC,IAAY,EAAE,SAAiB;QACzC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;IAED,gBAAgB,CAAC,SAAiB,EAAE,OAA0C;QAC5E,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,SAAS,cAAc,EAAE,OAAO,CAAC,CAAC;IACvE,CAAC;CACF","sourcesContent":["import { Resource } from '../Resource';\nimport { CreateImportTransactionForSociety, IConnector } from '../../types';\n\nexport class Stripe extends Resource {\n connect(code: string, idSociety: number): Promise<IConnector> {\n return this.axios.$post(`/stripe/${idSociety}/connect`, { code });\n }\n\n connectBank(code: string, idSociety: number): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/banks`, { code });\n }\n\n importForSociety(idSociety: number, payload: CreateImportTransactionForSociety): Promise<number> {\n return this.axios.$post(`/stripe/${idSociety}/importation`, payload);\n }\n}"]}
@@ -4,4 +4,8 @@ export declare class CreateStripeConnection {
4
4
  export declare class CreateStripePortals {
5
5
  stripeCustomerId?: string;
6
6
  }
7
+ export declare class CreateImportTransactionForSociety {
8
+ startDate?: Date;
9
+ endDate?: Date;
10
+ }
7
11
  //# sourceMappingURL=Create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Create.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IAG/B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,mBAAmB;IAI5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAE7B"}
1
+ {"version":3,"file":"Create.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":"AAGA,qBAAa,sBAAsB;IAG/B,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,mBAAmB;IAI5B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAE7B;AAED,qBAAa,iCAAiC;IAI1C,SAAS,CAAC,EAAE,IAAI,CAAC;IAKjB,OAAO,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  var __metadata = (this && this.__metadata) || function (k, v) {
8
8
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
9
9
  };
10
- import { IsOptional, IsString } from 'class-validator';
10
+ import { IsDate, IsOptional, IsString } from 'class-validator';
11
11
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
12
12
  export class CreateStripeConnection {
13
13
  code;
@@ -26,4 +26,20 @@ __decorate([
26
26
  IsOptional(),
27
27
  __metadata("design:type", String)
28
28
  ], CreateStripePortals.prototype, "stripeCustomerId", void 0);
29
+ export class CreateImportTransactionForSociety {
30
+ startDate;
31
+ endDate;
32
+ }
33
+ __decorate([
34
+ ApiPropertyOptional(),
35
+ IsDate(),
36
+ IsOptional(),
37
+ __metadata("design:type", Date)
38
+ ], CreateImportTransactionForSociety.prototype, "startDate", void 0);
39
+ __decorate([
40
+ ApiPropertyOptional(),
41
+ IsDate(),
42
+ IsOptional(),
43
+ __metadata("design:type", Date)
44
+ ], CreateImportTransactionForSociety.prototype, "endDate", void 0);
29
45
  //# sourceMappingURL=Create.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAErE,MAAM,OAAO,sBAAsB;IAG/B,IAAI,CAAS;CAChB;AADG;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;oDACI;AAGjB,MAAM,OAAO,mBAAmB;IAI5B,gBAAgB,CAAU;CAE7B;AAFG;IAHD,mBAAmB,EAAE;IACrB,QAAQ,EAAE;IACV,UAAU,EAAE;;6DACe","sourcesContent":["import { IsOptional, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\n\nexport class CreateStripeConnection {\n @ApiProperty()\n @IsString()\n code: string;\n}\n\nexport class CreateStripePortals {\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n stripeCustomerId?: string;\n\n}"]}
1
+ {"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/stripe/Create.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAErE,MAAM,OAAO,sBAAsB;IAG/B,IAAI,CAAS;CAChB;AADG;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;oDACI;AAGjB,MAAM,OAAO,mBAAmB;IAI5B,gBAAgB,CAAU;CAE7B;AAFG;IAHD,mBAAmB,EAAE;IACrB,QAAQ,EAAE;IACV,UAAU,EAAE;;6DACe;AAI9B,MAAM,OAAO,iCAAiC;IAI1C,SAAS,CAAQ;IAKjB,OAAO,CAAQ;CAClB;AANG;IAHD,mBAAmB,EAAE;IACrB,MAAM,EAAE;IACR,UAAU,EAAE;8BACC,IAAI;oEAAC;AAKjB;IAHD,mBAAmB,EAAE;IACrB,MAAM,EAAE;IACR,UAAU,EAAE;8BACD,IAAI;kEAAC","sourcesContent":["import { IsDate, IsOptional, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\n\nexport class CreateStripeConnection {\n @ApiProperty()\n @IsString()\n code: string;\n}\n\nexport class CreateStripePortals {\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n stripeCustomerId?: string;\n\n}\n\nexport class CreateImportTransactionForSociety {\n @ApiPropertyOptional()\n @IsDate()\n @IsOptional()\n startDate?: Date;\n\n @ApiPropertyOptional()\n @IsDate()\n @IsOptional()\n endDate?: Date;\n}"]}
@@ -34,7 +34,7 @@ const isExpress = (idPrestationList) => {
34
34
  return !!prestaList.isBack;
35
35
  };
36
36
  const calculateScoringOfPrestation = (idPrestationType, prestations) => {
37
- const prestationsSignedPaid = prestations.filter((prestation) => prestation.terminationList === null);
37
+ const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);
38
38
  // Get the list of prestations that are half price
39
39
  const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);
40
40
  const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);
@@ -1 +1 @@
1
- {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAwB,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AA4E5C,MAAM,yBAAyB,GAAG,CAAC,gBAAwB,EAAW,EAAE,CAAC;IACvE,cAAc,CAAC,YAAY;IAC3B,cAAc,CAAC,mBAAmB;IAClC,cAAc,CAAC,wCAAwC;IACvD,cAAc,CAAC,uBAAuB;IACtC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AC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;;YAChN,OAAO,KAAK,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AAEf,CAAC,CAAC;AAEF,OAAO,EACL,yBAAyB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qCAAqC,EAAE,wBAAwB,GACzV,CAAC","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { getTaxesIncludedAmount } from './vat/utils';\nimport { intersection } from './noLodash';\nimport { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';\nimport { LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport { PrestationOptionType, PrestationOption } from '../types/Enum/PrestationOption';\nimport { PriceGridClementine } from '../types/Enum/PriceGridClementine';\nimport { PriceGridPourcentage } from '../types/Enum/PriceGridPourcentage';\nimport { PriceGridLegalstart } from '../types/Enum/PriceGridLegalstart';\nimport { PriceGridStatutsExpress } from '../types/Enum/PriceGridStatutsExpress';\nimport { ClosingType } from '../types/Enum/ClosingType';\nimport { getBrandNameByNodeEnv } from './brands';\nimport * as dayjs from 'dayjs';\nimport { exerciceNumber } from './exercice';\n\ntype priceGridBrand = {\n idTypeBrand: number,\n price: priceGrid[]\n};\n\ntype priceGrid = {\n idPrestationList: number[],\n priceWithTaxesIncluded: boolean,\n applicationCost: number,\n monthlyNbr?: monthlyNbr[],\n exerciceNbr?: exerciceNbr[],\n turnoverCreatedYear?: turnover[],\n turnoverPastYear?: turnover[],\n turnoverMonthly?: turnover[],\n turnoverYearly?: turnover[],\n employee?: employee[],\n partner?: employee[],\n properties?: propertie[],\n vatRegimeMonthly?: vatRegime[],\n vatRegimeYearly?: vatRegime[],\n taxSystem?: taxSystem[],\n legalForm?: legalForm[],\n employeeByLegalForm?: employeeByLegalForm[],\n};\n\ntype monthlyNbr = {\n minimum: number,\n maximum: number,\n value: number,\n closingType: number[],\n};\n\ntype exerciceNbr = {\n minimum: number,\n maximum: number,\n price: number,\n};\n\ntype turnover = {\n turnoverValue: number,\n price: number,\n};\n\ntype legalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype employee = {\n amountMinimum: number,\n amountMaximum: number,\n price: number,\n};\n\ntype employeeByLegalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype propertie = {\n amount: number,\n price: number,\n};\n\ntype vatRegime = {\n type: number,\n price: number,\n};\n\ntype taxSystem = {\n id: number,\n price: number,\n};\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean => [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => !!intersection(idPrestationList, [PrestationType.CREATION_SOCIETE, PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE].includes(idPL)).length;\n\nconst isExpress = (idPrestationList: number):boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr:any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nconst calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {\n const prestationsSignedPaid = prestations.filter((prestation) => prestation.terminationList === null);\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);\n const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);\n\n // Get the number of points for the new prestation\n const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);\n const numberPoint = prestaDetails?.point || 0;\n\n // Get list of prestations that are already done and check if one of them is in the list of prestations that are half price\n const prestationsExistIds = prestationsSignedPaid.map((prestation) => prestation.idPrestationList);\n const prestationHalfPriceAlreadyDoneIds = prestationsExistIds.filter((id) => prestationHalfPriceIds.includes(id));\n\n // If one of the prestations already done is in the list of prestations that are half price and if the idPrestationType is in prestationHalfPriceIds, return 50% of points\n if (prestationHalfPriceAlreadyDoneIds.length && prestationHalfPriceIds.includes(idPrestationType)) return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\n};\n\nexport const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {\n let currentBrandPriceGrid: priceGridBrand | undefined;\n let currentPriceGrid: priceGrid | undefined;\n\n const currentEnvName = getBrandNameByNodeEnv(process.env.NODE_ENV);\n const listEnvEnum = {\n PriceGridClementine, PriceGridPourcentage, PriceGridLegalstart, PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile) currentBrandPriceGrid = currentPriceGridFile.find((priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand);\n if (currentBrandPriceGrid) currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) => price.idPrestationList.includes(idPrestationList));\n return currentPriceGrid;\n};\n\nconst calculatePrestationPriceWithPriceGrid = (\n idPrestationList: number, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n isYearly: boolean, /* Prestation annuel ou mensuel */\n totalMonth: number, /* Nbr de moiis offer */\n idTaxSystem: number, \n idLegalForm: number, \n exerciceNbr: number,\n balanceSheetOffered: number = 0, /* montant du bilan offer */\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n monthNbr: number, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let monthNbr: number = NbrMonth;\n let yearlyPrice: number | undefined;\n let finalMonthlyPrice: number | undefined;\n let canBeCreated: boolean = true;\n let recalculateMonthly: boolean = false;\n\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n \n if (currentPriceGrid) {\n let monthlyPrice: number | undefined;\n let vatRegimePrice: number | undefined;\n let taxSystemPrice: number | undefined;\n\n /* Gestion du régime de TVA */\n if (currentPriceGrid.vatRegimeMonthly && !isYearly) vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find(regime => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly) vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find(regime => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem) taxSystemPrice = currentPriceGrid.taxSystem?.find(tax => tax.id === idTaxSystem)?.price;\n\n /* Gestion des montants */\n /* Récupératioin des prix mensuels */\n if (currentPriceGrid.turnoverMonthly && !isYearly) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(emp => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n } else if (currentPriceGrid.employeeByLegalForm) {\n monthlyPrice = currentPriceGrid.employeeByLegalForm?.find(emp => emp.idLegalForm === idLegalForm)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n /* Récupération des prix annuels */\n } else if (currentPriceGrid.turnoverYearly && isYearly) yearlyPrice = currentPriceGrid.turnoverYearly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;\n else if (currentPriceGrid.legalForm) yearlyPrice = currentPriceGrid.legalForm?.find(form => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr) yearlyPrice = currentPriceGrid.exerciceNbr?.find(el => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum )?.price;\n /* Calcul du prix mensuel final */\n finalMonthlyPrice = (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);\n\n /* Gestion des mois */\n let cloturedPast: boolean = false;\n if (dayjs(endDate, 'YYYY-MM-DD').subtract(15, 'day').isBefore(dayjs())) cloturedPast = true;\n let monthlyNbrList: monthlyNbr[] | undefined;\n let monthlyNbr: monthlyNbr | undefined;\n if (currentPriceGrid.monthlyNbr) {\n monthlyNbrList = currentPriceGrid.monthlyNbr?.filter(el => el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS));\n if (monthlyNbrList) {\n monthlyNbr = monthlyNbrList.find(el => (el.minimum <= monthNbr) && (monthNbr <= el.maximum));\n if (monthlyNbr) {\n monthNbr = monthlyNbr.value;\n }\n }\n }\n /* Gestion des offres, mois offer */\n if (totalMonth > 0) {\n if (monthlyNbr && ((monthNbr - totalMonth) < monthlyNbr?.minimum)) canBeCreated = false; \n monthNbr = monthNbr - totalMonth;\n recalculateMonthly = true;\n }\n\n /* Calcul du nombre de mois soustraient */\n reduceMonth = (monthNbr === NbrMonth - totalMonth ? totalMonth : 0);\n\n /* Gestion des offres, bilan offer */\n if (balanceSheetOffered > 0) {\n yearlyPrice = undefined;\n recalculateMonthly = false;\n finalMonthlyPrice = balanceSheetOffered / monthNbr;\n }\n \n /* Prix Final */\n totalPrestation = (yearlyPrice ? yearlyPrice : finalMonthlyPrice * monthNbr);\n }\n return { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / monthNbr) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };\n};\n\nconst calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {\n let totalPrestation: number = 0;\n\n totalPrestation = prestationList?.price || 0;\n\n return totalPrestation;\n};\n\n/**\n * From idLegalForm, get application fees amount (without taxes included if no idVat passed, or with taxes included calculated by given idVat)\n * @param idLegalForm \n * @param idVat \n * @returns amount of application fees, without taxes included\n */\nconst getApplicationFeesAmount = (idLegalForm: number, idVat?: number) =>{\n let applicationFeesAmount = 50;\n if (idLegalForm === LegalFormTypeEnum.SCI) applicationFeesAmount = 150;\n\n //Sans tva, on envoie le montant HT\n if (!idVat) return applicationFeesAmount;\n\n //Avec tva, on envoie le montant TTC\n return getTaxesIncludedAmount(applicationFeesAmount, idVat);\n};\n\nconst calculatePrestationPrice = (\n idPrestationList: number, \n prestationList: IPrestationList, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n optionsList: number[], \n totalPercentage: number, /* total pourcentage offer (%) */\n totalAmount: number, /* total montant offer (€) */\n totalMonth: number, /* total mois offer (mois) */\n isWithApplicationFees: boolean, /* frais de dossier */\n idTaxSystem: number, \n idLegalForm: number, \n isYearly: boolean = false, /* prestation annuel ou mensuel */\n isSubPrestation: boolean = false,\n balanceSheetOffered: number = 0,\n exerciceList: IExercice[] = [],\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n calculDetail: string, \n monthlyPrice: string, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let canBeCreated: boolean = true;\n let monthNbr: number = 0;\n let price: number = 0;\n let totalWithReduce: { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } = { totalPrestation: 0, reduceMonth: 0, canBeCreated: true, monthNbr: 0, price: 0 };\n\n /* Gestion du prix en fonction de la prestation */\n if (\n [\n PrestationType.COMPTA_PRO,\n PrestationType.COMPTA_PRO_EXPRESS,\n PrestationType.COMPTA_ENTREPRISE,\n PrestationType.COMPTA_ENTREPRISE_EXPRESS,\n PrestationType.COMPTA_SCI,\n PrestationType.COMPTA_SCI_EXPRESS,\n PrestationType.BILAN_PREVISIONNEL,\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n PrestationType.COMPTA_POURCENTAGE,\n PrestationType.COMPTA_POURCENTAGE_EXPRESS,\n PrestationType.SOCIAL,\n PrestationType.GESTION_JURIDIQUE,\n PrestationType.COMPTA_PRO_COMPTASTART,\n PrestationType.COMPTA_PRO_COMPTASTART_EXPRESS,\n PrestationType.COMPTA_EI_KLEMS,\n PrestationType.COMPTA_EI_KLEMS_EXPRESS,\n PrestationType.COMPTA_MICRO_KLEMS,\n PrestationType.COMPTA_MICRO_KLEMS_EXPRESS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS_EXPRESS,\n PrestationType.STATUTS_OPTION_2,\n ].includes(idPrestationList)\n ) {\n let exerciceNbr: number = 0;\n if (exerciceList.length) exerciceNbr = exerciceNumber(dayjs(endDate, 'YYYY-MM-DD').toDate(), exerciceList);\n totalWithReduce = calculatePrestationPriceWithPriceGrid(\n idPrestationList, \n endDate, \n NbrMonth, \n turnover, \n rentsNumber, \n employeesNumber, \n associatesNumber, \n idTypeBrand, \n idVatRegime, \n pastBalanceSheet, \n isYearly, \n totalMonth, \n idTaxSystem, \n idLegalForm, \n exerciceNbr,\n balanceSheetOffered,\n );\n totalPrestation = totalWithReduce.totalPrestation;\n reduceMonth = totalWithReduce.reduceMonth;\n canBeCreated = totalWithReduce.canBeCreated;\n monthNbr = totalWithReduce.monthNbr;\n price = totalWithReduce.price;\n } else {\n totalPrestation = calculatePrestationPriceWithPrestationList(prestationList);\n if ([PrestationType.CREATION_SOCIETE].includes(idPrestationList) && !isSubPrestation) totalPrestation += 50;\n }\n /* Gestion des offres */\n /* Offre montant offer */\n if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;\n /* Offre pourcentage offer */\n if (totalPercentage > 0) totalPrestation = totalPrestation - (totalPrestation * (totalPercentage / 100));\n /* Gesstioin du prix minimum acceptable pour la prestation */\n if (prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice) totalPrestation = prestationList.minimumPrice;\n /* Gestion des options */\n let OptionTotalPrice: number = 0;\n if (optionsList.length) {\n optionsList.forEach((optionId) => {\n const optionPrice: number | undefined = Object.values(PrestationOption).find((option) => option.id === optionId)?.price;\n if (optionPrice) OptionTotalPrice += optionPrice;\n });\n }\n totalPrestation += (OptionTotalPrice ? OptionTotalPrice : 0);\n /* Gestion des frais de dossier */\n if (isWithApplicationFees) {\n const applicationFeesAmount = getApplicationFeesAmount(idLegalForm);\n totalPrestation += applicationFeesAmount;\n }\n\n const calculDetail = `${monthNbr > 0 ? monthNbr + ' mois x ' + (Math.round(price * 100) / 100) + '€' : (Math.round(price * 100) / 100) + '€'} ${totalAmount > 0 ? '- ' + totalAmount + '€' : ''} ${totalPercentage > 0 ? '- ' + totalPercentage + '%' : ''} ${isWithApplicationFees ? '+ 50€' : ''}`;\n\n return { totalPrestation, reduceMonth, canBeCreated, calculDetail, monthlyPrice: monthNbr > 0 ? (Math.round(price * 100) / 100) + '€/mois' : (Math.round(price * 100) / 100) + '€', price };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter(option => option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)));\n return PrestationOptionList.filter(option => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (idTypeBrand: number, idPrestationList: number, turnover: number, pastBalanceSheet: boolean): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n // @ts-ignore\n if ([PrestationType.COMPTA_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && !pastBalanceSheet && currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && pastBalanceSheet && currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover) return true;\n else return false;\n }\n return false;\n\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid, getApplicationFeesAmount,\n};"]}
1
+ {"version":3,"file":"prestation.js","sourceRoot":"","sources":["../../../ts/utils/prestation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAwB,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACxF,OAAO,EAAE,mBAAm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,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC,eAAe,CAAC,gBAAgB,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC1O,aAAa;aACR,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC5N,aAAa;aACR,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,IAAI,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,aAAa,GAAG,QAAQ;YAAE,OAAO,IAAI,CAAC;;YAChN,OAAO,KAAK,CAAC;IACpB,CAAC;IACD,OAAO,KAAK,CAAC;AAEf,CAAC,CAAC;AAEF,OAAO,EACL,yBAAyB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,qCAAqC,EAAE,wBAAwB,GACzV,CAAC","sourcesContent":["import { IExercice, IPrestation, IPrestationList } from '../types';\nimport { getTaxesIncludedAmount } from './vat/utils';\nimport { intersection } from './noLodash';\nimport { PrestationDetail, PrestationType } from '../types/Enum/PrestationType';\nimport { LegalFormTypeEnum } from '../types/Enum/LegalForm';\nimport { PrestationOptionType, PrestationOption } from '../types/Enum/PrestationOption';\nimport { PriceGridClementine } from '../types/Enum/PriceGridClementine';\nimport { PriceGridPourcentage } from '../types/Enum/PriceGridPourcentage';\nimport { PriceGridLegalstart } from '../types/Enum/PriceGridLegalstart';\nimport { PriceGridStatutsExpress } from '../types/Enum/PriceGridStatutsExpress';\nimport { ClosingType } from '../types/Enum/ClosingType';\nimport { getBrandNameByNodeEnv } from './brands';\nimport * as dayjs from 'dayjs';\nimport { exerciceNumber } from './exercice';\n\ntype priceGridBrand = {\n idTypeBrand: number,\n price: priceGrid[]\n};\n\ntype priceGrid = {\n idPrestationList: number[],\n priceWithTaxesIncluded: boolean,\n applicationCost: number,\n monthlyNbr?: monthlyNbr[],\n exerciceNbr?: exerciceNbr[],\n turnoverCreatedYear?: turnover[],\n turnoverPastYear?: turnover[],\n turnoverMonthly?: turnover[],\n turnoverYearly?: turnover[],\n employee?: employee[],\n partner?: employee[],\n properties?: propertie[],\n vatRegimeMonthly?: vatRegime[],\n vatRegimeYearly?: vatRegime[],\n taxSystem?: taxSystem[],\n legalForm?: legalForm[],\n employeeByLegalForm?: employeeByLegalForm[],\n};\n\ntype monthlyNbr = {\n minimum: number,\n maximum: number,\n value: number,\n closingType: number[],\n};\n\ntype exerciceNbr = {\n minimum: number,\n maximum: number,\n price: number,\n};\n\ntype turnover = {\n turnoverValue: number,\n price: number,\n};\n\ntype legalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype employee = {\n amountMinimum: number,\n amountMaximum: number,\n price: number,\n};\n\ntype employeeByLegalForm = {\n idLegalForm: number,\n price: number,\n};\n\ntype propertie = {\n amount: number,\n price: number,\n};\n\ntype vatRegime = {\n type: number,\n price: number,\n};\n\ntype taxSystem = {\n id: number,\n price: number,\n};\n\nconst isOtherAccountingMissions = (idPrestationList: number): boolean => [\n PrestationType.PREVISIONNEL,\n PrestationType.BILAN_INTERMEDIAIRE,\n PrestationType.AVANCE_OU_ABANDON_COMPTE_COURANT_ASSOCIE,\n PrestationType.AUTRE_MISSION_COMPTABLE,\n PrestationType.TVS,\n PrestationType.ETUDE_FISCALE,\n PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList);\n\nconst isOtherJuridicalMissions = (isJuridique:boolean, isCatalog:boolean, idPrestationList: number): boolean => idPrestationList !== PrestationType.GESTION_JURIDIQUE && isCatalog && isJuridique;\n\nconst isOtherSocialMission = (idPrestationList: number): boolean => idPrestationList === PrestationType.AUTRE_MISSION_SOCIALE_HORS_PAIE;\n\nconst isAdditionalPresta = (hidden:boolean, isCatalog:boolean): boolean => !hidden && isCatalog;\n\nconst isOnlyPrevi = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.PREVISIONNEL, PrestationType.BILAN_PREVISIONNEL, PrestationType.PV_AG].includes(idPL)).length;\n\nconst isOnlySocial = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.FRUCTUPAIE, PrestationType.SOCIAL].includes(idPL)).length;\n\nconst isOnlyJuridic = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.GESTION_JURIDIQUE].includes(idPL)).length;\n\nconst isCreation = (idPrestationList: number[]):boolean => !!intersection(idPrestationList, [PrestationType.CREATION_SOCIETE, PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE]).length;\n\nconst isFromStatutsExpress = (idPrestationList: number[]):boolean => !idPrestationList.filter((idPL:number) => ![PrestationType.STATUTS_FREE, PrestationType.STATUTS_OPTION_1, PrestationType.STATUTS_OPTION_2, PrestationType.STATUTS_OPTION_AE].includes(idPL)).length;\n\nconst isExpress = (idPrestationList: number):boolean => {\n const prestationDetailValues = Object.values(PrestationDetail) as any;\n const prestaList = prestationDetailValues.find((pr:any) => pr.id === idPrestationList);\n return !!prestaList.isBack;\n};\n\nconst calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {\n const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);\n\n // Get the list of prestations that are half price\n const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);\n const prestationHalfPriceIds = prestationHalfPriceList.map((t) => t.id);\n\n // Get the number of points for the new prestation\n const prestaDetails = Object.values(PrestationDetail).find((prestaDetail) => prestaDetail.id === idPrestationType);\n const numberPoint = prestaDetails?.point || 0;\n\n // Get list of prestations that are already done and check if one of them is in the list of prestations that are half price\n const prestationsExistIds = prestationsSignedPaid.map((prestation) => prestation.idPrestationList);\n const prestationHalfPriceAlreadyDoneIds = prestationsExistIds.filter((id) => prestationHalfPriceIds.includes(id));\n\n // If one of the prestations already done is in the list of prestations that are half price and if the idPrestationType is in prestationHalfPriceIds, return 50% of points\n if (prestationHalfPriceAlreadyDoneIds.length && prestationHalfPriceIds.includes(idPrestationType)) return Math.floor(numberPoint * 0.3);\n\n return numberPoint;\n};\n\nexport const getPriceGrid = (idTypeBrand: number, idPrestationList: number): priceGrid | undefined => {\n let currentBrandPriceGrid: priceGridBrand | undefined;\n let currentPriceGrid: priceGrid | undefined;\n\n const currentEnvName = getBrandNameByNodeEnv(process.env.NODE_ENV);\n const listEnvEnum = {\n PriceGridClementine, PriceGridPourcentage, PriceGridLegalstart, PriceGridStatutsExpress,\n };\n // @ts-ignore\n const currentPriceGridFile: priceGridBrand[] = listEnvEnum[`PriceGrid${currentEnvName}`];\n if (currentPriceGridFile) currentBrandPriceGrid = currentPriceGridFile.find((priceGrid: priceGridBrand) => priceGrid.idTypeBrand === idTypeBrand);\n if (currentBrandPriceGrid) currentPriceGrid = currentBrandPriceGrid?.price.find((price: priceGrid) => price.idPrestationList.includes(idPrestationList));\n return currentPriceGrid;\n};\n\nconst calculatePrestationPriceWithPriceGrid = (\n idPrestationList: number, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n isYearly: boolean, /* Prestation annuel ou mensuel */\n totalMonth: number, /* Nbr de moiis offer */\n idTaxSystem: number, \n idLegalForm: number, \n exerciceNbr: number,\n balanceSheetOffered: number = 0, /* montant du bilan offer */\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n monthNbr: number, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let monthNbr: number = NbrMonth;\n let yearlyPrice: number | undefined;\n let finalMonthlyPrice: number | undefined;\n let canBeCreated: boolean = true;\n let recalculateMonthly: boolean = false;\n\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n \n if (currentPriceGrid) {\n let monthlyPrice: number | undefined;\n let vatRegimePrice: number | undefined;\n let taxSystemPrice: number | undefined;\n\n /* Gestion du régime de TVA */\n if (currentPriceGrid.vatRegimeMonthly && !isYearly) vatRegimePrice = currentPriceGrid.vatRegimeMonthly?.find(regime => regime.type === idVatRegime)?.price;\n else if (currentPriceGrid.vatRegimeYearly && isYearly) vatRegimePrice = currentPriceGrid.vatRegimeYearly?.find(regime => regime.type === idVatRegime)?.price;\n\n /* Gestion du Régime d'imposition */\n if (currentPriceGrid.taxSystem && idTaxSystem) taxSystemPrice = currentPriceGrid.taxSystem?.find(tax => tax.id === idTaxSystem)?.price;\n\n /* Gestion des montants */\n /* Récupératioin des prix mensuels */\n if (currentPriceGrid.turnoverMonthly && !isYearly) monthlyPrice = currentPriceGrid.turnoverMonthly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.properties) monthlyPrice = currentPriceGrid.properties?.find(property => property.amount === rentsNumber)?.price;\n else if (currentPriceGrid.employee) {\n monthlyPrice = currentPriceGrid.employee?.find(emp => emp.amountMinimum <= employeesNumber && emp.amountMaximum >= employeesNumber)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n } else if (currentPriceGrid.employeeByLegalForm) {\n monthlyPrice = currentPriceGrid.employeeByLegalForm?.find(emp => emp.idLegalForm === idLegalForm)?.price;\n monthlyPrice = monthlyPrice ? monthlyPrice * employeesNumber : 0;\n /* Récupération des prix annuels */\n } else if (currentPriceGrid.turnoverYearly && isYearly) yearlyPrice = currentPriceGrid.turnoverYearly?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (!pastBalanceSheet && currentPriceGrid.turnoverCreatedYear) yearlyPrice = currentPriceGrid.turnoverCreatedYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (pastBalanceSheet && currentPriceGrid.turnoverPastYear) yearlyPrice = currentPriceGrid.turnoverPastYear?.find(turn => turnover < turn.turnoverValue)?.price;\n else if (currentPriceGrid.partner) yearlyPrice = currentPriceGrid.partner?.find(part => part.amountMinimum <= associatesNumber && part.amountMaximum >= associatesNumber)?.price;\n else if (currentPriceGrid.legalForm) yearlyPrice = currentPriceGrid.legalForm?.find(form => form.idLegalForm === idLegalForm)?.price;\n else if (currentPriceGrid.exerciceNbr) yearlyPrice = currentPriceGrid.exerciceNbr?.find(el => el.minimum <= exerciceNbr && exerciceNbr <= el.maximum )?.price;\n /* Calcul du prix mensuel final */\n finalMonthlyPrice = (monthlyPrice ? monthlyPrice : 0) + (vatRegimePrice ? vatRegimePrice : 0) + (taxSystemPrice ? taxSystemPrice : 0);\n\n /* Gestion des mois */\n let cloturedPast: boolean = false;\n if (dayjs(endDate, 'YYYY-MM-DD').subtract(15, 'day').isBefore(dayjs())) cloturedPast = true;\n let monthlyNbrList: monthlyNbr[] | undefined;\n let monthlyNbr: monthlyNbr | undefined;\n if (currentPriceGrid.monthlyNbr) {\n monthlyNbrList = currentPriceGrid.monthlyNbr?.filter(el => el.closingType.includes(cloturedPast ? ClosingType.OUTDATED : ClosingType.IN_PROGRESS));\n if (monthlyNbrList) {\n monthlyNbr = monthlyNbrList.find(el => (el.minimum <= monthNbr) && (monthNbr <= el.maximum));\n if (monthlyNbr) {\n monthNbr = monthlyNbr.value;\n }\n }\n }\n /* Gestion des offres, mois offer */\n if (totalMonth > 0) {\n if (monthlyNbr && ((monthNbr - totalMonth) < monthlyNbr?.minimum)) canBeCreated = false; \n monthNbr = monthNbr - totalMonth;\n recalculateMonthly = true;\n }\n\n /* Calcul du nombre de mois soustraient */\n reduceMonth = (monthNbr === NbrMonth - totalMonth ? totalMonth : 0);\n\n /* Gestion des offres, bilan offer */\n if (balanceSheetOffered > 0) {\n yearlyPrice = undefined;\n recalculateMonthly = false;\n finalMonthlyPrice = balanceSheetOffered / monthNbr;\n }\n \n /* Prix Final */\n totalPrestation = (yearlyPrice ? yearlyPrice : finalMonthlyPrice * monthNbr);\n }\n return { totalPrestation, reduceMonth, canBeCreated, monthNbr: yearlyPrice ? 0 : recalculateMonthly ? NbrMonth : monthNbr, price: yearlyPrice ? yearlyPrice : recalculateMonthly ? (totalPrestation / monthNbr) : (finalMonthlyPrice ? finalMonthlyPrice : 0) };\n};\n\nconst calculatePrestationPriceWithPrestationList = (prestationList: IPrestationList): number => {\n let totalPrestation: number = 0;\n\n totalPrestation = prestationList?.price || 0;\n\n return totalPrestation;\n};\n\n/**\n * From idLegalForm, get application fees amount (without taxes included if no idVat passed, or with taxes included calculated by given idVat)\n * @param idLegalForm \n * @param idVat \n * @returns amount of application fees, without taxes included\n */\nconst getApplicationFeesAmount = (idLegalForm: number, idVat?: number) =>{\n let applicationFeesAmount = 50;\n if (idLegalForm === LegalFormTypeEnum.SCI) applicationFeesAmount = 150;\n\n //Sans tva, on envoie le montant HT\n if (!idVat) return applicationFeesAmount;\n\n //Avec tva, on envoie le montant TTC\n return getTaxesIncludedAmount(applicationFeesAmount, idVat);\n};\n\nconst calculatePrestationPrice = (\n idPrestationList: number, \n prestationList: IPrestationList, \n endDate: string, \n NbrMonth: number, /* Nbr de mois dans l'exercice */\n turnover: number, \n rentsNumber: number, \n employeesNumber: number, \n associatesNumber: number, \n idTypeBrand: number, \n idVatRegime: number, \n pastBalanceSheet: boolean, \n optionsList: number[], \n totalPercentage: number, /* total pourcentage offer (%) */\n totalAmount: number, /* total montant offer (€) */\n totalMonth: number, /* total mois offer (mois) */\n isWithApplicationFees: boolean, /* frais de dossier */\n idTaxSystem: number, \n idLegalForm: number, \n isYearly: boolean = false, /* prestation annuel ou mensuel */\n isSubPrestation: boolean = false,\n balanceSheetOffered: number = 0,\n exerciceList: IExercice[] = [],\n): { \n totalPrestation: number, \n reduceMonth: number, \n canBeCreated: boolean, \n calculDetail: string, \n monthlyPrice: string, \n price: number \n} => {\n let totalPrestation: number = 0;\n let reduceMonth: number = 0;\n let canBeCreated: boolean = true;\n let monthNbr: number = 0;\n let price: number = 0;\n let totalWithReduce: { totalPrestation: number, reduceMonth: number, canBeCreated: boolean, monthNbr: number, price: number } = { totalPrestation: 0, reduceMonth: 0, canBeCreated: true, monthNbr: 0, price: 0 };\n\n /* Gestion du prix en fonction de la prestation */\n if (\n [\n PrestationType.COMPTA_PRO,\n PrestationType.COMPTA_PRO_EXPRESS,\n PrestationType.COMPTA_ENTREPRISE,\n PrestationType.COMPTA_ENTREPRISE_EXPRESS,\n PrestationType.COMPTA_SCI,\n PrestationType.COMPTA_SCI_EXPRESS,\n PrestationType.BILAN_PREVISIONNEL,\n PrestationType.COMPTA_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM,\n PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS,\n PrestationType.COMPTA_POURCENTAGE,\n PrestationType.COMPTA_POURCENTAGE_EXPRESS,\n PrestationType.SOCIAL,\n PrestationType.GESTION_JURIDIQUE,\n PrestationType.COMPTA_PRO_COMPTASTART,\n PrestationType.COMPTA_PRO_COMPTASTART_EXPRESS,\n PrestationType.COMPTA_EI_KLEMS,\n PrestationType.COMPTA_EI_KLEMS_EXPRESS,\n PrestationType.COMPTA_MICRO_KLEMS,\n PrestationType.COMPTA_MICRO_KLEMS_EXPRESS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS,\n PrestationType.COMPTA_LOUEUR_MEUBLE_NON_PRO_KLEMS_EXPRESS,\n PrestationType.STATUTS_OPTION_2,\n ].includes(idPrestationList)\n ) {\n let exerciceNbr: number = 0;\n if (exerciceList.length) exerciceNbr = exerciceNumber(dayjs(endDate, 'YYYY-MM-DD').toDate(), exerciceList);\n totalWithReduce = calculatePrestationPriceWithPriceGrid(\n idPrestationList, \n endDate, \n NbrMonth, \n turnover, \n rentsNumber, \n employeesNumber, \n associatesNumber, \n idTypeBrand, \n idVatRegime, \n pastBalanceSheet, \n isYearly, \n totalMonth, \n idTaxSystem, \n idLegalForm, \n exerciceNbr,\n balanceSheetOffered,\n );\n totalPrestation = totalWithReduce.totalPrestation;\n reduceMonth = totalWithReduce.reduceMonth;\n canBeCreated = totalWithReduce.canBeCreated;\n monthNbr = totalWithReduce.monthNbr;\n price = totalWithReduce.price;\n } else {\n totalPrestation = calculatePrestationPriceWithPrestationList(prestationList);\n if ([PrestationType.CREATION_SOCIETE].includes(idPrestationList) && !isSubPrestation) totalPrestation += 50;\n }\n /* Gestion des offres */\n /* Offre montant offer */\n if (totalAmount > 0) totalPrestation = totalPrestation - totalAmount;\n /* Offre pourcentage offer */\n if (totalPercentage > 0) totalPrestation = totalPrestation - (totalPrestation * (totalPercentage / 100));\n /* Gesstioin du prix minimum acceptable pour la prestation */\n if (prestationList.minimumPrice && totalPrestation < prestationList.minimumPrice) totalPrestation = prestationList.minimumPrice;\n /* Gestion des options */\n let OptionTotalPrice: number = 0;\n if (optionsList.length) {\n optionsList.forEach((optionId) => {\n const optionPrice: number | undefined = Object.values(PrestationOption).find((option) => option.id === optionId)?.price;\n if (optionPrice) OptionTotalPrice += optionPrice;\n });\n }\n totalPrestation += (OptionTotalPrice ? OptionTotalPrice : 0);\n /* Gestion des frais de dossier */\n if (isWithApplicationFees) {\n const applicationFeesAmount = getApplicationFeesAmount(idLegalForm);\n totalPrestation += applicationFeesAmount;\n }\n\n const calculDetail = `${monthNbr > 0 ? monthNbr + ' mois x ' + (Math.round(price * 100) / 100) + '€' : (Math.round(price * 100) / 100) + '€'} ${totalAmount > 0 ? '- ' + totalAmount + '€' : ''} ${totalPercentage > 0 ? '- ' + totalPercentage + '%' : ''} ${isWithApplicationFees ? '+ 50€' : ''}`;\n\n return { totalPrestation, reduceMonth, canBeCreated, calculDetail, monthlyPrice: monthNbr > 0 ? (Math.round(price * 100) / 100) + '€/mois' : (Math.round(price * 100) / 100) + '€', price };\n};\n\nconst getPrestationOptions = (idPrestationList: number): PrestationOptionType[] => {\n const PrestationOptionList: PrestationOptionType[] = Object.values(PrestationOption).filter(option => option.brand.includes(getBrandNameByNodeEnv(process.env.NODE_ENV)));\n return PrestationOptionList.filter(option => option.prestationList.includes(idPrestationList));\n};\n\nconst isAbleToUpdatePrice = (idTypeBrand: number, idPrestationList: number, turnover: number, pastBalanceSheet: boolean): boolean => {\n /* Récupération de la grille tarifaire */\n const currentPriceGrid: priceGrid | undefined = getPriceGrid(idTypeBrand, idPrestationList);\n if (currentPriceGrid) {\n // @ts-ignore\n if ([PrestationType.COMPTA_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM, PrestationType.COMPTA_POURCENTAGE_PREMIUM_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 2].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.COMPTA_POURCENTAGE, PrestationType.COMPTA_POURCENTAGE_EXPRESS].includes(idPrestationList) && currentPriceGrid.turnoverMonthly[currentPriceGrid.turnoverMonthly.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && !pastBalanceSheet && currentPriceGrid.turnoverCreatedYear[currentPriceGrid.turnoverCreatedYear.length - 1].turnoverValue < turnover) return true;\n // @ts-ignore\n else if ([PrestationType.BILAN_PREVISIONNEL].includes(idPrestationList) && pastBalanceSheet && currentPriceGrid.turnoverPastYear[currentPriceGrid.turnoverPastYear.length - 1].turnoverValue < turnover) return true;\n else return false;\n }\n return false;\n\n};\n\nexport {\n isOtherAccountingMissions, isOtherJuridicalMissions, isAdditionalPresta, isOtherSocialMission, isOnlyPrevi, isOnlySocial, isOnlyJuridic, isCreation, isFromStatutsExpress, isExpress, calculateScoringOfPrestation, calculatePrestationPrice, getPrestationOptions, isAbleToUpdatePrice, calculatePrestationPriceWithPriceGrid, getApplicationFeesAmount,\n};"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@silexpert/core",
3
- "version": "1.1.348",
3
+ "version": "1.1.349",
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,8 +1,12 @@
1
1
  import { Resource } from '../Resource';
2
- import { ReadAccountType } from '../../types';
2
+ import { IAccountType, ReadAccountType } from '../../types';
3
3
 
4
4
  export class AccountType extends Resource {
5
- getAll(params: { idSimulation: number }): Promise<ReadAccountType> {
5
+ getAllForSimulation(params: { idSimulation: number }): Promise<ReadAccountType> {
6
6
  return this.axios.$get(`/simulation/${params.idSimulation}/accountTypes`);
7
7
  }
8
+
9
+ getAll(): Promise<IAccountType[]> {
10
+ return this.axios.$get('accounts/types');
11
+ }
8
12
  }
@@ -1,5 +1,5 @@
1
1
  import { Resource } from '../Resource';
2
- import { IConnector } from '../../types';
2
+ import { CreateImportTransactionForSociety, IConnector } from '../../types';
3
3
 
4
4
  export class Stripe extends Resource {
5
5
  connect(code: string, idSociety: number): Promise<IConnector> {
@@ -10,7 +10,7 @@ export class Stripe extends Resource {
10
10
  return this.axios.$post(`/stripe/${idSociety}/banks`, { code });
11
11
  }
12
12
 
13
- importForSociety(idSociety: number): Promise<number> {
14
- return this.axios.$post(`/stripe/${idSociety}/importation`);
13
+ importForSociety(idSociety: number, payload: CreateImportTransactionForSociety): Promise<number> {
14
+ return this.axios.$post(`/stripe/${idSociety}/importation`, payload);
15
15
  }
16
16
  }
@@ -1,4 +1,4 @@
1
- import { IsOptional, IsString } from 'class-validator';
1
+ import { IsDate, IsOptional, IsString } from 'class-validator';
2
2
  import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
3
3
 
4
4
  export class CreateStripeConnection {
@@ -13,4 +13,16 @@ export class CreateStripePortals {
13
13
  @IsOptional()
14
14
  stripeCustomerId?: string;
15
15
 
16
+ }
17
+
18
+ export class CreateImportTransactionForSociety {
19
+ @ApiPropertyOptional()
20
+ @IsDate()
21
+ @IsOptional()
22
+ startDate?: Date;
23
+
24
+ @ApiPropertyOptional()
25
+ @IsDate()
26
+ @IsOptional()
27
+ endDate?: Date;
16
28
  }
@@ -119,7 +119,7 @@ const isExpress = (idPrestationList: number):boolean => {
119
119
  };
120
120
 
121
121
  const calculateScoringOfPrestation = (idPrestationType: PrestationType, prestations: IPrestation[]): number => {
122
- const prestationsSignedPaid = prestations.filter((prestation) => prestation.terminationList === null);
122
+ const prestationsSignedPaid = prestations.filter((prestation) => prestation.paid && prestation.signed && prestation.terminationList === null);
123
123
 
124
124
  // Get the list of prestations that are half price
125
125
  const prestationHalfPriceList = Object.values(PrestationDetail).filter((p) => p.isComptable && !p.isCatalog);