@silexpert/core 1.1.391 → 1.1.393
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/api/resources/Vat.d.ts +3 -1
- package/dist/cjs/api/resources/Vat.d.ts.map +1 -1
- package/dist/cjs/api/resources/Vat.js +6 -0
- package/dist/cjs/api/resources/Vat.js.map +1 -1
- package/dist/cjs/types/Enum/AutomaticRegistration.d.ts +4 -2
- package/dist/cjs/types/Enum/AutomaticRegistration.d.ts.map +1 -1
- package/dist/cjs/types/Enum/AutomaticRegistration.js +3 -1
- package/dist/cjs/types/Enum/AutomaticRegistration.js.map +1 -1
- package/dist/cjs/types/Enum/Log.d.ts +2 -1
- package/dist/cjs/types/Enum/Log.d.ts.map +1 -1
- package/dist/cjs/types/Enum/Log.js +1 -0
- package/dist/cjs/types/Enum/Log.js.map +1 -1
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts +7 -0
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.js +31 -1
- package/dist/cjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
- package/dist/cjs/types/Interface/api/registration/DeclareRegistration.d.ts +4 -0
- package/dist/cjs/types/Interface/api/registration/DeclareRegistration.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/registration/DeclareRegistration.js +16 -1
- package/dist/cjs/types/Interface/api/registration/DeclareRegistration.js.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Create.d.ts +1 -0
- package/dist/cjs/types/Interface/api/revision/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/revision/Create.js +5 -0
- package/dist/cjs/types/Interface/api/revision/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.d.ts +6 -0
- package/dist/cjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.js +4 -1
- package/dist/cjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.js.map +1 -1
- package/dist/cjs/types/Interface/models/IAutomaticRegistration.d.ts +1 -1
- package/dist/cjs/types/Interface/models/IAutomaticRegistration.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IAutomaticRegistration.js.map +1 -1
- package/dist/cjs/types/Interface/models/IRefund.d.ts +1 -0
- package/dist/cjs/types/Interface/models/IRefund.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IRefund.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.js +2 -1
- package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/mjs/api/resources/Vat.d.ts +3 -1
- package/dist/mjs/api/resources/Vat.d.ts.map +1 -1
- package/dist/mjs/api/resources/Vat.js +6 -0
- package/dist/mjs/api/resources/Vat.js.map +1 -1
- package/dist/mjs/types/Enum/AutomaticRegistration.d.ts +4 -2
- package/dist/mjs/types/Enum/AutomaticRegistration.d.ts.map +1 -1
- package/dist/mjs/types/Enum/AutomaticRegistration.js +3 -1
- package/dist/mjs/types/Enum/AutomaticRegistration.js.map +1 -1
- package/dist/mjs/types/Enum/Log.d.ts +2 -1
- package/dist/mjs/types/Enum/Log.d.ts.map +1 -1
- package/dist/mjs/types/Enum/Log.js +1 -0
- package/dist/mjs/types/Enum/Log.js.map +1 -1
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts +7 -0
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.js +35 -1
- package/dist/mjs/types/Interface/api/registration/CreateRegistration.js.map +1 -1
- package/dist/mjs/types/Interface/api/registration/DeclareRegistration.d.ts +4 -0
- package/dist/mjs/types/Interface/api/registration/DeclareRegistration.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/registration/DeclareRegistration.js +16 -0
- package/dist/mjs/types/Interface/api/registration/DeclareRegistration.js.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Create.d.ts +1 -0
- package/dist/mjs/types/Interface/api/revision/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/revision/Create.js +6 -0
- package/dist/mjs/types/Interface/api/revision/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.d.ts +6 -0
- package/dist/mjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.js +5 -0
- package/dist/mjs/types/Interface/api/vatDeclaration/ReadVatDeclaration.js.map +1 -1
- package/dist/mjs/types/Interface/models/IAutomaticRegistration.d.ts +1 -1
- package/dist/mjs/types/Interface/models/IAutomaticRegistration.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IAutomaticRegistration.js.map +1 -1
- package/dist/mjs/types/Interface/models/IRefund.d.ts +1 -0
- package/dist/mjs/types/Interface/models/IRefund.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IRefund.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.js +6 -5
- package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Vat.ts +9 -1
- package/ts/types/Enum/AutomaticRegistration.ts +3 -1
- package/ts/types/Enum/Log.ts +1 -0
- package/ts/types/Interface/api/registration/CreateRegistration.ts +27 -0
- package/ts/types/Interface/api/registration/DeclareRegistration.ts +12 -0
- package/ts/types/Interface/api/revision/Create.ts +5 -1
- package/ts/types/Interface/api/vatDeclaration/ReadVatDeclaration.ts +7 -0
- package/ts/types/Interface/models/IAutomaticRegistration.ts +1 -1
- package/ts/types/Interface/models/IRefund.ts +1 -0
- package/ts/utils/commercialManagement/document.ts +7 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.js","sour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AE;IACV,UAAU,EAAE;;iEACa;AAMxB;IAJD,mBAAmB,EAAE;IACrB,SAAS,EAAE;IACX,SAAS,EAAE;IACX,UAAU,EAAE;;yDACM;AAErB,MAAM,OAAO,qBAAqB;IAG9B,SAAS,CAAS;IAIlB,UAAU,CAAS;IAMnB,MAAM,CAAW;CACpB;AAXG;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;wDACS;AAIlB;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;yDACU;AAMnB;IAJD,mBAAmB,EAAE;IACrB,SAAS,EAAE;IACX,SAAS,EAAE;IACX,UAAU,EAAE;;qDACM;AAGrB,MAAM,OAAO,wBAAwB;IAGjC,SAAS,CAAS;IAIlB,SAAS,CAAS;IAIlB,OAAO,CAAS;CACnB;AATG;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;2DACS;AAIlB;IAFD,WAAW,EAAE;IACb,YAAY,EAAE;;2DACK;AAIlB;IAFD,WAAW,EAAE;IACb,YAAY,EAAE;;yDACG","sourcesContent":["import { IsBoolean, IsDate, IsDateString, IsNumber, IsOptional, IsString } from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../..';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\n\nexport class SuperVisionPendingPointsPayload {\n @ApiProperty()\n @IsNumber()\n @IsOptional()\n idPendingPoint: number;\n \n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n value?: string;\n\n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n hasValueBeenUpdated?: boolean;\n\n @ApiPropertyOptional()\n @IsNumber()\n @IsOptional()\n createdBy?: number; \n\n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n isCritical?: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n activated?: boolean;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n note?: string;\n\n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n hasNoteBeenUpdated?: boolean;\n\t\n @ApiPropertyOptional()\n @IsNumber()\n @IsOptional()\n idUser?: number; \n \n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n isDone?: boolean;\n\n @ApiPropertyOptional()\n @IsNumber()\n @IsOptional()\n isDoneBy?: number; \n \n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n toBalanceSheetNote?: boolean;\n\n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n toSummaryNote?: boolean;\n\n}\n\nexport class CreateOrUpdateState {\n @ApiProperty()\n pendingPoints: SuperVisionPendingPointsPayload[];\n \n @ApiProperty()\n @IsNumber()\n idSociety: number;\n \n @ApiProperty()\n @IsNumber()\n idClient: number;\n\n @ApiProperty()\n @IsDate()\n startDate: Date;\n\n @ApiProperty()\n @IsDate()\n endDate: Date;\n}\n\nexport class CreateReply {\n @ApiProperty()\n @IsString()\n reply: string;\n\n @ApiProperty()\n @IsNumber()\n idUser: number;\n}\n\nexport class CreatePersonalNote {\n @ApiProperty()\n @IsNumber()\n idSociety: number;\n\n @ApiProperty()\n @IsNumber()\n idUser: number;\n\n @ApiProperty()\n @IsDate()\n startDate: Date;\n\n @ApiProperty()\n @IsDate()\n endDate: Date;\n \n @ApiProperty()\n @IsNumber()\n idCycle: number;\n\n @ApiProperty()\n @IsString()\n note: string;\n}\n\nexport class UpdatePersonalNote {\n @ApiProperty()\n @IsString()\n note: string;\n}\n\nexport class CreateSupervisionNoteFile {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isBalanceSheetNote: boolean;\n\n @ApiProperty()\n @IsNumber()\n idSociety: number;\n \n @ApiProperty()\n @IsNumber()\n idExercice: number;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n freeText?: string;\n\n @ApiPropertyOptional()\n @IsNumber()\n @IsOptional()\n freeTextUserId?: number;\n \n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n isTest?: boolean;\n}\nexport class CreateSummaryDocument {\n @ApiProperty()\n @IsNumber()\n idSociety: number;\n \n @ApiProperty()\n @IsNumber()\n idExercice: number;\n\n @ApiPropertyOptional()\n @IsBoolean()\n @ToBoolean()\n @IsOptional()\n isTest?: boolean;\n}\n\nexport class ProcessMissingAnnotation {\n @ApiProperty()\n @IsNumber()\n idSociety: number;\n\n @ApiProperty()\n @IsDateString()\n startDate: string;\n\n @ApiProperty()\n @IsDateString()\n endDate: string;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IUser } from '../../..';
|
|
1
2
|
import { IAccountingEntry } from '../../models/IAccountingEntry';
|
|
2
3
|
import { FormEntry } from '../accountingEntry/AnnotateAccountingTransaction';
|
|
3
4
|
export declare class ReadVatDeclarationUpdatedEntry {
|
|
@@ -29,4 +30,9 @@ export declare class ReadVatOnCollection {
|
|
|
29
30
|
};
|
|
30
31
|
};
|
|
31
32
|
}
|
|
33
|
+
export declare class ReadVatMailPreview {
|
|
34
|
+
recipient: IUser | null;
|
|
35
|
+
content: string;
|
|
36
|
+
subject: string;
|
|
37
|
+
}
|
|
32
38
|
//# sourceMappingURL=ReadVatDeclaration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadVatDeclaration.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/vatDeclaration/ReadVatDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kDAAkD,CAAC;AAE7E,qBAAa,8BAA8B;IACzC,SAAS,EAAE,IAAI,CAAC;IAChB,GAAG,EAAE;QACH,IAAI,EAAE,SAAS,EAAE,CAAC;QAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;IACF,GAAG,EAAE;QACH,IAAI,EAAE,SAAS,EAAE,CAAC;QAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,qBAAa,mBAAmB;IAC9B,OAAO,EAAE;QACP,KAAK,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAC/B,SAAS,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACpC,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAC/B,SAAS,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACpC,CAAC;CACH"}
|
|
1
|
+
{"version":3,"file":"ReadVatDeclaration.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/vatDeclaration/ReadVatDeclaration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kDAAkD,CAAC;AAE7E,qBAAa,8BAA8B;IACzC,SAAS,EAAE,IAAI,CAAC;IAChB,GAAG,EAAE;QACH,IAAI,EAAE,SAAS,EAAE,CAAC;QAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;IACF,GAAG,EAAE;QACH,IAAI,EAAE,SAAS,EAAE,CAAC;QAClB,OAAO,EAAE,gBAAgB,EAAE,CAAC;KAC7B,CAAC;CACH;AAED,qBAAa,mBAAmB;IAC9B,OAAO,EAAE;QACP,KAAK,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAC/B,SAAS,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACpC,CAAC;IACF,KAAK,EAAE;QACL,KAAK,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;QAC/B,SAAS,EAAE;YAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,CAAC;KACpC,CAAC;CACH;AAED,qBAAa,kBAAkB;IAC7B,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadVatDeclaration.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/vatDeclaration/ReadVatDeclaration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReadVatDeclaration.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/vatDeclaration/ReadVatDeclaration.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,8BAA8B;IACzC,SAAS,CAAO;IAChB,GAAG,CAGD;IACF,GAAG,CAGD;CACH;AAED,MAAM,OAAO,mBAAmB;IAC9B,OAAO,CAGL;IACF,KAAK,CAGH;CACH;AAED,MAAM,OAAO,kBAAkB;IAC7B,SAAS,CAAe;IACxB,OAAO,CAAS;IAChB,OAAO,CAAS;CACjB","sourcesContent":["import { IUser } from '../../..';\nimport { IAccountingEntry } from '../../models/IAccountingEntry';\nimport { FormEntry } from '../accountingEntry/AnnotateAccountingTransaction';\n\nexport class ReadVatDeclarationUpdatedEntry {\n updatedAt: Date;\n old: {\n form: FormEntry[];\n entries: IAccountingEntry[];\n };\n new: {\n form: FormEntry[];\n entries: IAccountingEntry[];\n };\n}\n\nexport class ReadVatOnCollection {\n amounts: { \n sales: { [k: string]: number };\n purchases: { [k: string]: number };\n };\n rates: { \n sales: { [k: string]: number };\n purchases: { [k: string]: number };\n };\n}\n\nexport class ReadVatMailPreview {\n recipient: IUser | null;\n content: string;\n subject: string;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAutomaticRegistration.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IAutomaticRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,yBAAyB,CAAC;IACjC,OAAO,EAAE,GAAG,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"IAutomaticRegistration.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IAutomaticRegistration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,WAAW,sBAAsB;IACrC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,IAAI,CAAC;IACX,KAAK,EAAE,yBAAyB,CAAC;IACjC,OAAO,EAAE,GAAG,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,OAAO,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IAutomaticRegistration.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IAutomaticRegistration.ts"],"names":[],"mappings":"","sourcesContent":["import { AutomaticRegistrationType } from '../../Enum/AutomaticRegistration';\nimport { IRegistration } from './IRegistration';\nimport { ISociety } from './ISociety';\n\nexport interface IAutomaticRegistration {\n id?: number;\n date: Date;\n state: AutomaticRegistrationType;\n details: any;\n idSociety: number;\n idRegistration
|
|
1
|
+
{"version":3,"file":"IAutomaticRegistration.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IAutomaticRegistration.ts"],"names":[],"mappings":"","sourcesContent":["import { AutomaticRegistrationType } from '../../Enum/AutomaticRegistration';\nimport { IRegistration } from './IRegistration';\nimport { ISociety } from './ISociety';\n\nexport interface IAutomaticRegistration {\n id?: number;\n date: Date;\n state: AutomaticRegistrationType;\n details: any;\n idSociety: number;\n idRegistration?: number | null;\n\n registrations?: IRegistration | null;\n society?: ISociety | null;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRefund.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IRefund.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGxB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"IRefund.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IRefund.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAGhC,MAAM,WAAW,OAAO;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGxB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,UAAU,CAAC,EAAE,KAAK,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRefund.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IRefund.ts"],"names":[],"mappings":"","sourcesContent":["import { ISociety } from './ISociety';\nimport { IFile } from './IFile';\nimport { IUser } from './IUser';\n\n// refunds\nexport interface IRefund {\n id?: number;\n amount: number | null;\n comment: string | null;\n refundDate: Date | null;\n processed: boolean;\n idRefundMotif: number;\n idSociety: number;\n idUserDemand: number;\n idFile?: number | null; //non obligatoire désormais, utilisé avant pour rattacher le RIB\n createdAt?: Date | null;\n updatedAt?: Date | null;\n\n // Associations\n society?: ISociety;\n file?: IFile;\n userDemand?: IUser;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IRefund.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IRefund.ts"],"names":[],"mappings":"","sourcesContent":["import { ISociety } from './ISociety';\nimport { IFile } from './IFile';\nimport { IUser } from './IUser';\n\n// refunds\nexport interface IRefund {\n id?: number;\n amount: number | null;\n comment: string | null;\n refundDate: Date | null;\n processed: boolean;\n isAmountChecked?: boolean;\n idRefundMotif: number;\n idSociety: number;\n idUserDemand: number;\n idFile?: number | null; //non obligatoire désormais, utilisé avant pour rattacher le RIB\n createdAt?: Date | null;\n updatedAt?: Date | null;\n\n // Associations\n society?: ISociety;\n file?: IFile;\n userDemand?: IUser;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAuC,MAAM,qDAAqD,CAAC;AAI1I,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,0BAA0B,EAC3F,MAAM,aAAa,CAAC;AAgBrB,wBAAgB,0BAA0B,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,8BAA8B,
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAuC,MAAM,qDAAqD,CAAC;AAI1I,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,0BAA0B,EAC3F,MAAM,aAAa,CAAC;AAgBrB,wBAAgB,0BAA0B,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,8BAA8B,CA4GnP;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,0BAA0B,CAuB7J"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, } from 'lodash';
|
|
1
|
+
import { orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, round as _round, } from 'lodash';
|
|
2
2
|
import * as dayjs from 'dayjs';
|
|
3
3
|
import { AccountingCategoryList, FontIds, fontList, } from '../../types/Enum/CommercialManagement';
|
|
4
4
|
import { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';
|
|
@@ -29,6 +29,7 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
|
|
|
29
29
|
};
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
+
const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');
|
|
32
33
|
const data = {
|
|
33
34
|
...payload,
|
|
34
35
|
thirdParty,
|
|
@@ -43,13 +44,13 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
|
|
|
43
44
|
products,
|
|
44
45
|
vats,
|
|
45
46
|
totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),
|
|
46
|
-
totalTaxIncluded:
|
|
47
|
-
totalTaxAndDiscountIncluded:
|
|
47
|
+
totalTaxIncluded: _round(totalTaxIncluded),
|
|
48
|
+
totalTaxAndDiscountIncluded: _round(totalTaxIncluded),
|
|
48
49
|
generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null,
|
|
49
50
|
depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,
|
|
50
51
|
totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),
|
|
51
|
-
totalTaxIncludedFormatted: integerToFormattedAmountString(
|
|
52
|
-
totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(
|
|
52
|
+
totalTaxIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded),
|
|
53
|
+
totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),
|
|
53
54
|
totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),
|
|
54
55
|
font: {
|
|
55
56
|
id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,IAAI,IAAI,KAAK,GACzE,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,sBAAsB,EAAE,OAAO,EAAE,QAAQ,GAC1C,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAC3F,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAA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AAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,cAAc,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB;QAClF,mBAAmB;KACpB,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,0BAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import {\n orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq,\n} from 'lodash';\nimport * as dayjs from 'dayjs';\nimport { ReadCommercialDocumentTemplate, ReadDocumentEditing, ReadVatEditing } from '../../types/Interface/api/commercialManagement/Read';\nimport {\n AccountingCategoryList, FontIds, fontList,\n} 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, CreateMailHeader, CreatePreSaleDocument, ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\n\nconst ejs = require('ejs');\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(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).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')).map((v) => (vatToReadVatEditing(v)), 'value').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 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: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n totalTaxAndDiscountIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount')),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount') - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),\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}`.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(\n (p) => p.discount2 && p.discount2 > 0,\n ),\n // @ts-ignore\n marginVats: _uniq(\n products\n .filter((p) => p.marginVatFormatted !== null)\n .map((p) => p.marginVatFormatted),\n ),\n accountingCategoryFormatted:\n AccountingCategoryList.find((a) => a.id === payload.accountingCategory)\n ?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [\n EstimateInvoiceType.DEVIS,\n EstimateInvoiceType.BON,\n ].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:\n data.comment && typeof data.comment === 'string'\n ? data.comment?.replace(/\\n/g, '<br/>')\n : null,\n products: data.products.map((p) => ({\n ...p,\n comment:\n p.comment && typeof p.comment === 'string'\n ? p.comment?.replace(/\\n/g, '<br/>')\n : 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(params: CreateMailHeader, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialMailTemplate {\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(params.payload.totalTaxIncluded - params.payload.totalTaxExcluded),\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 };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}"]}
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,IAAI,QAAQ,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAK,IAAI,MAAM,EAAE,IAAI,IAAI,KAAK,EAAE,KAAK,IAAI,MAAM,GAC1F,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,sBAAsB,EAAE,OAAO,EAAE,QAAQ,GA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,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI;QACtG,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,aAAa;QACb,WAAW,EAAE,cAAc,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAmB;QAClF,mBAAmB;KACpB,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,0BAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import {\n orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, round as _round,\n} from 'lodash';\nimport * as dayjs from 'dayjs';\nimport { ReadCommercialDocumentTemplate, ReadDocumentEditing, ReadVatEditing } from '../../types/Interface/api/commercialManagement/Read';\nimport {\n AccountingCategoryList, FontIds, fontList,\n} 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, CreateMailHeader, CreatePreSaleDocument, ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\n\nconst ejs = require('ejs');\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(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).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')).map((v) => (vatToReadVatEditing(v)), 'value').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 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 ? integerToFormattedAmountString(payload.generalDiscount2) : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),\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}`.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(\n (p) => p.discount2 && p.discount2 > 0,\n ),\n // @ts-ignore\n marginVats: _uniq(\n products\n .filter((p) => p.marginVatFormatted !== null)\n .map((p) => p.marginVatFormatted),\n ),\n accountingCategoryFormatted:\n AccountingCategoryList.find((a) => a.id === payload.accountingCategory)\n ?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [\n EstimateInvoiceType.DEVIS,\n EstimateInvoiceType.BON,\n ].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:\n data.comment && typeof data.comment === 'string'\n ? data.comment?.replace(/\\n/g, '<br/>')\n : null,\n products: data.products.map((p) => ({\n ...p,\n comment:\n p.comment && typeof p.comment === 'string'\n ? p.comment?.replace(/\\n/g, '<br/>')\n : 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(params: CreateMailHeader, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialMailTemplate {\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(params.payload.totalTaxIncluded - params.payload.totalTaxExcluded),\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 };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.393",
|
|
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",
|
package/ts/api/resources/Vat.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
BasePaginate, CreateRegistrationDetail, DeclareVatRegistration, IAccountingTransaction, ICustomerVat, QueryPaginatedRegistration, QueryPreviousVatDeclaration, QueryVatEntry, QueryVatMigrationEntry, ReadFormattedAccountingTransaction, ReadRegistration, ReadVatDeclarationUpdatedEntry, ReadVatEntry, ReadVatVariousOperations, UpdateOrCreateVatAdvance, UpdateOrCreateVatRegistration,
|
|
2
|
+
BasePaginate, CreateAndSendVatMail, CreateRegistrationDetail, DeclareVatRegistration, IAccountingTransaction, ICustomerVat, QueryPaginatedRegistration, QueryPreviousVatDeclaration, QueryVatEntry, QueryVatMigrationEntry, ReadFormattedAccountingTransaction, ReadRegistration, ReadVatDeclarationUpdatedEntry, ReadVatEntry, ReadVatMailPreview, ReadVatVariousOperations, UpdateOrCreateVatAdvance, UpdateOrCreateVatRegistration,
|
|
3
3
|
} from '../..';
|
|
4
4
|
import { Resource } from '../Resource';
|
|
5
5
|
|
|
@@ -69,4 +69,12 @@ export class Vat extends Resource {
|
|
|
69
69
|
getAllAdvances(idExercice: number): Promise<ICustomerVat[]> {
|
|
70
70
|
return this.axios.$get(`/exercices/${idExercice}/vat/advances`);
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
getMailData(idCustomerVat: number): Promise<ReadVatMailPreview> {
|
|
74
|
+
return this.axios.$get(`/vat/advances/${idCustomerVat}/preview-mail`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
sendByMail(idCustomerVat: number, payload: CreateAndSendVatMail): Promise<ICustomerVat> {
|
|
78
|
+
return this.axios.$post(`/vat/advances/${idCustomerVat}`, payload);
|
|
79
|
+
}
|
|
72
80
|
}
|
package/ts/types/Enum/Log.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IsEnum, IsOptional, IsBoolean, IsNumber, Min, IsDateString, IsArray, ValidateNested, IsString,
|
|
3
|
+
IsEmail,
|
|
4
|
+
MinLength,
|
|
5
|
+
IsInt,
|
|
3
6
|
} from 'class-validator';
|
|
4
7
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
5
8
|
import { CerfaType } from '../../../Enum/CerfaType';
|
|
@@ -214,4 +217,28 @@ export class CreateVatMigration {
|
|
|
214
217
|
@ApiPropertyOptional()
|
|
215
218
|
@IsOptional()
|
|
216
219
|
limit?: number;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export class CreateAndSendVatMail {
|
|
223
|
+
@ApiProperty()
|
|
224
|
+
@IsEmail()
|
|
225
|
+
to: string;
|
|
226
|
+
|
|
227
|
+
@ApiProperty()
|
|
228
|
+
@IsString()
|
|
229
|
+
@MinLength(2)
|
|
230
|
+
subject: string;
|
|
231
|
+
|
|
232
|
+
@ApiProperty()
|
|
233
|
+
@IsString()
|
|
234
|
+
@MinLength(2)
|
|
235
|
+
content: string;
|
|
236
|
+
|
|
237
|
+
@ApiProperty()
|
|
238
|
+
@IsInt()
|
|
239
|
+
idSociety: number;
|
|
240
|
+
|
|
241
|
+
@ApiProperty()
|
|
242
|
+
@IsArray()
|
|
243
|
+
idFiles: number[];
|
|
217
244
|
}
|
|
@@ -71,4 +71,16 @@ export class GenerateVatAutomaticallyPayload {
|
|
|
71
71
|
@IsArray()
|
|
72
72
|
@IsInt({ each: true })
|
|
73
73
|
societyIds: number[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class SendRegistrationByMailAutomaticallyPayload {
|
|
77
|
+
@ApiPropertyOptional()
|
|
78
|
+
@IsInt()
|
|
79
|
+
@IsOptional()
|
|
80
|
+
idSociety?: number;
|
|
81
|
+
|
|
82
|
+
@ApiPropertyOptional()
|
|
83
|
+
@IsDateString()
|
|
84
|
+
@IsOptional()
|
|
85
|
+
startDate?: string;
|
|
74
86
|
}
|
|
@@ -7,7 +7,7 @@ export class SuperVisionPendingPointsPayload {
|
|
|
7
7
|
@IsNumber()
|
|
8
8
|
@IsOptional()
|
|
9
9
|
idPendingPoint: number;
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
@ApiPropertyOptional()
|
|
12
12
|
@IsString()
|
|
13
13
|
@IsOptional()
|
|
@@ -84,6 +84,10 @@ export class CreateOrUpdateState {
|
|
|
84
84
|
@ApiProperty()
|
|
85
85
|
@IsNumber()
|
|
86
86
|
idSociety: number;
|
|
87
|
+
|
|
88
|
+
@ApiProperty()
|
|
89
|
+
@IsNumber()
|
|
90
|
+
idClient: number;
|
|
87
91
|
|
|
88
92
|
@ApiProperty()
|
|
89
93
|
@IsDate()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IUser } from '../../..';
|
|
1
2
|
import { IAccountingEntry } from '../../models/IAccountingEntry';
|
|
2
3
|
import { FormEntry } from '../accountingEntry/AnnotateAccountingTransaction';
|
|
3
4
|
|
|
@@ -22,4 +23,10 @@ export class ReadVatOnCollection {
|
|
|
22
23
|
sales: { [k: string]: number };
|
|
23
24
|
purchases: { [k: string]: number };
|
|
24
25
|
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class ReadVatMailPreview {
|
|
29
|
+
recipient: IUser | null;
|
|
30
|
+
content: string;
|
|
31
|
+
subject: string;
|
|
25
32
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
-
orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq,
|
|
2
|
+
orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, round as _round,
|
|
3
3
|
} from 'lodash';
|
|
4
4
|
import * as dayjs from 'dayjs';
|
|
5
5
|
import { ReadCommercialDocumentTemplate, ReadDocumentEditing, ReadVatEditing } from '../../types/Interface/api/commercialManagement/Read';
|
|
@@ -52,6 +52,8 @@ export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoic
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');
|
|
56
|
+
|
|
55
57
|
const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {
|
|
56
58
|
...payload,
|
|
57
59
|
thirdParty,
|
|
@@ -66,13 +68,13 @@ export function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoic
|
|
|
66
68
|
products,
|
|
67
69
|
vats,
|
|
68
70
|
totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),
|
|
69
|
-
totalTaxIncluded:
|
|
70
|
-
totalTaxAndDiscountIncluded:
|
|
71
|
+
totalTaxIncluded:_round(totalTaxIncluded),
|
|
72
|
+
totalTaxAndDiscountIncluded: _round(totalTaxIncluded),
|
|
71
73
|
generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null,
|
|
72
74
|
depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,
|
|
73
75
|
totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),
|
|
74
|
-
totalTaxIncludedFormatted: integerToFormattedAmountString(
|
|
75
|
-
totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(
|
|
76
|
+
totalTaxIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded),
|
|
77
|
+
totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(totalTaxIncluded - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),
|
|
76
78
|
totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),
|
|
77
79
|
font: {
|
|
78
80
|
id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,
|