@silexpert/core 1.0.57 → 1.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/types/Interface/api/commercialManagement/Create.d.ts +1 -0
- package/es/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/es/types/Interface/api/commercialManagement/Create.js +6 -0
- package/es/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/es/types/Interface/api/commercialManagement/Read.d.ts +2 -1
- package/es/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/es/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/es/types/Interface/models/ISocietyGescom.d.ts +1 -0
- package/es/types/Interface/models/ISocietyGescom.d.ts.map +1 -1
- package/es/types/Interface/models/ISocietyGescom.js.map +1 -1
- package/es/utils/commercialManagement/document.d.ts.map +1 -1
- package/es/utils/commercialManagement/document.js +13 -11
- package/es/utils/commercialManagement/document.js.map +1 -1
- package/es/utils/commercialManagement/templates/common.d.ts.map +1 -1
- package/es/utils/commercialManagement/templates/common.js +78 -8
- package/es/utils/commercialManagement/templates/common.js.map +1 -1
- package/js/types/Interface/api/commercialManagement/Create.js +2 -0
- package/js/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/js/utils/commercialManagement/document.js +17 -15
- package/js/utils/commercialManagement/document.js.map +1 -1
- package/js/utils/commercialManagement/templates/common.js +77 -7
- package/js/utils/commercialManagement/templates/common.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Interface/api/commercialManagement/Create.ts +5 -0
- package/ts/types/Interface/api/commercialManagement/Read.ts +2 -1
- package/ts/types/Interface/models/ISocietyGescom.ts +1 -0
- package/ts/utils/commercialManagement/document.ts +5 -1
- package/ts/utils/commercialManagement/templates/common.ts +78 -8
|
@@ -39,6 +39,7 @@ export declare class CreateCommercialSetting {
|
|
|
39
39
|
idFont?: FontIds | null;
|
|
40
40
|
isEdgingDisplayed?: boolean;
|
|
41
41
|
edgingColor?: string;
|
|
42
|
+
fontColor?: string;
|
|
42
43
|
isCoordinatesFrameDisplayed?: boolean;
|
|
43
44
|
areLinesSeparationHidden?: boolean;
|
|
44
45
|
areColumnsSeparationHidden?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/commercialManagement/Create.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,oBAAY,uBAAuB,GAAG,eAAe,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3E,qBAAa,uBAAuB;IAOlC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKxB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKpB,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKrC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKrB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKrB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKpB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK5B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK7B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKxB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAK/B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,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AC,EAAE,EAAE,CAAC;CACxB;AACD,qBAAa,qBAAsB,SAAQ,wBAAwB;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,qBAAa,SAAS;IAEpB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,qBAAa,cAAc;IAIzB,WAAW,EAAE,OAAO,CAAC;IAKrB,OAAO,EAAE,OAAO,CAAC;IAKjB,UAAU,EAAE,OAAO,CAAC;IAKpB,UAAU,EAAE,OAAO,CAAC;IAKpB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,qBAAa,gBAAgB;IAG3B,IAAI,EAAE,MAAM,CAAC;IAIb,SAAS,EAAE,MAAM,CAAC;IAIlB,OAAO,EAAE,MAAM,CAAC;IAKhB,QAAQ,EAAE,OAAO,CAAC;CACnB"}
|
|
@@ -218,6 +218,12 @@ __decorate([
|
|
|
218
218
|
IsString(),
|
|
219
219
|
__metadata("design:type", String)
|
|
220
220
|
], CreateCommercialSetting.prototype, "edgingColor", void 0);
|
|
221
|
+
__decorate([
|
|
222
|
+
ApiPropertyOptional(),
|
|
223
|
+
IsOptional(),
|
|
224
|
+
IsString(),
|
|
225
|
+
__metadata("design:type", String)
|
|
226
|
+
], CreateCommercialSetting.prototype, "fontColor", void 0);
|
|
221
227
|
__decorate([
|
|
222
228
|
ApiPropertyOptional(),
|
|
223
229
|
IsOptional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/commercialManagement/Create.ts"],"names":[],"mappings":";;;;;;;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U,EAAE;;+CACI;AAIjB;IAFC,WAAW,EAAE;IACb,QAAQ,EAAE;;6CACG;AAGhB,MAAM,OAAO,gBAAgB;CAiB5B;AAdC;IAFC,WAAW,EAAE;IACb,MAAM,CAAC,cAAc,CAAC;;8CACV;AAIb;IAFC,WAAW,EAAE;IACb,YAAY,EAAE;;mDACG;AAIlB;IAFC,WAAW,EAAE;IACb,YAAY,EAAE;;iDACC;AAKhB;IAHC,WAAW,EAAE;IACb,SAAS,EAAE;IACX,SAAS,EAAE;;kDACM","sourcesContent":["import {\n IsArray, IsBoolean, IsDateString, IsEnum, IsNumber, IsOptional, IsString, Min,\n} from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\nimport { AccountingCategoryId, FontIds, LogoAlignment } from '../../../Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { RecurrenceType } from '../../../Enum/RecurrenceType';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ISocietyGescom } from '../../models/ISocietyGescom';\nimport { IThirdParty } from '../../models/IThirdParty';\n\nexport type IProductInvoiceToCreate = IProductInvoice & { save?: boolean };\n\nexport class CreateCommercialSetting {\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n @Min(0, {\n message: 'Capital should be positive',\n })\n capital?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n tvaCode?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n rcs?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n numberTradeDirectory?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bank?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n iban?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bic?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n mailContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n phoneContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n website?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n commercialName?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n penalties?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n discount?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n recoveryCost?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n vatMention?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n generatedBy?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n acceptCheque?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n mentionAutoent?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startInvoice?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startEstimate?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n dayOfValidity?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n paymentsAccepted?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n stripePaymentByDefault?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n displayLogo?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n invoiceCgv?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n color?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeInvoiceText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeEstimateText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n logoAlignment?: LogoAlignment | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n idFont?: FontIds | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isEdgingDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n edgingColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isCoordinatesFrameDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areLinesSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areColumnsSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n accountingCategory?: AccountingCategoryId;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n}\n\nexport class CreateCommercialMail {\n @ApiProperty()\n @IsString()\n to: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n cc?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bcc?: string;\n\n @ApiProperty()\n @IsString()\n subject: string;\n\n @ApiProperty()\n @IsString()\n content: string;\n}\n\nexport class CreateCommercialMailWithMultipleFiles extends CreateCommercialMail {\n idsFile: number[];\n}\n\nexport class CommercialDocumentInputs {\n @ApiProperty()\n legalForm: string | null;\n\n @ApiProperty()\n capital: number | null;\n\n @ApiProperty()\n siren: string | null;\n\n @ApiProperty()\n rcs: string | null;\n\n @ApiProperty()\n vatCode: string | null;\n\n @ApiProperty()\n nafCode: string | null;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n thirdParty: IThirdParty;\n\n @ApiProperty()\n @IsDateString()\n emissionDate: string;\n\n @ApiProperty()\n @IsDateString()\n dueDate: string;\n\n @ApiProperty({ description: 'Date d\\'expiration pour la facture d\\'acompte' })\n expirationDate: string | null;\n\n @ApiProperty({ description: 'Conditions de réglement' })\n termsOfPayment: string | null;\n\n @ApiProperty()\n @IsArray()\n products: Array<IProductInvoiceToCreate>;\n\n @ApiProperty({ description: 'Escompte' })\n discount: string | null;\n\n @ApiProperty()\n comment: string | null;\n\n @ApiProperty({ description: 'Pénalité de retard' })\n penalties: string | null;\n\n @ApiProperty({ description: 'Remise globale' })\n @IsNumber()\n generalDiscount2: number;\n\n @ApiProperty({ description: 'Indemnité forfaitaire' })\n compensation: string | null;\n\n @ApiProperty()\n vatMention: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n disableVat: boolean;\n\n @ApiProperty()\n title: string | null;\n\n @ApiProperty({ description: 'Commercial name of seller' })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Commercial number address of seller' })\n number?: string | null;\n\n @ApiProperty({ description: 'Commercial street address of seller' })\n street: string | null;\n\n @ApiProperty({ description: 'Commercial zip code address of seller' })\n zipCode: string | null;\n\n @ApiProperty({ description: 'Commercial city address of seller' })\n city: string | null;\n\n @ApiProperty()\n settings: ISocietyGescom;\n\n @ApiProperty()\n cgv: string | null;\n\n @ApiProperty()\n logoUrl: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isStripeAllowed: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isDraft: boolean;\n\n @ApiProperty()\n idEstimateInvoiceType: EstimateInvoiceType;\n\n @ApiProperty()\n accountingCategory: AccountingCategoryId;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n}\n\nexport class CreatePreSaleDocument extends CommercialDocumentInputs {\n paymentLink?: '#';\n deposit?: undefined;\n fromEstimateId: undefined;\n assetMarginVatIds?: [];\n}\nexport class CreateInvoiceDocument extends CommercialDocumentInputs {\n paymentLink?: string;\n deposit?: number;\n fromInvoiceId?: number | null; // Nécessaire lors de la création d'un avoir à partir d'une facture\n fromEstimateId: number | null; // Nécessaire lors du passage d'un devis à facture\n assetMarginVatIds?: number[]; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes\n}\n\nexport class CreateCgv {\n @ApiProperty()\n cgv: string | null;\n}\n\nexport class CreateReminder {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n beforeThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n dueDate: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterSeven: boolean;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n subject?: string;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n message?: string;\n\n @ApiProperty()\n @IsString()\n email: string;\n}\n\nexport class CreateRecurrence {\n @ApiProperty()\n @IsEnum(RecurrenceType)\n type: number;\n\n @ApiProperty()\n @IsDateString()\n startDate: string;\n\n @ApiProperty()\n @IsDateString()\n endDate: string;\n\n @ApiProperty()\n @ToBoolean()\n @IsBoolean()\n isActive: boolean;\n}"]}
|
|
1
|
+
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/commercialManagement/Create.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,GAC9E,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAA0B,MAAM,oCAAoC,CAAC;AAClG,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAO9D,MAAM,OAAO,uBAAuB;CA4MnC;AArMC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, IsString, Min,\n} from 'class-validator';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\nimport { AccountingCategoryId, FontIds, LogoAlignment } from '../../../Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { RecurrenceType } from '../../../Enum/RecurrenceType';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ISocietyGescom } from '../../models/ISocietyGescom';\nimport { IThirdParty } from '../../models/IThirdParty';\n\nexport type IProductInvoiceToCreate = IProductInvoice & { save?: boolean };\n\nexport class CreateCommercialSetting {\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n @Min(0, {\n message: 'Capital should be positive',\n })\n capital?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n tvaCode?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n rcs?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n numberTradeDirectory?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bank?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n iban?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bic?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n mailContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n phoneContact?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n website?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n commercialName?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n penalties?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n discount?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n recoveryCost?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n vatMention?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n generatedBy?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n acceptCheque?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n mentionAutoent?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startInvoice?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n startEstimate?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n dayOfValidity?: number | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n paymentsAccepted?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n stripePaymentByDefault?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n displayLogo?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n invoiceCgv?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n color?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeInvoiceText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n freeEstimateText?: string | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n logoAlignment?: LogoAlignment | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n idFont?: FontIds | null;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isEdgingDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n edgingColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n fontColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isCoordinatesFrameDisplayed?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areLinesSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n areColumnsSeparationHidden?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n accountingCategory?: AccountingCategoryId;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n}\n\nexport class CreateCommercialMail {\n @ApiProperty()\n @IsString()\n to: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n cc?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n bcc?: string;\n\n @ApiProperty()\n @IsString()\n subject: string;\n\n @ApiProperty()\n @IsString()\n content: string;\n}\n\nexport class CreateCommercialMailWithMultipleFiles extends CreateCommercialMail {\n idsFile: number[];\n}\n\nexport class CommercialDocumentInputs {\n @ApiProperty()\n legalForm: string | null;\n\n @ApiProperty()\n capital: number | null;\n\n @ApiProperty()\n siren: string | null;\n\n @ApiProperty()\n rcs: string | null;\n\n @ApiProperty()\n vatCode: string | null;\n\n @ApiProperty()\n nafCode: string | null;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n thirdParty: IThirdParty;\n\n @ApiProperty()\n @IsDateString()\n emissionDate: string;\n\n @ApiProperty()\n @IsDateString()\n dueDate: string;\n\n @ApiProperty({ description: 'Date d\\'expiration pour la facture d\\'acompte' })\n expirationDate: string | null;\n\n @ApiProperty({ description: 'Conditions de réglement' })\n termsOfPayment: string | null;\n\n @ApiProperty()\n @IsArray()\n products: Array<IProductInvoiceToCreate>;\n\n @ApiProperty({ description: 'Escompte' })\n discount: string | null;\n\n @ApiProperty()\n comment: string | null;\n\n @ApiProperty({ description: 'Pénalité de retard' })\n penalties: string | null;\n\n @ApiProperty({ description: 'Remise globale' })\n @IsNumber()\n generalDiscount2: number;\n\n @ApiProperty({ description: 'Indemnité forfaitaire' })\n compensation: string | null;\n\n @ApiProperty()\n vatMention: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n disableVat: boolean;\n\n @ApiProperty()\n title: string | null;\n\n @ApiProperty({ description: 'Commercial name of seller' })\n @IsString()\n name: string;\n\n @ApiProperty({ description: 'Commercial number address of seller' })\n number?: string | null;\n\n @ApiProperty({ description: 'Commercial street address of seller' })\n street: string | null;\n\n @ApiProperty({ description: 'Commercial zip code address of seller' })\n zipCode: string | null;\n\n @ApiProperty({ description: 'Commercial city address of seller' })\n city: string | null;\n\n @ApiProperty()\n settings: ISocietyGescom;\n\n @ApiProperty()\n cgv: string | null;\n\n @ApiProperty()\n logoUrl: string | null;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isStripeAllowed: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n isDraft: boolean;\n\n @ApiProperty()\n idEstimateInvoiceType: EstimateInvoiceType;\n\n @ApiProperty()\n accountingCategory: AccountingCategoryId;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n shouldPayTaxAfterDebit?: boolean;\n}\n\nexport class CreatePreSaleDocument extends CommercialDocumentInputs {\n paymentLink?: '#';\n deposit?: undefined;\n fromEstimateId: undefined;\n assetMarginVatIds?: [];\n}\nexport class CreateInvoiceDocument extends CommercialDocumentInputs {\n paymentLink?: string;\n deposit?: number;\n fromInvoiceId?: number | null; // Nécessaire lors de la création d'un avoir à partir d'une facture\n fromEstimateId: number | null; // Nécessaire lors du passage d'un devis à facture\n assetMarginVatIds?: number[]; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes\n}\n\nexport class CreateCgv {\n @ApiProperty()\n cgv: string | null;\n}\n\nexport class CreateReminder {\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n beforeThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n dueDate: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterThree: boolean;\n\n @ApiProperty()\n @IsBoolean()\n @ToBoolean()\n afterSeven: boolean;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n subject?: string;\n\n @ApiPropertyOptional()\n @IsString()\n @IsOptional()\n message?: string;\n\n @ApiProperty()\n @IsString()\n email: string;\n}\n\nexport class CreateRecurrence {\n @ApiProperty()\n @IsEnum(RecurrenceType)\n type: number;\n\n @ApiProperty()\n @IsDateString()\n startDate: string;\n\n @ApiProperty()\n @IsDateString()\n endDate: string;\n\n @ApiProperty()\n @ToBoolean()\n @IsBoolean()\n isActive: boolean;\n}"]}
|
|
@@ -4,7 +4,7 @@ import { IProductInvoice } from '../../models/IProductInvoice';
|
|
|
4
4
|
import { ReadFormattedAccountingTransaction } from '../accountingEntry/AnnotateAccountingTransaction';
|
|
5
5
|
import { CommercialDocumentInputs } from './Create';
|
|
6
6
|
import { IEstimateInvoice } from '../../models/IEstimateInvoice';
|
|
7
|
-
import { EstimateStatus, InvoiceStatus } from '../../../Enum/CommercialManagement';
|
|
7
|
+
import { EstimateStatus, FontIds, InvoiceStatus } from '../../../Enum/CommercialManagement';
|
|
8
8
|
export declare type ReadCashBasedInvoice = Partial<IAccountingFile>;
|
|
9
9
|
export declare type ReadAccrualInvoice = Partial<ReadFormattedAccountingTransaction>;
|
|
10
10
|
export declare type ReadEstimateInvoice = IEstimateInvoice & {
|
|
@@ -51,6 +51,7 @@ export declare type ReadDocumentEditing = CommercialDocumentInputs & {
|
|
|
51
51
|
totalTaxAndDiscountIncludedFormatted: string;
|
|
52
52
|
totalVatAmountFormatted: string;
|
|
53
53
|
font: {
|
|
54
|
+
id: FontIds;
|
|
54
55
|
name: string;
|
|
55
56
|
url: string;
|
|
56
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Read.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/commercialManagement/Read.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,eA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AC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,2BAA2B,EAAE,OAAO,CAAC;IACrC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5C,CAAC;AAEF,oBAAY,8BAA8B,GAAG;IAC3C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,mBAAmB,CAAC;CAC3B,CAAC;AAEF,oBAAY,yBAAyB,GACrC,aAAa,CAAC,IAAI,GAClB,aAAa,CAAC,MAAM,GACpB,aAAa,CAAC,QAAQ,GACtB,aAAa,CAAC,OAAO,GACrB,cAAc,CAAC,OAAO,GACtB,cAAc,CAAC,MAAM,GACrB,cAAc,CAAC,QAAQ,GACvB,cAAc,CAAC,OAAO,GACtB,cAAc,CAAC,OAAO,CAAC;AAEvB,aAAK,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;CAAE,CAAC;AAEzD,oBAAY,yBAAyB,GAAG;IACtC,QAAQ,EAAE;QAAE,IAAI,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,cAAc,CAAC;KAAE,CAAA;IACpF,QAAQ,EAAE;QAAE,QAAQ,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,cAAc,CAAC;KAAE,CAAA;CAC1F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Read.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/commercialManagement/Read.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { IAccountingFile } from '../../models/IAccountingFile';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ReadFormattedAccountingTransaction } from '../accountingEntry/AnnotateAccountingTransaction';\nimport { CommercialDocumentInputs } from './Create';\nimport { IEstimateInvoice } from '../../models/IEstimateInvoice';\nimport { EstimateStatus, InvoiceStatus } from '../../../Enum/CommercialManagement';\n\nexport type ReadCashBasedInvoice = Partial<IAccountingFile>;\n\nexport type ReadAccrualInvoice = Partial<ReadFormattedAccountingTransaction>;\n\nexport type ReadEstimateInvoice = IEstimateInvoice & { id: number };\n\nexport type ReadProductEditing = IProductInvoice & {\n totalTaxExcluded: number;\n unitFormatted: string;\n vatFormatted: string;\n discountFormatted: string | null;\n discountTypeFormatted: string | null;\n priceTaxExcludedFormatted: string | null;\n totalTaxExcludedFormatted: string | null;\n marginVatFormatted: string | null;\n};\n\nexport type ReadVatEditing = {\n id: number;\n name: string;\n amount: number;\n value: number;\n baseFormatted: string;\n amountFormatted: string;\n};\n\nexport type ReadPreview = { idFile: number; };\n\nexport type ReadDocumentEditing = CommercialDocumentInputs & {\n title?: string | null;\n idEstimateInvoiceType: EstimateInvoiceType;\n phoneContact: string | null;\n dueDateFormatted: string | null;\n expirationDateFormatted: string | null;\n capitalFormatted: string | null;\n depositFormatted: string | null;\n emissionDateFormatted: string | null;\n products: ReadProductEditing[];\n vats: ReadVatEditing[];\n totalTaxExcluded: number;\n totalTaxIncluded: number;\n totalTaxAndDiscountIncluded: number;\n generalDiscountFormatted: string | null;\n totalTaxExcludedFormatted: string;\n totalTaxIncludedFormatted: string;\n totalTaxAndDiscountIncludedFormatted: string;\n totalVatAmountFormatted: string;\n font: {\n name: string;\n url: string;\n },\n shouldDisplayDiscountColumn: boolean;\n paymentLink?: string;\n marginVats: string[];\n accountingCategoryFormatted: string | null;\n};\n\nexport type ReadCommercialDocumentTemplate = {\n header: string;\n body: string;\n footer: string;\n data: ReadDocumentEditing;\n};\n\nexport type ReadEstimateInvoiceStatus =\nInvoiceStatus.PAID |\nInvoiceStatus.UNPAID |\nInvoiceStatus.CANCELED |\nInvoiceStatus.WAITING |\nEstimateStatus.REFUSED |\nEstimateStatus.BILLED |\nEstimateStatus.ACCEPTED |\nEstimateStatus.WAITING |\nEstimateStatus.EXPIRED;\n\ntype CountAndNumber = { count: number; amount: number; };\n\nexport type ReadCountDocumentByStatus = {\n invoices: { paid: CountAndNumber; waiting: CountAndNumber; unpaid: CountAndNumber; }\n preSales: { accepted: CountAndNumber; waiting: CountAndNumber; refused: CountAndNumber; }\n};"]}
|
|
1
|
+
{"version":3,"file":"Read.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/api/commercialManagement/Read.ts"],"names":[],"mappings":"","sourcesContent":["import { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';\nimport { IAccountingFile } from '../../models/IAccountingFile';\nimport { IProductInvoice } from '../../models/IProductInvoice';\nimport { ReadFormattedAccountingTransaction } from '../accountingEntry/AnnotateAccountingTransaction';\nimport { CommercialDocumentInputs } from './Create';\nimport { IEstimateInvoice } from '../../models/IEstimateInvoice';\nimport { EstimateStatus, FontIds, InvoiceStatus } from '../../../Enum/CommercialManagement';\n\nexport type ReadCashBasedInvoice = Partial<IAccountingFile>;\n\nexport type ReadAccrualInvoice = Partial<ReadFormattedAccountingTransaction>;\n\nexport type ReadEstimateInvoice = IEstimateInvoice & { id: number };\n\nexport type ReadProductEditing = IProductInvoice & {\n totalTaxExcluded: number;\n unitFormatted: string;\n vatFormatted: string;\n discountFormatted: string | null;\n discountTypeFormatted: string | null;\n priceTaxExcludedFormatted: string | null;\n totalTaxExcludedFormatted: string | null;\n marginVatFormatted: string | null;\n};\n\nexport type ReadVatEditing = {\n id: number;\n name: string;\n amount: number;\n value: number;\n baseFormatted: string;\n amountFormatted: string;\n};\n\nexport type ReadPreview = { idFile: number; };\n\nexport type ReadDocumentEditing = CommercialDocumentInputs & {\n title?: string | null;\n idEstimateInvoiceType: EstimateInvoiceType;\n phoneContact: string | null;\n dueDateFormatted: string | null;\n expirationDateFormatted: string | null;\n capitalFormatted: string | null;\n depositFormatted: string | null;\n emissionDateFormatted: string | null;\n products: ReadProductEditing[];\n vats: ReadVatEditing[];\n totalTaxExcluded: number;\n totalTaxIncluded: number;\n totalTaxAndDiscountIncluded: number;\n generalDiscountFormatted: string | null;\n totalTaxExcludedFormatted: string;\n totalTaxIncludedFormatted: string;\n totalTaxAndDiscountIncludedFormatted: string;\n totalVatAmountFormatted: string;\n font: {\n id: FontIds;\n name: string;\n url: string;\n },\n shouldDisplayDiscountColumn: boolean;\n paymentLink?: string;\n marginVats: string[];\n accountingCategoryFormatted: string | null;\n};\n\nexport type ReadCommercialDocumentTemplate = {\n header: string;\n body: string;\n footer: string;\n data: ReadDocumentEditing;\n};\n\nexport type ReadEstimateInvoiceStatus =\nInvoiceStatus.PAID |\nInvoiceStatus.UNPAID |\nInvoiceStatus.CANCELED |\nInvoiceStatus.WAITING |\nEstimateStatus.REFUSED |\nEstimateStatus.BILLED |\nEstimateStatus.ACCEPTED |\nEstimateStatus.WAITING |\nEstimateStatus.EXPIRED;\n\ntype CountAndNumber = { count: number; amount: number; };\n\nexport type ReadCountDocumentByStatus = {\n invoices: { paid: CountAndNumber; waiting: CountAndNumber; unpaid: CountAndNumber; }\n preSales: { accepted: CountAndNumber; waiting: CountAndNumber; refused: CountAndNumber; }\n};"]}
|
|
@@ -37,6 +37,7 @@ export interface ISocietyGescom {
|
|
|
37
37
|
logoAlignment?: LogoAlignment | null;
|
|
38
38
|
isEdgingDisplayed?: boolean;
|
|
39
39
|
edgingColor?: string;
|
|
40
|
+
fontColor?: string;
|
|
40
41
|
isCoordinatesFrameDisplayed?: boolean;
|
|
41
42
|
areLinesSeparationHidden?: boolean;
|
|
42
43
|
areColumnsSeparationHidden?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISocietyGescom.d.ts","sourceRoot":"","sources":["../../../../ts/types/Interface/models/ISocietyGescom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,i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,IAAI,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,kBAAkB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACjD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACrC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISocietyGescom.js","sourceRoot":"","sources":["../../../../ts/types/Interface/models/ISocietyGescom.ts"],"names":[],"mappings":"","sourcesContent":["import { AccountingCategoryId, FontIds, LogoAlignment } from '../../Enum/CommercialManagement';\n\n// societyGescom\nexport interface ISocietyGescom {\n id?: number;\n capital?: number | null;\n tvaCode?: string | null;\n rcs?: string | null;\n numberTradeDirectory?: string | null;\n bank?: string | null;\n iban?: string | null;\n bic?: string | null;\n mailContact?: string | null;\n phoneContact?: string | null;\n website?: string | null;\n penalties?: string | null;\n discount?: string | null;\n recoveryCost?: string | null;\n vatMention?: string | null;\n generatedBy?: boolean | null;\n bonPour?: boolean | null;\n acceptCheque?: boolean | null;\n mentionAutoent?: boolean | null;\n startInvoice?: number | null;\n startEstimate?: number | null;\n paymentsAccepted?: boolean | null;\n stripePaymentByDefault?: boolean;\n displayLogo?: boolean | null;\n cgv?: string | null;\n invoiceCgv?: boolean | null;\n template?: number | null;\n dayOfValidity?: number | null;\n color?: string | null;\n commercialName?: string | null;\n freeInvoiceText?: string | null;\n freeEstimateText?: string | null;\n accountingCategory?: AccountingCategoryId | null;\n shouldPayTaxAfterDebit?: boolean;\n logoAlignment?: LogoAlignment | null;\n isEdgingDisplayed?: boolean;\n edgingColor?: string;\n isCoordinatesFrameDisplayed?: boolean;\n areLinesSeparationHidden?: boolean;\n areColumnsSeparationHidden?: boolean;\n areExternalBordersHidden?: boolean;\n idFont?: FontIds | null;\n idSociety?: number | null;\n idTvaMargin?: number | null;\n createdAt?: Date | null;\n updatedAt?: Date | null;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ISocietyGescom.js","sourceRoot":"","sources":["../../../../ts/types/Interface/models/ISocietyGescom.ts"],"names":[],"mappings":"","sourcesContent":["import { AccountingCategoryId, FontIds, LogoAlignment } from '../../Enum/CommercialManagement';\n\n// societyGescom\nexport interface ISocietyGescom {\n id?: number;\n capital?: number | null;\n tvaCode?: string | null;\n rcs?: string | null;\n numberTradeDirectory?: string | null;\n bank?: string | null;\n iban?: string | null;\n bic?: string | null;\n mailContact?: string | null;\n phoneContact?: string | null;\n website?: string | null;\n penalties?: string | null;\n discount?: string | null;\n recoveryCost?: string | null;\n vatMention?: string | null;\n generatedBy?: boolean | null;\n bonPour?: boolean | null;\n acceptCheque?: boolean | null;\n mentionAutoent?: boolean | null;\n startInvoice?: number | null;\n startEstimate?: number | null;\n paymentsAccepted?: boolean | null;\n stripePaymentByDefault?: boolean;\n displayLogo?: boolean | null;\n cgv?: string | null;\n invoiceCgv?: boolean | null;\n template?: number | null;\n dayOfValidity?: number | null;\n color?: string | null;\n commercialName?: string | null;\n freeInvoiceText?: string | null;\n freeEstimateText?: string | null;\n accountingCategory?: AccountingCategoryId | null;\n shouldPayTaxAfterDebit?: boolean;\n logoAlignment?: LogoAlignment | null;\n isEdgingDisplayed?: boolean;\n edgingColor?: string;\n fontColor?: string;\n isCoordinatesFrameDisplayed?: boolean;\n areLinesSeparationHidden?: boolean;\n areColumnsSeparationHidden?: boolean;\n areExternalBordersHidden?: boolean;\n idFont?: FontIds | null;\n idSociety?: number | null;\n idTvaMargin?: number | null;\n createdAt?: Date | null;\n updatedAt?: Date | null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAuB,MAAM,qDAAqD,CAAC;
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAuB,MAAM,qDAAqD,CAAC;AAI1H,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAI3E,wBAAgB,0BAA0B,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,GAAG,8BAA8B,CAgD7K;AAED,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,qBAAqB,GAAG,8BAA8B,CA4CtG"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq, } from 'lodash';
|
|
2
2
|
import * as dayjs from 'dayjs';
|
|
3
|
-
import { AccountingCategoryList, fontList, VatMarginCategyList } from '../../types/Enum/CommercialManagement';
|
|
3
|
+
import { AccountingCategoryList, FontIds, fontList, VatMarginCategyList, } from '../../types/Enum/CommercialManagement';
|
|
4
4
|
import { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';
|
|
5
5
|
import { Vat } from '../../types/Enum/Vat';
|
|
6
6
|
import { integerToFormattedAmountString } from '../amount';
|
|
@@ -10,18 +10,19 @@ import { productToReadProductEditing } from './product';
|
|
|
10
10
|
import { vatToReadVatEditing } from './vat';
|
|
11
11
|
const ejs = require('ejs');
|
|
12
12
|
export function generateCommercialDocument(idEstimateInvoiceType, payload) {
|
|
13
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
13
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
|
|
14
14
|
const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));
|
|
15
15
|
const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);
|
|
16
16
|
const data = Object.assign(Object.assign({}, payload), { paymentLink: (_a = payload.paymentLink) !== null && _a !== void 0 ? _a : '#', idEstimateInvoiceType, title: (_b = payload.title) !== null && _b !== void 0 ? _b : null, penalties: (_c = payload.penalties) !== null && _c !== void 0 ? _c : null, compensation: (_d = payload.compensation) !== null && _d !== void 0 ? _d : null, discount: (_e = payload.discount) !== null && _e !== void 0 ? _e : null, vatMention: (_f = payload.vatMention) !== null && _f !== void 0 ? _f : null, phoneContact: (_h = (_g = payload.settings) === null || _g === void 0 ? void 0 : _g.phoneContact) !== null && _h !== void 0 ? _h : null, products,
|
|
17
17
|
vats, totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'), totalTaxIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'), totalTaxAndDiscountIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'), generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null, depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null, totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')), totalTaxIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount')), totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount') - ((_j = payload.generalDiscount2) !== null && _j !== void 0 ? _j : 0) - ((_k = payload.deposit) !== null && _k !== void 0 ? _k : 0)), totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')), font: {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
id: (_m = (_l = payload.settings) === null || _l === void 0 ? void 0 : _l.idFont) !== null && _m !== void 0 ? _m : FontIds.CIRCULAR_STD,
|
|
19
|
+
name: (_p = (_o = fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _o === void 0 ? void 0 : _o.name) !== null && _p !== void 0 ? _p : fontList[0].name,
|
|
20
|
+
url: (_r = (_q = fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _q === void 0 ? void 0 : _q.link) !== null && _r !== void 0 ? _r : fontList[0].link,
|
|
20
21
|
}, capitalFormatted: payload.capital ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : 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),
|
|
21
22
|
// @ts-ignore
|
|
22
|
-
marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (
|
|
23
|
+
marginVats: _uniq(products.filter((p) => p.marginVatFormatted !== null).map((p) => p.marginVatFormatted)), accountingCategoryFormatted: (_t = (_s = AccountingCategoryList.find((a) => a.id === payload.accountingCategory)) === null || _s === void 0 ? void 0 : _s.label) !== null && _t !== void 0 ? _t : null });
|
|
23
24
|
const commonTemplate = new CommercialDocumentCommonHTML();
|
|
24
|
-
const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType) ? (
|
|
25
|
+
const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType) ? (_u = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _u === void 0 ? void 0 : _u.freeEstimateText : (_v = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _v === void 0 ? void 0 : _v.freeInvoiceText;
|
|
25
26
|
return {
|
|
26
27
|
header: ejs.render(commonTemplate.header, data),
|
|
27
28
|
body: ejs.render(bodyTemplate, data),
|
|
@@ -30,20 +31,21 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload) {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
export function generateAdvanceDocument(payload) {
|
|
33
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
34
35
|
if (!payload.deposit)
|
|
35
36
|
throw new Error('Aucun acompte défini');
|
|
36
37
|
const data = Object.assign(Object.assign({}, payload), { title: (_a = payload.title) !== null && _a !== void 0 ? _a : null, paymentLink: (_b = payload.paymentLink) !== null && _b !== void 0 ? _b : '#', idEstimateInvoiceType: EstimateInvoiceType.ACOMPTE, phoneContact: (_d = (_c = payload.settings) === null || _c === void 0 ? void 0 : _c.phoneContact) !== null && _d !== void 0 ? _d : null, products: [], vats: [], totalTaxExcluded: payload.deposit, totalTaxIncluded: payload.deposit, totalTaxAndDiscountIncluded: payload.deposit, generalDiscountFormatted: null, depositFormatted: integerToFormattedAmountString(payload.deposit), totalTaxExcludedFormatted: integerToFormattedAmountString(payload.deposit), totalTaxIncludedFormatted: integerToFormattedAmountString(payload.deposit), totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(payload.deposit), totalVatAmountFormatted: integerToFormattedAmountString(0), font: {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
id: (_f = (_e = payload.settings) === null || _e === void 0 ? void 0 : _e.idFont) !== null && _f !== void 0 ? _f : FontIds.CIRCULAR_STD,
|
|
39
|
+
name: (_h = (_g = fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _g === void 0 ? void 0 : _g.name) !== null && _h !== void 0 ? _h : fontList[0].name,
|
|
40
|
+
url: (_k = (_j = fontList.find((f) => { var _a; return f.id === ((_a = payload.settings) === null || _a === void 0 ? void 0 : _a.idFont); })) === null || _j === void 0 ? void 0 : _j.link) !== null && _k !== void 0 ? _k : fontList[0].link,
|
|
39
41
|
}, capitalFormatted: payload.capital ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : 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: false, disableVat: true,
|
|
40
42
|
// @ts-ignore
|
|
41
|
-
marginVats: _uniq(((
|
|
43
|
+
marginVats: _uniq(((_l = payload.assetMarginVatIds) !== null && _l !== void 0 ? _l : []).map((m) => { var _a, _b; return (_b = (_a = VatMarginCategyList.find((c) => c.id === m)) === null || _a === void 0 ? void 0 : _a.label) !== null && _b !== void 0 ? _b : null; })), accountingCategoryFormatted: (_o = (_m = AccountingCategoryList.find((a) => a.id === payload.accountingCategory)) === null || _m === void 0 ? void 0 : _m.label) !== null && _o !== void 0 ? _o : null });
|
|
42
44
|
const commonTemplate = new CommercialDocumentCommonHTML();
|
|
43
45
|
return {
|
|
44
46
|
header: ejs === null || ejs === void 0 ? void 0 : ejs.render(commonTemplate.header, data),
|
|
45
47
|
body: ejs === null || ejs === void 0 ? void 0 : ejs.render(bodyTemplate, data),
|
|
46
|
-
footer: ejs === null || ejs === void 0 ? void 0 : ejs.render(commonTemplate.footer, Object.assign(Object.assign({}, data), { freeText: (
|
|
48
|
+
footer: ejs === null || ejs === void 0 ? void 0 : ejs.render(commonTemplate.footer, Object.assign(Object.assign({}, data), { freeText: (_q = (_p = payload === null || payload === void 0 ? void 0 : payload.settings) === null || _p === void 0 ? void 0 : _p.freeInvoiceText) !== null && _q !== void 0 ? _q : null })),
|
|
47
49
|
data,
|
|
48
50
|
};
|
|
49
51
|
}
|
|
@@ -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,EAAE,sBAAsB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC9G,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,8BAA8B,EA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MAAA,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,0CAAE,KAAK,mCAAI,IAAI,CAAA,EAAA,CAAC,CAAC,EAC3H,2BAA2B,EAAE,MAAA,MAAA,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,kBAAkB,CAAC,0CAAE,KAAK,mCAAI,IAAI,GACpH,CAAC;IAEF,MAAM,cAAc,GAAG,IAAI,4BAA4B,EAAE,CAAC;IAE1D,OAAO;QACL,MAAM,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC;QAChD,IAAI,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC;QACrC,MAAM,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,cAAc,CAAC,MAAM,kCAAO,IAAI,KAAE,QAAQ,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,0CAAE,eAAe,mCAAI,IAAI,IAAG;QAC7G,IAAI;KACL,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 } from '../../types/Interface/api/commercialManagement/Read';\nimport { AccountingCategoryList, fontList, VatMarginCategyList } from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString } from '../amount';\nimport { CommercialDocumentCommonHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport { CreateInvoiceDocument, CreatePreSaleDocument } from '../../types';\n\nconst ejs = require('ejs');\n\nexport function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument): 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 data: ReadDocumentEditing = {\n ...payload,\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 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 ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : 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 };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType) ? payload?.settings?.freeEstimateText : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, data),\n footer: ejs.render(commonTemplate.footer, { ...data, freeText: documentFreeText ?? null }),\n data,\n };\n}\n\nexport function generateAdvanceDocument(payload: CreateInvoiceDocument): ReadCommercialDocumentTemplate {\n if (!payload.deposit) throw new Error('Aucun acompte défini');\n\n const data: ReadDocumentEditing = {\n ...payload,\n title: payload.title ?? null,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType: EstimateInvoiceType.ACOMPTE,\n phoneContact: payload.settings?.phoneContact ?? null,\n products: [],\n vats: [],\n totalTaxExcluded: payload.deposit,\n totalTaxIncluded: payload.deposit,\n totalTaxAndDiscountIncluded: payload.deposit,\n generalDiscountFormatted: null,\n depositFormatted: integerToFormattedAmountString(payload.deposit),\n totalTaxExcludedFormatted: integerToFormattedAmountString(payload.deposit),\n totalTaxIncludedFormatted: integerToFormattedAmountString(payload.deposit),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(payload.deposit),\n totalVatAmountFormatted: integerToFormattedAmountString(0),\n font: {\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 ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : 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: false,\n disableVat: true,\n // @ts-ignore\n marginVats: _uniq((payload.assetMarginVatIds ?? []).map((m) => VatMarginCategyList.find((c) => c.id === m)?.label ?? null)),\n accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n\n return {\n header: ejs?.render(commonTemplate.header, data),\n body: ejs?.render(bodyTemplate, data),\n footer: ejs?.render(commonTemplate.footer, { ...data, freeText: payload?.settings?.freeInvoiceText ?? null }),\n 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,GACzE,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,sBAAsB,EAAE,OAAO,EAAE,QAAQ,EAAE,mBAAmB,GAC/D,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCA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AY,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EACrG,2BAA2B,EAAE,KAAK,EAClC,UAAU,EAAE,IAAI;QAChB,aAAa;QACb,UAAU,EAAE,KAAK,CAAC,CAAC,MAAA,OAAO,CAAC,iBAAiB,mCAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,eAAC,OAAA,MAAA,MAAA,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,0CAAE,KAAK,mCAAI,IAAI,CAAA,EAAA,CAAC,CAAC,EAC3H,2BAA2B,EAAE,MAAA,MAAA,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,kBAAkB,CAAC,0CAAE,KAAK,mCAAI,IAAI,GACpH,CAAC;IAEF,MAAM,cAAc,GAAG,IAAI,4BAA4B,EAAE,CAAC;IAE1D,OAAO;QACL,MAAM,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC;QAChD,IAAI,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC;QACrC,MAAM,EAAE,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,MAAM,CAAC,cAAc,CAAC,MAAM,kCAAO,IAAI,KAAE,QAAQ,EAAE,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,0CAAE,eAAe,mCAAI,IAAI,IAAG;QAC7G,IAAI;KACL,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 } from '../../types/Interface/api/commercialManagement/Read';\nimport {\n AccountingCategoryList, FontIds, fontList, VatMarginCategyList,\n} from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString } from '../amount';\nimport { CommercialDocumentCommonHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport { CreateInvoiceDocument, CreatePreSaleDocument } from '../../types';\n\nconst ejs = require('ejs');\n\nexport function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument): 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 data: ReadDocumentEditing = {\n ...payload,\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 ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : 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 };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [EstimateInvoiceType.DEVIS, EstimateInvoiceType.BON].includes(idEstimateInvoiceType) ? payload?.settings?.freeEstimateText : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, data),\n footer: ejs.render(commonTemplate.footer, { ...data, freeText: documentFreeText ?? null }),\n data,\n };\n}\n\nexport function generateAdvanceDocument(payload: CreateInvoiceDocument): ReadCommercialDocumentTemplate {\n if (!payload.deposit) throw new Error('Aucun acompte défini');\n\n const data: ReadDocumentEditing = {\n ...payload,\n title: payload.title ?? null,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType: EstimateInvoiceType.ACOMPTE,\n phoneContact: payload.settings?.phoneContact ?? null,\n products: [],\n vats: [],\n totalTaxExcluded: payload.deposit,\n totalTaxIncluded: payload.deposit,\n totalTaxAndDiscountIncluded: payload.deposit,\n generalDiscountFormatted: null,\n depositFormatted: integerToFormattedAmountString(payload.deposit),\n totalTaxExcludedFormatted: integerToFormattedAmountString(payload.deposit),\n totalTaxIncludedFormatted: integerToFormattedAmountString(payload.deposit),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(payload.deposit),\n totalVatAmountFormatted: integerToFormattedAmountString(0),\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 ? `${payload.capital}`.split('').reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '').trim() : 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: false,\n disableVat: true,\n // @ts-ignore\n marginVats: _uniq((payload.assetMarginVatIds ?? []).map((m) => VatMarginCategyList.find((c) => c.id === m)?.label ?? null)),\n accountingCategoryFormatted: AccountingCategoryList.find((a) => a.id === payload.accountingCategory)?.label ?? null,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n\n return {\n header: ejs?.render(commonTemplate.header, data),\n body: ejs?.render(bodyTemplate, data),\n footer: ejs?.render(commonTemplate.footer, { ...data, freeText: payload?.settings?.freeInvoiceText ?? null }),\n data,\n };\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/templates/common.ts"],"names":[],"mappings":"AAGA,qBAAa,4BAA4B;IACvC,MAAM,SAIG;IAET,MAAM,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/templates/common.ts"],"names":[],"mappings":"AAGA,qBAAa,4BAA4B;IACvC,MAAM,SAIG;IAET,MAAM,SAA23C;IAEj4C,IAAI,SAEI;IAER,OAAO,SAMiF;IAExF,QAAQ,SA2CA;IAER,iBAAiB,SAeP;IAEV,oBAAoB,SAiDZ;IAER,aAAa,SAUD;IAEZ,KAAK,SA6HI;CACV"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { EstimateInvoiceType } from '../../../types/Enum/EstimateInvoice';
|
|
2
|
-
import { DiscountType } from '../../../types/Enum/CommercialManagement';
|
|
2
|
+
import { DiscountType, FontIds } from '../../../types/Enum/CommercialManagement';
|
|
3
3
|
export class CommercialDocumentCommonHTML {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.header = `<style>html {
|
|
6
6
|
-webkit-print-color-adjust: exact;
|
|
7
7
|
}</style><% if (settings && settings.isEdgingDisplayed) { %>
|
|
8
|
-
<span id="header-edging" style="position: absolute; top: 0; left: 0; width: 100vw; font-size: 10px; height: 15px; background-color: <%= settings && settings.edgingColor ? settings.edgingColor : '#333333' %>; margin-bottom: 20px;"></span>
|
|
8
|
+
<span id="header-edging" style="position: absolute; top: 0; left: 0; width: 100vw; font-size: 10px !important; height: 15px; background-color: <%= settings && settings.edgingColor ? settings.edgingColor : '#333333' %>; margin-bottom: 20px;"></span>
|
|
9
9
|
<% } %>`;
|
|
10
|
-
this.footer = '<div style="font-size: 8px; color: #838384; text-align: center; padding: 0 40px; display: block; width: 100%;"><% if (freeText) { %><%- freeText %><br/><br/><% } %><% if (accountingCategoryFormatted) {%><%= accountingCategoryFormatted %> | <%}%><% if(marginVats.length > 0) { %>Régime TVA sur marge - <% marginVats.forEach(function(v, index) { %><%= v %> - <% }) %>ART 297-A du CGI ou directive 2006-212 CE | <% } %><% if(penalties || compensation || discount) { %><%= penalties ? \'Pénalités en cas de retard : \' + penalties : \'\'%><%= penalties && compensation ? \' | \' : \'\'%><%= compensation ? \'Indemnité forfaitaire en cas de retard : \' + compensation + \' \' : \'\' %><%= (compensation || penalties) && discount ? \' | \' : \'\' %><%= discount ? discount + \' \' : \'\' %><%= shouldPayTaxAfterDebit ? "| Option pour le paiement de la taxe d\'après les débits" : \'\' %><% if(name || legalForm || capital || siren || rcs) {%><br/><br/><% } %><% } %><%= name %><%= name && (legalForm || capital || siren || rcs) ? \', \' : \'\'%><%= legalForm %><%= capital ? \' au capital de \' + capitalFormatted + \' €\' : \'\' %><%= siren ? \' immatriculée sous le SIREN \' + siren : \'\'%><%= rcs ? \'| RCS \' + rcs : \'\'%><% if (vatCode || nafCode) {%><br/><% } %><%= vatCode ? \'N° TVA \'+vatCode : \'\'%><% if(vatCode && nafCode){%>|<%}%><%= nafCode ? \'APE \'+nafCode : \'\' %></div>';
|
|
10
|
+
this.footer = '<div style="font-size: 8px !important; color: #838384; text-align: center; padding: 0 40px; display: block; width: 100%;"><% if (freeText) { %><%- freeText %><br/><br/><% } %><% if (accountingCategoryFormatted) {%><%= accountingCategoryFormatted %> | <%}%><% if(marginVats.length > 0) { %>Régime TVA sur marge - <% marginVats.forEach(function(v, index) { %><%= v %> - <% }) %>ART 297-A du CGI ou directive 2006-212 CE | <% } %><% if(penalties || compensation || discount) { %><%= penalties ? \'Pénalités en cas de retard : \' + penalties : \'\'%><%= penalties && compensation ? \' | \' : \'\'%><%= compensation ? \'Indemnité forfaitaire en cas de retard : \' + compensation + \' \' : \'\' %><%= (compensation || penalties) && discount ? \' | \' : \'\' %><%= discount ? discount + \' \' : \'\' %><%= shouldPayTaxAfterDebit ? "| Option pour le paiement de la taxe d\'après les débits" : \'\' %><% if(name || legalForm || capital || siren || rcs) {%><br/><br/><% } %><% } %><%= name %><%= name && (legalForm || capital || siren || rcs) ? \', \' : \'\'%><%= legalForm %><%= capital ? \' au capital de \' + capitalFormatted + \' €\' : \'\' %><%= siren ? \' immatriculée sous le SIREN \' + siren : \'\'%><%= rcs ? \'| RCS \' + rcs : \'\'%><% if (vatCode || nafCode) {%><br/><% } %><%= vatCode ? \'N° TVA \'+vatCode : \'\'%><% if(vatCode && nafCode){%>|<%}%><%= nafCode ? \'APE \'+nafCode : \'\' %></div>';
|
|
11
11
|
this.logo = `<div class="logo-placeholder">
|
|
12
12
|
<% if (logoUrl) { %><img src="<%= logoUrl %>" alt="logo" /><% } %>
|
|
13
13
|
</div>`;
|
|
@@ -139,10 +139,80 @@ export class CommercialDocumentCommonHTML {
|
|
|
139
139
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M78.6129 1C77.4206 1 64.7971 1 57.7475 1C57.1513 1 56.5552 1.6 56.5552 2.2V14.2C56.5552 15.4 57.1513 16 58.3436 16C64.9942 16 77.4206 16 78.6129 16C79.8052 16 80.4013 15.4 80.4013 14.2V2.8C80.4013 1.6 79.8052 1 78.6129 1Z" fill="#306FC5"/>
|
|
140
140
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M58.496 7.17857L58.0342 6.04592L57.575 7.17857H58.496ZM68.6703 6.72755C68.5775 6.7842 68.4679 6.78608 68.3365 6.78608H67.5168V6.15502H68.3476C68.4652 6.15502 68.5879 6.16033 68.6676 6.20626C68.7552 6.24765 68.8093 6.33575 68.8093 6.45744C68.8093 6.58161 68.7578 6.68153 68.6703 6.72755C68.7578 6.68153 68.6703 6.72755 68.6703 6.72755ZM74.518 7.17857L74.0511 6.04592L73.5867 7.17857H74.518ZM63.6175 8.40455H62.9257L62.9232 6.17935L61.9448 8.40455H61.3523L60.3713 6.17738V8.40455H58.9989L58.7396 7.77082H57.3347L57.0728 8.40455H56.3399L57.5483 5.56337H58.5508L59.6984 8.25338V5.56337H60.7997L61.6828 7.49077L62.494 5.56337H63.6174V8.40455H63.6175ZM66.3744 8.40455H64.1203V5.56337H66.3744V6.15502H64.7951V6.66714H66.3366V7.24953H64.7951V7.81693H66.3744V8.40455ZM69.5526 6.32855C69.5526 6.78154 69.2522 7.01558 69.0772 7.08585C69.2248 7.14241 69.3509 7.24233 69.411 7.32512C69.5062 7.46643 69.5227 7.59266 69.5227 7.84641V8.40455H68.8421L68.8395 8.04625C68.8395 7.87529 68.8558 7.62942 68.733 7.49274C68.6344 7.39282 68.4841 7.37113 68.2412 7.37113H67.5169V8.40455H66.8422V5.56337H68.3941C68.739 5.56337 68.9931 5.57254 69.2112 5.69945C69.4247 5.82637 69.5526 6.01165 69.5526 6.32855C69.5526 6.01165 69.5526 6.32855 69.5526 6.32855ZM70.6325 8.40455H69.944V5.56337H70.6325V8.40455ZM78.62 8.40455H77.6638L76.3848 6.27208V8.40455H75.0106L74.748 7.77082H73.3463L73.0915 8.40455H72.302C71.974 8.40455 71.5587 8.33153 71.3235 8.0903C71.0864 7.84906 70.963 7.5223 70.963 7.00564C70.963 6.58427 71.0368 6.19906 71.3268 5.89467C71.5449 5.66792 71.8865 5.56337 72.3515 5.56337H73.0048V6.17216H72.3652C72.119 6.17216 71.9799 6.209 71.846 6.34046C71.731 6.4601 71.652 6.68625 71.652 6.98404C71.652 7.28844 71.7121 7.50791 71.8376 7.65128C71.9414 7.76371 72.1302 7.79782 72.3078 7.79782H72.6109L73.5619 5.56345H74.5729L75.7153 8.25081V5.56345H76.7427L77.9288 7.54218V5.56345H78.62V8.40455ZM56.3321 8.9626H57.485L57.745 8.33153H58.3269L58.5862 8.9626H60.8546V8.48013L61.0571 8.96466H62.2347L62.4372 8.47293V8.9626H68.0746L68.0719 7.9267H68.181C68.2574 7.92936 68.2797 7.93647 68.2797 8.06339V8.9626H71.1954V8.72145C71.4306 8.84828 71.7964 8.9626 72.2777 8.9626H73.5043L73.7668 8.33153H74.3488L74.6055 8.9626H76.9693V8.36316L77.3273 8.9626H79.2214V5H77.3468V5.46799L77.0843 5H75.1608V5.46799L74.9197 5H72.3215C71.8865 5 71.5042 5.0611 71.1954 5.23138V5H69.4024V5.23138C69.2058 5.05587 68.9381 5 68.6403 5H62.0897L61.6501 6.02347L61.1988 5H59.1355V5.46799L58.9088 5H57.1492L56.332 6.88404V8.9626H56.3321ZM80.3331 11.0548H79.1033C78.9806 11.0548 78.899 11.0594 78.8303 11.1061C78.7591 11.1521 78.7317 11.2204 78.7317 11.3106C78.7317 11.4178 78.7918 11.4907 78.8792 11.5223C78.9504 11.5472 79.0269 11.5545 79.1393 11.5545L79.505 11.5643C79.874 11.5735 80.1203 11.6374 80.2705 11.7931C80.2979 11.8148 80.3143 11.8391 80.3331 11.8634V11.0548ZM80.3331 12.9284C80.1692 13.1696 79.8498 13.2919 79.4174 13.2919H78.1144V12.6825H79.4122C79.5409 12.6825 79.631 12.6655 79.6852 12.6122C79.7322 12.5682 79.765 12.5043 79.765 12.4268C79.765 12.344 79.7322 12.2783 79.6826 12.2389C79.6336 12.1955 79.5624 12.1758 79.4449 12.1758C78.8113 12.1541 78.0209 12.1955 78.0209 11.2962C78.0209 10.884 78.2809 10.4501 78.989 10.4501H80.333V9.8847H79.0843C78.7074 9.8847 78.4337 9.97553 78.2398 10.1168V9.8847H76.3927C76.0973 9.8847 75.7506 9.95839 75.5866 10.1168V9.8847H72.2882V10.1168C72.0257 9.92617 71.5827 9.8847 71.3783 9.8847H69.2026V10.1168C68.9949 9.91435 68.5331 9.8847 68.2516 9.8847H65.8166L65.2594 10.4916L64.7376 9.8847H61.1003V13.85H64.6691L65.2433 13.2335L65.7841 13.85L67.984 13.852V12.9192H68.2003C68.4921 12.9237 68.8364 12.9119 69.1401 12.7798V13.85H70.9546V12.8165H71.0421C71.1538 12.8165 71.1648 12.8211 71.1648 12.9334V13.8499H76.6769C77.0269 13.8499 77.3926 13.7597 77.5952 13.5961V13.8499H79.3436C79.7075 13.8499 80.0628 13.7985 80.3331 13.6671V12.9284ZM77.6415 11.7931C77.7729 11.9299 77.8433 12.1027 77.8433 12.3952C77.8433 13.0065 77.4638 13.2919 76.7833 13.2919H75.4691V12.6825H76.7781C76.906 12.6825 76.9968 12.6655 77.0537 12.6122C77.1001 12.5682 77.1334 12.5043 77.1334 12.4268C77.1334 12.344 77.0974 12.2783 77.051 12.2389C76.9994 12.1955 76.9283 12.1758 76.8108 12.1758C76.1797 12.1541 75.3895 12.1955 75.3895 11.2962C75.3895 10.884 75.6468 10.4501 76.3542 10.4501H77.7069V11.055H76.4691C76.3464 11.055 76.2667 11.0596 76.1988 11.1063C76.1249 11.1523 76.0975 11.2206 76.0975 11.3108C76.0975 11.418 76.1602 11.4909 76.2451 11.5224C76.3163 11.5474 76.3928 11.5547 76.5077 11.5547L76.871 11.5645C77.2373 11.5735 77.4887 11.6373 77.6415 11.7931C77.4887 11.6373 77.6415 11.7931 77.6415 11.7931ZM71.5528 11.6176C71.4626 11.6715 71.351 11.6761 71.2197 11.6761H70.3999V11.0378H71.2308C71.351 11.0378 71.4712 11.0404 71.5528 11.0892C71.6403 11.1352 71.6926 11.2232 71.6926 11.3448C71.6926 11.4664 71.6403 11.5643 71.5528 11.6176C71.6403 11.5643 71.5528 11.6176 71.5528 11.6176ZM71.9604 11.9712C72.1106 12.027 72.2333 12.127 72.2909 12.2098C72.3862 12.3486 72.4 12.478 72.4027 12.7285V13.2919H71.7253V12.9363C71.7253 12.7654 71.7416 12.5122 71.6162 12.3801C71.5176 12.2783 71.3673 12.2539 71.1211 12.2539H70.4V13.2919H69.722V10.45H71.2799C71.6215 10.45 71.8703 10.4652 72.0917 10.5841C72.3047 10.7136 72.4386 10.891 72.4386 11.2152C72.4385 11.6688 72.138 11.9003 71.9604 11.9712C72.138 11.9003 71.9604 11.9712 71.9604 11.9712ZM72.8128 10.45H75.0648V11.0377H73.4847V11.5544H75.0262V12.1342H73.4847V12.6997L75.0648 12.7022V13.2919H72.8128V10.45ZM68.2602 11.7615H67.3882V11.0378H68.268C68.5116 11.0378 68.6807 11.1377 68.6807 11.3863C68.6807 11.632 68.5195 11.7615 68.2602 11.7615ZM66.7161 13.0334L65.6802 11.8759L66.7161 10.755V13.0334ZM64.0407 12.6997H62.3817V12.1342H63.8631V11.5544H62.3817V11.0377H64.0734L64.8115 11.8659L64.0407 12.6997ZM69.4052 11.3863C69.4052 12.1757 68.82 12.3387 68.2301 12.3387H67.3882V13.2919H66.0767L65.2458 12.3511L64.3823 13.2919H61.7096V10.45H64.4235L65.2537 11.3816L66.1119 10.45H68.268C68.8035 10.45 69.4052 10.5992 69.4052 11.3863C69.4052 10.5992 69.4052 11.3863 69.4052 11.3863Z" fill="white"/>
|
|
141
141
|
</svg></a>`;
|
|
142
|
-
this.style =
|
|
142
|
+
this.style = `
|
|
143
|
+
<% if (font.id === ${FontIds.CIRCULAR_STD}) { %>
|
|
144
|
+
@font-face{font-family:circular std;font-style:normal;font-weight:450;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-Book.woff) format('woff')}@font-face{font-family:circular std;font-style:italic;font-weight:450;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-BookItalic.woff) format('woff')}@font-face{font-family:circular std;font-style:normal;font-weight:500;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-Medium.woff) format('woff')}@font-face{font-family:circular std;font-style:italic;font-weight:500;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-MediumItalic.woff) format('woff')}@font-face{font-family:circular std;font-style:normal;font-weight:700;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-Bold.woff) format('woff')}@font-face{font-family:circular std;font-style:italic;font-weight:700;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-BoldItalic.woff) format('woff')}@font-face{font-family:circular std;font-style:normal;font-weight:900;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-Black.woff) format('woff')}@font-face{font-family:circular std;font-style:italic;font-weight:900;src:local('Circular Std'),url(https://fonts.cdnfonts.com/s/15011/CircularStd-BlackItalic.woff) format('woff')}
|
|
145
|
+
<% } else if (font.id === ${FontIds.ROBOTO}) { %>
|
|
146
|
+
@font-face{font-family:roboto;font-style:normal;font-weight:400;src:local('Roboto'),url(https://fonts.cdnfonts.com/s/12165/Roboto-Regular.woff) format('woff')}@font-face{font-family:roboto;font-style:italic;font-weight:400;src:local('Roboto'),url(https://fonts.cdnfonts.com/s/12165/Roboto-Italic.woff) format('woff')}@font-face{font-family:roboto;font-style:normal;font-weight:700;src:local('Roboto'),url(https://fonts.cdnfonts.com/s/12165/Roboto-Bold.woff) format('woff')}@font-face{font-family:roboto;font-style:italic;font-weight:700;src:local('Roboto'),url(https://fonts.cdnfonts.com/s/12165/Roboto-BoldItalic.woff) format('woff')}@font-face{font-family:roboto thin;font-style:normal;font-weight:250;src:local('Roboto Thin'),url(https://fonts.cdnfonts.com/s/12165/Roboto-Thin.woff) format('woff')}@font-face{font-family:roboto thin;font-style:italic;font-weight:250;src:local('Roboto Thin'),url(https://fonts.cdnfonts.com/s/12165/Roboto-ThinItalic.woff) format('woff')}@font-face{font-family:roboto light;font-style:normal;font-weight:300;src:local('Roboto Light'),url(https://fonts.cdnfonts.com/s/12165/Roboto-Light.woff) format('woff')}@font-face{font-family:roboto light;font-style:italic;font-weight:300;src:local('Roboto Light'),url(https://fonts.cdnfonts.com/s/12165/Roboto-LightItalic.woff) format('woff')}@font-face{font-family:roboto medium;font-style:normal;font-weight:500;src:local('Roboto Medium'),url(https://fonts.cdnfonts.com/s/12165/Roboto-Medium.woff) format('woff')}@font-face{font-family:roboto medium;font-style:italic;font-weight:500;src:local('Roboto Medium'),url(https://fonts.cdnfonts.com/s/12165/Roboto-MediumItalic.woff) format('woff')}@font-face{font-family:roboto black;font-style:normal;font-weight:900;src:local('Roboto Black'),url(https://fonts.cdnfonts.com/s/12165/Roboto-Black.woff) format('woff')}@font-face{font-family:roboto black;font-style:italic;font-weight:900;src:local('Roboto Black'),url(https://fonts.cdnfonts.com/s/12165/Roboto-BlackItalic.woff) format('woff')}
|
|
147
|
+
<% } else if (font.id === ${FontIds.POPPINS}) { %>
|
|
148
|
+
@font-face{font-family:poppins;font-style:normal;font-weight:400;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-Regular.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:400;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-Italic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:250;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-Thin.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:250;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-ThinItalic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:275;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-ExtraLight.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:275;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-ExtraLightItalic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:300;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-Light.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:300;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-LightItalic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:500;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-Medium.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:500;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-MediumItalic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:600;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-SemiBold.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:600;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-SemiBoldItalic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:700;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-Bold.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:700;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-BoldItalic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:800;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-ExtraBold.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:800;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-ExtraBoldItalic.woff) format('woff')}@font-face{font-family:poppins;font-style:normal;font-weight:900;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-Black.woff) format('woff')}@font-face{font-family:poppins;font-style:italic;font-weight:900;src:local('Poppins'),url(https://fonts.cdnfonts.com/s/16009/Poppins-BlackItalic.woff) format('woff')}
|
|
149
|
+
<% } else if (font.id === ${FontIds.RALEWAY}) { %>
|
|
150
|
+
@font-face{font-family:raleway;font-style:normal;font-weight:400;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Regular.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:400;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Regular.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:400;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Italic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:250;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Thin.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:250;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-ThinItalic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:275;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-ExtraLight.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:275;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-ExtraLightItalic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:300;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Light.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:300;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-LightItalic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:500;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Medium.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:500;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-MediumItalic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:600;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-SemiBold.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:600;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-SemiBoldItalic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:700;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Bold.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:700;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-BoldItalic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:800;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-ExtraBold.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:800;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-ExtraBoldItalic.woff) format('woff')}@font-face{font-family:raleway;font-style:normal;font-weight:900;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-Black.woff) format('woff')}@font-face{font-family:raleway;font-style:italic;font-weight:900;src:local('Raleway'),url(https://fonts.cdnfonts.com/s/18954/Raleway-BlackItalic.woff) format('woff')}
|
|
151
|
+
<% } else if (font.id === ${FontIds.ZILLA}) { %>
|
|
152
|
+
@font-face {
|
|
153
|
+
font-family: 'Zilla Slab';
|
|
154
|
+
font-style: normal;
|
|
155
|
+
font-weight: 400;
|
|
156
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-Regular.woff') format('woff');
|
|
157
|
+
}
|
|
158
|
+
@font-face {
|
|
159
|
+
font-family: 'Zilla Slab';
|
|
160
|
+
font-style: italic;
|
|
161
|
+
font-weight: 400;
|
|
162
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-Italic.woff') format('woff');
|
|
163
|
+
}
|
|
164
|
+
@font-face {
|
|
165
|
+
font-family: 'Zilla Slab';
|
|
166
|
+
font-style: normal;
|
|
167
|
+
font-weight: 300;
|
|
168
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-Light.woff') format('woff');
|
|
169
|
+
}
|
|
170
|
+
@font-face {
|
|
171
|
+
font-family: 'Zilla Slab';
|
|
172
|
+
font-style: italic;
|
|
173
|
+
font-weight: 300;
|
|
174
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-LightItalic.woff') format('woff');
|
|
175
|
+
}
|
|
176
|
+
@font-face {
|
|
177
|
+
font-family: 'Zilla Slab';
|
|
178
|
+
font-style: normal;
|
|
179
|
+
font-weight: 500;
|
|
180
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-Medium.woff') format('woff');
|
|
181
|
+
}
|
|
182
|
+
@font-face {
|
|
183
|
+
font-family: 'Zilla Slab';
|
|
184
|
+
font-style: italic;
|
|
185
|
+
font-weight: 500;
|
|
186
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-MediumItalic.woff') format('woff');
|
|
187
|
+
}
|
|
188
|
+
@font-face {
|
|
189
|
+
font-family: 'Zilla Slab';
|
|
190
|
+
font-style: normal;
|
|
191
|
+
font-weight: 600;
|
|
192
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-SemiBold.woff') format('woff');
|
|
193
|
+
}
|
|
194
|
+
@font-face {
|
|
195
|
+
font-family: 'Zilla Slab';
|
|
196
|
+
font-style: italic;
|
|
197
|
+
font-weight: 600;
|
|
198
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-SemiBoldItalic.woff') format('woff');
|
|
199
|
+
}
|
|
200
|
+
@font-face {
|
|
201
|
+
font-family: 'Zilla Slab';
|
|
202
|
+
font-style: normal;
|
|
203
|
+
font-weight: 700;
|
|
204
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-Bold.woff') format('woff');
|
|
205
|
+
}
|
|
206
|
+
@font-face {
|
|
207
|
+
font-family: 'Zilla Slab';
|
|
208
|
+
font-style: italic;
|
|
209
|
+
font-weight: 700;
|
|
210
|
+
src: local('Zilla Slab'), url('https://fonts.cdnfonts.com/s/15572/ZillaSlab-BoldItalic.woff') format('woff');
|
|
211
|
+
}
|
|
212
|
+
<% } %>
|
|
143
213
|
|
|
144
214
|
.pdf-content { padding: 0; margin: 0px; }
|
|
145
|
-
.pdf-content body { width: 100%; margin: 0px; font-family: "<%= font.name %>"; font-size: 12px; font-weight: normal; }
|
|
215
|
+
.pdf-content body { width: 100%; margin: 0px; font-family: "<%= font.name %>"; font-size: 12px !important; font-weight: normal; }
|
|
146
216
|
.pdf-content .row { display: flex; }
|
|
147
217
|
.pdf-content .items-end { align-items: end; }
|
|
148
218
|
.pdf-content .space-between { justify-content: space-between; }
|
|
@@ -161,7 +231,7 @@ export class CommercialDocumentCommonHTML {
|
|
|
161
231
|
.pdf-content .society-informations > div p { font-weight: bold; }
|
|
162
232
|
.pdf-content .logo-placeholder { width: 300px; max-height: 150px;text-align: <%= settings && settings.logoAlignment === 'left' ? 'left' : 'right' %>; margin-bottom: <%= settings && settings.logoAlignment === 'left' ? '10px;' : '0px' %>}
|
|
163
233
|
.pdf-content .logo-placeholder > svg, .pdf-content .logo-placeholder > img { max-width: 100%; max-height: 150px; }
|
|
164
|
-
.pdf-content .document-reference { font-size: 20px; }
|
|
234
|
+
.pdf-content .document-reference { font-size: 20px !important; }
|
|
165
235
|
.pdf-content .customer-border { border: 2px solid #EAEAEA; border-radius: 6px; padding: 7px; }
|
|
166
236
|
|
|
167
237
|
/* Body */
|
|
@@ -169,7 +239,7 @@ export class CommercialDocumentCommonHTML {
|
|
|
169
239
|
.pdf-content table.commercial-table-preview, .pdf-content th, .pdf-content td { border: 1px solid #DADCDF; }
|
|
170
240
|
.pdf-content table.commercial-table-preview tr td p { margin: 0px; }
|
|
171
241
|
.pdf-content table.commercial-table-preview tbody tr td { padding: 7px; background-color: white; vertical-align: baseline;}
|
|
172
|
-
.pdf-content table.commercial-table-preview thead tr td { background-color: <%= settings && settings.color ? settings.color : '#EAEAEA' %>; padding: 7px; }
|
|
242
|
+
.pdf-content table.commercial-table-preview thead tr td { background-color: <%= settings && settings.color ? settings.color : '#EAEAEA' %>; color: <%= settings && settings.fontColor ? settings.fontColor : '#000000' %> !important; padding: 7px; }
|
|
173
243
|
.pdf-content table.commercial-table-preview thead tr td:not(:first-child) { text-align: right; }
|
|
174
244
|
.pdf-content table.commercial-table-preview .product-description { color: #838384 }
|
|
175
245
|
.pdf-content table.commercial-table-preview .product-quantity, .pdf-content table.commercial-table-preview .product-price-without-vat, .pdf-content table.commercial-table-preview .product-vat, .pdf-content table.commercial-table-preview .product-total-price-without-vat,.pdf-content table.commercial-table-preview .product-discount { text-align: right; }
|
|
@@ -180,7 +250,7 @@ export class CommercialDocumentCommonHTML {
|
|
|
180
250
|
.pdf-content table.commercial-table-preview.summary-prices tr td:not(:first-child) {text-align: right;}
|
|
181
251
|
.pdf-content table.commercial-table-preview.summary-prices tr td:first-child {border-right: none;}
|
|
182
252
|
.pdf-content table.commercial-table-preview .discount-percent { color: #838384; font-size: smaller }
|
|
183
|
-
.pdf-content a.payment-button { margin-left: 40px; display: flex; align-items: center; background-color: #EBF1FF; border-radius: 10px; font-weight: 450; font-size: 12px; color: #1656FF; border: none; padding: 8px 14px; text-decoration: none; }
|
|
253
|
+
.pdf-content a.payment-button { margin-left: 40px; display: flex; align-items: center; background-color: #EBF1FF; border-radius: 10px; font-weight: 450; font-size: 12px !important; color: #1656FF; border: none; padding: 8px 14px; text-decoration: none; }
|
|
184
254
|
.pdf-content a.payment-button svg { margin-left: 15px; }
|
|
185
255
|
<% if (settings && settings.areLinesSeparationHidden) { %>
|
|
186
256
|
.pdf-content td { border-top: none !important; border-bottom: none !important; }
|