@silexpert/core 1.2.68 → 1.2.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/types/Interface/api/balanceSheet/Query.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/balanceSheet/Query.js +2 -0
- package/dist/cjs/types/Interface/api/balanceSheet/Query.js.map +1 -1
- package/dist/cjs/types/Interface/api/toDoExpress/Query.d.ts +13 -6
- package/dist/cjs/types/Interface/api/toDoExpress/Query.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/toDoExpress/Query.js +59 -12
- package/dist/cjs/types/Interface/api/toDoExpress/Query.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.js +21 -11
- package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts +4 -0
- package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/internationalization/choices.js +112 -2
- package/dist/cjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
- package/dist/mjs/types/Interface/api/balanceSheet/Query.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/balanceSheet/Query.js +2 -0
- package/dist/mjs/types/Interface/api/balanceSheet/Query.js.map +1 -1
- package/dist/mjs/types/Interface/api/toDoExpress/Query.d.ts +13 -6
- package/dist/mjs/types/Interface/api/toDoExpress/Query.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/toDoExpress/Query.js +66 -12
- package/dist/mjs/types/Interface/api/toDoExpress/Query.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.js +17 -6
- package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts +4 -0
- package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/internationalization/choices.js +110 -2
- package/dist/mjs/utils/commercialManagement/internationalization/choices.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Interface/api/balanceSheet/Query.ts +2 -0
- package/ts/types/Interface/api/toDoExpress/Query.ts +52 -12
- package/ts/utils/commercialManagement/document.ts +17 -6
- package/ts/utils/commercialManagement/internationalization/choices.ts +124 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/balanceSheet/Query.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,qBAAa,0BAA0B;IAGrC,IAAI,EAAE,MAAM,CAAC;IAKb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,+BAA+B;IAI1C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,iCAAiC;IAG5C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,oCAAoC;IAG/C,IAAI,EAAE,MAAM,CAAC;IAKb,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,4BAA4B;IAGvC,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAIlB,cAAc,EAAE,MAAM,CAAC;IAIvB,UAAU,EAAE,MAAM,CAAC;IAInB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,6BAA6B;IAGxC,WAAW,EAAE,MAAM,CAAC;IAKpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAI3B,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAIf,aAAa,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/balanceSheet/Query.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,qBAAa,0BAA0B;IAGrC,IAAI,EAAE,MAAM,CAAC;IAKb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,+BAA+B;IAI1C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,qBAAa,iCAAiC;IAG5C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,qBAAa,oCAAoC;IAG/C,IAAI,EAAE,MAAM,CAAC;IAKb,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,4BAA4B;IAGvC,OAAO,EAAE,MAAM,CAAC;IAIhB,SAAS,EAAE,MAAM,CAAC;IAIlB,cAAc,EAAE,MAAM,CAAC;IAIvB,UAAU,EAAE,MAAM,CAAC;IAInB,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,qBAAa,6BAA6B;IAGxC,WAAW,EAAE,MAAM,CAAC;IAKpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAI3B,SAAS,EAAE,MAAM,CAAC;IAKlB,MAAM,EAAE,MAAM,CAAC;IAIf,aAAa,EAAE,MAAM,CAAC;IAatB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,iCAAiC;IAE5C,IAAI,EAAE,KAAK,CAAC;CACb"}
|
|
@@ -131,6 +131,8 @@ __decorate([
|
|
|
131
131
|
Supervision_1.Supervision.ATTEST_REFUSED_MATERIAL_FACTS,
|
|
132
132
|
Supervision_1.Supervision.ATTEST_REFUSED,
|
|
133
133
|
Supervision_1.Supervision.ATTEST_WITH_OBSERVATIONS,
|
|
134
|
+
Supervision_1.Supervision.ATTEST_REFUSED_MATERIAL_FACTS,
|
|
135
|
+
Supervision_1.Supervision.ATTEST_REFUSED_OFFENCES,
|
|
134
136
|
]),
|
|
135
137
|
__metadata("design:type", Number)
|
|
136
138
|
], CreateBalanceSheetAttestation.prototype, "state", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/balanceSheet/Query.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqE;AACrE,qDAAqF;AACrF,2DAAwD;AAGxD,MAAa,0BAA0B;CAStC;AATD,gEASC;AANC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;wDACF;AAKb;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACE;AAGjB,MAAa,+BAA+B;CAK3C;AALD,0EAKC;AADC;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kEACK;AAGpB,MAAa,iCAAiC;CAI7C;AAJD,8EAIC;AADC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;+DACF;AAGf,MAAa,oCAAoC;CAchD;AAdD,oFAcC;AAXC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;kEACF;AAKb;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,8BAAY,GAAE;;uEACI;AAKnB;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,8BAAY,GAAE;;qEACE;AAGnB,MAAa,4BAA4B;CAoBxC;AApBD,oEAoBC;AAjBC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;6DACK;AAIhB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;+DACO;AAIlB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;oEACY;AAIvB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;gEACQ;AAInB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;wEACgB;AAG7B,MAAa,6BAA6B;
|
|
1
|
+
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/balanceSheet/Query.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAqE;AACrE,qDAAqF;AACrF,2DAAwD;AAGxD,MAAa,0BAA0B;CAStC;AATD,gEASC;AANC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;wDACF;AAKb;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACE;AAGjB,MAAa,+BAA+B;CAK3C;AALD,0EAKC;AADC;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;kEACK;AAGpB,MAAa,iCAAiC;CAI7C;AAJD,8EAIC;AADC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;+DACF;AAGf,MAAa,oCAAoC;CAchD;AAdD,oFAcC;AAXC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,8BAAY,GAAE;;kEACF;AAKb;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,8BAAY,GAAE;;uEACI;AAKnB;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,8BAAY,GAAE;;qEACE;AAGnB,MAAa,4BAA4B;CAoBxC;AApBD,oEAoBC;AAjBC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;6DACK;AAIhB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;+DACO;AAIlB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;oEACY;AAIvB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;gEACQ;AAInB;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;wEACgB;AAG7B,MAAa,6BAA6B;CAmCzC;AAnCD,sEAmCC;AAhCC;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;kEACS;AAKpB;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wEACc;AAI3B;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;gEACO;AAKlB;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6DACE;AAIf;IAFC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;;oEACW;AAatB;IAXC,IAAA,mBAAW,GAAE;IACb,IAAA,0BAAQ,GAAE;IACV,IAAA,sBAAI,EAAC;QACJ,yBAAW,CAAC,QAAQ;QACpB,yBAAW,CAAC,cAAc;QAC1B,yBAAW,CAAC,6BAA6B;QACzC,yBAAW,CAAC,cAAc;QAC1B,yBAAW,CAAC,wBAAwB;QACpC,yBAAW,CAAC,6BAA6B;QACzC,yBAAW,CAAC,uBAAuB;KACpC,CAAC;;4DACY;AAGhB,MAAa,iCAAiC;CAG7C;AAHD,8EAGC;AADC;IADC,IAAA,mBAAW,GAAE;;+DACF","sourcesContent":["import { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { IsDateString, IsIn, IsNumber, IsOptional, IsString } from 'class-validator';\nimport { Supervision } from '../../../Enum/Supervision';\nimport { TFile } from '../file/TFile';\n\nexport class QueryBalanceSheetStatistic {\n @ApiProperty()\n @IsDateString()\n date: string;\n\n @ApiPropertyOptional()\n @IsNumber()\n @IsOptional()\n idUser: number;\n}\n\nexport class QueryBalanceSheetGenerateUnpaid {\n @ApiPropertyOptional()\n @IsNumber()\n @IsOptional()\n idSociety: number;\n}\n\nexport class QueryBalanceSheetMonthlyStatistic {\n @ApiProperty()\n @IsDateString()\n date: string;\n}\n\nexport class QueryBalanceSheetSupervisedStatistic {\n @ApiProperty()\n @IsDateString()\n date: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsDateString()\n startDate?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsDateString()\n endDate?: string;\n}\n\nexport class QueryBalanceSheetAttestation {\n @ApiProperty()\n @IsNumber()\n idState: number;\n\n @ApiProperty()\n @IsNumber()\n idSociety: number;\n\n @ApiProperty()\n @IsNumber()\n idBalanceSheet: number;\n\n @ApiProperty()\n @IsNumber()\n idExercice: number;\n\n @ApiProperty()\n @IsNumber()\n idExpertAccountant: number;\n}\n\nexport class CreateBalanceSheetAttestation {\n @ApiProperty()\n @IsString()\n attestation: string;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n attestationDetail?: string;\n\n @ApiProperty()\n @IsNumber()\n idSociety: number;\n\n @ApiPropertyOptional()\n @IsNumber()\n @IsOptional()\n idFile: number;\n\n @ApiProperty()\n @IsNumber()\n idSupervision: number;\n\n @ApiProperty()\n @IsNumber()\n @IsIn([\n Supervision.ATTESTED,\n Supervision.ATTEST_REFUSED,\n Supervision.ATTEST_REFUSED_MATERIAL_FACTS,\n Supervision.ATTEST_REFUSED,\n Supervision.ATTEST_WITH_OBSERVATIONS,\n Supervision.ATTEST_REFUSED_MATERIAL_FACTS,\n Supervision.ATTEST_REFUSED_OFFENCES,\n ])\n state: number;\n}\n\nexport class QueryValidateBalanceSheetByImport {\n @ApiProperty()\n file: TFile;\n}\n"]}
|
|
@@ -11,10 +11,13 @@ export declare class QueryToDoBalanceSheetPaginated extends RequiredQueryPaginat
|
|
|
11
11
|
dateEnd?: number;
|
|
12
12
|
year?: number;
|
|
13
13
|
collectionState?: boolean;
|
|
14
|
-
balanceSheetState?: number;
|
|
15
|
-
supervisionState?: number;
|
|
14
|
+
balanceSheetState?: number[];
|
|
15
|
+
supervisionState?: number[];
|
|
16
|
+
attributionState?: boolean;
|
|
16
17
|
planedState?: boolean;
|
|
17
18
|
balance?: boolean;
|
|
19
|
+
idComptaType?: number[];
|
|
20
|
+
balanceSheetLate?: boolean;
|
|
18
21
|
}
|
|
19
22
|
export declare class QueryToDoBalanceSheetStats {
|
|
20
23
|
isExpress: boolean;
|
|
@@ -27,18 +30,22 @@ export declare class QueryToDoBalanceSheetStats {
|
|
|
27
30
|
dateEnd?: number;
|
|
28
31
|
year?: number;
|
|
29
32
|
collectionState?: boolean;
|
|
30
|
-
balanceSheetState?: number;
|
|
31
|
-
supervisionState?: number;
|
|
33
|
+
balanceSheetState?: number[];
|
|
34
|
+
supervisionState?: number[];
|
|
35
|
+
attributionState?: boolean;
|
|
32
36
|
planedState?: boolean;
|
|
33
37
|
balance?: boolean;
|
|
38
|
+
idComptaType?: number[];
|
|
39
|
+
balanceSheetLate?: boolean;
|
|
34
40
|
}
|
|
35
41
|
export declare class QueryToDoBalanceSheetGetExercicesSociety {
|
|
36
42
|
isExpress: boolean;
|
|
37
43
|
turnoverMax?: number[];
|
|
38
44
|
dateEnd?: number;
|
|
39
45
|
year?: number;
|
|
40
|
-
balanceSheetState?: number;
|
|
41
|
-
supervisionState?: number;
|
|
46
|
+
balanceSheetState?: number[];
|
|
47
|
+
supervisionState?: number[];
|
|
48
|
+
attributionState?: boolean;
|
|
42
49
|
planedState?: boolean;
|
|
43
50
|
}
|
|
44
51
|
//# sourceMappingURL=Query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/toDoExpress/Query.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,qBAAa,8BAA+B,SAAQ,qBAAqB;IAIvE,SAAS,EAAE,OAAO,CAAC;IAKnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAK9B,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,WAAW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rC,SAAS,EAAE,OAAO,CAAC;IAKnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAKhB,UAAU,CAAC,EAAE,MAAM,CAAC;IAKpB,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,WAAW,CAAC,EAAE,IAAI,CAAC;IAKnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAKvB,eAAe,CAAC,EAAE,MAAM,CAAC;IAKzB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,IAAI,CAAC,EAAE,MAAM,CAAC;IAMd,eAAe,CAAC,EAAE,OAAO,CAAC;IAK1B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAK7B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAM5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,WAAW,CAAC,EAAE,OAAO,CAAC;IAMtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAKlB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAMxB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,qBAAa,wCAAwC;IAInD,SAAS,EAAE,OAAO,CAAC;IAKnB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IAKvB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,IAAI,CAAC,EAAE,MAAM,CAAC;IAKd,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAK7B,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAM5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAM3B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -86,15 +86,22 @@ __decorate([
|
|
|
86
86
|
__decorate([
|
|
87
87
|
(0, utils_1.ApiPropertyOptional)(),
|
|
88
88
|
(0, class_validator_1.IsOptional)(),
|
|
89
|
-
(0, class_validator_1.IsInt)(),
|
|
90
|
-
__metadata("design:type",
|
|
89
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
90
|
+
__metadata("design:type", Array)
|
|
91
91
|
], QueryToDoBalanceSheetPaginated.prototype, "balanceSheetState", void 0);
|
|
92
92
|
__decorate([
|
|
93
93
|
(0, utils_1.ApiPropertyOptional)(),
|
|
94
94
|
(0, class_validator_1.IsOptional)(),
|
|
95
|
-
(0, class_validator_1.IsInt)(),
|
|
96
|
-
__metadata("design:type",
|
|
95
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
97
|
], QueryToDoBalanceSheetPaginated.prototype, "supervisionState", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, utils_1.ApiPropertyOptional)(),
|
|
100
|
+
(0, class_validator_1.IsOptional)(),
|
|
101
|
+
(0, class_validator_1.IsBoolean)(),
|
|
102
|
+
(0, boolean_transform_1.ToBoolean)(),
|
|
103
|
+
__metadata("design:type", Boolean)
|
|
104
|
+
], QueryToDoBalanceSheetPaginated.prototype, "attributionState", void 0);
|
|
98
105
|
__decorate([
|
|
99
106
|
(0, utils_1.ApiPropertyOptional)(),
|
|
100
107
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -109,6 +116,19 @@ __decorate([
|
|
|
109
116
|
(0, boolean_transform_1.ToBoolean)(),
|
|
110
117
|
__metadata("design:type", Boolean)
|
|
111
118
|
], QueryToDoBalanceSheetPaginated.prototype, "balance", void 0);
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, utils_1.ApiPropertyOptional)(),
|
|
121
|
+
(0, class_validator_1.IsOptional)(),
|
|
122
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
123
|
+
__metadata("design:type", Array)
|
|
124
|
+
], QueryToDoBalanceSheetPaginated.prototype, "idComptaType", void 0);
|
|
125
|
+
__decorate([
|
|
126
|
+
(0, utils_1.ApiPropertyOptional)(),
|
|
127
|
+
(0, class_validator_1.IsOptional)(),
|
|
128
|
+
(0, class_validator_1.IsBoolean)(),
|
|
129
|
+
(0, boolean_transform_1.ToBoolean)(),
|
|
130
|
+
__metadata("design:type", Boolean)
|
|
131
|
+
], QueryToDoBalanceSheetPaginated.prototype, "balanceSheetLate", void 0);
|
|
112
132
|
class QueryToDoBalanceSheetStats {
|
|
113
133
|
}
|
|
114
134
|
exports.QueryToDoBalanceSheetStats = QueryToDoBalanceSheetStats;
|
|
@@ -176,15 +196,22 @@ __decorate([
|
|
|
176
196
|
__decorate([
|
|
177
197
|
(0, utils_1.ApiPropertyOptional)(),
|
|
178
198
|
(0, class_validator_1.IsOptional)(),
|
|
179
|
-
(0, class_validator_1.IsInt)(),
|
|
180
|
-
__metadata("design:type",
|
|
199
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
200
|
+
__metadata("design:type", Array)
|
|
181
201
|
], QueryToDoBalanceSheetStats.prototype, "balanceSheetState", void 0);
|
|
182
202
|
__decorate([
|
|
183
203
|
(0, utils_1.ApiPropertyOptional)(),
|
|
184
204
|
(0, class_validator_1.IsOptional)(),
|
|
185
|
-
(0, class_validator_1.IsInt)(),
|
|
186
|
-
__metadata("design:type",
|
|
205
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
206
|
+
__metadata("design:type", Array)
|
|
187
207
|
], QueryToDoBalanceSheetStats.prototype, "supervisionState", void 0);
|
|
208
|
+
__decorate([
|
|
209
|
+
(0, utils_1.ApiPropertyOptional)(),
|
|
210
|
+
(0, class_validator_1.IsOptional)(),
|
|
211
|
+
(0, class_validator_1.IsBoolean)(),
|
|
212
|
+
(0, boolean_transform_1.ToBoolean)(),
|
|
213
|
+
__metadata("design:type", Boolean)
|
|
214
|
+
], QueryToDoBalanceSheetStats.prototype, "attributionState", void 0);
|
|
188
215
|
__decorate([
|
|
189
216
|
(0, utils_1.ApiPropertyOptional)(),
|
|
190
217
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -199,6 +226,19 @@ __decorate([
|
|
|
199
226
|
(0, boolean_transform_1.ToBoolean)(),
|
|
200
227
|
__metadata("design:type", Boolean)
|
|
201
228
|
], QueryToDoBalanceSheetStats.prototype, "balance", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
(0, utils_1.ApiPropertyOptional)(),
|
|
231
|
+
(0, class_validator_1.IsOptional)(),
|
|
232
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
233
|
+
__metadata("design:type", Array)
|
|
234
|
+
], QueryToDoBalanceSheetStats.prototype, "idComptaType", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
(0, utils_1.ApiPropertyOptional)(),
|
|
237
|
+
(0, class_validator_1.IsOptional)(),
|
|
238
|
+
(0, class_validator_1.IsBoolean)(),
|
|
239
|
+
(0, boolean_transform_1.ToBoolean)(),
|
|
240
|
+
__metadata("design:type", Boolean)
|
|
241
|
+
], QueryToDoBalanceSheetStats.prototype, "balanceSheetLate", void 0);
|
|
202
242
|
class QueryToDoBalanceSheetGetExercicesSociety {
|
|
203
243
|
}
|
|
204
244
|
exports.QueryToDoBalanceSheetGetExercicesSociety = QueryToDoBalanceSheetGetExercicesSociety;
|
|
@@ -229,15 +269,22 @@ __decorate([
|
|
|
229
269
|
__decorate([
|
|
230
270
|
(0, utils_1.ApiPropertyOptional)(),
|
|
231
271
|
(0, class_validator_1.IsOptional)(),
|
|
232
|
-
(0, class_validator_1.IsInt)(),
|
|
233
|
-
__metadata("design:type",
|
|
272
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
273
|
+
__metadata("design:type", Array)
|
|
234
274
|
], QueryToDoBalanceSheetGetExercicesSociety.prototype, "balanceSheetState", void 0);
|
|
235
275
|
__decorate([
|
|
236
276
|
(0, utils_1.ApiPropertyOptional)(),
|
|
237
277
|
(0, class_validator_1.IsOptional)(),
|
|
238
|
-
(0, class_validator_1.IsInt)(),
|
|
239
|
-
__metadata("design:type",
|
|
278
|
+
(0, class_validator_1.IsInt)({ each: true }),
|
|
279
|
+
__metadata("design:type", Array)
|
|
240
280
|
], QueryToDoBalanceSheetGetExercicesSociety.prototype, "supervisionState", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
(0, utils_1.ApiPropertyOptional)(),
|
|
283
|
+
(0, class_validator_1.IsOptional)(),
|
|
284
|
+
(0, class_validator_1.IsBoolean)(),
|
|
285
|
+
(0, boolean_transform_1.ToBoolean)(),
|
|
286
|
+
__metadata("design:type", Boolean)
|
|
287
|
+
], QueryToDoBalanceSheetGetExercicesSociety.prototype, "attributionState", void 0);
|
|
241
288
|
__decorate([
|
|
242
289
|
(0, utils_1.ApiPropertyOptional)(),
|
|
243
290
|
(0, class_validator_1.IsOptional)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/toDoExpress/Query.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0F;AAC1F,6CAAqE;AACrE,kDAAwD;AACxD,sFAA2E;AAE3E,MAAa,8BAA+B,SAAQ,oCAAqB;
|
|
1
|
+
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/toDoExpress/Query.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA0F;AAC1F,6CAAqE;AACrE,kDAAwD;AACxD,sFAA2E;AAE3E,MAAa,8BAA+B,SAAQ,oCAAqB;CA8FxE;AA9FD,wEA8FC;AA1FC;IAHC,IAAA,mBAAW,GAAE;IACb,IAAA,2BAAS,GAAE;IACX,IAAA,6BAAS,GAAE;;iEACO;AAKnB;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,GAAE;;8DACK;AAIhB;IAFC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;;kEACiB;AAK9B;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,GAAE;;iEACW;AAKnB;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;8BACK,IAAI;mEAAC;AA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ACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;mFACO;AAK7B;IAHC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,uBAAK,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;kFACM;AAM5B;IAJC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,6BAAS,GAAE;;kFACe;AAM3B;IAJC,IAAA,2BAAmB,GAAE;IACrB,IAAA,4BAAU,GAAE;IACZ,IAAA,2BAAS,GAAE;IACX,IAAA,6BAAS,GAAE;;6EACU","sourcesContent":["import { IsArray, IsBoolean, IsDate, IsInt, IsOptional, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { RequiredQueryPaginate } from '../BasePaginate';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\n\nexport class QueryToDoBalanceSheetPaginated extends RequiredQueryPaginate {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isExpress: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n search?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n accountant: number | number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n legalForm?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsDate()\n arrivalDate?: Date;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsArray()\n turnoverMax?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n missionAcceptationState?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n onboardingState?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n dateEnd?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n year?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n collectionState?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n balanceSheetState?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n supervisionState?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n attributionState?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n planedState?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n balance?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n idComptaType?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n balanceSheetLate?: boolean;\n}\n\nexport class QueryToDoBalanceSheetStats {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isExpress: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n search?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n accountant?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n legalForm?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsDate()\n arrivalDate?: Date;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsArray()\n turnoverMax?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n onboardingState?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n dateEnd?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n year?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n collectionState?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n balanceSheetState?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n supervisionState?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n attributionState?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n planedState?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n balance?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n idComptaType?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n balanceSheetLate?: boolean;\n}\n\nexport class QueryToDoBalanceSheetGetExercicesSociety {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isExpress: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsArray()\n turnoverMax?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n dateEnd?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n year?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n balanceSheetState?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt({ each: true })\n supervisionState?: number[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n attributionState?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n planedState?: boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,8BAA8B,EAG/B,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAkBrB,wBAAgB,0BAA0B,CACxC,qBAAqB,EAAE,mBAAmB,EAC1C,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EACtD,mBAAmB,UAAQ,EAC3B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,8BAA8B,
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,8BAA8B,EAG/B,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,0BAA0B,EAC3B,MAAM,aAAa,CAAC;AAkBrB,wBAAgB,0BAA0B,CACxC,qBAAqB,EAAE,mBAAmB,EAC1C,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EACtD,mBAAmB,UAAQ,EAC3B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,8BAA8B,CAmHhC;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,gBAAgB,EACxB,mBAAmB,UAAQ,EAC3B,OAAO,GAAE,MAAM,GAAG,SAAqB,GACtC,0BAA0B,CA4B5B"}
|
|
@@ -19,7 +19,7 @@ const ejs = require("ejs");
|
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
20
20
|
require('dayjs/locale/fr');
|
|
21
21
|
function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBrandName = false, nodeEnv = undefined) {
|
|
22
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
22
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
23
23
|
const products = (0, lodash_1.orderBy)(payload.products.map((product) => (0, product_1.productToReadProductEditing)(product), 'reorder'));
|
|
24
24
|
const vats = (0, lodash_1.orderBy)(Object.values((0, lodash_1.groupBy)(products, 'vatFormatted')).map((v) => (0, vat_1.vatToReadVatEditing)(v), 'value')).filter((v) => v.id !== Vat_1.Vat.MARGE.id);
|
|
25
25
|
const thirdParty = (0, thirdParty_1.thirdPartyToReadThirdPartyEditing)(payload.thirdParty);
|
|
@@ -38,13 +38,21 @@ function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBr
|
|
|
38
38
|
const totalTaxIncluded = (0, lodash_1.sumBy)(products, 'totalTaxExcluded') + (0, lodash_1.sumBy)(vats, 'amount');
|
|
39
39
|
const locale = (_b = payload.language) !== null && _b !== void 0 ? _b : CommercialManagement_1.InvoiceLanguage.FR;
|
|
40
40
|
const languageOption = choices_1.internationalizationChoices[locale];
|
|
41
|
-
const data = Object.assign(Object.assign({}, payload), { thirdParty, paymentLink: (_c = payload.paymentLink) !== null && _c !== void 0 ? _c : '#', idEstimateInvoiceType, title: (_d = payload.title) !== null && _d !== void 0 ? _d : null, penalties:
|
|
41
|
+
const data = Object.assign(Object.assign({}, payload), { thirdParty, paymentLink: (_c = payload.paymentLink) !== null && _c !== void 0 ? _c : '#', idEstimateInvoiceType, title: (_d = payload.title) !== null && _d !== void 0 ? _d : null, penalties: payload.penalties
|
|
42
|
+
? ((_e = (0, choices_1.internationalizationConsistency)(locale, payload.penalties, 'penalties')) !== null && _e !== void 0 ? _e : null)
|
|
43
|
+
: null, termsOfPayment: payload.termsOfPayment
|
|
44
|
+
? ((_f = (0, choices_1.internationalizationConsistency)(locale, payload.termsOfPayment, 'termsOfPayment')) !== null && _f !== void 0 ? _f : null)
|
|
45
|
+
: null, compensation: payload.compensation
|
|
46
|
+
? ((_g = (0, choices_1.internationalizationConsistency)(locale, payload.compensation, 'recoveryCost')) !== null && _g !== void 0 ? _g : null)
|
|
47
|
+
: null, discount: payload.discount ? ((_h = (0, choices_1.internationalizationConsistency)(locale, payload.discount, 'discount')) !== null && _h !== void 0 ? _h : null) : null, vatMention: payload.vatMention
|
|
48
|
+
? ((_j = (0, choices_1.internationalizationConsistency)(locale, payload.vatMention, 'vatMention')) !== null && _j !== void 0 ? _j : null)
|
|
49
|
+
: null, phoneContact: (_l = (_k = payload.settings) === null || _k === void 0 ? void 0 : _k.phoneContact) !== null && _l !== void 0 ? _l : null, products,
|
|
42
50
|
vats, totalTaxExcluded: (0, lodash_1.sumBy)(products, 'totalTaxExcluded'), totalTaxIncluded: (0, lodash_1.round)(totalTaxIncluded), totalTaxAndDiscountIncluded: (0, lodash_1.round)(totalTaxIncluded), generalDiscountFormatted: payload.generalDiscount2
|
|
43
51
|
? (0, amount_1.integerToFormattedAmountString)(payload.generalDiscount2)
|
|
44
|
-
: null, depositFormatted: payload.deposit ? (0, amount_1.integerToFormattedAmountString)(payload.deposit) : null, totalTaxExcludedFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, 'totalTaxExcluded')), totalTaxIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded), totalTaxAndDiscountIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded - ((
|
|
45
|
-
id: (
|
|
46
|
-
name: (
|
|
47
|
-
url: (
|
|
52
|
+
: null, depositFormatted: payload.deposit ? (0, amount_1.integerToFormattedAmountString)(payload.deposit) : null, totalTaxExcludedFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(products, 'totalTaxExcluded')), totalTaxIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded), totalTaxAndDiscountIncludedFormatted: (0, amount_1.integerToFormattedAmountString)(totalTaxIncluded - ((_m = payload.generalDiscount2) !== null && _m !== void 0 ? _m : 0) - ((_o = payload.deposit) !== null && _o !== void 0 ? _o : 0)), totalVatAmountFormatted: (0, amount_1.integerToFormattedAmountString)((0, lodash_1.sumBy)(vats, 'amount')), font: {
|
|
53
|
+
id: (_q = (_p = payload.settings) === null || _p === void 0 ? void 0 : _p.idFont) !== null && _q !== void 0 ? _q : CommercialManagement_1.FontIds.CIRCULAR_STD,
|
|
54
|
+
name: (_s = (_r = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _r === void 0 ? void 0 : _r.name) !== null && _s !== void 0 ? _s : CommercialManagement_1.fontList[0].name,
|
|
55
|
+
url: (_u = (_t = CommercialManagement_1.fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _t === void 0 ? void 0 : _t.link) !== null && _u !== void 0 ? _u : CommercialManagement_1.fontList[0].link,
|
|
48
56
|
}, capitalFormatted: payload.capital
|
|
49
57
|
? `${payload.capital}`
|
|
50
58
|
.split('')
|
|
@@ -52,16 +60,18 @@ function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBr
|
|
|
52
60
|
.trim()
|
|
53
61
|
: null, dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null, expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null, emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null, shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),
|
|
54
62
|
// @ts-ignore
|
|
55
|
-
marginVats: (0, lodash_1.uniq)(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (
|
|
63
|
+
marginVats: (0, lodash_1.uniq)(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (_w = (_v = CommercialManagement_1.AccountingCategoryList.find((a) => a.id === payload.accountingCategory)) === null || _v === void 0 ? void 0 : _v.label) !== null && _w !== void 0 ? _w : null,
|
|
56
64
|
// @ts-ignore
|
|
57
|
-
brandColors: (0, brands_1.getBrandConfig)({ objectWaited: 'colors', nodeEnv }), brandName: `${(0, brands_1.getBrandConfig)({ objectWaited: 'name', nodeEnv })}`, shouldHideBrandName, paymentType: payload.paymentType
|
|
65
|
+
brandColors: (0, brands_1.getBrandConfig)({ objectWaited: 'colors', nodeEnv }), brandName: `${(0, brands_1.getBrandConfig)({ objectWaited: 'name', nodeEnv })}`, shouldHideBrandName, paymentType: payload.paymentType
|
|
66
|
+
? (0, choices_1.internationalizationConsistency)(locale, payload.paymentType, 'paymentType')
|
|
67
|
+
: null, languageTemplate: languageOption });
|
|
58
68
|
const commonTemplate = new common_1.CommercialDocumentCommonHTML();
|
|
59
69
|
const documentFreeText = [EstimateInvoice_1.EstimateInvoiceType.DEVIS, EstimateInvoice_1.EstimateInvoiceType.BON].includes(idEstimateInvoiceType)
|
|
60
|
-
? (
|
|
61
|
-
: (
|
|
70
|
+
? (_x = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _x === void 0 ? void 0 : _x.freeEstimateText
|
|
71
|
+
: (_y = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _y === void 0 ? void 0 : _y.freeInvoiceText;
|
|
62
72
|
return {
|
|
63
73
|
header: ejs.render(commonTemplate.header, data),
|
|
64
|
-
body: ejs.render(body_1.bodyTemplate, Object.assign(Object.assign({}, data), { comment: data.comment && typeof data.comment === 'string' ? (
|
|
74
|
+
body: ejs.render(body_1.bodyTemplate, Object.assign(Object.assign({}, data), { comment: data.comment && typeof data.comment === 'string' ? (_z = data.comment) === null || _z === void 0 ? void 0 : _z.replace(/\n/g, '<br/>') : null, products: data.products.map((p) => {
|
|
65
75
|
var _a;
|
|
66
76
|
return (Object.assign(Object.assign({}, p), { comment: p.comment && typeof p.comment === 'string' ? (_a = p.comment) === null || _a === void 0 ? void 0 : _a.replace(/\n/g, '<br/>') : null }));
|
|
67
77
|
}), vats: forcedVats !== null && forcedVats !== void 0 ? forcedVats : vats })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":";;AAsCA,gEA6GC;AAED,gDAgCC;AArLD,mCAAmH;AACnH,+BAA+B;AAM/B,gFAAmH;AACnH,sEAAuE;AACvE,8CAA2C;AAC3C,sCAA2F;AAC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CAAC,OAAO,KACjB,yBAAyB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,yBAAyB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,iBAAiB,EAAE,IAAA,uCAA8B,EAC/C,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAClE,EACD,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EACtG,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,IAAA,uBAAc,EAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB,EAClF,mBAAmB,EACnB,YAAY,EAAE,cAAc,GAC7B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,mCAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import { orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, round as _round } from 'lodash';\nimport * as dayjs from 'dayjs';\nimport {\n ReadCommercialDocumentTemplate,\n ReadDocumentEditing,\n ReadVatEditing,\n} from '../../types/Interface/api/commercialManagement/Read';\nimport { AccountingCategoryList, FontIds, fontList, InvoiceLanguage } from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';\nimport { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport {\n CreateInvoiceDocument,\n CreateMailHeader,\n CreatePreSaleDocument,\n ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\nimport { internationalizationChoices } from './internationalization/choices';\n\nimport * as ejs from 'ejs';\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nrequire('dayjs/locale/fr');\n\ntype brandColorType = {\n primary: string;\n primary50: string;\n primary100: string;\n primary300: string;\n primary500: string;\n primary700: string;\n};\n\nexport function generateCommercialDocument(\n idEstimateInvoiceType: EstimateInvoiceType,\n payload: CreateInvoiceDocument | CreatePreSaleDocument,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(\n Object.values(_groupBy(products, 'vatFormatted')).map((v) => vatToReadVatEditing(v), 'value'),\n ).filter((v) => v.id !== Vat.MARGE.id);\n const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);\n\n let forcedVats: ReadVatEditing[] | undefined = undefined;\n\n if (payload.advanceProducts?.length) {\n const advanceVats = Object.values(_groupBy(payload.advanceProducts, 'vatFormatted'))\n .map((v) => vatToReadVatEditing(v), 'value')\n .filter((v) => v.id !== Vat.MARGE.id);\n\n forcedVats = vats.map((v) => {\n const base = v.base - (advanceVats.find((a) => a.id === v.id)?.base ?? 0);\n const toPay = v.toPay - (advanceVats.find((a) => a.id === v.id)?.toPay ?? 0);\n return {\n ...v,\n baseFormatted: integerToFormattedAmountString(base),\n amountFormatted: integerToFormattedAmountString(toPay),\n };\n });\n }\n\n const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');\n\n const locale = payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n\n const data: ReadDocumentEditing & { brandColors: brandColorType; brandName: string; shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties ?? null,\n compensation: payload.compensation ?? null,\n discount: payload.discount ?? null,\n vatMention: payload.vatMention ?? null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _round(totalTaxIncluded),\n totalTaxAndDiscountIncluded: _round(totalTaxIncluded),\n generalDiscountFormatted: payload.generalDiscount2\n ? integerToFormattedAmountString(payload.generalDiscount2)\n : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(\n totalTaxIncluded - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0),\n ),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`\n .split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),\n // @ts-ignore\n marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)),\n accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv }) as unknown as string}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n languageTemplate: languageOption,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment: data.comment && typeof data.comment === 'string' ? data.comment?.replace(/\\n/g, '<br/>') : null,\n products: data.products.map((p) => ({\n ...p,\n comment: p.comment && typeof p.comment === 'string' ? p.comment?.replace(/\\n/g, '<br/>') : null,\n })),\n vats: forcedVats ?? vats,\n }),\n footer: ejs.render(commonTemplate.footer, {\n ...data,\n freeText: documentFreeText ?? null,\n }),\n data,\n };\n}\n\nexport function generateMailHeader(\n params: CreateMailHeader,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialMailTemplate {\n const locale = params.payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(\n params.payload.totalTaxIncluded - params.payload.totalTaxExcluded,\n ),\n dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,\n hasVat: params.hasVat,\n hostS3: params.hostS3,\n logoUrl: params.logoUrl,\n companyName: params.companyName,\n fileUrl: params.fileUrl,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n shouldHideBrandName,\n languageMail: languageOption,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":";;AAsCA,gEAwHC;AAED,gDAgCC;AAhMD,mCAAmH;AACnH,+BAA+B;AAM/B,gFAAmH;AACnH,sEAAuE;AACvE,8CAA2C;AAC3C,sCAA2F;AAC3F,+CAA8F;AAC9F,2CAAgD;AAChD,uCAAwD;AACxD,+BAA4C;AAO5C,6CAAiE;AACjE,sCAA2C;AAC3C,4DAA8G;AAE9G,2BAA2B;AAC3B,iEAAiE;AACjE,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAW3B,SAAgB,0BAA0B,CACxC,qBAA0C,EAC1C,OAAsD,EACtD,mBAAmB,GAAG,KAAK,EAC3B,UAA8B,SAAS;;IAEvC,MAAM,QAAQ,GAAG,IAAA,gBAAQ,EAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAA,qCAA2B,EAAC,OAAO,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IAC9G,MAAM,IAAI,GAAG,IAAA,gBAAQ,EACnB,MAAM,CAAC,MAAM,CAAC,IAAA,gBAAQ,EAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,yBAAmB,EAAC,CAAC,CAAC,EAA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AM,cAAc,GAAG,qCAA2B,CAAC,MAAM,CAAC,CAAC;IAC3D,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnB,MAAM,IAAI,mCACL,MAAM,CAAC,OAAO,KACjB,yBAAyB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,yBAAyB,EAAE,IAAA,uCAA8B,EAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAC1F,iBAAiB,EAAE,IAAA,uCAA8B,EAC/C,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAClE,EACD,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,EACtG,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,MAAM,CAAC,OAAO,EACvB,WAAW,EAAE,MAAM,CAAC,WAAW,EAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,IAAA,uBAAc,EAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB,EAClF,mBAAmB,EACnB,YAAY,EAAE,cAAc,GAC7B,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,mCAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import { orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, round as _round } from 'lodash';\nimport * as dayjs from 'dayjs';\nimport {\n ReadCommercialDocumentTemplate,\n ReadDocumentEditing,\n ReadVatEditing,\n} from '../../types/Interface/api/commercialManagement/Read';\nimport { AccountingCategoryList, FontIds, fontList, InvoiceLanguage } from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';\nimport { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport {\n CreateInvoiceDocument,\n CreateMailHeader,\n CreatePreSaleDocument,\n ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\nimport { internationalizationChoices, internationalizationConsistency } from './internationalization/choices';\n\nimport * as ejs from 'ejs';\n// eslint-disable-next-line @typescript-eslint/no-require-imports\nrequire('dayjs/locale/fr');\n\ntype brandColorType = {\n primary: string;\n primary50: string;\n primary100: string;\n primary300: string;\n primary500: string;\n primary700: string;\n};\n\nexport function generateCommercialDocument(\n idEstimateInvoiceType: EstimateInvoiceType,\n payload: CreateInvoiceDocument | CreatePreSaleDocument,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(\n Object.values(_groupBy(products, 'vatFormatted')).map((v) => vatToReadVatEditing(v), 'value'),\n ).filter((v) => v.id !== Vat.MARGE.id);\n const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);\n\n let forcedVats: ReadVatEditing[] | undefined = undefined;\n\n if (payload.advanceProducts?.length) {\n const advanceVats = Object.values(_groupBy(payload.advanceProducts, 'vatFormatted'))\n .map((v) => vatToReadVatEditing(v), 'value')\n .filter((v) => v.id !== Vat.MARGE.id);\n\n forcedVats = vats.map((v) => {\n const base = v.base - (advanceVats.find((a) => a.id === v.id)?.base ?? 0);\n const toPay = v.toPay - (advanceVats.find((a) => a.id === v.id)?.toPay ?? 0);\n return {\n ...v,\n baseFormatted: integerToFormattedAmountString(base),\n amountFormatted: integerToFormattedAmountString(toPay),\n };\n });\n }\n\n const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');\n\n const locale = payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n\n const data: ReadDocumentEditing & { brandColors: brandColorType; brandName: string; shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties\n ? (internationalizationConsistency(locale, payload.penalties, 'penalties') ?? null)\n : null,\n termsOfPayment: payload.termsOfPayment\n ? (internationalizationConsistency(locale, payload.termsOfPayment, 'termsOfPayment') ?? null)\n : null,\n compensation: payload.compensation\n ? (internationalizationConsistency(locale, payload.compensation, 'recoveryCost') ?? null)\n : null,\n discount: payload.discount ? (internationalizationConsistency(locale, payload.discount, 'discount') ?? null) : null,\n vatMention: payload.vatMention\n ? (internationalizationConsistency(locale, payload.vatMention, 'vatMention') ?? null)\n : null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _round(totalTaxIncluded),\n totalTaxAndDiscountIncluded: _round(totalTaxIncluded),\n generalDiscountFormatted: payload.generalDiscount2\n ? integerToFormattedAmountString(payload.generalDiscount2)\n : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(\n totalTaxIncluded - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0),\n ),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`\n .split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find((p) => p.discount2 && p.discount2 > 0),\n // @ts-ignore\n marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)),\n accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv }) as unknown as string}`,\n shouldHideBrandName,\n paymentType: payload.paymentType\n ? internationalizationConsistency(locale, payload.paymentType, 'paymentType')\n : null,\n languageTemplate: languageOption,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment: data.comment && typeof data.comment === 'string' ? data.comment?.replace(/\\n/g, '<br/>') : null,\n products: data.products.map((p) => ({\n ...p,\n comment: p.comment && typeof p.comment === 'string' ? p.comment?.replace(/\\n/g, '<br/>') : null,\n })),\n vats: forcedVats ?? vats,\n }),\n footer: ejs.render(commonTemplate.footer, {\n ...data,\n freeText: documentFreeText ?? null,\n }),\n data,\n };\n}\n\nexport function generateMailHeader(\n params: CreateMailHeader,\n shouldHideBrandName = false,\n nodeEnv: string | undefined = undefined,\n): ReadCommercialMailTemplate {\n const locale = params.payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(\n params.payload.totalTaxIncluded - params.payload.totalTaxExcluded,\n ),\n dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,\n hasVat: params.hasVat,\n hostS3: params.hostS3,\n logoUrl: params.logoUrl,\n companyName: params.companyName,\n fileUrl: params.fileUrl,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n shouldHideBrandName,\n languageMail: languageOption,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}\n"]}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { InvoiceLanguage } from '../../../types/Enum/CommercialManagement';
|
|
1
2
|
import { InternationalizationChoicesType } from './type';
|
|
3
|
+
type InternationalizationConsistencyKey = 'penalties' | 'discount' | 'vatMention' | 'recoveryCost' | 'paymentType' | 'termsOfPayment';
|
|
2
4
|
export declare const internationalizationChoices: InternationalizationChoicesType;
|
|
5
|
+
export declare const internationalizationConsistency: (language: InvoiceLanguage, value: string, key: InternationalizationConsistencyKey) => string | undefined;
|
|
6
|
+
export {};
|
|
3
7
|
//# sourceMappingURL=choices.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,eAAe,EAAE,MAAM,0CAA0C,CAAC;AACjG,OAAO,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AAEzD,KAAK,kCAAkC,GACnC,WAAW,GACX,UAAU,GACV,YAAY,GACZ,cAAc,GACd,aAAa,GACb,gBAAgB,CAAC;AAErB,eAAO,MAAM,2BAA2B,EAAE,+BA6XzC,CAAC;AAyGF,eAAO,MAAM,+BAA+B,aAChC,eAAe,SAClB,MAAM,OACR,kCAAkC,KACtC,MAAM,GAAG,SAKX,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.internationalizationChoices = void 0;
|
|
3
|
+
exports.internationalizationConsistency = exports.internationalizationChoices = void 0;
|
|
4
4
|
const CommercialManagement_1 = require("../../../types/Enum/CommercialManagement");
|
|
5
5
|
exports.internationalizationChoices = {
|
|
6
6
|
fr: {
|
|
@@ -229,7 +229,7 @@ exports.internationalizationChoices = {
|
|
|
229
229
|
'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
|
|
230
230
|
'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
|
|
231
231
|
'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
|
|
232
|
-
'
|
|
232
|
+
'Invoice subject to VAT reverse charge system',
|
|
233
233
|
],
|
|
234
234
|
recoveryCost: ['Not applicable', '40€'],
|
|
235
235
|
paymentType: ['Credit card', 'Check', 'Cash', 'Direct debit', 'Bank transfer'],
|
|
@@ -384,4 +384,114 @@ exports.internationalizationChoices = {
|
|
|
384
384
|
},
|
|
385
385
|
},
|
|
386
386
|
};
|
|
387
|
+
const internationalizationMatching = {
|
|
388
|
+
penalties: [
|
|
389
|
+
{ fr: 'Non applicable', en: 'Not applicable' },
|
|
390
|
+
{ fr: '3 fois le taux légal', en: '3 times the legal rate' },
|
|
391
|
+
{ fr: 'Taux directeur de la BCE + 10 points', en: 'ECB key rate + 10 points' },
|
|
392
|
+
],
|
|
393
|
+
discount: [
|
|
394
|
+
{ fr: 'Non applicable', en: 'Not applicable' },
|
|
395
|
+
{ fr: 'Aucun escompte en cas de paiement anticipé', en: 'No discount for early payment' },
|
|
396
|
+
],
|
|
397
|
+
recoveryCost: [
|
|
398
|
+
{ fr: 'Non applicable', en: 'Not applicable' },
|
|
399
|
+
{ fr: '40€', en: '40€' },
|
|
400
|
+
],
|
|
401
|
+
paymentType: [
|
|
402
|
+
{ fr: 'Carte bancaire', en: 'Credit card' },
|
|
403
|
+
{ fr: 'Chèque', en: 'Check' },
|
|
404
|
+
{ fr: 'Espèces', en: 'Cash' },
|
|
405
|
+
{ fr: 'Prélèvement', en: 'Direct debit' },
|
|
406
|
+
{ fr: 'Virement bancaire', en: 'Bank transfer' },
|
|
407
|
+
],
|
|
408
|
+
vatMention: [
|
|
409
|
+
{ fr: 'Non concerné', en: 'Not affected' },
|
|
410
|
+
{ fr: 'Non applicable', en: 'Not applicable' },
|
|
411
|
+
{
|
|
412
|
+
fr: 'TVA non applicable, art. 293 B du CGI',
|
|
413
|
+
en: 'VAT not applicable, art. 293 B of the French General Tax Code (FGTC)',
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
fr: 'TVA non applicable - Exportation hors UE - Art. 259-1 du CGI',
|
|
417
|
+
en: 'VAT not applicable - Exports outside the EU - Art. 259-1 of the French General Tax Code (FGTC)',
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
fr: "Non soumis à TVA selon l'article 261C du CGI",
|
|
421
|
+
en: 'Not subject to VAT according to article 261C of the French General Tax Code (FGTC)',
|
|
422
|
+
},
|
|
423
|
+
{ fr: 'Article 261 D du code général des impôts (CGI)', en: 'Article 261D of the French General Tax Code (FGTC)' },
|
|
424
|
+
{
|
|
425
|
+
fr: 'Exonération de TVA, article 283-2 du Code général des impôts',
|
|
426
|
+
en: 'VAT exemption, article 283-2 of the French General Tax Code (FGTC)',
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
fr: 'Exonération de la TVA : Article 262 ter I du CGI',
|
|
430
|
+
en: 'VAT exemption: Article 262 ter I of the French General Tax Code (FGTC)',
|
|
431
|
+
},
|
|
432
|
+
{ fr: 'Mention de TVA 261.4.4 1 du CGI', en: 'VAT notice 261.4.4 1 of the French General Tax Code (FGTC)' },
|
|
433
|
+
{
|
|
434
|
+
fr: "Régime particulier – Biens d'occasion - article 297 A du CGI et directive communautaire 2006/112/CE",
|
|
435
|
+
en: 'Specific regime - Second-hand goods - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
fr: "Régime particulier – Objets d'art - article 297 A du CGI et directive communautaire 2006/112/CE",
|
|
439
|
+
en: 'Specific regime - Works of art - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
fr: "Régime particulier – Objets de collection ou d'antiquité - article 297 A du CGI et directive communautaire 2006/112/CE",
|
|
443
|
+
en: 'Specific regime – Collectibles and antiques - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
fr: 'Régime particulier – Agences de voyage - article 297 A du CGI et directive communautaire 2006/112/CE',
|
|
447
|
+
en: 'Specific regime - Travel agencies - article 297 A of the French General Tax Code (FGTC) and Community Directive 2006/112/EC',
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
fr: 'Facture soumise au régime de l’auto-liquidation de la TVA',
|
|
451
|
+
en: 'Invoice subject to VAT reverse charge system',
|
|
452
|
+
},
|
|
453
|
+
],
|
|
454
|
+
termsOfPayment: [
|
|
455
|
+
{
|
|
456
|
+
fr: 'À la livraison',
|
|
457
|
+
en: 'On delivery',
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
fr: 'À la command',
|
|
461
|
+
en: 'On order',
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
fr: 'À réception de la facture',
|
|
465
|
+
en: 'Upon receipt of invoice',
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
fr: 'Exigible sous 14 jours',
|
|
469
|
+
en: 'Due within 14 days',
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
fr: 'Exigible sous 30 jours',
|
|
473
|
+
en: 'Due within 30 days',
|
|
474
|
+
},
|
|
475
|
+
{
|
|
476
|
+
fr: '30 jours à réception de la facture',
|
|
477
|
+
en: '30 days upon receipt of invoice',
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
fr: '45 jours à réception de la facture',
|
|
481
|
+
en: '45 days upon receipt of invoice',
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
fr: '60 jours à réception de la facture',
|
|
485
|
+
en: '60 days upon receipt of invoice',
|
|
486
|
+
},
|
|
487
|
+
],
|
|
488
|
+
};
|
|
489
|
+
const internationalizationConsistency = (language, value, key) => {
|
|
490
|
+
var _a, _b;
|
|
491
|
+
const keyObjectToMacht = internationalizationMatching[key];
|
|
492
|
+
return language === CommercialManagement_1.InvoiceLanguage.FR
|
|
493
|
+
? (_a = keyObjectToMacht.find((obj) => obj.fr === value)) === null || _a === void 0 ? void 0 : _a.fr
|
|
494
|
+
: (_b = keyObjectToMacht.find((obj) => obj.fr === value)) === null || _b === void 0 ? void 0 : _b.en;
|
|
495
|
+
};
|
|
496
|
+
exports.internationalizationConsistency = internationalizationConsistency;
|
|
387
497
|
//# sourceMappingURL=choices.js.map
|