@silexpert/core 1.1.400 → 1.1.402
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/types/Enum/CommercialManagement.d.ts +4 -0
- package/dist/cjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/cjs/types/Enum/CommercialManagement.js +6 -1
- package/dist/cjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/cjs/types/Interface/api/PaymentRecovery/Create.d.ts +1 -1
- package/dist/cjs/types/Interface/api/PaymentRecovery/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/PaymentRecovery/Create.js +3 -3
- package/dist/cjs/types/Interface/api/PaymentRecovery/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/PaymentRecovery/Read.d.ts +3 -0
- package/dist/cjs/types/Interface/api/PaymentRecovery/Read.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/PaymentRecovery/Read.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +4 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Read.d.ts +2 -0
- package/dist/cjs/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/dist/cjs/types/Interface/models/IBankAccount.d.ts +0 -1
- package/dist/cjs/types/Interface/models/IBankAccount.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IBankAccount.js.map +1 -1
- package/dist/cjs/types/Interface/models/IEstimateInvoice.d.ts +2 -1
- package/dist/cjs/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
- package/dist/cjs/types/Interface/models/IEstimateInvoice.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.js +18 -12
- package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts +3 -0
- package/dist/cjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -0
- package/dist/cjs/utils/commercialManagement/internationalization/choices.js +417 -0
- package/dist/cjs/utils/commercialManagement/internationalization/choices.js.map +1 -0
- package/dist/cjs/utils/commercialManagement/internationalization/type.d.ts +144 -0
- package/dist/cjs/utils/commercialManagement/internationalization/type.d.ts.map +1 -0
- package/dist/cjs/utils/commercialManagement/internationalization/type.js +3 -0
- package/dist/cjs/utils/commercialManagement/internationalization/type.js.map +1 -0
- package/dist/cjs/utils/commercialManagement/templates/body.js +15 -15
- package/dist/cjs/utils/commercialManagement/templates/body.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/templates/common.js +37 -37
- package/dist/cjs/utils/commercialManagement/templates/common.js.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.d.ts +4 -0
- package/dist/mjs/types/Enum/CommercialManagement.d.ts.map +1 -1
- package/dist/mjs/types/Enum/CommercialManagement.js +5 -0
- package/dist/mjs/types/Enum/CommercialManagement.js.map +1 -1
- package/dist/mjs/types/Interface/api/PaymentRecovery/Create.d.ts +1 -1
- package/dist/mjs/types/Interface/api/PaymentRecovery/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/PaymentRecovery/Create.js +3 -3
- package/dist/mjs/types/Interface/api/PaymentRecovery/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/PaymentRecovery/Read.d.ts +3 -0
- package/dist/mjs/types/Interface/api/PaymentRecovery/Read.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/PaymentRecovery/Read.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +4 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js +2 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Read.d.ts +2 -0
- package/dist/mjs/types/Interface/api/commercialManagement/Read.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Read.js.map +1 -1
- package/dist/mjs/types/Interface/models/IBankAccount.d.ts +0 -1
- package/dist/mjs/types/Interface/models/IBankAccount.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IBankAccount.js.map +1 -1
- package/dist/mjs/types/Interface/models/IEstimateInvoice.d.ts +2 -1
- package/dist/mjs/types/Interface/models/IEstimateInvoice.d.ts.map +1 -1
- package/dist/mjs/types/Interface/models/IEstimateInvoice.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.js +8 -1
- package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts +3 -0
- package/dist/mjs/utils/commercialManagement/internationalization/choices.d.ts.map +1 -0
- package/dist/mjs/utils/commercialManagement/internationalization/choices.js +414 -0
- package/dist/mjs/utils/commercialManagement/internationalization/choices.js.map +1 -0
- package/dist/mjs/utils/commercialManagement/internationalization/type.d.ts +144 -0
- package/dist/mjs/utils/commercialManagement/internationalization/type.d.ts.map +1 -0
- package/dist/mjs/utils/commercialManagement/internationalization/type.js +2 -0
- package/dist/mjs/utils/commercialManagement/internationalization/type.js.map +1 -0
- package/dist/mjs/utils/commercialManagement/templates/body.js +15 -15
- package/dist/mjs/utils/commercialManagement/templates/body.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/templates/common.js +37 -37
- package/dist/mjs/utils/commercialManagement/templates/common.js.map +1 -1
- package/package.json +1 -1
- package/ts/types/Enum/CommercialManagement.ts +6 -1
- package/ts/types/Interface/api/PaymentRecovery/Create.ts +3 -3
- package/ts/types/Interface/api/PaymentRecovery/Read.ts +1 -0
- package/ts/types/Interface/api/commercialManagement/Create.ts +4 -1
- package/ts/types/Interface/api/commercialManagement/Read.ts +2 -0
- package/ts/types/Interface/models/IBankAccount.ts +0 -1
- package/ts/types/Interface/models/IEstimateInvoice.ts +2 -1
- package/ts/utils/commercialManagement/document.ts +10 -0
- package/ts/utils/commercialManagement/internationalization/choices.ts +421 -0
- package/ts/utils/commercialManagement/internationalization/type.ts +156 -0
- package/ts/utils/commercialManagement/templates/body.ts +15 -15
- package/ts/utils/commercialManagement/templates/common.ts +37 -37
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Read.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/PaymentRecovery/Read.ts"],"names":[],"mappings":"","sourcesContent":["import { PaymentRecoveryStatus } from '../../../Enum/PaymentRecovery';\nimport { IFile } from '../../models/IFile';\nimport { IThirdParty } from '../../models/IThirdParty';\nimport { CaarlEvent } from './Caarl';\n\nexport interface ReadPaymentRecoveryClaim {\n status: PaymentRecoveryStatus;\n type: string;\n events: CaarlEvent[];\n iban: string;\n debtor: {\n firstname: string;\n lastname: string;\n email: string;\n phone: string;\n address: string;\n zipCode: string;\n city: string;\n };\n}\n\nexport interface ReadPaymentRecovery {\n id: number;\n status: PaymentRecoveryStatus;\n externalId: string;\n thirdParty: IThirdParty;\n invoice: {\n file: IFile;\n amountTotalTaxIncluded: number;\n amountTotalTaxExcluded: number;\n title: string;\n reference: string;\n };\n lastSync: Date | null;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface ReadPaymentRecoveryStatistic {\n recovered: {\n count: number;\n amount: number;\n };\n waiting: {\n count: number;\n amount: number;\n };\n notRecovered: {\n count: number;\n amount: number;\n };\n}"]}
|
|
1
|
+
{"version":3,"file":"Read.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/PaymentRecovery/Read.ts"],"names":[],"mappings":"","sourcesContent":["import { PaymentRecoveryStatus } from '../../../Enum/PaymentRecovery';\nimport { IFile } from '../../models/IFile';\nimport { IThirdParty } from '../../models/IThirdParty';\nimport { CaarlEvent } from './Caarl';\n\nexport interface ReadPaymentRecoveryClaim {\n status: PaymentRecoveryStatus;\n type: string;\n events: CaarlEvent[];\n iban: string;\n debtor: {\n firstname: string;\n lastname: string;\n email: string;\n phone: string;\n address: string;\n zipCode: string;\n city: string;\n };\n}\n\nexport interface ReadPaymentRecovery {\n id: number;\n status: PaymentRecoveryStatus;\n externalId: string;\n thirdParty: IThirdParty;\n invoice: {\n file: IFile;\n amountTotalTaxIncluded: number;\n amountTotalTaxExcluded: number;\n title: string;\n reference: string;\n };\n metadata: { askCertificate?: Date; } | null;\n lastSync: Date | null;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport interface ReadPaymentRecoveryStatistic {\n recovered: {\n count: number;\n amount: number;\n };\n waiting: {\n count: number;\n amount: number;\n };\n notRecovered: {\n count: number;\n amount: number;\n };\n}"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IFile, ReadProductEditing } from '../../..';
|
|
2
|
-
import { AccountingCategoryId, FontIds, LogoAlignment } from '../../../Enum/CommercialManagement';
|
|
2
|
+
import { AccountingCategoryId, FontIds, InvoiceLanguage, LogoAlignment } from '../../../Enum/CommercialManagement';
|
|
3
3
|
import { EstimateInvoiceType } from '../../../Enum/EstimateInvoice';
|
|
4
4
|
import { IProductInvoice } from '../../models/IProductInvoice';
|
|
5
5
|
import { ISocietyGescom } from '../../models/ISocietyGescom';
|
|
@@ -113,6 +113,7 @@ export declare class CreatePreSaleDocument extends CommercialDocumentInputs {
|
|
|
113
113
|
fromEstimateId: undefined;
|
|
114
114
|
assetMarginVatIds?: [];
|
|
115
115
|
advanceProducts?: [];
|
|
116
|
+
language?: InvoiceLanguage;
|
|
116
117
|
}
|
|
117
118
|
export declare class CreateInvoiceDocument extends CommercialDocumentInputs {
|
|
118
119
|
paymentLink?: string;
|
|
@@ -121,6 +122,7 @@ export declare class CreateInvoiceDocument extends CommercialDocumentInputs {
|
|
|
121
122
|
fromEstimateId: number | null;
|
|
122
123
|
assetMarginVatIds?: number[];
|
|
123
124
|
advanceProducts?: ReadProductEditing[];
|
|
125
|
+
language?: InvoiceLanguage;
|
|
124
126
|
}
|
|
125
127
|
export declare class CreateCgv {
|
|
126
128
|
cgv: string | null;
|
|
@@ -153,6 +155,7 @@ export type CreateMailHeader = {
|
|
|
153
155
|
totalTaxExcluded: number;
|
|
154
156
|
totalTaxIncluded: number;
|
|
155
157
|
file?: IFile;
|
|
158
|
+
language: InvoiceLanguage;
|
|
156
159
|
};
|
|
157
160
|
logoUrl: string | null;
|
|
158
161
|
companyName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/commercialManagement/Create.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"Create.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/commercialManagement/Create.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAGrD,OAAO,EAAE,oBAAoB,EAAE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnH,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,MAAM,MAAM,uBAAuB,GAAG,eAAe,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE3E,qBAAa,uBAAuB;IAOhC,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAKxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI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;CACrB;AAED,qBAAa,wBAAwB;IAGjC,KAAK,EAAE,MAAM,CAAC;IAId,SAAS,EAAE,MAAM,CAAC;IAIlB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;QACrB,qBAAqB,EAAE,mBAAmB,CAAC;QAC3C,gBAAgB,EAAE,MAAM,CAAC;QACzB,gBAAgB,EAAE,MAAM,CAAC;QACzB,IAAI,CAAC,EAAE,KAAK,CAAA;QACZ,QAAQ,EAAE,eAAe,CAAA;KAC1B,CAAC;IACF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAA;CAChB,CAAC"}
|
|
@@ -621,6 +621,7 @@ export class CreatePreSaleDocument extends CommercialDocumentInputs {
|
|
|
621
621
|
fromEstimateId;
|
|
622
622
|
assetMarginVatIds;
|
|
623
623
|
advanceProducts;
|
|
624
|
+
language;
|
|
624
625
|
}
|
|
625
626
|
export class CreateInvoiceDocument extends CommercialDocumentInputs {
|
|
626
627
|
paymentLink;
|
|
@@ -629,6 +630,7 @@ export class CreateInvoiceDocument extends CommercialDocumentInputs {
|
|
|
629
630
|
fromEstimateId; // Nécessaire lors du passage d'un devis à facture
|
|
630
631
|
assetMarginVatIds; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes
|
|
631
632
|
advanceProducts; // Laisser vide côté front, utilisé pour l'affichage des bases TVA sur les acomptes
|
|
633
|
+
language;
|
|
632
634
|
}
|
|
633
635
|
export class CreateCgv {
|
|
634
636
|
cgv;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Create.js","sourceRoot":"","sources":["../../../../../../ts/types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;;8CACR;AAIb;IAFD,WAAW,EAAE;IACb,YAAY,EAAE;;mDACK;AAIlB;IAFD,WAAW,EAAE;IACb,YAAY,EAAE;;iDACG;AAKhB;IAHD,WAAW,EAAE;IACb,SAAS,EAAE;IACX,SAAS,EAAE;;kDACQ;AAGtB,MAAM,OAAO,wBAAwB;IAGjC,KAAK,CAAS;IAId,SAAS,CAAS;IAIlB,KAAK,CAAS;CACjB;AATG;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;uDACK;AAId;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;2DACS;AAIlB;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;uDACK","sourcesContent":["import {\n IsArray, IsBoolean, IsDateString, IsEnum, IsNumber, IsOptional, IsString, Min,\n} from 'class-validator';\nimport { IFile, ReadProductEditing } from '../../..';\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 @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideEmailHeader?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideBrandName?: boolean;\n\n \n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n customerBlockBorderThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n customerBlockBorderColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n lineSeparationThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n lineSeparationType?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n lineSeparationColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n columnSeparationThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n columnSeparationType?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n columnSeparationColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n externalBorderThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n externalBorderType?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n externalBorderColor?: string;\n\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 @ApiPropertyOptional({ description: 'Remise globale' })\n generalDiscount2: number | null;\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 @ApiPropertyOptional({ description: 'Moyen de paiement' })\n paymentType?: string | null;\n}\n\nexport class CreatePreSaleDocument extends CommercialDocumentInputs {\n paymentLink?: '#';\n deposit?: undefined;\n fromEstimateId: undefined;\n assetMarginVatIds?: [];\n advanceProducts?: [];\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 advanceProducts?: ReadProductEditing[]; // Laisser vide côté front, utilisé pour l'affichage des bases TVA 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}\n\nexport class CreateRegenerateDocument {\n @ApiProperty()\n @IsString()\n label: string;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n @IsString()\n title: string;\n}\n\nexport type CreateMailHeader = {\n payload: {\n reference: string,\n dueDate: Date | null,\n idEstimateInvoiceType: EstimateInvoiceType,\n totalTaxExcluded: number,\n totalTaxIncluded: number,\n file?: IFile\n },\n logoUrl: string | null,\n companyName: string,\n fileUrl: string | null,\n hostS3: string,\n hasVat: 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;AAEzB,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAA2C,MAAM,oCAAoC,CA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AAId;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;2DACS;AAIlB;IAFD,WAAW,EAAE;IACb,QAAQ,EAAE;;uDACK","sourcesContent":["import {\n IsArray, IsBoolean, IsDateString, IsEnum, IsNumber, IsOptional, IsString, Min,\n} from 'class-validator';\nimport { IFile, ReadProductEditing } from '../../..';\nimport { ApiProperty, ApiPropertyOptional } from '../../../../utils';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\nimport { AccountingCategoryId, FontIds, InvoiceLanguage, 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 @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideEmailHeader?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n shouldHideBrandName?: boolean;\n\n \n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n customerBlockBorderThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n customerBlockBorderColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n lineSeparationThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n lineSeparationType?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n lineSeparationColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n columnSeparationThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n columnSeparationType?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n columnSeparationColor?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsNumber()\n externalBorderThickness?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n externalBorderType?: string;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n externalBorderColor?: string;\n\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 @ApiPropertyOptional({ description: 'Remise globale' })\n generalDiscount2: number | null;\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 @ApiPropertyOptional({ description: 'Moyen de paiement' })\n paymentType?: string | null;\n}\n\nexport class CreatePreSaleDocument extends CommercialDocumentInputs {\n paymentLink?: '#';\n deposit?: undefined;\n fromEstimateId: undefined;\n assetMarginVatIds?: [];\n advanceProducts?: [];\n language?: InvoiceLanguage; \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 advanceProducts?: ReadProductEditing[]; // Laisser vide côté front, utilisé pour l'affichage des bases TVA sur les acomptes\n language?: InvoiceLanguage; \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}\n\nexport class CreateRegenerateDocument {\n @ApiProperty()\n @IsString()\n label: string;\n\n @ApiProperty()\n @IsString()\n reference: string;\n\n @ApiProperty()\n @IsString()\n title: string;\n}\n\nexport type CreateMailHeader = {\n payload: {\n reference: string,\n dueDate: Date | null,\n idEstimateInvoiceType: EstimateInvoiceType,\n totalTaxExcluded: number,\n totalTaxIncluded: number,\n file?: IFile\n language: InvoiceLanguage\n },\n logoUrl: string | null,\n companyName: string,\n fileUrl: string | null,\n hostS3: string,\n hasVat: boolean\n};"]}
|
|
@@ -6,6 +6,7 @@ import { CommercialDocumentInputs } from './Create';
|
|
|
6
6
|
import { IEstimateInvoice } from '../../models/IEstimateInvoice';
|
|
7
7
|
import { EstimateStatus, FontIds, InvoiceStatus } from '../../../Enum/CommercialManagement';
|
|
8
8
|
import { IThirdParty } from '../../models/IThirdParty';
|
|
9
|
+
import { InternationalizationChoices } from '../../../../utils/commercialManagement/internationalization/type';
|
|
9
10
|
export type ReadCashBasedInvoice = Partial<IAccountingFile>;
|
|
10
11
|
export type ReadAccrualInvoice = Partial<ReadFormattedAccountingTransaction>;
|
|
11
12
|
export type ReadEstimateInvoice = IEstimateInvoice & {
|
|
@@ -66,6 +67,7 @@ export type ReadDocumentEditing = CommercialDocumentInputs & {
|
|
|
66
67
|
paymentLink?: string;
|
|
67
68
|
marginVats: string[];
|
|
68
69
|
accountingCategoryFormatted: string | null;
|
|
70
|
+
languageTemplate: InternationalizationChoices;
|
|
69
71
|
};
|
|
70
72
|
export type ReadCommercialDocumentTemplate = {
|
|
71
73
|
header: string;
|
|
@@ -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,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,kDAAkD,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;
|
|
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,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,kCAAkC,EAAE,MAAM,kDAAkD,CAAC;AACtG,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kEAAkE,CAAC;AAE/G,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAA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,CAAC;AAEvB,KAAK,cAAc,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;CAAE,CAAC;AAEzD,MAAM,MAAM,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;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,MAAM,EAAE,MAAM,CAAC;CAChB,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, FontIds, InvoiceStatus } from '../../../Enum/CommercialManagement';\nimport { IThirdParty } from '../../models/IThirdParty';\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 ReadThirdPartyEditing = IThirdParty & {\n deliveryCountry: string | null;\n country: 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 toPay: number;\n base: number;\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};\n\nexport type ReadCommercialMailTemplate = {\n header: string;\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';\nimport { IThirdParty } from '../../models/IThirdParty';\nimport { InternationalizationChoices } from '../../../../utils/commercialManagement/internationalization/type';\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 ReadThirdPartyEditing = IThirdParty & {\n deliveryCountry: string | null;\n country: 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 toPay: number;\n base: number;\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 languageTemplate: InternationalizationChoices\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};\n\nexport type ReadCommercialMailTemplate = {\n header: string;\n};"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBankAccount.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankAccount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAGvD,MAAM,WAAW,Y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AE,IAAI,GAAG,IAAI,CAAC;IACxB,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGxB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,cAAc,CAAC,EAAE,eAAe,CAAC;IACjC,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mBAAmB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC5C,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;IAC5B,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;CAC5C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBankAccount.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankAccount.ts"],"names":[],"mappings":"","sourcesContent":["import { ICurrency } from './ICurrency';\nimport { ISociety } from './ISociety';\nimport { IBankConnection } from './IBankConnection';\nimport { IAccount } from './IAccount';\nimport { IBankList } from './IBankList';\nimport { IBalanceBankAccount } from './IBalanceBankAccount';\nimport { ISimulation } from './ISimulation';\nimport { IUpToDateBankAccount } from './IUpToDateBankAccount';\nimport { StateSynchro } from '../../Enum/StateSynchro';\n\n// bankAccounts\nexport interface IBankAccount {\n id?: number;\n name: string | null;\n typeBankAccount: number;\n iban: string | null;\n identifierOb: string | null;\n budgeaUserId: number | null;\n budgeaAccountId: number | null;\n startImport: Date | null;\n activated: boolean;\n pcgExtension: number | null;\n lastUpdate?: Date | null;\n lastTryImport?: Date | null;\n notSynchroModaleLastDisplayDate?: Date | null;\n firstSynchroModaleDisplay?: boolean | null;\n disabledAt?: Date | null;\n inProgressImport: Date | null;\n amountStart: number | null;\n
|
|
1
|
+
{"version":3,"file":"IBankAccount.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IBankAccount.ts"],"names":[],"mappings":"","sourcesContent":["import { ICurrency } from './ICurrency';\nimport { ISociety } from './ISociety';\nimport { IBankConnection } from './IBankConnection';\nimport { IAccount } from './IAccount';\nimport { IBankList } from './IBankList';\nimport { IBalanceBankAccount } from './IBalanceBankAccount';\nimport { ISimulation } from './ISimulation';\nimport { IUpToDateBankAccount } from './IUpToDateBankAccount';\nimport { StateSynchro } from '../../Enum/StateSynchro';\n\n// bankAccounts\nexport interface IBankAccount {\n id?: number;\n name: string | null;\n typeBankAccount: number;\n iban: string | null;\n identifierOb: string | null;\n budgeaUserId: number | null;\n budgeaAccountId: number | null;\n startImport: Date | null;\n activated: boolean;\n pcgExtension: number | null;\n lastUpdate?: Date | null;\n lastTryImport?: Date | null;\n notSynchroModaleLastDisplayDate?: Date | null;\n firstSynchroModaleDisplay?: boolean | null;\n disabledAt?: Date | null;\n inProgressImport: Date | null;\n amountStart: number | null;\n dateStart: Date | null;\n errorCode: string | null;\n idPartnerType: number | null;\n idAccount: number | null;\n idBankList: number | null;\n idCurrency: number | null;\n idSociety: number;\n idBankConnection: number | null;\n synchronizationState?: StateSynchro | null;\n createdAt?: Date | null;\n updatedAt?: Date | null;\n\n // Associations\n currency?: ICurrency;\n society?: ISociety;\n bankConnection?: IBankConnection;\n account?: IAccount;\n bankList?: IBankList;\n balanceBankAccounts?: IBalanceBankAccount[];\n simulations?: ISimulation[];\n upToDateBankAccount?: IUpToDateBankAccount;\n}\n"]}
|
|
@@ -8,7 +8,7 @@ import { IInvoiceReminder } from './IInvoiceReminder';
|
|
|
8
8
|
import { IFile } from './IFile';
|
|
9
9
|
import { IInvoiceRecurrence } from './IInvoiceRecurrence';
|
|
10
10
|
import { ReadEstimateInvoiceStatus } from '../api/commercialManagement/Read';
|
|
11
|
-
import { AccountingCategoryId } from '../../Enum/CommercialManagement';
|
|
11
|
+
import { AccountingCategoryId, InvoiceLanguage } from '../../Enum/CommercialManagement';
|
|
12
12
|
export interface IEstimateInvoice {
|
|
13
13
|
id?: number;
|
|
14
14
|
label: string | null;
|
|
@@ -42,6 +42,7 @@ export interface IEstimateInvoice {
|
|
|
42
42
|
status?: ReadEstimateInvoiceStatus;
|
|
43
43
|
accountingCategory: AccountingCategoryId;
|
|
44
44
|
shouldPayTaxAfterDebit: boolean;
|
|
45
|
+
language: InvoiceLanguage;
|
|
45
46
|
idFile?: number | null;
|
|
46
47
|
idRelatedInvoice: number | null;
|
|
47
48
|
idEstimateInvoiceType: number | number[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEstimateInvoice.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IEstimateInvoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"IEstimateInvoice.d.ts","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IEstimateInvoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,E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CAAC,EAAE,gBAAgB,CAAC;IAC5B,cAAc,CAAC,EAAE,gBAAgB,CAAC;IAClC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,IAAI,CAAC,EAAE,KAAK,CAAC;CACd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IEstimateInvoice.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IEstimateInvoice.ts"],"names":[],"mappings":"","sourcesContent":["import { IProductInvoice } from './IProductInvoice';\nimport { IPaymentExpectationCustomer } from './IPaymentExpectationCustomer';\nimport { IThirdParty } from './IThirdParty';\nimport { IFrequency } from './IFrequency';\nimport { IEstimateInvoiceType } from './IEstimateInvoiceType';\nimport { ISociety } from './ISociety';\nimport { IInvoiceReminder } from './IInvoiceReminder';\nimport { IFile } from './IFile';\nimport { IInvoiceRecurrence } from './IInvoiceRecurrence';\nimport { ReadEstimateInvoiceStatus } from '../api/commercialManagement/Read';\nimport { AccountingCategoryId } from '../../Enum/CommercialManagement';\n\n// estimatesInvoices\nexport interface IEstimateInvoice {\n id?: number;\n label: string | null;\n payment: string | null;\n reference: string | null;\n depositAmount: number;\n totalTaxExcluded: number;\n totalTaxIncluded: number;\n isDraft: boolean;\n dueDate: Date | null;\n expirationDate: Date | null;\n emissionDate: Date | null;\n acceptationDate: Date | null;\n mailSent: Date | null;\n isPaid?: boolean;\n isUsed: boolean;\n isStripe: boolean;\n lastTryRepeat: Date | null;\n penalties: string | null;\n discount: string | null;\n recoveryCost: string | null;\n vatMention: string | null;\n freeText: string | null;\n greetings: boolean;\n paymentType: string | null;\n generalComment: string | null;\n generalDiscount2: number | null;\n lastRelanceDate: Date | null;\n isRefused: boolean;\n isCanceled: boolean;\n status?: ReadEstimateInvoiceStatus;\n accountingCategory: AccountingCategoryId;\n shouldPayTaxAfterDebit: boolean;\n idFile?: number | null;\n idRelatedInvoice: number | null;\n idEstimateInvoiceType: number | number[];\n idFrequency: number | null;\n idSociety: number;\n idThirdParty: number;\n idEstimateInvoiceForThisRepeat: number | null;\n createdAt?: Date | null;\n updatedAt?: Date | null;\n deletedAt?: Date | null;\n\n // Associations\n products?: IProductInvoice[];\n thirdParty?: IThirdParty;\n frequency?: IFrequency;\n type?: IEstimateInvoiceType;\n customerPayment?: IPaymentExpectationCustomer;\n society?: ISociety;\n assetRelatedToThisEstimateInvoice?: IEstimateInvoice;\n estimateInvoiceForThisAsset?: IEstimateInvoice;\n estimateInvoiceForThisRepeat?: IEstimateInvoice;\n reminder?: IInvoiceReminder;\n relatedInvoice?: IEstimateInvoice;\n recurrence?: IInvoiceRecurrence;\n file?: IFile;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IEstimateInvoice.js","sourceRoot":"","sources":["../../../../../ts/types/Interface/models/IEstimateInvoice.ts"],"names":[],"mappings":"","sourcesContent":["import { IProductInvoice } from './IProductInvoice';\nimport { IPaymentExpectationCustomer } from './IPaymentExpectationCustomer';\nimport { IThirdParty } from './IThirdParty';\nimport { IFrequency } from './IFrequency';\nimport { IEstimateInvoiceType } from './IEstimateInvoiceType';\nimport { ISociety } from './ISociety';\nimport { IInvoiceReminder } from './IInvoiceReminder';\nimport { IFile } from './IFile';\nimport { IInvoiceRecurrence } from './IInvoiceRecurrence';\nimport { ReadEstimateInvoiceStatus } from '../api/commercialManagement/Read';\nimport { AccountingCategoryId, InvoiceLanguage } from '../../Enum/CommercialManagement';\n\n// estimatesInvoices\nexport interface IEstimateInvoice {\n id?: number;\n label: string | null;\n payment: string | null;\n reference: string | null;\n depositAmount: number;\n totalTaxExcluded: number;\n totalTaxIncluded: number;\n isDraft: boolean;\n dueDate: Date | null;\n expirationDate: Date | null;\n emissionDate: Date | null;\n acceptationDate: Date | null;\n mailSent: Date | null;\n isPaid?: boolean;\n isUsed: boolean;\n isStripe: boolean;\n lastTryRepeat: Date | null;\n penalties: string | null;\n discount: string | null;\n recoveryCost: string | null;\n vatMention: string | null;\n freeText: string | null;\n greetings: boolean;\n paymentType: string | null;\n generalComment: string | null;\n generalDiscount2: number | null;\n lastRelanceDate: Date | null;\n isRefused: boolean;\n isCanceled: boolean;\n status?: ReadEstimateInvoiceStatus;\n accountingCategory: AccountingCategoryId;\n shouldPayTaxAfterDebit: boolean;\n language: InvoiceLanguage;\n idFile?: number | null;\n idRelatedInvoice: number | null;\n idEstimateInvoiceType: number | number[];\n idFrequency: number | null;\n idSociety: number;\n idThirdParty: number;\n idEstimateInvoiceForThisRepeat: number | null;\n createdAt?: Date | null;\n updatedAt?: Date | null;\n deletedAt?: Date | null;\n\n // Associations\n products?: IProductInvoice[];\n thirdParty?: IThirdParty;\n frequency?: IFrequency;\n type?: IEstimateInvoiceType;\n customerPayment?: IPaymentExpectationCustomer;\n society?: ISociety;\n assetRelatedToThisEstimateInvoice?: IEstimateInvoice;\n estimateInvoiceForThisAsset?: IEstimateInvoice;\n estimateInvoiceForThisRepeat?: IEstimateInvoice;\n reminder?: IInvoiceReminder;\n relatedInvoice?: IEstimateInvoice;\n recurrence?: IInvoiceRecurrence;\n file?: IFile;\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;
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAuC,MAAM,qDAAqD,CAAC;AAK1I,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,0BAA0B,EAC3F,MAAM,aAAa,CAAC;AAiBrB,wBAAgB,0BAA0B,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,8BAA8B,CAiHnP;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,0BAA0B,CA0B7J"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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
|
-
import { AccountingCategoryList, FontIds, fontList, } from '../../types/Enum/CommercialManagement';
|
|
3
|
+
import { AccountingCategoryList, FontIds, fontList, InvoiceLanguage, } from '../../types/Enum/CommercialManagement';
|
|
4
4
|
import { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';
|
|
5
5
|
import { Vat } from '../../types/Enum/Vat';
|
|
6
6
|
import { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';
|
|
@@ -10,6 +10,7 @@ import { productToReadProductEditing } from './product';
|
|
|
10
10
|
import { vatToReadVatEditing } from './vat';
|
|
11
11
|
import { thirdPartyToReadThirdPartyEditing } from './thirdParty';
|
|
12
12
|
import { getBrandConfig } from '../brands';
|
|
13
|
+
import { internationalizationChoices } from './internationalization/choices';
|
|
13
14
|
const ejs = require('ejs');
|
|
14
15
|
require('dayjs/locale/fr');
|
|
15
16
|
export function generateCommercialDocument(idEstimateInvoiceType, payload, shouldHideBrandName = false, nodeEnv = undefined) {
|
|
@@ -30,6 +31,8 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
|
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
const totalTaxIncluded = _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount');
|
|
34
|
+
const locale = payload.language ?? InvoiceLanguage.FR;
|
|
35
|
+
const languageOption = internationalizationChoices[locale];
|
|
33
36
|
const data = {
|
|
34
37
|
...payload,
|
|
35
38
|
thirdParty,
|
|
@@ -77,6 +80,7 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
|
|
|
77
80
|
brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,
|
|
78
81
|
shouldHideBrandName,
|
|
79
82
|
paymentType: payload.paymentType,
|
|
83
|
+
languageTemplate: languageOption,
|
|
80
84
|
};
|
|
81
85
|
const commonTemplate = new CommercialDocumentCommonHTML();
|
|
82
86
|
const documentFreeText = [
|
|
@@ -108,6 +112,8 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
|
|
|
108
112
|
};
|
|
109
113
|
}
|
|
110
114
|
export function generateMailHeader(params, shouldHideBrandName = false, nodeEnv = undefined) {
|
|
115
|
+
const locale = params.payload.language ?? InvoiceLanguage.FR;
|
|
116
|
+
const languageOption = internationalizationChoices[locale];
|
|
111
117
|
dayjs.locale('fr');
|
|
112
118
|
const data = {
|
|
113
119
|
...params.payload,
|
|
@@ -123,6 +129,7 @@ export function generateMailHeader(params, shouldHideBrandName = false, nodeEnv
|
|
|
123
129
|
// @ts-ignore
|
|
124
130
|
brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }),
|
|
125
131
|
shouldHideBrandName,
|
|
132
|
+
languageMail: languageOption,
|
|
126
133
|
};
|
|
127
134
|
const mailTemplate = new CommercialDocumentMailHTML();
|
|
128
135
|
return {
|
|
@@ -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,EAAE,KAAK,IAAI,MAAM,GAC1F,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,EA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O,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}"]}
|
|
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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AK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACnB,MAAM,IAAI,GAAG;QACX,GAAG,MAAM,CAAC,OAAO;QACjB,yBAAyB,EAAE,8BAA8B,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAC1F,yBAAyB,EAAE,8BAA8B,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;QAC1F,iBAAiB,EAAE,8BAA8B,CAAC,MAAM,CAAC,OAAO,CAAC,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;QACpH,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI;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;QACnB,YAAY,EAAE,cAAc;KAC7B,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 InvoiceLanguage,\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';\nimport { internationalizationChoices } from './internationalization/choices';\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 locale = payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\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:_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 languageTemplate: languageOption,\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 const locale = params.payload.language ?? InvoiceLanguage.FR;\n const languageOption = internationalizationChoices[locale];\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(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 languageMail: languageOption,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"choices.d.ts","sourceRoot":"","sources":["../../../../../ts/utils/commercialManagement/internationalization/choices.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,QAAQ,CAAC;AAGzD,eAAO,MAAM,2BAA2B,EAAE,+BAgazC,CAAC"}
|