@silexpert/core 1.1.270 → 1.1.272
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/resources/Transaction.d.ts +2 -2
- package/dist/cjs/api/resources/Transaction.d.ts.map +1 -1
- package/dist/cjs/api/resources/Transaction.js.map +1 -1
- package/dist/cjs/types/Enum/AccountType.d.ts +28 -0
- package/dist/cjs/types/Enum/AccountType.d.ts.map +1 -1
- package/dist/cjs/types/Enum/AccountType.js +28 -0
- package/dist/cjs/types/Enum/AccountType.js.map +1 -1
- package/dist/cjs/types/Interface/api/account/Create.d.ts +2 -0
- package/dist/cjs/types/Interface/api/account/Create.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/account/Create.js +12 -0
- package/dist/cjs/types/Interface/api/account/Create.js.map +1 -1
- package/dist/cjs/types/Interface/api/account/Update.d.ts +2 -0
- package/dist/cjs/types/Interface/api/account/Update.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/account/Update.js +12 -0
- package/dist/cjs/types/Interface/api/account/Update.js.map +1 -1
- package/dist/cjs/types/Interface/api/commercialManagement/Create.d.ts +3 -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/api/mail/QueryPaginatedMail.d.ts +1 -0
- package/dist/cjs/types/Interface/api/mail/QueryPaginatedMail.d.ts.map +1 -1
- package/dist/cjs/types/Interface/api/mail/QueryPaginatedMail.js +8 -0
- package/dist/cjs/types/Interface/api/mail/QueryPaginatedMail.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/document.js +21 -11
- package/dist/cjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/cjs/utils/commercialManagement/vat.d.ts.map +1 -1
- package/dist/cjs/utils/commercialManagement/vat.js +3 -1
- package/dist/cjs/utils/commercialManagement/vat.js.map +1 -1
- package/dist/mjs/api/resources/Transaction.d.ts +2 -2
- package/dist/mjs/api/resources/Transaction.d.ts.map +1 -1
- package/dist/mjs/api/resources/Transaction.js.map +1 -1
- package/dist/mjs/types/Enum/AccountType.d.ts +28 -0
- package/dist/mjs/types/Enum/AccountType.d.ts.map +1 -1
- package/dist/mjs/types/Enum/AccountType.js +28 -0
- package/dist/mjs/types/Enum/AccountType.js.map +1 -1
- package/dist/mjs/types/Interface/api/account/Create.d.ts +2 -0
- package/dist/mjs/types/Interface/api/account/Create.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/account/Create.js +15 -1
- package/dist/mjs/types/Interface/api/account/Create.js.map +1 -1
- package/dist/mjs/types/Interface/api/account/Update.d.ts +2 -0
- package/dist/mjs/types/Interface/api/account/Update.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/account/Update.js +15 -1
- package/dist/mjs/types/Interface/api/account/Update.js.map +1 -1
- package/dist/mjs/types/Interface/api/commercialManagement/Create.d.ts +3 -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/api/mail/QueryPaginatedMail.d.ts +1 -0
- package/dist/mjs/types/Interface/api/mail/QueryPaginatedMail.d.ts.map +1 -1
- package/dist/mjs/types/Interface/api/mail/QueryPaginatedMail.js +8 -0
- package/dist/mjs/types/Interface/api/mail/QueryPaginatedMail.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/document.js +14 -0
- package/dist/mjs/utils/commercialManagement/document.js.map +1 -1
- package/dist/mjs/utils/commercialManagement/vat.d.ts.map +1 -1
- package/dist/mjs/utils/commercialManagement/vat.js +2 -0
- package/dist/mjs/utils/commercialManagement/vat.js.map +1 -1
- package/package.json +1 -1
- package/ts/api/resources/Transaction.ts +2 -1
- package/ts/types/Enum/AccountType.ts +28 -0
- package/ts/types/Interface/api/account/Create.ts +11 -1
- package/ts/types/Interface/api/account/Update.ts +12 -1
- package/ts/types/Interface/api/commercialManagement/Create.ts +3 -1
- package/ts/types/Interface/api/commercialManagement/Read.ts +2 -0
- package/ts/types/Interface/api/mail/QueryPaginatedMail.ts +6 -0
- package/ts/utils/commercialManagement/document.ts +18 -1
- package/ts/utils/commercialManagement/vat.ts +2 -0
|
@@ -1 +1 @@
|
|
|
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,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;IAOhC,OAAO,CAAiB;IAKxB,OAAO,CAAiB;IAKxB,GAAG,CAAiB;IAKpB,oBAAoB,CAAiB;IAKrC,IAAI,CAAiB;I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IsEnum, IsNumber, IsOptional, IsString, Min,\n} from 'class-validator';\nimport { IFile } 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\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}\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}\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,MAA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,YAAY,EAAE;;iDACG;AAElB;IAAC,WAAW,EAAE;IACb,SAAS,EAAE;IACX,SAAS,EAAE;;kDACQ;AAGtB,MAAM,OAAO,wBAAwB;IAGjC,KAAK,CAAS;IAId,SAAS,CAAS;IAIlB,KAAK,CAAS;CACjB;AAXC;IAAC,WAAW,EAAE;IACb,QAAQ,EAAE;;uDACK;AAEhB;IAAC,WAAW,EAAE;IACb,QAAQ,EAAE;;2DACS;AAEpB;IAAC,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\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 +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;AAEvD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AAE7E,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAAG;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpE,MAAM,MAAM,kBAAkB,GAAG,eAAe,GAAG;IACjD,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,kBAAkB,EAAE,MA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AE,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};\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';\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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryPaginatedMail.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/mail/QueryPaginatedMail.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;
|
|
1
|
+
{"version":3,"file":"QueryPaginatedMail.d.ts","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/mail/QueryPaginatedMail.ts"],"names":[],"mappings":"AAMA,qBAAa,kBAAkB;IAK3B,iBAAiB,CAAC,sBAAS;IAK3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,WAAW,CAAC,sBAAS;IASrB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAQnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAKtB,OAAO,CAAC,EAAE,MAAM,CAAU;IAM1B,MAAM,CAAC,EAAE,OAAO,CAAC;IAMjB,WAAW,CAAC,EAAE,OAAO,CAAC;IAMtB,SAAS,CAAC,EAAE,OAAO,CAAC;IAMpB,OAAO,CAAC,EAAE,OAAO,CAAC;IAMlB,WAAW,CAAC,EAAE,OAAO,CAAC;IAMtB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAK3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAMhB,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAKnC,SAAS,CAAC,EAAE,MAAM,CAAC;IAKnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAK1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAK3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAKhB,KAAK,CAAC,EAAE,MAAM,CAAC;IAKf,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -11,6 +11,7 @@ import { IsBoolean, IsIn, IsNumber, IsOptional, IsString, IsArray, IsInt, } from
|
|
|
11
11
|
import { ApiPropertyOptional } from '../../../../utils';
|
|
12
12
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
13
13
|
export class QueryPaginatedMail {
|
|
14
|
+
displayAccountant = false;
|
|
14
15
|
search;
|
|
15
16
|
withDeleted = false;
|
|
16
17
|
include;
|
|
@@ -31,6 +32,13 @@ export class QueryPaginatedMail {
|
|
|
31
32
|
limit;
|
|
32
33
|
page;
|
|
33
34
|
}
|
|
35
|
+
__decorate([
|
|
36
|
+
ApiPropertyOptional({ default: false }),
|
|
37
|
+
IsOptional(),
|
|
38
|
+
IsBoolean(),
|
|
39
|
+
ToBoolean(),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], QueryPaginatedMail.prototype, "displayAccountant", void 0);
|
|
34
42
|
__decorate([
|
|
35
43
|
ApiPropertyOptional(),
|
|
36
44
|
IsOptional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryPaginatedMail.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/mail/QueryPaginatedMail.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EACL,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,GAChE,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAE3E,MAAM,OAAO,kBAAkB;
|
|
1
|
+
{"version":3,"file":"QueryPaginatedMail.js","sourceRoot":"","sources":["../../../../../../ts/types/Interface/api/mail/QueryPaginat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Z,KAAK,EAAE;;6DACqB;AAE7B;IAAC,mBAAmB,EAAE;IACrB,UAAU,EAAE;IACZ,KAAK,EAAE;;kDACU;AAElB;IAAC,mBAAmB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACpC,UAAU,EAAE;IACZ,QAAQ,EAAE;;iDACM;AAEjB;IAAC,mBAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACnC,UAAU,EAAE;IACZ,QAAQ,EAAE;;gDACK","sourcesContent":["import {\n IsBoolean, IsIn, IsNumber, IsOptional, IsString, IsArray, IsInt,\n} from 'class-validator';\nimport { ApiPropertyOptional } from '../../../../utils';\nimport { ToBoolean } from '../../../../utils/transforms/boolean.transform';\n\nexport class QueryPaginatedMail {\n @ApiPropertyOptional({ default: false })\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n displayAccountant? = false;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n search?: string;\n\n @ApiPropertyOptional({ default: false })\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n withDeleted? = false;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsArray()\n @IsString({\n each: true,\n })\n @IsIn(['society', 'mailContent', 'mailAttachment', 'userWhoFlagged'], { each: true })\n include?: string[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsArray()\n @IsString({\n each: true,\n })\n attributes?: string[];\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsString()\n orderBy?: string = 'date';\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isSent?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isProcessed?: boolean;\n\n @ApiPropertyOptional({ default: false })\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isDeleted?: boolean;\n\n @ApiPropertyOptional({ default: false })\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isDraft?: boolean;\n\n @ApiPropertyOptional({ default: false })\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isImportant?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n isWithoutSociety?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idUser?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsBoolean()\n @ToBoolean()\n handlingManagerRoleMails?: boolean;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idSociety?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idUserWhoFlagged?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idUserWhoAnswered?: number;\n\n @ApiPropertyOptional()\n @IsOptional()\n @IsInt()\n idRole?: number;\n\n @ApiPropertyOptional({ default: 25 })\n @IsOptional()\n @IsNumber()\n limit?: number;\n\n @ApiPropertyOptional({ default: 1 })\n @IsOptional()\n @IsNumber()\n page?: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/document.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,8BAA8B,EAAuC,MAAM,qDAAqD,CAAC;AAI1I,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAOvE,OAAO,EACL,qBAAqB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,0BAA0B,EAC3F,MAAM,aAAa,CAAC;AAgBrB,wBAAgB,0BAA0B,CAAC,qBAAqB,EAAE,mBAAmB,EAAE,OAAO,EAAE,qBAAqB,GAAG,qBAAqB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,8BAA8B,CA0GnP;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,mBAAmB,UAAQ,EAAE,OAAO,GAAE,MAAM,GAAG,SAAqB,GAAG,0BAA0B,CAuB7J"}
|
|
@@ -16,6 +16,19 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
|
|
|
16
16
|
const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));
|
|
17
17
|
const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);
|
|
18
18
|
const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);
|
|
19
|
+
let forcedVats = undefined;
|
|
20
|
+
if (payload.advanceProducts?.length) {
|
|
21
|
+
const advanceVats = Object.values(_groupBy(payload.advanceProducts, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value').filter((v) => v.id !== Vat.MARGE.id);
|
|
22
|
+
forcedVats = vats.map(v => {
|
|
23
|
+
const base = v.base - (advanceVats.find(a => a.id === v.id)?.base ?? 0);
|
|
24
|
+
const toPay = v.toPay - (advanceVats.find(a => a.id === v.id)?.toPay ?? 0);
|
|
25
|
+
return {
|
|
26
|
+
...v,
|
|
27
|
+
baseFormatted: integerToFormattedAmountString(base),
|
|
28
|
+
amountFormatted: integerToFormattedAmountString(toPay),
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
}
|
|
19
32
|
const data = {
|
|
20
33
|
...payload,
|
|
21
34
|
thirdParty,
|
|
@@ -84,6 +97,7 @@ export function generateCommercialDocument(idEstimateInvoiceType, payload, shoul
|
|
|
84
97
|
? p.comment?.replace(/\n/g, '<br/>')
|
|
85
98
|
: null,
|
|
86
99
|
})),
|
|
100
|
+
vats: forcedVats ?? vats,
|
|
87
101
|
}),
|
|
88
102
|
footer: ejs.render(commonTemplate.footer, {
|
|
89
103
|
...data,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../../../ts/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uniq,\n} from 'lodash';\nimport * as dayjs from 'dayjs';\nimport { ReadCommercialDocumentTemplate, ReadDocumentEditing } 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 const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties ?? null,\n compensation: payload.compensation ?? null,\n discount: payload.discount ?? null,\n vatMention: payload.vatMention ?? null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n totalTaxAndDiscountIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount')),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount') - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`.split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find(\n (p) => p.discount2 && p.discount2 > 0,\n ),\n // @ts-ignore\n marginVats: _uniq(\n products\n .filter((p) => p.marginVatFormatted !== null)\n .map((p) => p.marginVatFormatted),\n ),\n accountingCategoryFormatted:\n AccountingCategoryList.find((a) => a.id === payload.accountingCategory)\n ?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [\n EstimateInvoiceType.DEVIS,\n EstimateInvoiceType.BON,\n ].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment:\n data.comment && typeof data.comment === 'string'\n ? data.comment?.replace(/\\n/g, '<br/>')\n : null,\n products: data.products.map((p) => ({\n ...p,\n comment:\n p.comment && typeof p.comment === 'string'\n ? p.comment?.replace(/\\n/g, '<br/>')\n : null,\n })),\n }),\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
|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KAAK,EAAE,UAA8B,SAAS;IAC/H,KAAK,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;KACpB,CAAC;IAEF,MAAM,YAAY,GAAG,IAAI,0BAA0B,EAAE,CAAC;IAEtD,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import {\n orderBy as _orderBy, groupBy as _groupBy, sumBy as _sumBy, uniq as _uniq,\n} from 'lodash';\nimport * as dayjs from 'dayjs';\nimport { ReadCommercialDocumentTemplate, ReadDocumentEditing, ReadVatEditing } from '../../types/Interface/api/commercialManagement/Read';\nimport {\n AccountingCategoryList, FontIds, fontList,\n} from '../../types/Enum/CommercialManagement';\nimport { EstimateInvoiceType } from '../../types/Enum/EstimateInvoice';\nimport { Vat } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString, integerToFormattedAmountObject } from '../amount';\nimport { CommercialDocumentCommonHTML, CommercialDocumentMailHTML } from './templates/common';\nimport { bodyTemplate } from './templates/body';\nimport { productToReadProductEditing } from './product';\nimport { vatToReadVatEditing } from './vat';\nimport {\n CreateInvoiceDocument, CreateMailHeader, CreatePreSaleDocument, ReadCommercialMailTemplate,\n} from '../../types';\nimport { thirdPartyToReadThirdPartyEditing } from './thirdParty';\nimport { getBrandConfig } from '../brands';\n\nconst ejs = require('ejs');\nrequire('dayjs/locale/fr');\n\ntype brandColorType = {\n primary: string,\n primary50: string,\n primary100: string,\n primary300: string,\n primary500: string,\n primary700: string\n};\n\nexport function generateCommercialDocument(idEstimateInvoiceType: EstimateInvoiceType, payload: CreateInvoiceDocument | CreatePreSaleDocument, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialDocumentTemplate {\n const products = _orderBy(payload.products.map((product) => productToReadProductEditing(product), 'reorder'));\n const vats = _orderBy(Object.values(_groupBy(products, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value')).filter((v) => v.id !== Vat.MARGE.id);\n const thirdParty = thirdPartyToReadThirdPartyEditing(payload.thirdParty);\n\n let forcedVats: ReadVatEditing[] | undefined = undefined;\n\n if (payload.advanceProducts?.length) {\n const advanceVats = Object.values(_groupBy(payload.advanceProducts, 'vatFormatted')).map((v) => (vatToReadVatEditing(v)), 'value').filter((v) => v.id !== Vat.MARGE.id);\n \n forcedVats = vats.map(v => {\n const base = v.base - (advanceVats.find(a => a.id === v.id)?.base ?? 0);\n const toPay = v.toPay - (advanceVats.find(a => a.id === v.id)?.toPay ?? 0);\n return {\n ...v,\n baseFormatted: integerToFormattedAmountString(base),\n amountFormatted: integerToFormattedAmountString(toPay),\n };\n });\n }\n\n const data: ReadDocumentEditing & { brandColors: brandColorType, brandName: string, shouldHideBrandName: boolean } = {\n ...payload,\n thirdParty,\n paymentLink: payload.paymentLink ?? '#',\n idEstimateInvoiceType,\n title: payload.title ?? null,\n penalties: payload.penalties ?? null,\n compensation: payload.compensation ?? null,\n discount: payload.discount ?? null,\n vatMention: payload.vatMention ?? null,\n phoneContact: payload.settings?.phoneContact ?? null,\n products,\n vats,\n totalTaxExcluded: _sumBy(products, 'totalTaxExcluded'),\n totalTaxIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n totalTaxAndDiscountIncluded: _sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount'),\n generalDiscountFormatted: payload.generalDiscount2 ? integerToFormattedAmountString(payload.generalDiscount2) : null,\n depositFormatted: payload.deposit ? integerToFormattedAmountString(payload.deposit) : null,\n totalTaxExcludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded')),\n totalTaxIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount')),\n totalTaxAndDiscountIncludedFormatted: integerToFormattedAmountString(_sumBy(products, 'totalTaxExcluded') + _sumBy(vats, 'amount') - (payload.generalDiscount2 ?? 0) - (payload.deposit ?? 0)),\n totalVatAmountFormatted: integerToFormattedAmountString(_sumBy(vats, 'amount')),\n font: {\n id: payload.settings?.idFont ?? FontIds.CIRCULAR_STD,\n name: fontList.find((f) => f.id === payload.settings?.idFont)?.name ?? fontList[0].name,\n url: fontList.find((f) => f.id === payload.settings?.idFont)?.link ?? fontList[0].link,\n },\n capitalFormatted: payload.capital\n ? `${payload.capital}`.split('')\n .reduceRight((acc, char, i, { length }) => `${char}${(length - (i + 1)) % 3 === 0 ? ' ' : ''}${acc}`, '')\n .trim()\n : null,\n dueDateFormatted: payload.dueDate ? dayjs(payload.dueDate).format('DD/MM/YYYY') : null,\n expirationDateFormatted: payload.expirationDate ? dayjs(payload.expirationDate).format('DD/MM/YYYY') : null,\n emissionDateFormatted: payload.emissionDate ? dayjs(payload.emissionDate).format('DD/MM/YYYY') : null,\n shouldDisplayDiscountColumn: !!products.find(\n (p) => p.discount2 && p.discount2 > 0,\n ),\n // @ts-ignore\n marginVats: _uniq(\n products\n .filter((p) => p.marginVatFormatted !== null)\n .map((p) => p.marginVatFormatted),\n ),\n accountingCategoryFormatted:\n AccountingCategoryList.find((a) => a.id === payload.accountingCategory)\n ?.label ?? null,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n brandName: `${getBrandConfig({ objectWaited: 'name', nodeEnv })}`,\n shouldHideBrandName,\n paymentType: payload.paymentType,\n };\n\n const commonTemplate = new CommercialDocumentCommonHTML();\n const documentFreeText = [\n EstimateInvoiceType.DEVIS,\n EstimateInvoiceType.BON,\n ].includes(idEstimateInvoiceType)\n ? payload?.settings?.freeEstimateText\n : payload?.settings?.freeInvoiceText;\n\n return {\n header: ejs.render(commonTemplate.header, data),\n body: ejs.render(bodyTemplate, {\n ...data,\n comment:\n data.comment && typeof data.comment === 'string'\n ? data.comment?.replace(/\\n/g, '<br/>')\n : null,\n products: data.products.map((p) => ({\n ...p,\n comment:\n p.comment && typeof p.comment === 'string'\n ? p.comment?.replace(/\\n/g, '<br/>')\n : null,\n })),\n vats: forcedVats ?? vats,\n }),\n footer: ejs.render(commonTemplate.footer, {\n ...data,\n freeText: documentFreeText ?? null,\n }),\n data,\n };\n}\n\nexport function generateMailHeader(params: CreateMailHeader, shouldHideBrandName = false, nodeEnv: string | undefined = undefined): ReadCommercialMailTemplate {\n dayjs.locale('fr');\n const data = {\n ...params.payload,\n totalTaxExcludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxExcluded),\n totalTaxIncludedFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded),\n totalVatFormatted: integerToFormattedAmountObject(params.payload.totalTaxIncluded - params.payload.totalTaxExcluded),\n dueDateFormatted: params.payload.dueDate ? dayjs(params.payload.dueDate).format('DD MMMM YYYY') : null,\n hasVat: params.hasVat,\n hostS3: params.hostS3,\n logoUrl: params.logoUrl,\n companyName: params.companyName,\n fileUrl: params.fileUrl,\n // @ts-ignore\n brandColors: getBrandConfig({ objectWaited: 'colors', nodeEnv }) as brandColorType,\n shouldHideBrandName,\n };\n\n const mailTemplate = new CommercialDocumentMailHTML();\n\n return {\n header: ejs.render(mailTemplate.header, data),\n };\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/vat.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEvD;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/vat.ts"],"names":[],"mappings":"AACA,OAAO,EAAO,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGzE;AAED,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAEvD;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,cAAc,CAYlF"}
|
|
@@ -17,6 +17,8 @@ export function vatToReadVatEditing(products) {
|
|
|
17
17
|
value: getById(idVat)?.value ?? 0,
|
|
18
18
|
baseFormatted: integerToFormattedAmountString(_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0))),
|
|
19
19
|
amountFormatted: integerToFormattedAmountString((_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * ((getById(idVat)?.value ?? 0))) / 100),
|
|
20
|
+
toPay: (_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * ((getById(idVat)?.value ?? 0))) / 100,
|
|
21
|
+
base: _sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)),
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
//# sourceMappingURL=vat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat.js","sourceRoot":"","sources":["../../../../ts/utils/commercialManagement/vat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAE,GAAG,EAAW,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,8BAA8B,EAAE,MAAM,WAAW,CAAC;AAG3D,MAAM,UAAU,SAAS,CAAC,MAAqB,EAAE,QAAgB;IAC/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,CAAC;IAC5B,OAAO,OAAO,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,EAAU;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,QAA8B;IAChE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9B,OAAO;QACL,EAAE,EAAE,KAAK;QACT,I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,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;QACvH,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9E,CAAC;AACJ,CAAC","sourcesContent":["import { sumBy as _sumBy } from 'lodash';\nimport { Vat, VatType } from '../../types/Enum/Vat';\nimport { integerToFormattedAmountString } from '../amount';\nimport { ReadProductEditing, ReadVatEditing } from '../../types';\n\nexport function getAmount(amount: number | null, vatValue: number): number {\n const _amount = amount ?? 0;\n return _amount * (vatValue / 100);\n}\n\nexport function getById(id: number): VatType | undefined {\n return Object.values(Vat).find((vat) => vat.id === id);\n}\n\nexport function vatToReadVatEditing(products: ReadProductEditing[]): ReadVatEditing {\n const { idVat } = products[0];\n return {\n id: idVat,\n name: getById(idVat)?.saleName ?? '',\n amount: _sumBy(products, (p) => getAmount(p.totalTaxExcluded, getById(idVat)?.value ?? 0)),\n value: getById(idVat)?.value ?? 0,\n baseFormatted: integerToFormattedAmountString(_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0))),\n amountFormatted: integerToFormattedAmountString((_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * ((getById(idVat)?.value ?? 0))) / 100),\n toPay: (_sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)) * ((getById(idVat)?.value ?? 0))) / 100,\n base: _sumBy(products, (p) => (p.totalTaxExcluded ? +p.totalTaxExcluded : 0)),\n };\n}"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@silexpert/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.272",
|
|
4
4
|
"description": "Silex Core perform HTTP Request and object binding. Silex core helps developers to retrieve and return formatted object",
|
|
5
5
|
"homepage": "https://gitlab.compta-clementine.fr/dev/silex-api",
|
|
6
6
|
"main": "dist/cjs/index.js",
|
|
@@ -2,6 +2,7 @@ import { Resource } from '../Resource';
|
|
|
2
2
|
import {
|
|
3
3
|
BasePaginate,
|
|
4
4
|
ReadFormattedAccountingTransaction, UpdateAccountingTransaction, DeleteTransactions, QueryUnexport, QueryGetAllTransactions, IAccountingTransaction, ReadAccountantBalance, CreateManualEntry, IAccountingEntry, QueryDeleteInvoices, ReadDeletedInvoices, QuerySocietyTransactionCount, ReadSocietyTransactionCount, ReadBankAccountSum, QueryBankAccountSum, QueryTransaction, ReadPartnerTransactionType, DuplicateAccountingTransaction, CreateWithMasterEntry,
|
|
5
|
+
QueryExport,
|
|
5
6
|
} from '../../types';
|
|
6
7
|
|
|
7
8
|
export class Transaction extends Resource {
|
|
@@ -32,7 +33,7 @@ export class Transaction extends Resource {
|
|
|
32
33
|
return this.axios.$put(`/society/${idSociety}/transactions/unexport`, params);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
|
-
export(idSociety: number, params:
|
|
36
|
+
export(idSociety: number, params: QueryExport): Promise<number> {
|
|
36
37
|
return this.axios.$put(`/society/${idSociety}/transactions/export`, params);
|
|
37
38
|
}
|
|
38
39
|
annotate(id: number, data: UpdateAccountingTransaction): Promise<ReadFormattedAccountingTransaction> {
|
|
@@ -3,140 +3,168 @@ export const AccountType = {
|
|
|
3
3
|
id: 1,
|
|
4
4
|
color: '#8765D0',
|
|
5
5
|
icon: 'TravelExpenses',
|
|
6
|
+
name: 'Déplacement',
|
|
6
7
|
},
|
|
7
8
|
BANQUES: {
|
|
8
9
|
id: 2,
|
|
9
10
|
color: '#FF7E3C',
|
|
10
11
|
icon: 'BankFees',
|
|
12
|
+
name: 'Banque',
|
|
11
13
|
},
|
|
12
14
|
DEPENSES_DIVERSES: {
|
|
13
15
|
id: 3,
|
|
14
16
|
color: '#FFB13C',
|
|
15
17
|
icon: 'MiscExpenses',
|
|
18
|
+
name: 'Dépenses diverses',
|
|
16
19
|
},
|
|
17
20
|
SOUS_TRAITANCES: {
|
|
18
21
|
id: 4,
|
|
19
22
|
color: '#A35305',
|
|
20
23
|
icon: 'ServicesAndSubcontracting',
|
|
24
|
+
name: 'Sous-traitances',
|
|
21
25
|
},
|
|
22
26
|
ACHAT_MARCHANDISES: {
|
|
23
27
|
id: 5,
|
|
24
28
|
color: '#FFB13C',
|
|
25
29
|
icon: 'Buyings',
|
|
30
|
+
name: 'Achat marchandises',
|
|
26
31
|
},
|
|
27
32
|
CHARGES_SOCIALES: {
|
|
28
33
|
id: 6,
|
|
29
34
|
color: '#C72B16',
|
|
30
35
|
icon: 'SalariesAndSocialCharges',
|
|
36
|
+
name: 'charges sociales',
|
|
31
37
|
},
|
|
32
38
|
TAXES: {
|
|
33
39
|
id: 8,
|
|
34
40
|
color: '#C72B16',
|
|
35
41
|
icon: 'Taxes',
|
|
42
|
+
name: 'Taxes',
|
|
36
43
|
},
|
|
37
44
|
FONCTIONNEMENT: {
|
|
38
45
|
id: 9,
|
|
39
46
|
color: '#84908D',
|
|
40
47
|
icon: 'FixedChargesAndSubscriptions',
|
|
48
|
+
name: 'Fonctionnement',
|
|
41
49
|
},
|
|
42
50
|
RECETTES_PRODUCTION: {
|
|
43
51
|
id: 10,
|
|
44
52
|
color: '#65D09A',
|
|
45
53
|
icon: 'ProductionIncomes',
|
|
54
|
+
name: 'Recettes production',
|
|
46
55
|
},
|
|
47
56
|
RECETTES_NEGOCE: {
|
|
48
57
|
id: 11,
|
|
49
58
|
color: '#65D09A',
|
|
50
59
|
icon: 'TradingIncomes',
|
|
60
|
+
name: 'recettes négoce',
|
|
51
61
|
},
|
|
52
62
|
RECETTES_DIVERSES: {
|
|
53
63
|
id: 12,
|
|
54
64
|
color: '#65D09A',
|
|
55
65
|
icon: 'MiscIncomes',
|
|
66
|
+
name: 'Recettes diverses',
|
|
56
67
|
},
|
|
57
68
|
AUTRES: {
|
|
58
69
|
id: 13,
|
|
59
70
|
color: '#FFB13C',
|
|
60
71
|
icon: 'Others',
|
|
72
|
+
name: 'Autres',
|
|
61
73
|
},
|
|
62
74
|
ACHATS: {
|
|
63
75
|
id: 14,
|
|
64
76
|
color: '#FFB13C',
|
|
65
77
|
icon: 'Buyings',
|
|
78
|
+
name: 'Achats',
|
|
66
79
|
},
|
|
67
80
|
SALAIRES: {
|
|
68
81
|
id: 15,
|
|
69
82
|
color: '#C72B16',
|
|
70
83
|
icon: 'SalariesAndSocialCharges',
|
|
84
|
+
name: 'Salaires',
|
|
71
85
|
},
|
|
72
86
|
IMMOBILIER: {
|
|
73
87
|
id: 16,
|
|
74
88
|
color: '#088C4A',
|
|
75
89
|
icon: 'RealEstate',
|
|
90
|
+
name: 'Immobilier',
|
|
76
91
|
},
|
|
77
92
|
SERVICES: {
|
|
78
93
|
id: 17,
|
|
79
94
|
color: '#A35305',
|
|
80
95
|
icon: 'ServicesAndSubcontracting',
|
|
96
|
+
name: 'Services',
|
|
81
97
|
},
|
|
82
98
|
ABONNEMENTS: {
|
|
83
99
|
id: 18,
|
|
84
100
|
color: '#E74242',
|
|
85
101
|
icon: 'FixedChargesAndSubscriptions',
|
|
102
|
+
name: 'Abonnements',
|
|
86
103
|
},
|
|
87
104
|
DEPENSES_COURANTES: {
|
|
88
105
|
id: 19,
|
|
89
106
|
color: '#FFB13C',
|
|
90
107
|
icon: 'MiscExpenses',
|
|
108
|
+
name: 'Dépenses courantes',
|
|
91
109
|
},
|
|
92
110
|
TRANSPORTS: {
|
|
93
111
|
id: 20,
|
|
94
112
|
color: '#8765D0',
|
|
95
113
|
icon: 'FreightTransport',
|
|
114
|
+
name: 'Transports',
|
|
96
115
|
},
|
|
97
116
|
ADMINISTRATIF: {
|
|
98
117
|
id: 21,
|
|
99
118
|
color: '#5894EF',
|
|
100
119
|
icon: 'Administrative',
|
|
120
|
+
name: 'Administratif',
|
|
101
121
|
},
|
|
102
122
|
PUBLICITES_ET_MISSIONS: {
|
|
103
123
|
id: 22,
|
|
104
124
|
color: '#088C4A',
|
|
105
125
|
icon: 'AdvertisingCommunication',
|
|
126
|
+
name: 'Publicités et missions',
|
|
106
127
|
},
|
|
107
128
|
DIVERS: {
|
|
108
129
|
id: 23,
|
|
109
130
|
color: '#FFB13C',
|
|
110
131
|
icon: 'Others',
|
|
132
|
+
name: 'Divers',
|
|
111
133
|
},
|
|
112
134
|
FINANCES: {
|
|
113
135
|
id: 24,
|
|
114
136
|
color: '#FF7E3C',
|
|
115
137
|
icon: 'Finances',
|
|
138
|
+
name: 'Finances',
|
|
116
139
|
},
|
|
117
140
|
IMMOBILISATIONS: {
|
|
118
141
|
id: 25,
|
|
119
142
|
color: '#5894EF',
|
|
120
143
|
icon: 'CapitalAssets',
|
|
144
|
+
name: 'Immobilisations',
|
|
121
145
|
},
|
|
122
146
|
TIERS: {
|
|
123
147
|
id: 27,
|
|
124
148
|
color: '#26D395',
|
|
125
149
|
icon: 'Tiers',
|
|
150
|
+
name: 'Tiers',
|
|
126
151
|
},
|
|
127
152
|
STOCKS: {
|
|
128
153
|
id: 28,
|
|
129
154
|
color: '#C2C1C1',
|
|
130
155
|
icon: 'Stocks',
|
|
156
|
+
name: 'Stocks',
|
|
131
157
|
},
|
|
132
158
|
ACHATS_MATIERE_PREMIERE: {
|
|
133
159
|
id: 29,
|
|
134
160
|
color: '#FFB13C',
|
|
135
161
|
icon: 'Buyings',
|
|
162
|
+
name: 'Achats matière première',
|
|
136
163
|
},
|
|
137
164
|
ACHATS_EXTERNES: {
|
|
138
165
|
id: 30,
|
|
139
166
|
color: '#FFB13C',
|
|
140
167
|
icon: 'Buyings',
|
|
168
|
+
name: 'Achars Externes',
|
|
141
169
|
},
|
|
142
170
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsOptional, IsString } from 'class-validator';
|
|
1
|
+
import { IsArray, IsNumber, IsOptional, IsString } from 'class-validator';
|
|
2
2
|
import { IAccount } from '../../..';
|
|
3
3
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
4
4
|
|
|
@@ -20,6 +20,11 @@ export class CreateAccountSociety {
|
|
|
20
20
|
export class CreateAccount {
|
|
21
21
|
@ApiProperty()
|
|
22
22
|
account: Partial<IAccount>;
|
|
23
|
+
|
|
24
|
+
@ApiPropertyOptional()
|
|
25
|
+
@IsNumber()
|
|
26
|
+
@IsOptional()
|
|
27
|
+
idSociety?: number;
|
|
23
28
|
|
|
24
29
|
@ApiPropertyOptional()
|
|
25
30
|
@IsString()
|
|
@@ -30,4 +35,9 @@ export class CreateAccount {
|
|
|
30
35
|
@IsString({ each: true })
|
|
31
36
|
@IsOptional()
|
|
32
37
|
tags?: string[];
|
|
38
|
+
|
|
39
|
+
@ApiPropertyOptional()
|
|
40
|
+
@IsOptional()
|
|
41
|
+
@IsArray()
|
|
42
|
+
idSectors?: Array<number>;
|
|
33
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IsOptional, IsString } from 'class-validator';
|
|
1
|
+
import { IsArray, IsNumber, IsOptional, IsString } from 'class-validator';
|
|
2
2
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
3
3
|
import { IAccount } from '../../..';
|
|
4
4
|
|
|
@@ -26,6 +26,11 @@ export class UpdateAccount {
|
|
|
26
26
|
@ApiProperty()
|
|
27
27
|
account: Partial<IAccount>;
|
|
28
28
|
|
|
29
|
+
@ApiPropertyOptional()
|
|
30
|
+
@IsNumber()
|
|
31
|
+
@IsOptional()
|
|
32
|
+
idSociety?: number;
|
|
33
|
+
|
|
29
34
|
@ApiPropertyOptional()
|
|
30
35
|
@IsString()
|
|
31
36
|
@IsOptional()
|
|
@@ -40,4 +45,10 @@ export class UpdateAccount {
|
|
|
40
45
|
@IsString({ each: true })
|
|
41
46
|
@IsOptional()
|
|
42
47
|
tagsToRemove?: string[];
|
|
48
|
+
|
|
49
|
+
@ApiPropertyOptional()
|
|
50
|
+
@IsOptional()
|
|
51
|
+
@IsArray()
|
|
52
|
+
idSectors?: Array<number>;
|
|
53
|
+
|
|
43
54
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
IsArray, IsBoolean, IsDateString, IsEnum, IsNumber, IsOptional, IsString, Min,
|
|
3
3
|
} from 'class-validator';
|
|
4
|
-
import { IFile } from '../../..';
|
|
4
|
+
import { IFile, ReadProductEditing } from '../../..';
|
|
5
5
|
import { ApiProperty, ApiPropertyOptional } from '../../../../utils';
|
|
6
6
|
import { ToBoolean } from '../../../../utils/transforms/boolean.transform';
|
|
7
7
|
import { AccountingCategoryId, FontIds, LogoAlignment } from '../../../Enum/CommercialManagement';
|
|
@@ -384,6 +384,7 @@ export class CreatePreSaleDocument extends CommercialDocumentInputs {
|
|
|
384
384
|
deposit?: undefined;
|
|
385
385
|
fromEstimateId: undefined;
|
|
386
386
|
assetMarginVatIds?: [];
|
|
387
|
+
advanceProducts?: [];
|
|
387
388
|
}
|
|
388
389
|
export class CreateInvoiceDocument extends CommercialDocumentInputs {
|
|
389
390
|
paymentLink?: string;
|
|
@@ -391,6 +392,7 @@ export class CreateInvoiceDocument extends CommercialDocumentInputs {
|
|
|
391
392
|
fromInvoiceId?: number | null; // Nécessaire lors de la création d'un avoir à partir d'une facture
|
|
392
393
|
fromEstimateId: number | null; // Nécessaire lors du passage d'un devis à facture
|
|
393
394
|
assetMarginVatIds?: number[]; // Laisser vide côté front, utilisé pour l'affichage des tva sur marge sur les acomptes
|
|
395
|
+
advanceProducts?: ReadProductEditing[]; // Laisser vide côté front, utilisé pour l'affichage des bases TVA sur les acomptes
|
|
394
396
|
}
|
|
395
397
|
|
|
396
398
|
export class CreateCgv {
|